Author: mordante
Date: Sat Nov 1 17:43:20 2008
New Revision: 30499
URL: http://svn.gna.org/viewcvs/wesnoth?rev=30499&view=rev
Log:
Turned the spacer size formula based.
This change is needed to make the dialogs with Kitty's large portraits
properly sizable.
Modified:
trunk/src/gui/widgets/window_builder.cpp
trunk/src/gui/widgets/window_builder_private.hpp
Modified: trunk/src/gui/widgets/window_builder.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/window_builder.cpp?rev=30499&r1=30498&r2=30499&view=diff
==============================================================================
--- trunk/src/gui/widgets/window_builder.cpp (original)
+++ trunk/src/gui/widgets/window_builder.cpp Sat Nov 1 17:43:20 2008
@@ -1107,8 +1107,12 @@
init_control(spacer);
- if(width_ || height_) {
- spacer->set_best_size(tpoint(width_, height_));
+ const game_logic::map_formula_callable& size =
get_screen_size_variables();
+ const unsigned width = width_(size);
+ const unsigned height = height_(size);
+
+ if(width || height) {
+ spacer->set_best_size(tpoint(width, height));
}
DBG_GUI << "Window builder: placed spacer '" << id << "' with defintion
'"
Modified: trunk/src/gui/widgets/window_builder_private.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/window_builder_private.hpp?rev=30499&r1=30498&r2=30499&view=diff
==============================================================================
--- trunk/src/gui/widgets/window_builder_private.hpp (original)
+++ trunk/src/gui/widgets/window_builder_private.hpp Sat Nov 1 17:43:20 2008
@@ -273,21 +273,25 @@
* zero the spacer functions as a fixed size spacer.
*
* @start_table = config
- * width (unsigned = 0) The width of the spacer.
- * height (unsigned = 0) The height of the spacer.
+ * width (f_unsigned = 0) The width of the spacer.
+ * height (f_unsigned = 0) The height of the spacer.
* @end_table
+ *
+ * The variable available are the same as for the window resolution see
+ * http://www.wesnoth.org/wiki/GUIToolkitWML#Resolution_2 for the list of
+ * items.
*/
tbuilder_spacer(const config& cfg) :
tbuilder_control(cfg),
- width_(lexical_cast_default<unsigned>(cfg["width"])),
- height_(lexical_cast_default<unsigned>(cfg["height"]))
+ width_(cfg["width"]),
+ height_(cfg["height"])
{}
twidget* build () const;
private:
- unsigned width_;
- unsigned height_;
+ tformula<unsigned> width_;
+ tformula<unsigned> height_;
};
struct tbuilder_text_box : public tbuilder_control
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits