diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-02-11 19:00:59 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-02-11 19:01:24 +0200 |
commit | 2d7ec0718b258dcce1d15ff5b804c69695ba9e66 (patch) | |
tree | 6796e42040d70e1a24f5644375d0ab3c8c8f0717 /src/ui | |
parent | 0585c687a38f0d177ec4db48567ea08326094111 (diff) | |
parent | 876266d19f42f705178e4b0ad67b047399497eeb (diff) |
Merge branch 'dev' into work/v1.11
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/documentwidget.c | 7 | ||||
-rw-r--r-- | src/ui/keys.c | 1 | ||||
-rw-r--r-- | src/ui/linkinfo.c | 6 | ||||
-rw-r--r-- | src/ui/sidebarwidget.c | 4 |
4 files changed, 14 insertions, 4 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 3d2e31b2..6513fc33 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -2745,7 +2745,7 @@ static void updateDocument_DocumentWidget_(iDocumentWidget *d, | |||
2745 | : "media.untitled.audio"); | 2745 | : "media.untitled.audio"); |
2746 | iUrl parts; | 2746 | iUrl parts; |
2747 | init_Url(&parts, d->mod.url); | 2747 | init_Url(&parts, d->mod.url); |
2748 | if (!isEmpty_Range(&parts.path)) { | 2748 | if (!isEmpty_Range(&parts.path) && !equalCase_Rangecc(parts.scheme, "data")) { |
2749 | linkTitle = | 2749 | linkTitle = |
2750 | baseName_Path(collect_String(newRange_String(parts.path))).start; | 2750 | baseName_Path(collect_String(newRange_String(parts.path))).start; |
2751 | } | 2751 | } |
@@ -3254,9 +3254,10 @@ static void checkResponse_DocumentWidget_(iDocumentWidget *d) { | |||
3254 | addChildPos_Widget(buttons, iClob(lineBreak), front_WidgetAddPos); | 3254 | addChildPos_Widget(buttons, iClob(lineBreak), front_WidgetAddPos); |
3255 | } | 3255 | } |
3256 | /* Menu for additional actions, past entries. */ { | 3256 | /* Menu for additional actions, past entries. */ { |
3257 | const iBinding *bind = findCommand_Keys("input.precedingline"); | ||
3257 | iMenuItem items[] = { { "${menu.input.precedingline}", | 3258 | iMenuItem items[] = { { "${menu.input.precedingline}", |
3258 | SDLK_v, | 3259 | bind->key, |
3259 | KMOD_PRIMARY | KMOD_SHIFT, | 3260 | bind->mods, |
3260 | format_CStr("!valueinput.set ptr:%p text:%s", | 3261 | format_CStr("!valueinput.set ptr:%p text:%s", |
3261 | buttons, | 3262 | buttons, |
3262 | cstr_String(&d->linePrecedingLink)) } }; | 3263 | cstr_String(&d->linePrecedingLink)) } }; |
diff --git a/src/ui/keys.c b/src/ui/keys.c index d4d9320e..33f39633 100644 --- a/src/ui/keys.c +++ b/src/ui/keys.c | |||
@@ -241,6 +241,7 @@ static const struct { int id; iMenuItem bind; int flags; } defaultBindings_[] = | |||
241 | { 110,{ "${menu.save.downloads}", SDLK_s, KMOD_PRIMARY, "document.save" }, 0 }, | 241 | { 110,{ "${menu.save.downloads}", SDLK_s, KMOD_PRIMARY, "document.save" }, 0 }, |
242 | { 120,{ "${keys.upload}", SDLK_u, KMOD_PRIMARY, "document.upload" }, 0 }, | 242 | { 120,{ "${keys.upload}", SDLK_u, KMOD_PRIMARY, "document.upload" }, 0 }, |
243 | { 121,{ "${keys.upload.edit}", SDLK_e, KMOD_PRIMARY, "document.upload copy:1" }, 0 }, | 243 | { 121,{ "${keys.upload.edit}", SDLK_e, KMOD_PRIMARY, "document.upload copy:1" }, 0 }, |
244 | { 130,{ "${keys.input.precedingline}", SDLK_v, KMOD_PRIMARY | KMOD_SHIFT, "input.precedingline" }, 0 }, | ||
244 | /* The following cannot currently be changed (built-in duplicates). */ | 245 | /* The following cannot currently be changed (built-in duplicates). */ |
245 | #if defined (iPlatformApple) | 246 | #if defined (iPlatformApple) |
246 | { 1002, { NULL, SDLK_LEFTBRACKET, KMOD_PRIMARY, "navigate.back" }, 0 }, | 247 | { 1002, { NULL, SDLK_LEFTBRACKET, KMOD_PRIMARY, "navigate.back" }, 0 }, |
diff --git a/src/ui/linkinfo.c b/src/ui/linkinfo.c index 72d76678..46aa6663 100644 --- a/src/ui/linkinfo.c +++ b/src/ui/linkinfo.c | |||
@@ -100,8 +100,12 @@ void infoText_LinkInfo(const iGmDocument *doc, iGmLinkId linkId, iString *text_o | |||
100 | appendRange_String(text_out, (iRangecc){ constBegin_String(url), comma }); | 100 | appendRange_String(text_out, (iRangecc){ constBegin_String(url), comma }); |
101 | } | 101 | } |
102 | else if (scheme != gemini_GmLinkScheme) { | 102 | else if (scheme != gemini_GmLinkScheme) { |
103 | const size_t maxDispLen = 300; | ||
103 | appendCStr_String(text_out, scheme == file_GmLinkScheme ? "" : globe_Icon " "); | 104 | appendCStr_String(text_out, scheme == file_GmLinkScheme ? "" : globe_Icon " "); |
104 | appendCStrN_String(text_out, cstr_String(url), iMin(500, size_String(url))); | 105 | appendCStrN_String(text_out, cstr_String(url), iMin(maxDispLen, size_String(url))); |
106 | if (size_String(url) > maxDispLen) { | ||
107 | appendCStr_String(text_out, "..."); | ||
108 | } | ||
105 | } | 109 | } |
106 | else { | 110 | else { |
107 | appendCStr_String(text_out, "\x1b[1m"); | 111 | appendCStr_String(text_out, "\x1b[1m"); |
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index da0ec22c..da377ac2 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -1392,6 +1392,10 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
1392 | } | 1392 | } |
1393 | } | 1393 | } |
1394 | } | 1394 | } |
1395 | else if (equal_Command(cmd, "idents.changed") && d->mode == identities_SidebarMode) { | ||
1396 | updateItems_SidebarWidget_(d); | ||
1397 | return iTrue; | ||
1398 | } | ||
1395 | else if (isPortraitPhone_App() && isVisible_Widget(w) && d->side == left_SidebarSide && | 1399 | else if (isPortraitPhone_App() && isVisible_Widget(w) && d->side == left_SidebarSide && |
1396 | equal_Command(cmd, "swipe.forward")) { | 1400 | equal_Command(cmd, "swipe.forward")) { |
1397 | postCommand_App("sidebar.toggle"); | 1401 | postCommand_App("sidebar.toggle"); |