From cddc057a609ef2a4e7e873bd3a37bf3f1767c984 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 15 Nov 2009 15:37:37 +0000 Subject: (svn r18099) -Codechange: scale the edit boxes to the fontsize --- src/misc_gui.cpp | 4 ---- src/network/network_content_gui.cpp | 4 ---- src/widget.cpp | 6 ++++-- 3 files changed, 4 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 5b3bc9d37..74b5c2b2a 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -1871,10 +1871,6 @@ public: resize->width = 1; break; - case SLWW_SAVE_OSK_TITLE: - size->height = FONT_HEIGHT_NORMAL + padding.height; - break; - case SLWW_BACKGROUND: size->height = 2 * FONT_HEIGHT_NORMAL + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM; break; diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 4e9167190..6f15cbc0a 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -381,10 +381,6 @@ public: *size = maxdim(*size, GetStringBoundingBox(STR_CONTENT_FILTER_TITLE)); break; - case NCLWW_FILTER: - size->height = FONT_HEIGHT_NORMAL + padding.height; - break; - case NCLWW_TYPE: { Dimension d = *size; for (int i = CONTENT_TYPE_BEGIN; i < CONTENT_TYPE_END; i++) { diff --git a/src/widget.cpp b/src/widget.cpp index 25a09be9b..9f7db9fd0 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -1772,8 +1772,10 @@ void NWidgetLeaf::SetupSmallestSize(Window *w, bool init_array) size = maxdim(size, NWidgetLeaf::resizebox_dimension); break; } - case WWT_PUSHBTN: - case WWT_EDITBOX: { + case WWT_EDITBOX: + size.height = max(size.height, GetStringBoundingBox("_").height + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM); + /* fall through */ + case WWT_PUSHBTN: { static const Dimension extra = {WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM}; padding = &extra; break; -- cgit v1.2.3-70-g09d2