summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-15 15:37:37 +0000
committerrubidium <rubidium@openttd.org>2009-11-15 15:37:37 +0000
commitcddc057a609ef2a4e7e873bd3a37bf3f1767c984 (patch)
treef2bf6fdc6134a6c3e85c57155e6af2251a8a12e6 /src
parent36e030c19dad7b8e6c299b46af47c995b874c5ba (diff)
downloadopenttd-cddc057a609ef2a4e7e873bd3a37bf3f1767c984.tar.xz
(svn r18099) -Codechange: scale the edit boxes to the fontsize
Diffstat (limited to 'src')
-rw-r--r--src/misc_gui.cpp4
-rw-r--r--src/network/network_content_gui.cpp4
-rw-r--r--src/widget.cpp6
3 files changed, 4 insertions, 10 deletions
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;