Merge lp:~widelands-dev/widelands/bug-1744583_fix_building_help into lp:widelands

Proposed by kaputtnik
Status: Merged
Merged at revision: 8586
Proposed branch: lp:~widelands-dev/widelands/bug-1744583_fix_building_help
Merge into: lp:widelands
Diff against target: 41 lines (+8/-1)
3 files modified
src/graphic/text_layout.cc (+6/-0)
src/graphic/text_layout.h (+1/-0)
src/wui/helpwindow.cc (+1/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1744583_fix_building_help
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+337509@code.launchpad.net

Commit message

Fixing buildinghelp by adding a method to enclose strings in rt tags

Description of the change

Fixing buildinghelp by adding a method to enclose strings in rt tags.

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

Continuous integration builds have changed state:

Travis build 3165. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/339956534.
Appveyor build 2972. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1744583_fix_building_help-2972.

Revision history for this message
GunChleoc (gunchleoc) wrote :

LGTM - thanks for following up :)

@bunnybot merge

review: Approve

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 2017-05-25 12:30:40 +0000
3+++ src/graphic/text_layout.cc 2018-02-10 20:30:21 +0000
4@@ -141,6 +141,12 @@
5 return f.str();
6 }
7
8+std::string as_richtext(const std::string& txt) {
9+ static boost::format f("<rt>%s</rt>");
10+ f % txt;
11+ return f.str();
12+}
13+
14 std::string as_tooltip(const std::string& txt) {
15 static boost::format f("<rt><p><font face=sans size=%i bold=1 color=%s>%s</font></p></rt>");
16
17
18=== modified file 'src/graphic/text_layout.h'
19--- src/graphic/text_layout.h 2017-05-21 18:15:17 +0000
20+++ src/graphic/text_layout.h 2018-02-10 20:30:21 +0000
21@@ -84,6 +84,7 @@
22 const RGBColor& clr = UI_FONT_CLR_FG,
23 UI::FontSet::Face face = UI::FontSet::Face::kSans);
24
25+std::string as_richtext(const std::string&);
26 std::string as_tooltip(const std::string&);
27 std::string as_waresinfo(const std::string&);
28 std::string as_game_tip(const std::string&);
29
30=== modified file 'src/wui/helpwindow.cc'
31--- src/wui/helpwindow.cc 2018-02-02 11:12:04 +0000
32+++ src/wui/helpwindow.cc 2018-02-10 20:30:21 +0000
33@@ -56,7 +56,7 @@
34 std::unique_ptr<LuaTable> return_table = cr->pop_table();
35 return_table->do_not_warn_about_unaccessed_keys(); // We won't display the title here
36 textarea_->force_new_renderer();
37- textarea_->set_text(as_waresinfo(return_table->get_string("text")));
38+ textarea_->set_text(as_richtext(return_table->get_string("text")));
39 } catch (LuaError& err) {
40 textarea_->set_text(err.what());
41 }

Subscribers

People subscribed via source and target branches

to status/vote changes: