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/util.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/util.c')
-rw-r--r-- | src/ui/util.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index 5995f6a0..8c058ac3 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -2218,6 +2218,14 @@ iWidget *makePreferences_Widget(void) { | |||
2218 | addChild_Widget(values, iClob(makeToggle_Widget("prefs.hoverlink"))); | 2218 | addChild_Widget(values, iClob(makeToggle_Widget("prefs.hoverlink"))); |
2219 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.archive.openindex}"))); | 2219 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.archive.openindex}"))); |
2220 | addChild_Widget(values, iClob(makeToggle_Widget("prefs.archive.openindex"))); | 2220 | addChild_Widget(values, iClob(makeToggle_Widget("prefs.archive.openindex"))); |
2221 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.pinsplit}"))); | ||
2222 | iWidget *pinSplit = new_Widget(); | ||
2223 | /* Split mode document pinning. */ { | ||
2224 | addRadioButton_(pinSplit, "prefs.pinsplit.0", "${prefs.pinsplit.none}", "pinsplit.set arg:0"); | ||
2225 | addRadioButton_(pinSplit, "prefs.pinsplit.1", "${prefs.pinsplit.left}", "pinsplit.set arg:1"); | ||
2226 | addRadioButton_(pinSplit, "prefs.pinsplit.2", "${prefs.pinsplit.right}", "pinsplit.set arg:2"); | ||
2227 | } | ||
2228 | addChildFlags_Widget(values, iClob(pinSplit), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); | ||
2221 | addChild_Widget(headings, iClob(makePadding_Widget(bigGap))); | 2229 | addChild_Widget(headings, iClob(makePadding_Widget(bigGap))); |
2222 | addChild_Widget(values, iClob(makePadding_Widget(bigGap))); | 2230 | addChild_Widget(values, iClob(makePadding_Widget(bigGap))); |
2223 | /* UI languages. */ { | 2231 | /* UI languages. */ { |
@@ -2457,10 +2465,21 @@ iWidget *makeBookmarkEditor_Widget(void) { | |||
2457 | setUrlContent_InputWidget(inputs[1], iTrue); | 2465 | setUrlContent_InputWidget(inputs[1], iTrue); |
2458 | addDialogInputWithHeading_(headings, values, "${dlg.bookmark.tags}", "bmed.tags", iClob(inputs[2] = new_InputWidget(0))); | 2466 | addDialogInputWithHeading_(headings, values, "${dlg.bookmark.tags}", "bmed.tags", iClob(inputs[2] = new_InputWidget(0))); |
2459 | addDialogInputWithHeading_(headings, values, "${dlg.bookmark.icon}", "bmed.icon", iClob(inputs[3] = new_InputWidget(1))); | 2467 | addDialogInputWithHeading_(headings, values, "${dlg.bookmark.icon}", "bmed.icon", iClob(inputs[3] = new_InputWidget(1))); |
2468 | /* Buttons for special tags. */ | ||
2469 | addChild_Widget(dlg, iClob(makePadding_Widget(gap_UI))); | ||
2470 | addChild_Widget(dlg, iClob(makeTwoColumnWidget_(&headings, &values))); | ||
2471 | makeTwoColumnHeading_("SPECIAL TAGS", headings, values); | ||
2472 | addChild_Widget(headings, iClob(makeHeading_Widget("${bookmark.tag.home}"))); | ||
2473 | addChild_Widget(values, iClob(makeToggle_Widget("bmed.tag.home"))); | ||
2474 | addChild_Widget(headings, iClob(makeHeading_Widget("${bookmark.tag.remote}"))); | ||
2475 | addChild_Widget(values, iClob(makeToggle_Widget("bmed.tag.remote"))); | ||
2476 | addChild_Widget(headings, iClob(makeHeading_Widget("${bookmark.tag.sub}"))); | ||
2477 | addChild_Widget(values, iClob(makeToggle_Widget("bmed.tag.sub"))); | ||
2460 | arrange_Widget(dlg); | 2478 | arrange_Widget(dlg); |
2461 | for (int i = 0; i < 3; ++i) { | 2479 | for (int i = 0; i < 3; ++i) { |
2462 | as_Widget(inputs[i])->rect.size.x = 100 * gap_UI - headings->rect.size.x; | 2480 | as_Widget(inputs[i])->rect.size.x = 100 * gap_UI - headings->rect.size.x; |
2463 | } | 2481 | } |
2482 | addChild_Widget(dlg, iClob(makePadding_Widget(gap_UI))); | ||
2464 | addChild_Widget( | 2483 | addChild_Widget( |
2465 | dlg, | 2484 | dlg, |
2466 | iClob(makeDialogButtons_Widget((iMenuItem[]){ { "${cancel}", 0, 0, NULL }, | 2485 | iClob(makeDialogButtons_Widget((iMenuItem[]){ { "${cancel}", 0, 0, NULL }, |
@@ -2489,8 +2508,8 @@ static iBool handleBookmarkCreationCommands_SidebarWidget_(iWidget *editor, cons | |||
2489 | const uint32_t id = add_Bookmarks(bookmarks_App(), url, title, tags, first_String(icon)); | 2508 | const uint32_t id = add_Bookmarks(bookmarks_App(), url, title, tags, first_String(icon)); |
2490 | if (!isEmpty_String(icon)) { | 2509 | if (!isEmpty_String(icon)) { |
2491 | iBookmark *bm = get_Bookmarks(bookmarks_App(), id); | 2510 | iBookmark *bm = get_Bookmarks(bookmarks_App(), id); |
2492 | if (!hasTag_Bookmark(bm, "usericon")) { | 2511 | if (!hasTag_Bookmark(bm, userIcon_BookmarkTag)) { |
2493 | addTag_Bookmark(bm, "usericon"); | 2512 | addTag_Bookmark(bm, userIcon_BookmarkTag); |
2494 | } | 2513 | } |
2495 | } | 2514 | } |
2496 | postCommand_App("bookmarks.changed"); | 2515 | postCommand_App("bookmarks.changed"); |
@@ -2609,7 +2628,7 @@ iWidget *makeFeedSettings_Widget(uint32_t bookmarkId) { | |||
2609 | setText_InputWidget(findChild_Widget(dlg, "feedcfg.title"), | 2628 | setText_InputWidget(findChild_Widget(dlg, "feedcfg.title"), |
2610 | bm ? &bm->title : feedTitle_DocumentWidget(document_App())); | 2629 | bm ? &bm->title : feedTitle_DocumentWidget(document_App())); |
2611 | setFlags_Widget(findChild_Widget(dlg, | 2630 | setFlags_Widget(findChild_Widget(dlg, |
2612 | hasTag_Bookmark(bm, "headings") ? "feedcfg.type.headings" | 2631 | hasTag_Bookmark(bm, headings_BookmarkTag) ? "feedcfg.type.headings" |
2613 | : "feedcfg.type.gemini"), | 2632 | : "feedcfg.type.gemini"), |
2614 | selected_WidgetFlag, | 2633 | selected_WidgetFlag, |
2615 | iTrue); | 2634 | iTrue); |