[Commits] [wesnoth/wesnoth] fa9f75: gui2/ttransient_message: Hide title and image widg...

GitHub noreply at github.com
Thu Mar 13 05:08:31 UTC 2014


  Branch: refs/heads/1.12
  Home:   https://github.com/wesnoth/wesnoth
  Commit: fa9f75b6270706f5a966c60a19be441fea108d21
      https://github.com/wesnoth/wesnoth/commit/fa9f75b6270706f5a966c60a19be441fea108d21
  Author: Ignacio R. Morelle <shadowm at wesnoth.org>
  Date:   2014-03-13 (Thu, 13 Mar 2014)

  Changed paths:
    M src/gui/dialogs/transient_message.cpp
    M src/gui/dialogs/transient_message.hpp

  Log Message:
  -----------
  gui2/ttransient_message: Hide title and image widgets when unused

When the title or image widget labels are left empty, the widgets
continue to take up space in the grid, which is particularly conspicuous
with our current border,border_size=all,5 convention.

Commit 037ec6af8b307c20de860d670744deab309f7b23 exposes the underlying
problem quite clearly in most dialogs because the image widget's cell
takes up extra space to the left of the dialog while empty -- see the
Objectives popup for an example.

Hiding the relevant widgets when missing label values is trivial to do,
even if it requires additional boilerplate in the
gui2::ttransient_message case (no existing pre_show() method override),
so it should be a good solution as any until cell borders gain the
ability to become null when the contained widget is otherwise unused.

NOTE: I had to move the inclusion of gettext.hpp around a bit in order
to avoid name collisions with Boost headers introduced along with the
two new GUI2 inclusions in transient_message.cpp. The _ gettext
shorthand macro is truly a PITA to have near some of the most
complicated Boost libraries.


  Commit: 403ccb10c750703242554f0a1b55914fbb6fb0aa
      https://github.com/wesnoth/wesnoth/commit/403ccb10c750703242554f0a1b55914fbb6fb0aa
  Author: Ignacio R. Morelle <shadowm at wesnoth.org>
  Date:   2014-03-13 (Thu, 13 Mar 2014)

  Changed paths:
    M src/gui/dialogs/message.cpp

  Log Message:
  -----------
  gui2/tmessage: Hide title and image widgets when unused

When the title or image widget labels are left empty, the widgets
continue to take up space in the grid, which is particularly conspicuous
with our current border,border_size=all,5 convention.

Commit b9b199f4f19a414813c28db68e903b9bb5306101 exposes the underlying
problem quite clearly in most dialogs because the image widget's cell
takes up extra space to the left of the dialog while empty -- see the
"you have not started your turn yet, do you really want to end your
turn" prompt for an example.

Hiding the relevant widgets when missing label values is trivial to do.
In the gui2::tmessage case it required a minor internal refactoring to
keep a find_widget<>() reference around for a second method call for
each widget. This should be a good solution as any until cell borders
gain the ability to become null when the contained widget is otherwise
unused.


Compare: https://github.com/wesnoth/wesnoth/compare/d36fbdc57806...403ccb10c750


More information about the Commits mailing list