summaryrefslogtreecommitdiff
path: root/src/ui/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 19432691..b1fd3a07 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -94,7 +94,7 @@ static iBool handleRootCommands_(iWidget *root, const char *cmd) {
94/* TODO: Submenus wouldn't hurt here. */ 94/* TODO: Submenus wouldn't hurt here. */
95static const iMenuItem navMenuItems[] = { 95static const iMenuItem navMenuItems[] = {
96 { "New Tab", 't', KMOD_PRIMARY, "tabs.new" }, 96 { "New Tab", 't', KMOD_PRIMARY, "tabs.new" },
97 { "Open Location...", SDLK_l, KMOD_PRIMARY, "focus.set id:url" }, 97 { "Open Location...", SDLK_l, KMOD_PRIMARY, "navigate.focus" },
98 { "---", 0, 0, NULL }, 98 { "---", 0, 0, NULL },
99 { "Save to Downloads", SDLK_s, KMOD_PRIMARY, "document.save" }, 99 { "Save to Downloads", SDLK_s, KMOD_PRIMARY, "document.save" },
100 { "---", 0, 0, NULL }, 100 { "---", 0, 0, NULL },
@@ -118,7 +118,7 @@ static const iMenuItem navMenuItems[] = {
118/* Using native menus. */ 118/* Using native menus. */
119static const iMenuItem fileMenuItems[] = { 119static const iMenuItem fileMenuItems[] = {
120 { "New Tab", SDLK_t, KMOD_PRIMARY, "tabs.new" }, 120 { "New Tab", SDLK_t, KMOD_PRIMARY, "tabs.new" },
121 { "Open Location...", SDLK_l, KMOD_PRIMARY, "focus.set id:url" }, 121 { "Open Location...", SDLK_l, KMOD_PRIMARY, "navigate.focus" },
122 { "---", 0, 0, NULL }, 122 { "---", 0, 0, NULL },
123 { "Save to Downloads", SDLK_s, KMOD_PRIMARY, "document.save" }, 123 { "Save to Downloads", SDLK_s, KMOD_PRIMARY, "document.save" },
124}; 124};
@@ -212,6 +212,16 @@ static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {
212 postCommand_Widget(navBar, "layout.changed id:navbar"); 212 postCommand_Widget(navBar, "layout.changed id:navbar");
213 return iFalse; 213 return iFalse;
214 } 214 }
215 else if (equal_Command(cmd, "navigate.focus")) {
216 iWidget *url = findChild_Widget(navBar, "url");
217 if (focus_Widget() != url) {
218 setFocus_Widget(findChild_Widget(navBar, "url"));
219 }
220 else {
221 selectAll_InputWidget((iInputWidget *) url);
222 }
223 return iTrue;
224 }
215 else if (equal_Command(cmd, "input.edited")) { 225 else if (equal_Command(cmd, "input.edited")) {
216 iAnyObject *url = findChild_Widget(navBar, "url"); 226 iAnyObject *url = findChild_Widget(navBar, "url");
217 if (pointer_Command(cmd) == url) { 227 if (pointer_Command(cmd) == url) {
@@ -459,7 +469,7 @@ static void setupUserInterface_Window(iWindow *d) {
459 addAction_Widget(d->root, prevTab_KeyShortcut, "tabs.prev"); 469 addAction_Widget(d->root, prevTab_KeyShortcut, "tabs.prev");
460 addAction_Widget(d->root, nextTab_KeyShortcut, "tabs.next"); 470 addAction_Widget(d->root, nextTab_KeyShortcut, "tabs.next");
461#if !defined (iHaveNativeMenus) 471#if !defined (iHaveNativeMenus)
462 addAction_Widget(d->root, 'l', KMOD_PRIMARY, "focus.set id:url"); 472 addAction_Widget(d->root, 'l', KMOD_PRIMARY, "navigate.focus");
463 addAction_Widget(d->root, 'f', KMOD_PRIMARY, "focus.set id:find.input"); 473 addAction_Widget(d->root, 'f', KMOD_PRIMARY, "focus.set id:find.input");
464 addAction_Widget(d->root, '1', KMOD_PRIMARY, "sidebar.mode arg:0 toggle:1"); 474 addAction_Widget(d->root, '1', KMOD_PRIMARY, "sidebar.mode arg:0 toggle:1");
465 addAction_Widget(d->root, '2', KMOD_PRIMARY, "sidebar.mode arg:1 toggle:1"); 475 addAction_Widget(d->root, '2', KMOD_PRIMARY, "sidebar.mode arg:1 toggle:1");