From 2adb05255f80f0cacb591dea07d43af3d41f1f38 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 13 Mar 2021 09:12:09 +0200 Subject: Fixed resizing of input dialogs --- src/ui/util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ui/util.c') 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) { else { dlg->rect.size.x = iMaxi(iMaxi(rootSize.x / 2, title->rect.size.x), prompt->rect.size.x); } - as_Widget(findChild_Widget(dlg, "input"))->rect.size.x = dlg->rect.size.x; } iBool valueInputHandler_(iWidget *dlg, const char *cmd) { @@ -1470,6 +1469,7 @@ iBool valueInputHandler_(iWidget *dlg, const char *cmd) { if (equal_Command(cmd, "window.resized")) { if (isVisible_Widget(dlg)) { updateValueInputWidth_(dlg); + arrange_Widget(dlg); } return iFalse; } @@ -1574,7 +1574,8 @@ iWidget *makeValueInput_Widget(iWidget *parent, const iString *initialValue, con setId_Widget( addChildFlags_Widget(dlg, iClob(new_LabelWidget(prompt, NULL)), frameless_WidgetFlag), "valueinput.prompt"); - iInputWidget *input = addChildFlags_Widget(dlg, iClob(new_InputWidget(0)), 0); + iInputWidget *input = addChildFlags_Widget(dlg, iClob(new_InputWidget(0)), + resizeToParentWidth_WidgetFlag); setContentPadding_InputWidget(input, 0.5f * gap_UI, 0.5f * gap_UI); if (deviceType_App() == phone_AppDeviceType) { setFont_InputWidget(input, defaultBig_FontId); -- cgit v1.2.3