diff options
-rw-r--r-- | res/about/version.gmi | 1 | ||||
-rw-r--r-- | src/ui/sidebarwidget.c | 20 |
2 files changed, 18 insertions, 3 deletions
diff --git a/res/about/version.gmi b/res/about/version.gmi index aed2f74d..fc35bd0f 100644 --- a/res/about/version.gmi +++ b/res/about/version.gmi | |||
@@ -12,6 +12,7 @@ | |||
12 | * Import all links on page as bookmarks. | 12 | * Import all links on page as bookmarks. |
13 | * Links can be bookmarked via context menu. | 13 | * Links can be bookmarked via context menu. |
14 | * Open links with an unrecognized scheme in the default browser. | 14 | * Open links with an unrecognized scheme in the default browser. |
15 | * Sidebar: Open links in new/background tab via context menu or modifier keys. | ||
15 | * "Edit Feed..." menu item shows the Feed Settings dialog. | 16 | * "Edit Feed..." menu item shows the Feed Settings dialog. |
16 | * Removed unimplemented menu items. | 17 | * Removed unimplemented menu items. |
17 | 18 | ||
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index ff4be073..c2672646 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -222,14 +222,17 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { | |||
222 | } | 222 | } |
223 | d->menu = makeMenu_Widget( | 223 | d->menu = makeMenu_Widget( |
224 | as_Widget(d), | 224 | as_Widget(d), |
225 | (iMenuItem[]){ { "Edit Bookmark...", 0, 0, "bookmark.edit" }, | 225 | (iMenuItem[]){ { "Open in New Tab", 0, 0, "bookmark.open newtab:1" }, |
226 | { "Open in Background Tab", 0, 0, "bookmark.open newtab:2" }, | ||
227 | { "---", 0, 0, NULL }, | ||
228 | { "Edit Bookmark...", 0, 0, "bookmark.edit" }, | ||
226 | { "Copy URL", 0, 0, "bookmark.copy" }, | 229 | { "Copy URL", 0, 0, "bookmark.copy" }, |
227 | { "---", 0, 0, NULL }, | 230 | { "---", 0, 0, NULL }, |
228 | { "Subscribe to Feed", 0, 0, "bookmark.tag tag:subscribed" }, | 231 | { "Subscribe to Feed", 0, 0, "bookmark.tag tag:subscribed" }, |
229 | { "", 0, 0, "bookmark.tag tag:homepage" }, | 232 | { "", 0, 0, "bookmark.tag tag:homepage" }, |
230 | { "---", 0, 0, NULL }, | 233 | { "---", 0, 0, NULL }, |
231 | { uiTextCaution_ColorEscape "Delete Bookmark", 0, 0, "bookmark.delete" } }, | 234 | { uiTextCaution_ColorEscape "Delete Bookmark", 0, 0, "bookmark.delete" } }, |
232 | 7); | 235 | 10); |
233 | break; | 236 | break; |
234 | } | 237 | } |
235 | case history_SidebarMode: { | 238 | case history_SidebarMode: { |
@@ -518,7 +521,9 @@ static void itemClicked_SidebarWidget_(iSidebarWidget *d, const iSidebarItem *it | |||
518 | case bookmarks_SidebarMode: | 521 | case bookmarks_SidebarMode: |
519 | case history_SidebarMode: { | 522 | case history_SidebarMode: { |
520 | if (!isEmpty_String(&item->url)) { | 523 | if (!isEmpty_String(&item->url)) { |
521 | postCommandf_App("open url:%s", cstr_String(&item->url)); | 524 | postCommandf_App("open newtab:%d url:%s", |
525 | openTabMode_Sym(SDL_GetModState()), | ||
526 | cstr_String(&item->url)); | ||
522 | } | 527 | } |
523 | break; | 528 | break; |
524 | } | 529 | } |
@@ -707,6 +712,15 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
707 | else if (isCommand_Widget(w, ev, "menu.closed")) { | 712 | else if (isCommand_Widget(w, ev, "menu.closed")) { |
708 | setFlags_Widget(as_Widget(d->list), disabled_WidgetFlag, iFalse); | 713 | setFlags_Widget(as_Widget(d->list), disabled_WidgetFlag, iFalse); |
709 | } | 714 | } |
715 | else if (isCommand_Widget(w, ev, "bookmark.open")) { | ||
716 | const iSidebarItem *item = d->contextItem; | ||
717 | if (d->mode == bookmarks_SidebarMode && item) { | ||
718 | postCommandf_App("open newtab:%d url:%s", | ||
719 | argLabel_Command(cmd, "newtab"), | ||
720 | cstr_String(&item->url)); | ||
721 | } | ||
722 | return iTrue; | ||
723 | } | ||
710 | else if (isCommand_Widget(w, ev, "bookmark.copy")) { | 724 | else if (isCommand_Widget(w, ev, "bookmark.copy")) { |
711 | const iSidebarItem *item = d->contextItem; | 725 | const iSidebarItem *item = d->contextItem; |
712 | if (d->mode == bookmarks_SidebarMode && item) { | 726 | if (d->mode == bookmarks_SidebarMode && item) { |