From 084d9254e368d189a21a262d5bb630bfed88413d Mon Sep 17 00:00:00 2001 From: StapleButter Date: Thu, 5 Oct 2017 02:05:23 +0200 Subject: maybe now the input dialog can stop being dumb --- src/libui_sdl/DlgInputConfig.cpp | 6 ++++++ src/libui_sdl/libui/unix/button.c | 2 ++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/libui_sdl/DlgInputConfig.cpp b/src/libui_sdl/DlgInputConfig.cpp index 29f835f..5a98a91 100644 --- a/src/libui_sdl/DlgInputConfig.cpp +++ b/src/libui_sdl/DlgInputConfig.cpp @@ -309,6 +309,8 @@ void Open() uiBoxAppend(in_ctrl, uiControl(g_key), 1); uiGrid* b_key = uiNewGrid(); uiGroupSetChild(g_key, uiControl(b_key)); + + const int width = 120; for (int i = 0; i < 12; i++) { @@ -316,12 +318,14 @@ void Open() uiLabel* label = uiNewLabel(keylabels[j]); uiGridAppend(b_key, uiControl(label), 0, i, 1, 1, 1, uiAlignStart, 1, uiAlignCenter); + uiControlSetMinSize(uiControl(label), width, 1); char* keyname = uiKeyName(Config::KeyMapping[j]); uiButton* btn = uiNewButton(keyname); uiGridAppend(b_key, uiControl(btn), 1, i, 1, 1, 1, uiAlignFill, 1, uiAlignCenter); uiButtonOnClicked(btn, OnKeyStartConfig, &keyorder[i]); + uiControlSetMinSize(uiControl(btn), width, 1); uiFreeText(keyname); } @@ -337,6 +341,7 @@ void Open() uiLabel* label = uiNewLabel(keylabels[j]); uiGridAppend(b_joy, uiControl(label), 0, i, 1, 1, 1, uiAlignStart, 1, uiAlignCenter); + uiControlSetMinSize(uiControl(label), width, 1); char keyname[16]; JoyMappingName(Config::JoyMapping[j], keyname); @@ -344,6 +349,7 @@ void Open() uiButton* btn = uiNewButton(keyname); uiGridAppend(b_joy, uiControl(btn), 1, i, 1, 1, 1, uiAlignFill, 1, uiAlignCenter); uiButtonOnClicked(btn, OnJoyStartConfig, &keyorder[i]); + uiControlSetMinSize(uiControl(btn), width, 1); } } diff --git a/src/libui_sdl/libui/unix/button.c b/src/libui_sdl/libui/unix/button.c index 00a87f4..b0500e3 100644 --- a/src/libui_sdl/libui/unix/button.c +++ b/src/libui_sdl/libui/unix/button.c @@ -50,6 +50,8 @@ uiButton *uiNewButton(const char *text) g_signal_connect(b->widget, "clicked", G_CALLBACK(onClicked), b); uiButtonOnClicked(b, defaultOnClicked, NULL); + + gtk_widget_set_size_request(b->widget, 64, 1); return b; } -- cgit v1.2.3