diff options
author | rubidium <rubidium@openttd.org> | 2009-11-15 15:37:37 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-11-15 15:37:37 +0000 |
commit | cddc057a609ef2a4e7e873bd3a37bf3f1767c984 (patch) | |
tree | f2bf6fdc6134a6c3e85c57155e6af2251a8a12e6 /src/widget.cpp | |
parent | 36e030c19dad7b8e6c299b46af47c995b874c5ba (diff) | |
download | openttd-cddc057a609ef2a4e7e873bd3a37bf3f1767c984.tar.xz |
(svn r18099) -Codechange: scale the edit boxes to the fontsize
Diffstat (limited to 'src/widget.cpp')
-rw-r--r-- | src/widget.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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; |