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

Proposed by Tino
Status: Merged
Merged at revision: 6882
Proposed branch: lp:~widelands-dev/widelands/tooltips_fixes
Merge into: lp:widelands
Diff against target: 147 lines (+32/-17)
7 files modified
src/ui_basic/table.cc (+3/-2)
src/ui_basic/table.h (+4/-2)
src/ui_fsmenu/internet_lobby.cc (+15/-3)
src/ui_fsmenu/mapselect.cc (+2/-2)
src/wui/building_statistics_menu.cc (+4/-4)
src/wui/game_message_menu.cc (+2/-2)
src/wui/game_summary.cc (+2/-2)
To merge this branch: bzr merge lp:~widelands-dev/widelands/tooltips_fixes
Reviewer Review Type Date Requested Status
Tino Approve
Review via email: mp+211326@code.launchpad.net

Description of the change

- Allow setting a tooltip for table column headers
- Implements a tooltip for the internet lobby user status column

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :
Download full text (6.0 KiB)

Lgtm.

> Am 17.03.2014 um 15:25 schrieb Tino <email address hidden>:
>
> Tino has proposed merging lp:~widelands-dev/widelands/tooltips_fixes into lp:widelands.
>
> Requested reviews:
> Widelands Developers (widelands-dev)
>
> For more details, see:
> https://code.launchpad.net/~widelands-dev/widelands/tooltips_fixes/+merge/211326
>
> - Allow setting a tooltip for table column headers
> - Implements a tooltip for the internet lobby user status column
> --
> https://code.launchpad.net/~widelands-dev/widelands/tooltips_fixes/+merge/211326
> Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/tooltips_fixes into lp:widelands.
> === modified file 'src/ui_basic/table.cc' --- src/ui_basic/table.cc 2014-02-22 18:04:02 +0000 +++ src/ui_basic/table.cc 2014-03-17 14:24:48 +0000 @@ -78,7 +78,8 @@ /// Add a new column to this table. void Table::add_column (uint32_t const width, - const std::string & title, + const std::string & title, + const std::string & tooltip, Align const alignment, bool const is_checkbox_column) { @@ -101,7 +102,7 @@ (this, title, complete_width, 0, width, m_headerheight, g_gr->images().get("pics/but3.png"), - title, "", true, false); + title, tooltip, true, false); c.btn->sigclicked.connect (boost::bind(&Table::header_button_clicked, boost::ref(*this), m_columns.size())); c.btn->set_font(Font::get(m_fontname, m_fontsize)); === modified file 'src/ui_basic/table.h' --- src/ui_basic/table.h 2014-02-22 18:04:02 +0000 +++ src/ui_basic/table.h 2014-03-17 14:24:48 +0000 @@ -60,7 +60,8 @@ /// A column that has a title is sortable (by clicking on the title). void add_column (uint32_t width, - const std::string & title = std::string(), + const std::string & title = std::string(), + const std::string & tooltip = std::string(), Align = Align_Left, bool is_checkbox_column = false); @@ -165,7 +166,8 @@ void add_column (uint32_t width, - const std::string & title = std::string(), + const std::string & title = std::string(), + const std::string & tooltip = std::string(), Align = Align_Left, bool is_checkbox_column = false); === modified file 'src/ui_fsmenu/internet_lobby.cc' --- src/ui_fsmenu/internet_lobby.cc 2014-03-03 20:50:30 +0000 +++ src/ui_fsmenu/internet_lobby.cc 2014-03-17 14:24:48 +0000 @@ -19,7 +19,8 @@ #include "ui_fsmenu/internet_lobby.h" -#include +#include +#include #include "compile_diagnostics.h" #include "constants.h" @@ -151,8 +152,19 @@ servername .set_font(m_fn, m_fs, UI_FONT_CLR_FG); // prepare the lists - clientsonline .set_font(m_fn, m_fs); - clientsonline .add_column(22, "°"); + clientsonline .set_font(m_fn, m_fs); + std::string t_tip = (boost::format("%s%s%s%s%s%s%s%s%s%s") + % "
> " + % _("User Status") + % "
> " + % " " + % _("Registered") + % "
> " + % _("Administrator") + % "
> " + % _("Unregistered") + % "
>
> ").str(); + clientsonline .add_column(22, "°", t_tip); clientsonline .add_column((m_lisw - 22) * 3 / 8, _("Name")); clientsonline .add_column((m_lisw - 22) * 2 / 8, _("Points")); clientsonline .add_column((m_lisw - 22) * 3 / 8, _("Game")); === modified file 'src/ui_fsmenu/mapselect.cc' --- src/ui_fsmenu/mapselect.cc 2014...

