Merge lp:~widelands-dev/widelands/statistics_gui into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 7867
Proposed branch: lp:~widelands-dev/widelands/statistics_gui
Merge into: lp:widelands
Diff against target: 67 lines (+9/-6)
4 files modified
src/graphic/text_layout.cc (+5/-2)
src/ui_basic/box.cc (+1/-1)
src/ui_basic/slider.cc (+2/-2)
src/wui/plot_area.cc (+1/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/statistics_gui
Reviewer Review Type Date Requested Status
TiborB Approve
kaputtnik (community) testing Approve
Review via email: mp+286787@code.launchpad.net

Commit message

GUI fixes for General Statistics:

- Fixed pointer error in box.cc. This fixes the button width in the general statistics GUI.
- Fixed text cropping in DiscreteSlider.
- Gave plot area bottom axis labels some space.
- autofit_ui_text now calls richtext_escape.

Description of the change

GUI fixes for General Statistics:

- Fixed pointer error in box.cc. This fixes the button width in the general statistics GUI.
- Fixed text cropping in DiscreteSlider.
- Gave plot area bottom axis labels some space.
- autofit_ui_text now calls richtext_escape.

To post a comment you must log in.
Revision history for this message
kaputtnik (franku) wrote :

Works :-)

review: Approve (testing)
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 763. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/110920193.
Appveyor build 609. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_statistics_gui-609.

Revision history for this message
TiborB (tiborb95) wrote :

Code looks good

review: Approve
Revision history for this message
GunChleoc (gunchleoc) wrote :

@bunnybot merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/graphic/text_layout.cc'
2--- src/graphic/text_layout.cc 2016-02-18 09:29:38 +0000
3+++ src/graphic/text_layout.cc 2016-03-02 17:15:03 +0000
4@@ -138,10 +138,13 @@
5
6 const Image* autofit_ui_text(const std::string& text, int width, RGBColor color, int fontsize) {
7 const Image* result =
8- UI::g_fh1->render(as_uifont(text, fontsize, color, UI::FontSet::Face::kSans));
9+ UI::g_fh1->render(as_uifont(richtext_escape(text), fontsize, color, UI::FontSet::Face::kSans));
10 if (width > 0) { // Autofit
11 for (; result->width() > width && fontsize >= kMinimumFontSize; --fontsize) {
12- result = UI::g_fh1->render(as_uifont(text, fontsize, color, UI::FontSet::Face::kCondensed));
13+ result = UI::g_fh1->render(as_uifont(richtext_escape(text),
14+ fontsize,
15+ color,
16+ UI::FontSet::Face::kCondensed));
17 }
18 }
19 return result;
20
21=== modified file 'src/ui_basic/box.cc'
22--- src/ui_basic/box.cc 2016-02-04 19:46:40 +0000
23+++ src/ui_basic/box.cc 2016-03-02 17:15:03 +0000
24@@ -347,7 +347,7 @@
25 const Item & it = items_[idx];
26
27 get_item_desired_size(idx, depth, breadth);
28- depth += it.assigned_var_depth;
29+ *depth += it.assigned_var_depth;
30 }
31
32 /**
33
34=== modified file 'src/ui_basic/slider.cc'
35--- src/ui_basic/slider.cc 2016-02-03 18:09:15 +0000
36+++ src/ui_basic/slider.cc 2016-03-02 17:15:03 +0000
37@@ -576,7 +576,7 @@
38 uint32_t gap_n = get_w() / labels.size();
39
40 for (uint32_t i = 0; i < labels.size(); i++) {
41- dst.blit(Point(gap_1 + i * gap_n, get_h() + 2),
42+ dst.blit(Point(gap_1 + i * gap_n, get_h()),
43 UI::g_fh1->render(as_uifont(labels[i])),
44 BlendMode::UseAlpha,
45 UI::Align::kBottomCenter);
46@@ -597,7 +597,7 @@
47 slider.set_pos(Point(w / (2 * labels.size()) - slider.cursor_size_ / 2, 0));
48 slider.set_size
49 (w - (w / labels.size()) + slider.cursor_size_,
50- h - UI::g_fh1->render(as_uifont("."))->height() - 2);
51+ h - UI::g_fh1->render(as_uifont("."))->height() + 2);
52 Panel::layout();
53 }
54
55
56=== modified file 'src/wui/plot_area.cc'
57--- src/wui/plot_area.cc 2016-01-29 08:37:22 +0000
58+++ src/wui/plot_area.cc 2016-03-02 17:15:03 +0000
59@@ -43,7 +43,7 @@
60 const uint32_t days = 24 * 60 * 60 * 1000;
61
62 const int32_t spacing = 5;
63-const int32_t space_at_bottom = 15;
64+const int32_t space_at_bottom = 20;
65 const int32_t space_at_right = 10;
66 const int32_t space_left_of_label = 15;
67 const uint32_t nr_samples = 30; // How many samples per diagramm when relative plotting

Subscribers

People subscribed via source and target branches

to status/vote changes: