mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-03 14:52:26 +00:00

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. (cherry-picked from commit db5abb7e637fd87699fce49a9543faafc3f58068)