← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/align_cleanup_textarea into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/align_cleanup_textarea into lp:widelands.

Commit message:
Removed default parameters from calls to Textarea constructor and Table::add_column().

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/align_cleanup_textarea/+merge/318322

Align cleanup followup - part 2.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/align_cleanup_textarea into lp:widelands.
=== modified file 'src/editor/ui_menus/main_menu_load_or_save_map.cc'
--- src/editor/ui_menus/main_menu_load_or_save_map.cc	2017-02-25 13:27:40 +0000
+++ src/editor/ui_menus/main_menu_load_or_save_map.cc	2017-02-26 12:20:48 +0000
@@ -56,8 +56,7 @@
                   get_inner_w() - right_column_x_ - padding_,
                   tableh_,
                   MapDetails::Style::kWui),
-     directory_info_(
-        this, padding_, get_inner_h() - 2 * buth_ - 4 * padding_, "", UI::Align::kLeft),
+     directory_info_(this, padding_, get_inner_h() - 2 * buth_ - 4 * padding_),
      ok_(this,
          "ok",
          UI::g_fh1->fontset()->is_rtl() ? get_inner_w() / 2 - butw_ - padding_ :

=== modified file 'src/editor/ui_menus/main_menu_save_map.cc'
--- src/editor/ui_menus/main_menu_save_map.cc	2017-02-23 19:38:51 +0000
+++ src/editor/ui_menus/main_menu_save_map.cc	2017-02-26 12:20:48 +0000
@@ -67,13 +67,8 @@
                    buth_,
                    g_gr->images().get("images/ui_basic/but5.png"),
                    _("Map Options")),
