summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-09-09 20:22:33 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-09-09 20:22:33 +0300
commitb85471a5b84f0837611fb47be35ee713139f702f (patch)
treee2d2ae695279f14c2e559595a3129151e574fbe2 /src/ui/documentwidget.c
parent55cd303c52a8fe524e15bd618bfcb02b8ff7dcb7 (diff)
Mobile: Working on dialogs
The new panels maker offers a declarative solution for creating consistent UIs.
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 6ca4fd8d..83f2ea6a 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -3127,7 +3127,7 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
3127 makeQuestion_Widget( 3127 makeQuestion_Widget(
3128 uiHeading_ColorEscape "${heading.import.bookmarks}", 3128 uiHeading_ColorEscape "${heading.import.bookmarks}",
3129 formatCStrs_Lang("dlg.import.found.n", count), 3129 formatCStrs_Lang("dlg.import.found.n", count),
3130 (iMenuItem[]){ { "${cancel}", 0, 0, NULL }, 3130 (iMenuItem[]){ { "${cancel}" },
3131 { format_CStr(cstrCount_Lang("dlg.import.add.n", (int) count), 3131 { format_CStr(cstrCount_Lang("dlg.import.add.n", (int) count),
3132 uiTextAction_ColorEscape, 3132 uiTextAction_ColorEscape,
3133 count), 3133 count),
@@ -3299,7 +3299,7 @@ static iBool processMediaEvents_DocumentWidget_(iDocumentWidget *d, const SDL_Ev
3299 d->playerMenu = makeMenu_Widget( 3299 d->playerMenu = makeMenu_Widget(
3300 as_Widget(d), 3300 as_Widget(d),
3301 (iMenuItem[]){ 3301 (iMenuItem[]){
3302 { cstrCollect_String(metadataLabel_Player(plr)), 0, 0, NULL }, 3302 { cstrCollect_String(metadataLabel_Player(plr)) },
3303 }, 3303 },
3304 1); 3304 1);
3305 openMenu_Widget(d->playerMenu, bottomLeft_Rect(ui.menuRect)); 3305 openMenu_Widget(d->playerMenu, bottomLeft_Rect(ui.menuRect));
@@ -3604,7 +3604,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
3604 pushBackN_Array( 3604 pushBackN_Array(
3605 &items, 3605 &items,
3606 (iMenuItem[]){ 3606 (iMenuItem[]){
3607 { "---", 0, 0, NULL }, 3607 { "---" },
3608 { isGemini ? "${link.noproxy}" : openExt_Icon " ${link.browser}", 3608 { isGemini ? "${link.noproxy}" : openExt_Icon " ${link.browser}",
3609 0, 3609 0,
3610 0, 3610 0,
@@ -3615,7 +3615,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
3615 linkLabel_GmDocument(d->doc, d->contextLink->linkId)); 3615 linkLabel_GmDocument(d->doc, d->contextLink->linkId));
3616 urlEncodeSpaces_String(linkLabel); 3616 urlEncodeSpaces_String(linkLabel);
3617 pushBackN_Array(&items, 3617 pushBackN_Array(&items,
3618 (iMenuItem[]){ { "---", 0, 0, NULL }, 3618 (iMenuItem[]){ { "---" },
3619 { "${link.copy}", 0, 0, "document.copylink" }, 3619 { "${link.copy}", 0, 0, "document.copylink" },
3620 { bookmark_Icon " ${link.bookmark}", 3620 { bookmark_Icon " ${link.bookmark}",
3621 0, 3621 0,
@@ -3627,7 +3627,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
3627 3); 3627 3);
3628 if (isNative && d->contextLink->mediaType != download_GmRunMediaType) { 3628 if (isNative && d->contextLink->mediaType != download_GmRunMediaType) {
3629 pushBackN_Array(&items, (iMenuItem[]){ 3629 pushBackN_Array(&items, (iMenuItem[]){
3630 { "---", 0, 0, NULL }, 3630 { "---" },
3631 { download_Icon " ${link.download}", 0, 0, "document.downloadlink" }, 3631 { download_Icon " ${link.download}", 0, 0, "document.downloadlink" },
3632 }, 2); 3632 }, 2);
3633 } 3633 }
@@ -3670,22 +3670,22 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
3670 { "${menu.forward}", navigateForward_KeyShortcut, "navigate.forward" }, 3670 { "${menu.forward}", navigateForward_KeyShortcut, "navigate.forward" },
3671 { upArrow_Icon " ${menu.parent}", navigateParent_KeyShortcut, "navigate.parent" }, 3671 { upArrow_Icon " ${menu.parent}", navigateParent_KeyShortcut, "navigate.parent" },
3672 { upArrowBar_Icon " ${menu.root}", navigateRoot_KeyShortcut, "navigate.root" }, 3672 { upArrowBar_Icon " ${menu.root}", navigateRoot_KeyShortcut, "navigate.root" },
3673 { "---", 0, 0, NULL }, 3673 { "---" },
3674 { reload_Icon " ${menu.reload}", reload_KeyShortcut, "navigate.reload" }, 3674 { reload_Icon " ${menu.reload}", reload_KeyShortcut, "navigate.reload" },
3675 { timer_Icon " ${menu.autoreload}", 0, 0, "document.autoreload.menu" }, 3675 { timer_Icon " ${menu.autoreload}", 0, 0, "document.autoreload.menu" },
3676 { "---", 0, 0, NULL }, 3676 { "---" },
3677 { bookmark_Icon " ${menu.page.bookmark}", SDLK_d, KMOD_PRIMARY, "bookmark.add" }, 3677 { bookmark_Icon " ${menu.page.bookmark}", SDLK_d, KMOD_PRIMARY, "bookmark.add" },
3678 { star_Icon " ${menu.page.subscribe}", subscribeToPage_KeyModifier, "feeds.subscribe" }, 3678 { star_Icon " ${menu.page.subscribe}", subscribeToPage_KeyModifier, "feeds.subscribe" },
3679 { "---", 0, 0, NULL }, 3679 { "---" },
3680 { book_Icon " ${menu.page.import}", 0, 0, "bookmark.links confirm:1" }, 3680 { book_Icon " ${menu.page.import}", 0, 0, "bookmark.links confirm:1" },
3681 { globe_Icon " ${menu.page.translate}", 0, 0, "document.translate" }, 3681 { globe_Icon " ${menu.page.translate}", 0, 0, "document.translate" },
3682#if defined (iPlatformMobile) 3682#if defined (iPlatformMobile)
3683 { "---", 0, 0, NULL }, 3683 { "---" },
3684 { "${menu.page.copyurl}", 0, 0, "document.copylink" } }, 3684 { "${menu.page.copyurl}", 0, 0, "document.copylink" } },
3685 14); 3685 14);
3686#else 3686#else
3687 { upload_Icon " ${menu.page.upload}", 0, 0, "document.upload" }, 3687 { upload_Icon " ${menu.page.upload}", 0, 0, "document.upload" },
3688 { "---", 0, 0, NULL }, 3688 { "---" },
3689 { "${menu.page.copyurl}", 0, 0, "document.copylink" } }, 3689 { "${menu.page.copyurl}", 0, 0, "document.copylink" } },
3690 15); 3690 15);
3691#endif 3691#endif
@@ -3862,7 +3862,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
3862 } 3862 }
3863 d->copyMenu = makeMenu_Widget(w, (iMenuItem[]){ 3863 d->copyMenu = makeMenu_Widget(w, (iMenuItem[]){
3864 { clipCopy_Icon " ${menu.copy}", 0, 0, "copy" }, 3864 { clipCopy_Icon " ${menu.copy}", 0, 0, "copy" },
3865 { "---", 0, 0, NULL }, 3865 { "---" },
3866 { close_Icon " ${menu.select.clear}", 0, 0, "document.select arg:0" }, 3866 { close_Icon " ${menu.select.clear}", 0, 0, "document.select arg:0" },
3867 }, 3); 3867 }, 3);
3868 setFlags_Widget(d->copyMenu, noFadeBackground_WidgetFlag, iTrue); 3868 setFlags_Widget(d->copyMenu, noFadeBackground_WidgetFlag, iTrue);
@@ -3955,7 +3955,7 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
3955 uiTextAction_ColorEscape, 3955 uiTextAction_ColorEscape,
3956 cstr_String(url)), 3956 cstr_String(url)),
3957 (iMenuItem[]){ 3957 (iMenuItem[]){
3958 { "${cancel}", 0, 0, NULL }, 3958 { "${cancel}" },
3959 { uiTextCaution_ColorEscape "${dlg.openlink}", 3959 { uiTextCaution_ColorEscape "${dlg.openlink}",
3960 0, 0, format_CStr("!open default:1 url:%s", cstr_String(url)) } }, 3960 0, 0, format_CStr("!open default:1 url:%s", cstr_String(url)) } },
3961 2); 3961 2);