diff --git a/data/gui/options_ui.stkgui b/data/gui/options_ui.stkgui index 408a565f9..a9750ce84 100644 --- a/data/gui/options_ui.stkgui +++ b/data/gui/options_ui.stkgui @@ -26,19 +26,19 @@
- +
- +
-
- +
+
diff --git a/data/gui/options_video.stkgui b/data/gui/options_video.stkgui index ba0618fbf..1a28fdb06 100644 --- a/data/gui/options_video.stkgui +++ b/data/gui/options_video.stkgui @@ -22,17 +22,14 @@
- - +
@@ -51,8 +48,7 @@
- - +
diff --git a/src/guiengine/layout_manager.cpp b/src/guiengine/layout_manager.cpp index b9bb04371..453642eef 100644 --- a/src/guiengine/layout_manager.cpp +++ b/src/guiengine/layout_manager.cpp @@ -163,19 +163,21 @@ void LayoutManager::readCoords(Widget* self) // lines are required, we need to specify a height explicitely label_h = dim.Height + self->getHeightNeededAroundLabel(); } - else if (self->getType() == WTYPE_SPINNER) + else if (self->getType() == WTYPE_CHECKBOX) { - // User text height to guess spinner height + // User text height to guess checkbox size IGUIFont* font = (self->m_title_font ? GUIEngine::getTitleFont() : GUIEngine::getFont()); core::dimension2d< u32 > dim = font->getDimension( L"X" ); - label_h = dim.Height + self->getHeightNeededAroundLabel(); + label_h = dim.Height + self->getHeightNeededAroundLabel(); + label_w = label_h; // a checkbox is square } if (label_h == -1) { if (self->getType() == WTYPE_TEXTBOX || - self->getType() == WTYPE_BUTTON || - self->getType() == WTYPE_LABEL) + self->getType() == WTYPE_BUTTON || + self->getType() == WTYPE_LABEL || + self->getType() == WTYPE_SPINNER) { IGUIFont* font = (self->m_title_font ? GUIEngine::getTitleFont() : GUIEngine::getFont()); diff --git a/src/guiengine/widgets/check_box_widget.hpp b/src/guiengine/widgets/check_box_widget.hpp index 795ee8999..ee90bc075 100644 --- a/src/guiengine/widgets/check_box_widget.hpp +++ b/src/guiengine/widgets/check_box_widget.hpp @@ -48,6 +48,10 @@ namespace GUIEngine /** Set whether the checkbox is checked */ void setState(const bool checked) { m_state = checked; } + + /** When inferring widget size from its label length, this method will be called to + * if/how much space must be added to the raw label's size for the widget to be large enough */ + virtual int getHeightNeededAroundLabel() const { return 10; } }; }