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/widget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/widget.cpp') 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-54-g00ecf