aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl/libui/windows
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-10-05 01:03:22 +0200
committerStapleButter <thetotalworm@gmail.com>2017-10-05 01:03:22 +0200
commit5d5311c53cb3c94cdeb57abba447969345b89ca4 (patch)
tree0894c160ce4e669b4fa689a2665098fa1b540f65 /src/libui_sdl/libui/windows
parent9d3f13b6891eafc4b12d62259ad0b6876952eccd (diff)
use grids instead of nested boxes for input config dialog. (still lags, needs optimization)
adjust things to make those dialogs sexier.
Diffstat (limited to 'src/libui_sdl/libui/windows')
-rw-r--r--src/libui_sdl/libui/windows/button.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libui_sdl/libui/windows/button.cpp b/src/libui_sdl/libui/windows/button.cpp
index 3b12e72..b83d6ec 100644
--- a/src/libui_sdl/libui/windows/button.cpp
+++ b/src/libui_sdl/libui/windows/button.cpp
@@ -32,6 +32,7 @@ uiWindowsControlAllDefaultsExceptDestroy(uiButton)
// from http://msdn.microsoft.com/en-us/library/windows/desktop/dn742486.aspx#sizingandspacing
#define buttonHeight 14
+#define buttonMinWidth 64
static void uiButtonMinimumSize(uiWindowsControl *c, int *width, int *height)
{
@@ -45,6 +46,7 @@ static void uiButtonMinimumSize(uiWindowsControl *c, int *width, int *height)
size.cy = 0;
if (SendMessageW(b->hwnd, BCM_GETIDEALSIZE, 0, (LPARAM) (&size)) != FALSE) {
*width = size.cx;
+ if (*width < buttonMinWidth) *width = buttonMinWidth;
*height = size.cy;
return;
}
@@ -53,6 +55,7 @@ static void uiButtonMinimumSize(uiWindowsControl *c, int *width, int *height)
// Microsoft says to use a fixed width for all buttons; this isn't good enough
// use the text width instead, with some edge padding
*width = uiWindowsWindowTextWidth(b->hwnd) + (2 * GetSystemMetrics(SM_CXEDGE));
+ if (*width < buttonMinWidth) *width = buttonMinWidth;
y = buttonHeight;
uiWindowsGetSizing(b->hwnd, &sizing);
uiWindowsSizingDlgUnitsToPixels(&sizing, NULL, &y);