diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-06 16:02:41 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-06 16:03:17 +0200 |
commit | 5b80af0e983db5e3d09e207c9fce6790b53dea4d (patch) | |
tree | 614a227b3aeade6a2ff3b43424c4f3ea45adc1fc /src/ui/util.c | |
parent | af0aaf36dcde341d5eb43214297df71eefc90829 (diff) |
Rasterize a few glyphs on every frame
Also various widget fixes/improvements.
Diffstat (limited to 'src/ui/util.c')
-rw-r--r-- | src/ui/util.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index ad72a11e..10fa66b0 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -166,7 +166,7 @@ iRangei union_Rangei(iRangei a, iRangei b) { | |||
166 | /*----------------------------------------------------------------------------------------------*/ | 166 | /*----------------------------------------------------------------------------------------------*/ |
167 | 167 | ||
168 | iBool isFinished_Anim(const iAnim *d) { | 168 | iBool isFinished_Anim(const iAnim *d) { |
169 | return frameTime_Window(get_Window()) >= d->due; | 169 | return d->from == d->to || frameTime_Window(get_Window()) >= d->due; |
170 | } | 170 | } |
171 | 171 | ||
172 | void init_Anim(iAnim *d, float value) { | 172 | void init_Anim(iAnim *d, float value) { |
@@ -520,7 +520,7 @@ void openMenu_Widget(iWidget *d, iInt2 coord) { | |||
520 | /* Menu closes when commands are emitted, so handle any pending ones beforehand. */ | 520 | /* Menu closes when commands are emitted, so handle any pending ones beforehand. */ |
521 | postCommand_App("cancel"); /* dismiss any other menus */ | 521 | postCommand_App("cancel"); /* dismiss any other menus */ |
522 | processEvents_App(postedEventsOnly_AppEventMode); | 522 | processEvents_App(postedEventsOnly_AppEventMode); |
523 | setFlags_Widget(d, hidden_WidgetFlag, iFalse); | 523 | setFlags_Widget(d, hidden_WidgetFlag | disabled_WidgetFlag, iFalse); |
524 | setFlags_Widget(d, commandOnMouseMiss_WidgetFlag, iTrue); | 524 | setFlags_Widget(d, commandOnMouseMiss_WidgetFlag, iTrue); |
525 | setFlags_Widget(findChild_Widget(d, "menu.cancel"), disabled_WidgetFlag, iFalse); | 525 | setFlags_Widget(findChild_Widget(d, "menu.cancel"), disabled_WidgetFlag, iFalse); |
526 | if (isPortraitPhone) { | 526 | if (isPortraitPhone) { |
@@ -589,10 +589,13 @@ void openMenu_Widget(iWidget *d, iInt2 coord) { | |||
589 | } | 589 | } |
590 | 590 | ||
591 | void closeMenu_Widget(iWidget *d) { | 591 | void closeMenu_Widget(iWidget *d) { |
592 | setFlags_Widget(d, hidden_WidgetFlag, iTrue); | 592 | setFlags_Widget(d, hidden_WidgetFlag | disabled_WidgetFlag, iTrue); |
593 | setFlags_Widget(findChild_Widget(d, "menu.cancel"), disabled_WidgetFlag, iTrue); | 593 | setFlags_Widget(findChild_Widget(d, "menu.cancel"), disabled_WidgetFlag, iTrue); |
594 | postRefresh_App(); | 594 | postRefresh_App(); |
595 | postCommand_Widget(d, "menu.closed"); | 595 | postCommand_Widget(d, "menu.closed"); |
596 | if (isPortrait_App() && deviceType_App() == phone_AppDeviceType) { | ||
597 | setVisualOffset_Widget(d, height_Widget(d), 200, easeIn_AnimFlag | softer_AnimFlag); | ||
598 | } | ||
596 | } | 599 | } |
597 | 600 | ||
598 | iLabelWidget *findMenuItem_Widget(iWidget *menu, const char *command) { | 601 | iLabelWidget *findMenuItem_Widget(iWidget *menu, const char *command) { |
@@ -988,6 +991,7 @@ void finalizeSheet_Widget(iWidget *sheet) { | |||
988 | const iBool isMenuButton = findChild_Widget(value, "menu") != NULL; | 991 | const iBool isMenuButton = findChild_Widget(value, "menu") != NULL; |
989 | if (isMenuButton) { | 992 | if (isMenuButton) { |
990 | setFlags_Widget(value, noBackground_WidgetFlag | frameless_WidgetFlag, iTrue); | 993 | setFlags_Widget(value, noBackground_WidgetFlag | frameless_WidgetFlag, iTrue); |
994 | setFlags_Widget(value, alignLeft_WidgetFlag, iFalse); | ||
991 | } | 995 | } |
992 | if (valueInput || isMenuButton) { | 996 | if (valueInput || isMenuButton) { |
993 | setFlags_Widget(value, borderBottom_WidgetFlag, iFalse); | 997 | setFlags_Widget(value, borderBottom_WidgetFlag, iFalse); |