-     editbox_label_(this,
-                    padding_,
-                    tabley_ + tableh_ + 3 * padding_,
-                    butw_,
-                    buth_,
-                    _("Filename:"),
-                    UI::Align::kLeft) {
+     editbox_label_(
+        this, padding_, tabley_ + tableh_ + 3 * padding_, butw_, buth_, _("Filename:")) {
 	set_current_directory(curdir_);
 
 	// Make room for edit_options_ button

=== modified file 'src/editor/ui_menus/main_menu_save_map_make_directory.cc'
--- src/editor/ui_menus/main_menu_save_map_make_directory.cc	2017-02-25 11:17:28 +0000
+++ src/editor/ui_menus/main_menu_save_map_make_directory.cc	2017-02-26 12:20:48 +0000
@@ -38,13 +38,7 @@
            get_inner_w() - 2 * padding_,
            get_inner_h() - 3 * padding_ - buth_,
            padding_ / 2),
-     label_(&vbox_,
-            0,
-            0,
-            get_inner_w() - 2 * padding_,
-            buth_,
-            _("Enter Directory Name:"),
-            UI::Align::kLeft),
+     label_(&vbox_, 0, 0, get_inner_w() - 2 * padding_, buth_, _("Enter Directory Name:")),
      edit_(&vbox_,
            0,
            0,

=== modified file 'src/main.cc'
--- src/main.cc	2017-02-18 14:03:02 +0000
+++ src/main.cc	2017-02-26 12:20:48 +0000
@@ -65,7 +65,8 @@
 		     << "') in outermost handler!\nThe exception said: " << e.what()
 		     << "\n\nThis should not happen. Please file a bug report on version " << build_id()
 		     << '(' << build_type() << ')' << ".\n"
-		     << "and remember to specify your operating system.\n\n" << flush;
+		     << "and remember to specify your operating system.\n\n"
+		     << flush;
 		delete g_app;
 
 		return 1;
@@ -74,7 +75,8 @@
 		     << "') in outermost handler!\nThe exception said: " << e.what()
 		     << "\n\nThis should not happen. Please file a bug report on version " << build_id()
 		     << '(' << build_type() << ')' << ".\n"
-		     << "and remember to specify your operating system.\n\n" << flush;
+		     << "and remember to specify your operating system.\n\n"
+		     << flush;
 		delete g_app;
 
 		return 1;

=== modified file 'src/ui_fsmenu/campaign_select.cc'
--- src/ui_fsmenu/campaign_select.cc	2017-02-23 19:38:51 +0000
+++ src/ui_fsmenu/campaign_select.cc	2017-02-26 12:20:48 +0000
@@ -48,29 +48,21 @@
      title_(this, get_w() / 2, tabley_ / 3, _("Choose a campaign"), UI::Align::kCenter),
 
      // Campaign description
-     label_campname_(this, right_column_x_, tabley_, "", UI::Align::kLeft),
+     label_campname_(this, right_column_x_, tabley_),
      ta_campname_(this,
                   right_column_x_ + indent_,
                   get_y_from_preceding(label_campname_) + padding_,
                   get_right_column_w(right_column_x_) - indent_,
                   label_height_),
 
-     label_tribename_(this,
-                      right_column_x_,
-                      get_y_from_preceding(ta_campname_) + 2 * padding_,
-                      "",
-                      UI::Align::kLeft),
+     label_tribename_(this, right_column_x_, get_y_from_preceding(ta_campname_) + 2 * padding_),
      ta_tribename_(this,
                    right_column_x_ + indent_,
                    get_y_from_preceding(label_tribename_) + padding_,
                    get_right_column_w(right_column_x_ + indent_),
                    label_height_),
 
-     label_difficulty_(this,
-                       right_column_x_,
-                       get_y_from_preceding(ta_tribename_) + 2 * padding_,
-                       "",
-                       UI::Align::kLeft),
+     label_difficulty_(this, right_column_x_, get_y_from_preceding(ta_tribename_) + 2 * padding_),
      ta_difficulty_(this,
                     right_column_x_ + indent_,
                     get_y_from_preceding(label_difficulty_) + padding_,
@@ -80,8 +72,7 @@
      label_description_(this,
                         right_column_x_,
                         get_y_from_preceding(ta_difficulty_) + 2 * padding_,
-                        _("Description:"),
-                        UI::Align::kLeft),
+                        _("Description:")),
      ta_description_(this,
                      right_column_x_ + indent_,
                      get_y_from_preceding(label_description_) + padding_,
@@ -103,8 +94,8 @@
 	   boost::bind(&FullscreenMenuCampaignSelect::clicked_ok, boost::ref(*this)));
 
 	/** TRANSLATORS: Campaign difficulty table header */
-	table_.add_column(45, _("Diff."), _("Difficulty"), UI::Align::kLeft);
-	table_.add_column(100, _("Tribe"), _("Tribe Name"), UI::Align::kLeft);
+	table_.add_column(45, _("Diff."), _("Difficulty"));
+	table_.add_column(100, _("Tribe"), _("Tribe Name"));
 	table_.add_column(
 	   0, _("Campaign Name"), _("Campaign Name"), UI::Align::kLeft, UI::TableColumnType::kFlexible);
 	table_.set_column_compare(
@@ -291,26 +282,21 @@
                UI::Align::kCenter),
 
      // Map description
-     label_mapname_(this, right_column_x_, tabley_, "", UI::Align::kLeft),
+     label_mapname_(this, right_column_x_, tabley_),
      ta_mapname_(this,
                  right_column_x_ + indent_,
                  get_y_from_preceding(label_mapname_) + padding_,
                  get_right_column_w(right_column_x_ + indent_),
                  label_height_),
 
-     label_author_(this,
-                   right_column_x_,
-                   get_y_from_preceding(ta_mapname_) + 2 * padding_,
-                   "",
-                   UI::Align::kLeft),
+     label_author_(this, right_column_x_, get_y_from_preceding(ta_mapname_) + 2 * padding_),
      ta_author_(this,
                 right_column_x_ + indent_,
                 get_y_from_preceding(label_author_) + padding_,
                 get_right_column_w(right_column_x_ + indent_),
                 2 * label_height_),
 
-     label_description_(
-        this, right_column_x_, get_y_from_preceding(ta_author_) + padding_, "", UI::Align::kLeft),
+     label_description_(this, right_column_x_, get_y_from_preceding(ta_author_) + padding_),
      ta_description_(this,
                      right_column_x_ + indent_,
                      get_y_from_preceding(label_description_) + padding_,
@@ -348,7 +334,7 @@
 	}
 
 	/** TRANSLATORS: Campaign scenario number table header */
-	table_.add_column(35, _("#"), number_tooltip, UI::Align::kLeft);
+	table_.add_column(35, _("#"), number_tooltip);
 	table_.add_column(
 	   0, name_tooltip, name_tooltip, UI::Align::kLeft, UI::TableColumnType::kFlexible);
 	table_.set_sort_column(0);

=== modified file 'src/ui_fsmenu/helpwindow.cc'
--- src/ui_fsmenu/helpwindow.cc	2017-02-23 17:58:25 +0000
+++ src/ui_fsmenu/helpwindow.cc	2017-02-26 12:20:48 +0000
@@ -40,8 +40,7 @@
                                            uint32_t height)
    : Window(
         parent, "help_window", 0, 0, width, height, (boost::format(_("Help: %s")) % caption).str()),
-     textarea_(new MultilineTextarea(
-        this, 5, 5, width - 10, height - 30, std::string(), UI::Align::kLeft)) {
+     textarea_(new MultilineTextarea(this, 5, 5, width - 10, height - 30)) {
 	int margin = 5;
 
 	// Calculate sizes

=== modified file 'src/ui_fsmenu/launch_spg.cc'
--- src/ui_fsmenu/launch_spg.cc	2017-02-23 19:38:51 +0000
+++ src/ui_fsmenu/launch_spg.cc	2017-02-26 12:20:48 +0000
@@ -90,28 +90,22 @@
               get_h() * 53 / 200 - 15,
               std::string(),
               UI::Align::kCenter),
-     name_(this, get_w() * 1 / 25, get_h() * 53 / 200 - 15, _("Player’s name"), UI::Align::kLeft),
+     name_(this, get_w() * 1 / 25, get_h() * 53 / 200 - 15, _("Player’s name")),
      type_(this,
            // (Element x) + (PlayerDescriptionGroup x)  + border
            ((get_w() * 16 / 25) * 35 / 125) + (get_w() / 25) + 2,
            get_h() * 53 / 200 - 15,
-           _("Player’s type"),
-           UI::Align::kLeft),
-     team_(this,
-           ((get_w() * 16 / 25) * 35 / 125) + (get_w() / 25) + 2,
-           get_h() * 53 / 200,
-           _("Team"),
-           UI::Align::kLeft),
+           _("Player’s type")),
+     team_(
+        this, ((get_w() * 16 / 25) * 35 / 125) + (get_w() / 25) + 2, get_h() * 53 / 200, _("Team")),
      tribe_(this,
             ((get_w() * 16 / 25) * 80 / 125) + (get_w() / 25) + 2,
             get_h() * 53 / 200 - 15,
-            _("Player’s tribe"),
-            UI::Align::kLeft),
+            _("Player’s tribe")),
      init_(this,
            ((get_w() * 16 / 25) * 55 / 125) + (get_w() / 25) + 2,
            get_h() * 53 / 200,
-           _("Start type"),
-           UI::Align::kLeft),
+           _("Start type")),
      wincondition_type_(this,
                         get_w() * 7 / 10 + (butw_ / 2),
                         get_h() * 7 / 20 + buth_,

=== modified file 'src/ui_fsmenu/loadgame.cc'
--- src/ui_fsmenu/loadgame.cc	2017-02-23 19:38:51 +0000
+++ src/ui_fsmenu/loadgame.cc	2017-02-26 12:20:48 +0000
@@ -102,40 +102,31 @@
             UI::Align::kCenter),
 
      // Savegame description
