summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/macos.m12
-rw-r--r--src/ui/documentwidget.c7
-rw-r--r--src/ui/keys.c1
-rw-r--r--src/ui/linkinfo.c6
-rw-r--r--src/ui/sidebarwidget.c4
5 files changed, 25 insertions, 5 deletions
diff --git a/src/macos.m b/src/macos.m
index 191842f6..7b248c3b 100644
--- a/src/macos.m
+++ b/src/macos.m
@@ -475,10 +475,20 @@ static iBool processScrollWheelEvent_(NSEvent *event) {
475 break; 475 break;
476 } 476 }
477 } 477 }
478 else {
479 SDL_MouseWheelEvent e = { .type = SDL_MOUSEWHEEL };
480 e.timestamp = SDL_GetTicks();
481 e.which = 1; /* Distinction between trackpad and regular mouse. */
482 /* Disregard any wheel acceleration. */
483 e.x = event.scrollingDeltaX > 0 ? 1 : event.scrollingDeltaX < 0 ? -1 : 0;
484 e.y = event.scrollingDeltaY > 0 ? 1 : event.scrollingDeltaY < 0 ? -1 : 0;
485 SDL_PushEvent((SDL_Event *) &e);
486 return iTrue;
487 }
478 /* Post corresponding MOUSEWHEEL events. */ 488 /* Post corresponding MOUSEWHEEL events. */
479 SDL_MouseWheelEvent e = { .type = SDL_MOUSEWHEEL }; 489 SDL_MouseWheelEvent e = { .type = SDL_MOUSEWHEEL };
480 e.timestamp = SDL_GetTicks(); 490 e.timestamp = SDL_GetTicks();
481 e.which = isPerPixel ? 0 : 1; /* Distinction between trackpad and regular mouse. TODO: Still needed? */ 491 e.which = isPerPixel ? 0 : 1; /* Distinction between trackpad and regular mouse. */
482 setPerPixel_MouseWheelEvent(&e, isPerPixel); 492 setPerPixel_MouseWheelEvent(&e, isPerPixel);
483 if (isPerPixel) { 493 if (isPerPixel) {
484 setInertia_MouseWheelEvent(&e, isInertia); 494 setInertia_MouseWheelEvent(&e, isInertia);
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");