diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-04 22:34:31 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-04 22:34:31 +0300 |
commit | 7a4d9cc39337f93cb3b9e5bca982b04f0a7c7da5 (patch) | |
tree | 1e55a93e0e69b91d4b50c75ce581e03d6b54e229 /src/ui/sidebarwidget.c | |
parent | d827dab6cdbc376b6d33cbe5924588e92cffcf54 (diff) |
Split view pinning, "linksplit" special tag
A navigation aid: when in split mode, option to keep one of the tabs pinned to the current page so all links open to the side.
Added "linksplit" bookmark tag to activate view splitting when opening a link on the page.
Diffstat (limited to 'src/ui/sidebarwidget.c')
-rw-r--r-- | src/ui/sidebarwidget.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 7d08b83a..245b76a3 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -824,12 +824,12 @@ iBool handleBookmarkEditorCommands_SidebarWidget_(iWidget *editor, const char *c | |||
824 | set_String(&bm->url, url); | 824 | set_String(&bm->url, url); |
825 | set_String(&bm->tags, tags); | 825 | set_String(&bm->tags, tags); |
826 | if (isEmpty_String(icon)) { | 826 | if (isEmpty_String(icon)) { |
827 | removeTag_Bookmark(bm, "usericon"); | 827 | removeTag_Bookmark(bm, userIcon_BookmarkTag); |
828 | bm->icon = 0; | 828 | bm->icon = 0; |
829 | } | 829 | } |
830 | else { | 830 | else { |
831 | if (!hasTag_Bookmark(bm, "usericon")) { | 831 | if (!hasTag_Bookmark(bm, userIcon_BookmarkTag)) { |
832 | addTag_Bookmark(bm, "usericon"); | 832 | addTag_Bookmark(bm, userIcon_BookmarkTag); |
833 | } | 833 | } |
834 | bm->icon = first_String(icon); | 834 | bm->icon = first_String(icon); |
835 | } | 835 | } |
@@ -1008,7 +1008,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
1008 | setText_InputWidget(findChild_Widget(dlg, "bmed.title"), &bm->title); | 1008 | setText_InputWidget(findChild_Widget(dlg, "bmed.title"), &bm->title); |
1009 | setText_InputWidget(findChild_Widget(dlg, "bmed.url"), &bm->url); | 1009 | setText_InputWidget(findChild_Widget(dlg, "bmed.url"), &bm->url); |
1010 | setText_InputWidget(findChild_Widget(dlg, "bmed.tags"), &bm->tags); | 1010 | setText_InputWidget(findChild_Widget(dlg, "bmed.tags"), &bm->tags); |
1011 | if (hasTag_Bookmark(bm, "usericon")) { | 1011 | if (hasTag_Bookmark(bm, userIcon_BookmarkTag)) { |
1012 | setText_InputWidget(findChild_Widget(dlg, "bmed.icon"), | 1012 | setText_InputWidget(findChild_Widget(dlg, "bmed.icon"), |
1013 | collect_String(newUnicodeN_String(&bm->icon, 1))); | 1013 | collect_String(newUnicodeN_String(&bm->icon, 1))); |
1014 | } | 1014 | } |
@@ -1022,7 +1022,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
1022 | if (d->mode == bookmarks_SidebarMode && item) { | 1022 | if (d->mode == bookmarks_SidebarMode && item) { |
1023 | setFlags_Widget(w, disabled_WidgetFlag, iTrue); | 1023 | setFlags_Widget(w, disabled_WidgetFlag, iTrue); |
1024 | iBookmark *bm = get_Bookmarks(bookmarks_App(), item->id); | 1024 | iBookmark *bm = get_Bookmarks(bookmarks_App(), item->id); |
1025 | const iBool isRemote = hasTag_Bookmark(bm, "remote"); | 1025 | const iBool isRemote = hasTag_Bookmark(bm, remote_BookmarkTag); |
1026 | iChar icon = isRemote ? 0x1f588 : bm->icon; | 1026 | iChar icon = isRemote ? 0x1f588 : bm->icon; |
1027 | iWidget *dlg = makeBookmarkCreation_Widget(&bm->url, &bm->title, icon); | 1027 | iWidget *dlg = makeBookmarkCreation_Widget(&bm->url, &bm->title, icon); |
1028 | setId_Widget(dlg, format_CStr("bmed.%s", cstr_String(id_Widget(w)))); | 1028 | setId_Widget(dlg, format_CStr("bmed.%s", cstr_String(id_Widget(w)))); |
@@ -1040,7 +1040,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
1040 | iBookmark *bm = get_Bookmarks(bookmarks_App(), item->id); | 1040 | iBookmark *bm = get_Bookmarks(bookmarks_App(), item->id); |
1041 | if (hasTag_Bookmark(bm, tag)) { | 1041 | if (hasTag_Bookmark(bm, tag)) { |
1042 | removeTag_Bookmark(bm, tag); | 1042 | removeTag_Bookmark(bm, tag); |
1043 | if (!iCmpStr(tag, "subscribed")) { | 1043 | if (!iCmpStr(tag, subscribed_BookmarkTag)) { |
1044 | removeEntries_Feeds(item->id); | 1044 | removeEntries_Feeds(item->id); |
1045 | } | 1045 | } |
1046 | } | 1046 | } |
@@ -1119,7 +1119,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
1119 | } | 1119 | } |
1120 | if (isCommand_Widget(w, ev, "feed.entry.unsubscribe")) { | 1120 | if (isCommand_Widget(w, ev, "feed.entry.unsubscribe")) { |
1121 | if (arg_Command(cmd)) { | 1121 | if (arg_Command(cmd)) { |
1122 | removeTag_Bookmark(feedBookmark, "subscribed"); | 1122 | removeTag_Bookmark(feedBookmark, subscribed_BookmarkTag); |
1123 | removeEntries_Feeds(id_Bookmark(feedBookmark)); | 1123 | removeEntries_Feeds(id_Bookmark(feedBookmark)); |
1124 | updateItems_SidebarWidget_(d); | 1124 | updateItems_SidebarWidget_(d); |
1125 | } | 1125 | } |
@@ -1308,7 +1308,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
1308 | "bookmark.tag tag:homepage"); | 1308 | "bookmark.tag tag:homepage"); |
1309 | if (menuItem) { | 1309 | if (menuItem) { |
1310 | setTextCStr_LabelWidget(menuItem, | 1310 | setTextCStr_LabelWidget(menuItem, |
1311 | hasTag_Bookmark(bm, "homepage") | 1311 | hasTag_Bookmark(bm, homepage_BookmarkTag) |
1312 | ? home_Icon " ${bookmark.untag.home}" | 1312 | ? home_Icon " ${bookmark.untag.home}" |
1313 | : home_Icon " ${bookmark.tag.home}"); | 1313 | : home_Icon " ${bookmark.tag.home}"); |
1314 | checkIcon_LabelWidget(menuItem); | 1314 | checkIcon_LabelWidget(menuItem); |
@@ -1316,7 +1316,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
1316 | menuItem = findMenuItem_Widget(d->menu, "bookmark.tag tag:subscribed"); | 1316 | menuItem = findMenuItem_Widget(d->menu, "bookmark.tag tag:subscribed"); |
1317 | if (menuItem) { | 1317 | if (menuItem) { |
1318 | setTextCStr_LabelWidget(menuItem, | 1318 | setTextCStr_LabelWidget(menuItem, |
1319 | hasTag_Bookmark(bm, "subscribed") | 1319 | hasTag_Bookmark(bm, subscribed_BookmarkTag) |
1320 | ? star_Icon " ${bookmark.untag.sub}" | 1320 | ? star_Icon " ${bookmark.untag.sub}" |
1321 | : star_Icon " ${bookmark.tag.sub}"); | 1321 | : star_Icon " ${bookmark.tag.sub}"); |
1322 | checkIcon_LabelWidget(menuItem); | 1322 | checkIcon_LabelWidget(menuItem); |
@@ -1324,7 +1324,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
1324 | menuItem = findMenuItem_Widget(d->menu, "bookmark.tag tag:remotesource"); | 1324 | menuItem = findMenuItem_Widget(d->menu, "bookmark.tag tag:remotesource"); |
1325 | if (menuItem) { | 1325 | if (menuItem) { |
1326 | setTextCStr_LabelWidget(menuItem, | 1326 | setTextCStr_LabelWidget(menuItem, |
1327 | hasTag_Bookmark(bm, "remotesource") | 1327 | hasTag_Bookmark(bm, remoteSource_BookmarkTag) |
1328 | ? downArrowBar_Icon " ${bookmark.untag.remote}" | 1328 | ? downArrowBar_Icon " ${bookmark.untag.remote}" |
1329 | : downArrowBar_Icon " ${bookmark.tag.remote}"); | 1329 | : downArrowBar_Icon " ${bookmark.tag.remote}"); |
1330 | checkIcon_LabelWidget(menuItem); | 1330 | checkIcon_LabelWidget(menuItem); |
@@ -1386,13 +1386,13 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
1386 | const iSidebarItem *hoverItem = hoverItem_ListWidget(d->list); | 1386 | const iSidebarItem *hoverItem = hoverItem_ListWidget(d->list); |
1387 | iAssert(hoverItem); | 1387 | iAssert(hoverItem); |
1388 | const iBookmark * bm = get_Bookmarks(bookmarks_App(), hoverItem->id); | 1388 | const iBookmark * bm = get_Bookmarks(bookmarks_App(), hoverItem->id); |
1389 | const iBool isRemote = hasTag_Bookmark(bm, "remote"); | 1389 | const iBool isRemote = hasTag_Bookmark(bm, remote_BookmarkTag); |
1390 | static const char *localOnlyCmds[] = { "bookmark.edit", | 1390 | static const char *localOnlyCmds[] = { "bookmark.edit", |
1391 | "bookmark.delete", | 1391 | "bookmark.delete", |
1392 | "bookmark.tag tag:subscribed", | 1392 | "bookmark.tag tag:" subscribed_BookmarkTag, |
1393 | "bookmark.tag tag:homepage", | 1393 | "bookmark.tag tag:" homepage_BookmarkTag, |
1394 | "bookmark.tag tag:remotesource", | 1394 | "bookmark.tag tag:" remoteSource_BookmarkTag, |
1395 | "bookmark.tag tag:subscribed" }; | 1395 | "bookmark.tag tag:" subscribed_BookmarkTag }; |
1396 | iForIndices(i, localOnlyCmds) { | 1396 | iForIndices(i, localOnlyCmds) { |
1397 | setFlags_Widget(as_Widget(findMenuItem_Widget(d->menu, localOnlyCmds[i])), | 1397 | setFlags_Widget(as_Widget(findMenuItem_Widget(d->menu, localOnlyCmds[i])), |
1398 | disabled_WidgetFlag, | 1398 | disabled_WidgetFlag, |