summaryrefslogtreecommitdiff
path: root/src/ui/mobile.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-09-12 13:49:38 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-09-12 13:49:38 +0300
commit33620846cca5678fbd662ea1a48fad302727dae7 (patch)
tree322fb4ab2c1dd7dd3eceee0834f3e90d27838de4 /src/ui/mobile.c
parent1410bbde7779efe3a20f603523547c8b8f55b6a1 (diff)
Mobile: Draw optimizations; focus handling
Widgets can now be marked for buffering their contents, which is useful if their contents change seldom but they are drawn often. For example, the navbar is always visible but doesn't change very often, and during animations menu contents are static but there is a moving animation so everything gets drawn 60 FPS. Focus handling was also improved so the lookup results can be scrolled while entering text, and one can tap outside an input field to unfocus it.
Diffstat (limited to 'src/ui/mobile.c')
-rw-r--r--src/ui/mobile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ui/mobile.c b/src/ui/mobile.c
index 6ea672e6..9e2dc4f7 100644
--- a/src/ui/mobile.c
+++ b/src/ui/mobile.c
@@ -357,6 +357,7 @@ static iWidget *addChildPanel_(iWidget *parent, iLabelWidget *panelButton,
357 setId_Widget(panel, "panel"); 357 setId_Widget(panel, "panel");
358 setUserData_Object(panelButton, panel); 358 setUserData_Object(panelButton, panel);
359 setBackgroundColor_Widget(panel, uiBackground_ColorId); 359 setBackgroundColor_Widget(panel, uiBackground_ColorId);
360 setDrawBufferEnabled_Widget(panel, iTrue);
360 setId_Widget(addChild_Widget(panel, iClob(makePadding_Widget(0))), "panel.toppad"); 361 setId_Widget(addChild_Widget(panel, iClob(makePadding_Widget(0))), "panel.toppad");
361 if (titleText) { 362 if (titleText) {
362 iLabelWidget *title = 363 iLabelWidget *title =
@@ -601,6 +602,7 @@ void initPanels_Mobile(iWidget *panels, iWidget *parentWidget,
601 /* The panel roots. */ 602 /* The panel roots. */
602 iWidget *topPanel = new_Widget(); { 603 iWidget *topPanel = new_Widget(); {
603 setId_Widget(topPanel, "panel.top"); 604 setId_Widget(topPanel, "panel.top");
605 setDrawBufferEnabled_Widget(topPanel, iTrue);
604 setCommandHandler_Widget(topPanel, topPanelHandler_); 606 setCommandHandler_Widget(topPanel, topPanelHandler_);
605 setFlags_Widget(topPanel, 607 setFlags_Widget(topPanel,
606 arrangeVertical_WidgetFlag | resizeWidthOfChildren_WidgetFlag | 608 arrangeVertical_WidgetFlag | resizeWidthOfChildren_WidgetFlag |
@@ -730,7 +732,7 @@ void initPanels_Mobile(iWidget *panels, iWidget *parentWidget,
730 updatePanelSheetMetrics_(panels); 732 updatePanelSheetMetrics_(panels);
731 arrange_Widget(panels); 733 arrange_Widget(panels);
732 postCommand_App("widget.overflow"); /* with the correct dimensions */ 734 postCommand_App("widget.overflow"); /* with the correct dimensions */
733 printTree_Widget(panels); 735// printTree_Widget(panels);
734} 736}
735 737
736#if 0 738#if 0