-     label_mapname_(this, right_column_x_, tabley_, "", UI::Align::kLeft),
+     label_mapname_(this, right_column_x_, tabley_),
      ta_mapname_(this,
                  right_column_x_ + indent_,
                  get_y_from_preceding(label_mapname_) + padding_,
                  get_right_column_w(right_column_x_ + indent_),
                  2 * label_height_ - padding_),
 
-     label_gametime_(this,
-                     right_column_x_,
-                     get_y_from_preceding(ta_mapname_) + 2 * padding_,
-                     "",
-                     UI::Align::kLeft),
+     label_gametime_(this, right_column_x_, get_y_from_preceding(ta_mapname_) + 2 * padding_),
      ta_gametime_(this,
                   right_column_tab_,
                   label_gametime_.get_y(),
                   get_right_column_w(right_column_tab_),
                   label_height_),
 
-     label_players_(
-        this, right_column_x_, get_y_from_preceding(ta_gametime_), "", UI::Align::kLeft),
+     label_players_(this, right_column_x_, get_y_from_preceding(ta_gametime_)),
      ta_players_(this,
                  right_column_tab_,
                  label_players_.get_y(),
                  get_right_column_w(right_column_tab_),
                  label_height_),
 
-     label_version_(this, right_column_x_, get_y_from_preceding(ta_players_), "", UI::Align::kLeft),
-     ta_version_(this, right_column_tab_, label_version_.get_y(), "", UI::Align::kLeft),
+     label_version_(this, right_column_x_, get_y_from_preceding(ta_players_)),
+     ta_version_(this, right_column_tab_, label_version_.get_y()),
 