Read more...

Revision history for this message
Tino (tino79) wrote :

Ah, ok, I am just going to merge it ;). Trunk is is really evolving atm...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ui_basic/table.cc'
2--- src/ui_basic/table.cc 2014-02-22 18:04:02 +0000
3+++ src/ui_basic/table.cc 2014-03-17 14:24:48 +0000
4@@ -78,7 +78,8 @@
5 /// Add a new column to this table.
6 void Table<void *>::add_column
7 (uint32_t const width,
8- const std::string & title,
9+ const std::string & title,
10+ const std::string & tooltip,
11 Align const alignment,
12 bool const is_checkbox_column)
13 {
14@@ -101,7 +102,7 @@
15 (this, title,
16 complete_width, 0, width, m_headerheight,
17 g_gr->images().get("pics/but3.png"),
18- title, "", true, false);
19+ title, tooltip, true, false);
20 c.btn->sigclicked.connect
21 (boost::bind(&Table::header_button_clicked, boost::ref(*this), m_columns.size()));
22 c.btn->set_font(Font::get(m_fontname, m_fontsize));
23
24=== modified file 'src/ui_basic/table.h'
25--- src/ui_basic/table.h 2014-02-22 18:04:02 +0000
26+++ src/ui_basic/table.h 2014-03-17 14:24:48 +0000
27@@ -60,7 +60,8 @@
28 /// A column that has a title is sortable (by clicking on the title).
29 void add_column
30 (uint32_t width,
31- const std::string & title = std::string(),
32+ const std::string & title = std::string(),
33+ const std::string & tooltip = std::string(),
34 Align = Align_Left,
35 bool is_checkbox_column = false);
36
37@@ -165,7 +166,8 @@
38
39 void add_column
40 (uint32_t width,
41- const std::string & title = std::string(),
42+ const std::string & title = std::string(),
43+ const std::string & tooltip = std::string(),
44 Align = Align_Left,
45 bool is_checkbox_column = false);
46
47
48=== modified file 'src/ui_fsmenu/internet_lobby.cc'
49--- src/ui_fsmenu/internet_lobby.cc 2014-03-03 20:50:30 +0000
50+++ src/ui_fsmenu/internet_lobby.cc 2014-03-17 14:24:48 +0000
51@@ -19,7 +19,8 @@
52
53 #include "ui_fsmenu/internet_lobby.h"
54
55-#include <boost/bind.hpp>
56+#include <boost/bind.hpp>
57+#include <boost/format.hpp>
58
59 #include "compile_diagnostics.h"
60 #include "constants.h"
61@@ -151,8 +152,19 @@
62 servername .set_font(m_fn, m_fs, UI_FONT_CLR_FG);
63
64 // prepare the lists
65- clientsonline .set_font(m_fn, m_fs);
66- clientsonline .add_column(22, "°");
67+ clientsonline .set_font(m_fn, m_fs);
68+ std::string t_tip = (boost::format("%s%s%s%s%s%s%s%s%s%s")
69+ % "<rt><p><font underline=yes>"
70+ % _("User Status")
71+ % "</font><br>"
72+ % "<img src=pics/roadb_yellow.png> "
73+ % _("Registered")
74+ % "<br><img src=pics/roadb_green.png> "
75+ % _("Administrator")
76+ % "<br><img src=pics/roadb_red.png> "
77+ % _("Unregistered")
78+ % "</p></rt>").str();
79+ clientsonline .add_column(22, "°", t_tip);
80 clientsonline .add_column((m_lisw - 22) * 3 / 8, _("Name"));
81 clientsonline .add_column((m_lisw - 22) * 2 / 8, _("Points"));
82 clientsonline .add_column((m_lisw - 22) * 3 / 8, _("Game"));
83
84=== modified file 'src/ui_fsmenu/mapselect.cc'
85--- src/ui_fsmenu/mapselect.cc 2014-03-09 10:28:39 +0000
86+++ src/ui_fsmenu/mapselect.cc 2014-03-17 14:24:48 +0000
87@@ -147,9 +147,9 @@
88
89 #define NR_PLAYERS_WIDTH 35
90 /** TRANSLATORS: Column title for number of players in map list */
91- m_table.add_column(NR_PLAYERS_WIDTH, _("#"), UI::Align_HCenter);
92+ m_table.add_column(NR_PLAYERS_WIDTH, _("#"), "", UI::Align_HCenter);
93 m_table.add_column
94- (m_table.get_w() - NR_PLAYERS_WIDTH, _("Map Name"), UI::Align_Left);
95+ (m_table.get_w() - NR_PLAYERS_WIDTH, _("Map Name"), "", UI::Align_Left);
96 m_table.set_column_compare
97 (1,
98 boost::bind
99
100=== modified file 'src/wui/building_statistics_menu.cc'
101--- src/wui/building_statistics_menu.cc 2014-03-05 11:59:09 +0000
102+++ src/wui/building_statistics_menu.cc 2014-03-17 14:24:48 +0000
103@@ -108,10 +108,10 @@
104 {
105 // building list
106 m_table.add_column(310, _("Name"));
107- m_table.add_column (70, _("Size"), UI::Align_HCenter);
108- m_table.add_column (70, _("Prod"), UI::Align_Right);
109- m_table.add_column (70, _("Owned"), UI::Align_Right);
110- m_table.add_column (70, _("Build"), UI::Align_Right);
111+ m_table.add_column (70, _("Size"), "", UI::Align_HCenter);
112+ m_table.add_column (70, _("Prod"), "", UI::Align_Right);
113+ m_table.add_column (70, _("Owned"), "", UI::Align_Right);
114+ m_table.add_column (70, _("Build"), "", UI::Align_Right);
115 m_table.selected.connect(boost::bind(&Building_Statistics_Menu::table_changed, this, _1));
116 m_table.set_column_compare
117 (Columns::Size,
118
119=== modified file 'src/wui/game_message_menu.cc'
120--- src/wui/game_message_menu.cc 2014-03-10 19:27:00 +0000
121+++ src/wui/game_message_menu.cc 2014-03-17 14:24:48 +0000
122@@ -53,8 +53,8 @@
123 list = new UI::Table<uintptr_t>(this, 5, 35, 570, 110);
124 list->selected.connect(boost::bind(&GameMessageMenu::selected, this, _1));
125 list->double_clicked.connect(boost::bind(&GameMessageMenu::double_clicked, this, _1));
126- list->add_column (60, _("Select"), UI::Align_HCenter, true);
127- list->add_column (60, _("Status"), UI::Align_HCenter);
128+ list->add_column (60, _("Select"), "", UI::Align_HCenter, true);
129+ list->add_column (60, _("Status"), "", UI::Align_HCenter);
130 list->add_column(330, _("Title"));
131 list->add_column(120, _("Time sent"));
132
133
134=== modified file 'src/wui/game_summary.cc'
135--- src/wui/game_summary.cc 2014-02-22 18:04:02 +0000
136+++ src/wui/game_summary.cc 2014-03-17 14:24:48 +0000
137@@ -88,8 +88,8 @@
138
139 // Prepare table
140 m_players_table->add_column(150, _("Player"));
141- m_players_table->add_column(50, _("Team"), UI::Align_HCenter);
142- m_players_table->add_column(100, _("Status"), UI::Align_HCenter);
143+ m_players_table->add_column(50, _("Team"), "", UI::Align_HCenter);
144+ m_players_table->add_column(100, _("Status"), "", UI::Align_HCenter);
145 m_players_table->add_column(100, _("Time"));
146
147 // Prepare Elements

Subscribers

People subscribed via source and target branches

to status/vote changes: