From f43337d022872ac9beddabf39ac5f3e97645ec8e Mon Sep 17 00:00:00 2001 From: Juanjo Date: Fri, 27 Sep 2013 20:38:34 +0000 Subject: [PATCH] Some amends about sizings. --- src/network/network_gui.cpp | 2 +- src/settings_gui.cpp | 5 +++-- src/widget.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 18135dfedf..e324a58442 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -494,7 +494,7 @@ public: switch (widget) { case WID_NG_CONN_BTN: *size = maxdim(GetStringBoundingBox(_lan_internet_types_dropdown[0]), GetStringBoundingBox(_lan_internet_types_dropdown[1])); - size->width += padding.width; + size->width += padding.width + GetMinSizing(NWST_STEP, 11U); size->height += padding.height; break; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 755b829ff9..a02dc915f0 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1150,8 +1150,9 @@ uint SettingEntry::Draw(GameSettings *settings_ptr, int left, int right, int bas break; case SEF_SUBTREE_KIND: if (cur_row >= first_row) { - DrawSprite((this->d.sub.folded ? SPR_CIRCLE_FOLDED : SPR_CIRCLE_UNFOLDED), PAL_NONE, rtl ? x - 8 : x, y + (SETTING_HEIGHT - 11) / 2); - DrawString(rtl ? left : x + 12, rtl ? x - 12 : right, Center(y, SETTING_HEIGHT), this->d.sub.title); + Dimension d = GetSpriteSize(SPR_CIRCLE_UNFOLDED); + DrawSprite((this->d.sub.folded ? SPR_CIRCLE_FOLDED : SPR_CIRCLE_UNFOLDED), PAL_NONE, rtl ? x - d.width : x, Center(y, SETTING_HEIGHT, d.height)); + DrawString(rtl ? left : x + d.width + 2, rtl ? x - (d.width + 2) : right, Center(y, SETTING_HEIGHT), this->d.sub.title); } cur_row++; if (!this->d.sub.folded) { diff --git a/src/widget.cpp b/src/widget.cpp index 1ead186b78..40e531b678 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -2347,7 +2347,7 @@ void NWidgetLeaf::SetupSmallestSize(Window *w, bool init_array) padding = &extra; if (this->index >= 0) w->SetStringParameters(this->index); Dimension d2 = GetStringBoundingBox(this->widget_data); - d2.width += extra.width; + d2.width += extra.width + GetMinSizing(NWST_STEP, 11U); d2.height += extra.height; size = maxdim(size, d2); break;