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

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


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 4968a4b242e05952416cd0b425823081d43a7ce9
      https://github.com/wesnoth/wesnoth/commit/4968a4b242e05952416cd0b425823081d43a7ce9
  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: 849878612133880d356157dedb5eba00bb9694b7
      https://github.com/wesnoth/wesnoth/commit/849878612133880d356157dedb5eba00bb9694b7
  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/037ec6af8b30...849878612133


More information about the Commits mailing list