maybe now the input dialog can stop being dumb

This commit is contained in:
StapleButter 2017-10-05 02:05:23 +02:00
parent d895dfc9fb
commit 084d9254e3
2 changed files with 8 additions and 0 deletions

View File

@ -309,6 +309,8 @@ void Open()
uiBoxAppend(in_ctrl, uiControl(g_key), 1); uiBoxAppend(in_ctrl, uiControl(g_key), 1);
uiGrid* b_key = uiNewGrid(); uiGrid* b_key = uiNewGrid();
uiGroupSetChild(g_key, uiControl(b_key)); uiGroupSetChild(g_key, uiControl(b_key));
const int width = 120;
for (int i = 0; i < 12; i++) for (int i = 0; i < 12; i++)
{ {
@ -316,12 +318,14 @@ void Open()
uiLabel* label = uiNewLabel(keylabels[j]); uiLabel* label = uiNewLabel(keylabels[j]);
uiGridAppend(b_key, uiControl(label), 0, i, 1, 1, 1, uiAlignStart, 1, uiAlignCenter); uiGridAppend(b_key, uiControl(label), 0, i, 1, 1, 1, uiAlignStart, 1, uiAlignCenter);
uiControlSetMinSize(uiControl(label), width, 1);
char* keyname = uiKeyName(Config::KeyMapping[j]); char* keyname = uiKeyName(Config::KeyMapping[j]);
uiButton* btn = uiNewButton(keyname); uiButton* btn = uiNewButton(keyname);
uiGridAppend(b_key, uiControl(btn), 1, i, 1, 1, 1, uiAlignFill, 1, uiAlignCenter); uiGridAppend(b_key, uiControl(btn), 1, i, 1, 1, 1, uiAlignFill, 1, uiAlignCenter);
uiButtonOnClicked(btn, OnKeyStartConfig, &keyorder[i]); uiButtonOnClicked(btn, OnKeyStartConfig, &keyorder[i]);
uiControlSetMinSize(uiControl(btn), width, 1);
uiFreeText(keyname); uiFreeText(keyname);
} }
@ -337,6 +341,7 @@ void Open()
uiLabel* label = uiNewLabel(keylabels[j]); uiLabel* label = uiNewLabel(keylabels[j]);
uiGridAppend(b_joy, uiControl(label), 0, i, 1, 1, 1, uiAlignStart, 1, uiAlignCenter); uiGridAppend(b_joy, uiControl(label), 0, i, 1, 1, 1, uiAlignStart, 1, uiAlignCenter);
uiControlSetMinSize(uiControl(label), width, 1);
char keyname[16]; char keyname[16];
JoyMappingName(Config::JoyMapping[j], keyname); JoyMappingName(Config::JoyMapping[j], keyname);
@ -344,6 +349,7 @@ void Open()
uiButton* btn = uiNewButton(keyname); uiButton* btn = uiNewButton(keyname);
uiGridAppend(b_joy, uiControl(btn), 1, i, 1, 1, 1, uiAlignFill, 1, uiAlignCenter); uiGridAppend(b_joy, uiControl(btn), 1, i, 1, 1, 1, uiAlignFill, 1, uiAlignCenter);
uiButtonOnClicked(btn, OnJoyStartConfig, &keyorder[i]); uiButtonOnClicked(btn, OnJoyStartConfig, &keyorder[i]);
uiControlSetMinSize(uiControl(btn), width, 1);
} }
} }

View File

@ -50,6 +50,8 @@ uiButton *uiNewButton(const char *text)
g_signal_connect(b->widget, "clicked", G_CALLBACK(onClicked), b); g_signal_connect(b->widget, "clicked", G_CALLBACK(onClicked), b);
uiButtonOnClicked(b, defaultOnClicked, NULL); uiButtonOnClicked(b, defaultOnClicked, NULL);
gtk_widget_set_size_request(b->widget, 64, 1);
return b; return b;
} }