-     label_win_condition_(this,
-                          right_column_x_,
-                          get_y_from_preceding(ta_version_) + 3 * padding_,
-                          "",
-                          UI::Align::kLeft),
+     label_win_condition_(this, right_column_x_, get_y_from_preceding(ta_version_) + 3 * padding_),
      ta_win_condition_(this,
                        right_column_x_ + indent_,
                        get_y_from_preceding(label_win_condition_) + padding_,
@@ -194,7 +185,7 @@
 	ok_.sigclicked.connect(boost::bind(&FullscreenMenuLoadGame::clicked_ok, boost::ref(*this)));
 	delete_.sigclicked.connect(
 	   boost::bind(&FullscreenMenuLoadGame::clicked_delete, boost::ref(*this)));
-	table_.add_column(130, _("Save Date"), _("The date this game was saved"), UI::Align::kLeft);
+	table_.add_column(130, _("Save Date"), _("The date this game was saved"));
 	if (is_replay_ || settings_->settings().multiplayer) {
 		std::vector<std::string> modes;
 		if (is_replay_) {
@@ -221,8 +212,7 @@
 		   /** TRANSLATORS: Game Mode table column when choosing a game/replay to load. */
 		   /** TRANSLATORS: Keep this to 5 letters maximum. */
 		   /** TRANSLATORS: A tooltip will explain if you need to use an abbreviation. */
-		   _("Mode"), (boost::format("%s %s") % mode_tooltip_1 % mode_tooltip_2).str(),
-		   UI::Align::kLeft);
+		   _("Mode"), (boost::format("%s %s") % mode_tooltip_1 % mode_tooltip_2).str());
 	}
 	table_.add_column(0, _("Description"),
 	                  _("The filename that the game was saved under followed by the map’s name, "

=== modified file 'src/ui_fsmenu/main.cc'
--- src/ui_fsmenu/main.cc	2017-02-25 13:27:40 +0000
+++ src/ui_fsmenu/main.cc	2017-02-26 12:20:48 +0000
@@ -102,9 +102,8 @@
                /** TRANSLATORS: Placeholders are the copyright years */
                (boost::format(_("(C) %1%-%2% by the Widelands Development Team")) %
                 kWidelandsCopyrightStart % kWidelandsCopyrightEnd)
-                  .str(),
-               UI::Align::kLeft),
-     gpl(this, 0, 0, _("Licensed under the GNU General Public License V2.0"), UI::Align::kLeft) {
+                  .str()),
+     gpl(this, 0, 0, _("Licensed under the GNU General Public License V2.0")) {
 	playtutorial.sigclicked.connect(
 	   boost::bind(&FullscreenMenuMain::end_modal<FullscreenMenuBase::MenuTarget>, boost::ref(*this),
 	               FullscreenMenuBase::MenuTarget::kTutorial));

=== modified file 'src/wui/building_statistics_menu.cc'
--- src/wui/building_statistics_menu.cc	2017-02-23 19:38:51 +0000
+++ src/wui/building_statistics_menu.cc	2017-02-26 12:20:48 +0000
@@ -69,27 +69,19 @@
      navigation_panel_(this, 0, 0, kWindowWidth, 4 * kButtonRowHeight),
      building_name_(
         &navigation_panel_, get_inner_w() / 2, 0, 0, kButtonHeight, "", UI::Align::kCenter),
-     owned_label_(&navigation_panel_,
-                  kMargin,
-                  kButtonRowHeight,
-                  0,
-                  kButtonHeight,
-                  _("Owned:"),
-                  UI::Align::kLeft),
+     owned_label_(&navigation_panel_, kMargin, kButtonRowHeight, 0, kButtonHeight, _("Owned:")),
      construction_label_(&navigation_panel_,
                          kMargin,
                          2 * kButtonRowHeight,
                          0,
                          kButtonHeight,
-                         _("Under Construction:"),
-                         UI::Align::kLeft),
+                         _("Under Construction:")),
      unproductive_box_(&navigation_panel_, kMargin, 3 * kButtonRowHeight + 3, UI::Box::Horizontal),
      unproductive_label_(
         &unproductive_box_,
         /** TRANSLATORS: This is the first part of productivity with input field */
         /** TRANSLATORS: Building statistics window - 'Low Productivity <input>%:' */
-        _("Low Productivity"),
-        UI::Align::kLeft),
+        _("Low Productivity")),
      unproductive_percent_(
         &unproductive_box_,
         0,
@@ -103,8 +95,7 @@
         &unproductive_box_,
         /** TRANSLATORS: This is the second part of productivity with input field */
         /** TRANSLATORS: Building statistics window -  'Low Productivity <input>%:' */
-        _("%:"),
-        UI::Align::kLeft),
+        _("%:")),
      no_owned_label_(&navigation_panel_,
                      get_inner_w() - 2 * kButtonRowHeight - kMargin,
                      kButtonRowHeight,

=== modified file 'src/wui/encyclopedia_window.cc'
--- src/wui/encyclopedia_window.cc	2017-02-21 07:56:18 +0000
+++ src/wui/encyclopedia_window.cc	2017-02-26 12:20:48 +0000
@@ -87,8 +87,8 @@
 			   tab_name, std::unique_ptr<UI::Listselect<EncyclopediaEntry>>(
 			                new UI::Listselect<EncyclopediaEntry>(
 			                   boxes_.at(tab_name).get(), 0, 0, contents_width, contents_height))));
