summaryrefslogtreecommitdiff
path: root/src/ui/window.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-15 22:12:57 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-15 22:12:57 +0200
commit71d8274d07a548decdd9065106c9a8fdf50a6f8c (patch)
tree06aa4a80b9f1f1f441f6fddb4fabb7825ad2e698 /src/ui/window.c
parent65f47b60d521c23f16cb8cbcce6f9e9e3176279a (diff)
Mobile: Find on page, various minor tweaks
On mobile, the search bar appears at the top of the page. Keep the haptic engine running so there is no delay before each effect. After a long-press, remove the "mouse" from the display area so there is no misleading hover. Widget border top/bottom use metrics.
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 29f240c2..2ef67142 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -218,8 +218,6 @@ static const iMenuItem tabletNavMenuItems_[] = {
218 { add_Icon " New Tab", 't', KMOD_PRIMARY, "tabs.new" }, 218 { add_Icon " New Tab", 't', KMOD_PRIMARY, "tabs.new" },
219 { close_Icon " Close Tab", 'w', KMOD_PRIMARY, "tabs.close" }, 219 { close_Icon " Close Tab", 'w', KMOD_PRIMARY, "tabs.close" },
220 { "---", 0, 0, NULL }, 220 { "---", 0, 0, NULL },
221 { download_Icon " Save to Downloads", SDLK_s, KMOD_PRIMARY, "document.save" },
222 { "---", 0, 0, NULL },
223 { "Toggle Left Sidebar", SDLK_l, KMOD_PRIMARY | KMOD_SHIFT, "sidebar.toggle" }, 221 { "Toggle Left Sidebar", SDLK_l, KMOD_PRIMARY | KMOD_SHIFT, "sidebar.toggle" },
224 { "Toggle Right Sidebar", SDLK_p, KMOD_PRIMARY | KMOD_SHIFT, "sidebar2.toggle" }, 222 { "Toggle Right Sidebar", SDLK_p, KMOD_PRIMARY | KMOD_SHIFT, "sidebar2.toggle" },
225 { "Zoom In", SDLK_EQUALS, KMOD_PRIMARY, "zoom.delta arg:10" }, 223 { "Zoom In", SDLK_EQUALS, KMOD_PRIMARY, "zoom.delta arg:10" },
@@ -240,8 +238,6 @@ static const iMenuItem phoneNavMenuItems_[] = {
240 { add_Icon " New Tab", 't', KMOD_PRIMARY, "tabs.new" }, 238 { add_Icon " New Tab", 't', KMOD_PRIMARY, "tabs.new" },
241 { close_Icon " Close Tab", 'w', KMOD_PRIMARY, "tabs.close" }, 239 { close_Icon " Close Tab", 'w', KMOD_PRIMARY, "tabs.close" },
242 { "---", 0, 0, NULL }, 240 { "---", 0, 0, NULL },
243 { download_Icon " Save to Downloads", SDLK_s, KMOD_PRIMARY, "document.save" },
244 { "---", 0, 0, NULL },
245 { "Toggle Sidebar", SDLK_l, KMOD_PRIMARY | KMOD_SHIFT, "sidebar.toggle" }, 241 { "Toggle Sidebar", SDLK_l, KMOD_PRIMARY | KMOD_SHIFT, "sidebar.toggle" },
246 { "Zoom In", SDLK_EQUALS, KMOD_PRIMARY, "zoom.delta arg:10" }, 242 { "Zoom In", SDLK_EQUALS, KMOD_PRIMARY, "zoom.delta arg:10" },
247 { "Zoom Out", SDLK_MINUS, KMOD_PRIMARY, "zoom.delta arg:-10" }, 243 { "Zoom Out", SDLK_MINUS, KMOD_PRIMARY, "zoom.delta arg:-10" },
@@ -1093,11 +1089,19 @@ static void setupUserInterface_Window(iWindow *d) {
1093 arrangeHeight_WidgetFlag | resizeChildren_WidgetFlag | 1089 arrangeHeight_WidgetFlag | resizeChildren_WidgetFlag |
1094 arrangeHorizontal_WidgetFlag, 1090 arrangeHorizontal_WidgetFlag,
1095 iTrue); 1091 iTrue);
1096 addChild_Widget(div, iClob(searchBar)); 1092 if (deviceType_App() == desktop_AppDeviceType) {
1093 addChild_Widget(div, iClob(searchBar));
1094 }
1095 else {
1096 /* The search bar appears at the top on mobile, because there is a virtual keyboard
1097 covering the bottom. */
1098 insertChildAfter_Widget(div, iClob(searchBar),
1099 childIndex_Widget(div, findChild_Widget(div, "navbar")));
1100 }
1097 setBackgroundColor_Widget(searchBar, uiBackground_ColorId); 1101 setBackgroundColor_Widget(searchBar, uiBackground_ColorId);
1098 setCommandHandler_Widget(searchBar, handleSearchBarCommands_); 1102 setCommandHandler_Widget(searchBar, handleSearchBarCommands_);
1099 addChildFlags_Widget( 1103 addChildFlags_Widget(
1100 searchBar, iClob(new_LabelWidget("\U0001f50d Text", NULL)), frameless_WidgetFlag); 1104 searchBar, iClob(new_LabelWidget(magnifyingGlass_Icon " Text", NULL)), frameless_WidgetFlag);
1101 iInputWidget *input = new_InputWidget(0); 1105 iInputWidget *input = new_InputWidget(0);
1102 setSelectAllOnFocus_InputWidget(input, iTrue); 1106 setSelectAllOnFocus_InputWidget(input, iTrue);
1103 setEatEscape_InputWidget(input, iFalse); /* unfocus and close with one keypress */ 1107 setEatEscape_InputWidget(input, iFalse); /* unfocus and close with one keypress */