[wesnoth-commits] [wesnoth/wesnoth] 71d626: GUI2/Canvas: allow formula values for [text] font_...

GitHub noreply at github.com
Mon Mar 26 01:13:17 UTC 2018


  Branch: refs/heads/1.14
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 71d62630877afecc7cfbe431451db96f285c0221
      https://github.com/wesnoth/wesnoth/commit/71d62630877afecc7cfbe431451db96f285c0221
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-03-26 (Mon, 26 Mar 2018)

  Changed paths:
    M data/gui/schema.cfg
    M src/gui/core/canvas.cpp
    M src/gui/core/canvas_private.hpp

  Log Message:
  -----------
  GUI2/Canvas: allow formula values for [text] font_size=


  Commit: 90ea8dcf0d034850c41735e8279a650ad5745007
      https://github.com/wesnoth/wesnoth/commit/90ea8dcf0d034850c41735e8279a650ad5745007
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-03-26 (Mon, 26 Mar 2018)

  Changed paths:
    M data/gui/macros/_initial.cfg
    M data/gui/schema.cfg
    M data/gui/widget/text_box_default.cfg
    M data/gui/window/addon_manager.cfg
    M data/gui/window/chat_log.cfg
    M data/gui/window/game_load.cfg
    M data/gui/window/lobby_main.cfg
    M data/gui/window/mp_create_game.cfg
    M data/gui/window/unit_create.cfg
    M data/gui/window/unit_recall.cfg
    M src/gui/widgets/text_box.cpp
    M src/gui/widgets/text_box.hpp

  Log Message:
  -----------
  GUI2/Text Box: refactored hint text interface

Previously, I had implemented the hint text ("Search)" and image (the magnifying glass)
as a custom text box definition. This caused some problems, though. Since the string was
hard-coded as part of a WFL formula, it couldn't be translated (see #2709 and #2732). It
also wasn't expandable to any other usecase.

Instead, I've added two new hint_text= and hint_image= keys to [text_box], wrapped the
"Search" text and magnifying image path in a helper macro, and refactored the default
definition to display the hint text and image when appropriate.

This also fixes a minor issue where selected text wouldn't remain highlighted when the
box wasn't focused when using the filter definition (it did with the default one).

This should fix the untranslatable "Search" text issue mentioned in both issues above.
The new string is in the wesnoth-lib textdomain.


Compare: https://github.com/wesnoth/wesnoth/compare/ae2b875cd40a...90ea8dcf0d03


More information about the Commits mailing list