diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-10-05 02:05:23 +0200 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-10-05 02:05:23 +0200 |
commit | 084d9254e368d189a21a262d5bb630bfed88413d (patch) | |
tree | 0af8ca8ae69d983beb718f584aaf249678ac6fa5 /src/libui_sdl | |
parent | d895dfc9fbc68fff836a719b4024299bbdd9aeb0 (diff) |
maybe now the input dialog can stop being dumb
Diffstat (limited to 'src/libui_sdl')
-rw-r--r-- | src/libui_sdl/DlgInputConfig.cpp | 6 | ||||
-rw-r--r-- | src/libui_sdl/libui/unix/button.c | 2 |
2 files changed, 8 insertions, 0 deletions
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; } |