-			lists_.at(tab_name)
-			   ->selected.connect(boost::bind(&EncyclopediaWindow::entry_selected, this, tab_name));
+			lists_.at(tab_name)->selected.connect(
+			   boost::bind(&EncyclopediaWindow::entry_selected, this, tab_name));
 
 			contents_.insert(std::make_pair(
 			   tab_name, std::unique_ptr<UI::MultilineTextarea>(new UI::MultilineTextarea(
@@ -126,8 +126,9 @@
 					                 entry_name.c_str());
 				}
 
-				EncyclopediaEntry entry(entry_script, entry_table->get_table("script_parameters")
-				                                         ->array_entries<std::string>());
+				EncyclopediaEntry entry(
+				   entry_script,
+				   entry_table->get_table("script_parameters")->array_entries<std::string>());
 
 				if (entry_icon.empty()) {
 					lists_.at(tab_name)->add(entry_title, entry);

=== modified file 'src/wui/game_main_menu_save_game.cc'
--- src/wui/game_main_menu_save_game.cc	2017-02-23 19:38:51 +0000
+++ src/wui/game_main_menu_save_game.cc	2017-02-26 12:20:48 +0000
@@ -72,13 +72,13 @@
          LIST_WIDTH,
          LIST_HEIGHT - editbox_.get_h(),
          g_gr->images().get("images/ui_basic/but1.png")),
-     name_label_(this, DESCRIPTION_X, 5, 0, 20, _("Map Name:"), UI::Align::kLeft),
-     mapname_(this, DESCRIPTION_X, 20, 0, 20, " ", UI::Align::kLeft),
-     gametime_label_(this, DESCRIPTION_X, 45, 0, 20, _("Game Time:"), UI::Align::kLeft),
-     gametime_(this, DESCRIPTION_X, 60, 0, 20, " ", UI::Align::kLeft),
-     players_label_(this, DESCRIPTION_X, 85, 0, 20, " ", UI::Align::kLeft),
-     win_condition_label_(this, DESCRIPTION_X, 110, 0, 20, _("Win condition:"), UI::Align::kLeft),
-     win_condition_(this, DESCRIPTION_X, 125, 0, 20, " ", UI::Align::kLeft),
+     name_label_(this, DESCRIPTION_X, 5, 0, 20, _("Map Name:")),
+     mapname_(this, DESCRIPTION_X, 20, 0, 20),
+     gametime_label_(this, DESCRIPTION_X, 45, 0, 20, _("Game Time:")),
+     gametime_(this, DESCRIPTION_X, 60, 0, 20),
+     players_label_(this, DESCRIPTION_X, 85, 0, 20),
+     win_condition_label_(this, DESCRIPTION_X, 110, 0, 20, _("Win condition:")),
+     win_condition_(this, DESCRIPTION_X, 125, 0, 20),
      curdir_(SaveHandler::get_base_dir()) {
 	editbox_.changed.connect(boost::bind(&GameMainMenuSaveGame::edit_box_changed, this));
 	editbox_.ok.connect(boost::bind(&GameMainMenuSaveGame::ok, this));

=== modified file 'src/wui/helpwindow.cc'
--- src/wui/helpwindow.cc	2017-02-23 17:58:25 +0000
+++ src/wui/helpwindow.cc	2017-02-26 12:20:48 +0000
@@ -44,8 +44,7 @@
                       width,
                       height,
                       (boost::format(_("Help: %s")) % building_description.descname()).str()),
-     textarea_(new MultilineTextarea(
-        this, 5, 5, width - 10, height - 10, std::string(), UI::Align::kLeft)) {
+     textarea_(new MultilineTextarea(this, 5, 5, width - 10, height - 10)) {
 	assert(tribe.has_building(tribe.building_index(building_description.name())) ||
 	       building_description.type() == Widelands::MapObjectType::MILITARYSITE);
 	try {

=== modified file 'src/wui/login_box.cc'
--- src/wui/login_box.cc	2017-02-23 17:58:25 +0000
+++ src/wui/login_box.cc	2017-02-26 12:20:48 +0000
@@ -38,9 +38,8 @@
 	eb_password =
 	   new UI::EditBox(this, 150, 40, 330, 20, 2, g_gr->images().get("images/ui_basic/but2.png"));
 
-	pwd_warning = new UI::MultilineTextarea(this, margin, 65, 505, 50,
-	                                        _("WARNING: Password will be shown and saved readable!"),
-	                                        UI::Align::kLeft);
+	pwd_warning = new UI::MultilineTextarea(
+	   this, margin, 65, 505, 50, _("WARNING: Password will be shown and saved readable!"));
 
 	cb_register = new UI::Checkbox(this, Vector2i(margin, 110), _("Log in to a registered account"),
 	                               "", get_inner_w() - 2 * margin);

=== modified file 'src/wui/maptable.cc'
--- src/wui/maptable.cc	2017-02-23 17:58:25 +0000
+++ src/wui/maptable.cc	2017-02-26 12:20:48 +0000
@@ -35,7 +35,7 @@
 	add_column(35, _("Pl."), _("Number of players"), UI::Align::kCenter);
 	add_column(0, _("Filename"), _("The name of the map or scenario"), UI::Align::kLeft,
 	           UI::TableColumnType::kFlexible);
-	add_column(115, _("Size"), _("The size of the map (Width x Height)"), UI::Align::kLeft);
+	add_column(115, _("Size"), _("The size of the map (Width x Height)"));
 	set_sort_column(0);
 }
 

=== modified file 'src/wui/suggested_teams_box.cc'
--- src/wui/suggested_teams_box.cc	2017-02-23 17:58:25 +0000
+++ src/wui/suggested_teams_box.cc	2017-02-26 12:20:48 +0000
@@ -50,7 +50,7 @@
 	suggested_teams_.clear();
 	set_size(max_x, max_y);
 
-	suggested_teams_box_label_ = new UI::Textarea(this, "", UI::Align::kLeft);
+	suggested_teams_box_label_ = new UI::Textarea(this);
 	add(suggested_teams_box_label_);
 }
 SuggestedTeamsBox::~SuggestedTeamsBox() {


Follow ups