diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-13 09:12:09 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-13 09:12:09 +0200 |
commit | 2adb05255f80f0cacb591dea07d43af3d41f1f38 (patch) | |
tree | e86c2c54ad356ae5a55ab4bbce9941704b9a6b95 /src/ui/util.c | |
parent | 97d8767043174ba7901014cc904579e1a741ef30 (diff) |
Fixed resizing of input dialogs
Diffstat (limited to 'src/ui/util.c')
-rw-r--r-- | src/ui/util.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index adb3c4b4..a2aaa893 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -1462,7 +1462,6 @@ static void updateValueInputWidth_(iWidget *dlg) { | |||
1462 | else { | 1462 | else { |
1463 | dlg->rect.size.x = iMaxi(iMaxi(rootSize.x / 2, title->rect.size.x), prompt->rect.size.x); | 1463 | dlg->rect.size.x = iMaxi(iMaxi(rootSize.x / 2, title->rect.size.x), prompt->rect.size.x); |
1464 | } | 1464 | } |
1465 | as_Widget(findChild_Widget(dlg, "input"))->rect.size.x = dlg->rect.size.x; | ||
1466 | } | 1465 | } |
1467 | 1466 | ||
1468 | iBool valueInputHandler_(iWidget *dlg, const char *cmd) { | 1467 | iBool valueInputHandler_(iWidget *dlg, const char *cmd) { |
@@ -1470,6 +1469,7 @@ iBool valueInputHandler_(iWidget *dlg, const char *cmd) { | |||
1470 | if (equal_Command(cmd, "window.resized")) { | 1469 | if (equal_Command(cmd, "window.resized")) { |
1471 | if (isVisible_Widget(dlg)) { | 1470 | if (isVisible_Widget(dlg)) { |
1472 | updateValueInputWidth_(dlg); | 1471 | updateValueInputWidth_(dlg); |
1472 | arrange_Widget(dlg); | ||
1473 | } | 1473 | } |
1474 | return iFalse; | 1474 | return iFalse; |
1475 | } | 1475 | } |
@@ -1574,7 +1574,8 @@ iWidget *makeValueInput_Widget(iWidget *parent, const iString *initialValue, con | |||
1574 | setId_Widget( | 1574 | setId_Widget( |
1575 | addChildFlags_Widget(dlg, iClob(new_LabelWidget(prompt, NULL)), frameless_WidgetFlag), | 1575 | addChildFlags_Widget(dlg, iClob(new_LabelWidget(prompt, NULL)), frameless_WidgetFlag), |
1576 | "valueinput.prompt"); | 1576 | "valueinput.prompt"); |
1577 | iInputWidget *input = addChildFlags_Widget(dlg, iClob(new_InputWidget(0)), 0); | 1577 | iInputWidget *input = addChildFlags_Widget(dlg, iClob(new_InputWidget(0)), |
1578 | resizeToParentWidth_WidgetFlag); | ||
1578 | setContentPadding_InputWidget(input, 0.5f * gap_UI, 0.5f * gap_UI); | 1579 | setContentPadding_InputWidget(input, 0.5f * gap_UI, 0.5f * gap_UI); |
1579 | if (deviceType_App() == phone_AppDeviceType) { | 1580 | if (deviceType_App() == phone_AppDeviceType) { |
1580 | setFont_InputWidget(input, defaultBig_FontId); | 1581 | setFont_InputWidget(input, defaultBig_FontId); |