summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-01-12 17:50:00 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-01-12 17:51:36 +0200
commit8a9cc8bfafaee7d6810b831182f7f055c2827f8b (patch)
tree4b7107a1767d6c5474054522d07e4093364d51e1
parent6b8cb273ad31f01251b1363b11d12982ec63a419 (diff)
Added keybinding for toggling URL hover showing
IssueID #64
-rw-r--r--src/app.c5
-rw-r--r--src/ui/keys.c1
-rw-r--r--src/ui/util.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/src/app.c b/src/app.c
index 05739f0a..d884d203 100644
--- a/src/app.c
+++ b/src/app.c
@@ -1134,6 +1134,11 @@ iBool handleCommand_App(const char *cmd) {
1134 postRefresh_App(); 1134 postRefresh_App();
1135 return iTrue; 1135 return iTrue;
1136 } 1136 }
1137 else if (equal_Command(cmd, "prefs.hoverlink.toggle")) {
1138 d->prefs.hoverLink = !d->prefs.hoverLink;
1139 postRefresh_App();
1140 return iTrue;
1141 }
1137 else if (equal_Command(cmd, "saturation.set")) { 1142 else if (equal_Command(cmd, "saturation.set")) {
1138 d->prefs.saturation = (float) arg_Command(cmd) / 100.0f; 1143 d->prefs.saturation = (float) arg_Command(cmd) / 100.0f;
1139 postCommandf_App("theme.changed auto:1"); 1144 postCommandf_App("theme.changed auto:1");
diff --git a/src/ui/keys.c b/src/ui/keys.c
index a4e5c6fc..10855b8d 100644
--- a/src/ui/keys.c
+++ b/src/ui/keys.c
@@ -84,6 +84,7 @@ static const struct { int id; iMenuItem bind; int flags; } defaultBindings_[] =
84 { 72, { "Reset zoom", SDLK_0, KMOD_PRIMARY, "zoom.set arg:100" }, 0 }, 84 { 72, { "Reset zoom", SDLK_0, KMOD_PRIMARY, "zoom.set arg:100" }, 0 },
85 { 80, { "Previous tab", prevTab_KeyShortcut, "tabs.prev" }, 0 }, 85 { 80, { "Previous tab", prevTab_KeyShortcut, "tabs.prev" }, 0 },
86 { 81, { "Next tab", nextTab_KeyShortcut, "tabs.next" }, 0 }, 86 { 81, { "Next tab", nextTab_KeyShortcut, "tabs.next" }, 0 },
87 { 100,{ "Toggle show URL on hover", '/', KMOD_PRIMARY, "prefs.hoverlink.toggle" }, 0 },
87 /* The following cannot currently be changed (built-in duplicates). */ 88 /* The following cannot currently be changed (built-in duplicates). */
88 { 1000, { NULL, SDLK_SPACE, KMOD_SHIFT, "scroll.page arg:-1" }, argRepeat_BindFlag }, 89 { 1000, { NULL, SDLK_SPACE, KMOD_SHIFT, "scroll.page arg:-1" }, argRepeat_BindFlag },
89 { 1001, { NULL, SDLK_SPACE, 0, "scroll.page arg:1" }, argRepeat_BindFlag }, 90 { 1001, { NULL, SDLK_SPACE, 0, "scroll.page arg:1" }, argRepeat_BindFlag },
diff --git a/src/ui/util.c b/src/ui/util.c
index 6615a454..222d5716 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -1043,7 +1043,7 @@ iWidget *makePreferences_Widget(void) {
1043 appendTwoColumnPage_(tabs, "General", '1', &headings, &values); 1043 appendTwoColumnPage_(tabs, "General", '1', &headings, &values);
1044 addChild_Widget(headings, iClob(makeHeading_Widget("Downloads folder:"))); 1044 addChild_Widget(headings, iClob(makeHeading_Widget("Downloads folder:")));
1045 setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.downloads"); 1045 setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.downloads");
1046 addChild_Widget(headings, iClob(makeHeading_Widget("Full link on hover:"))); 1046 addChild_Widget(headings, iClob(makeHeading_Widget("Show URL on hover:")));
1047 addChild_Widget(values, iClob(makeToggle_Widget("prefs.hoverlink"))); 1047 addChild_Widget(values, iClob(makeToggle_Widget("prefs.hoverlink")));
1048 addChild_Widget(headings, iClob(makeHeading_Widget("Smooth scrolling:"))); 1048 addChild_Widget(headings, iClob(makeHeading_Widget("Smooth scrolling:")));
1049 addChild_Widget(values, iClob(makeToggle_Widget("prefs.smoothscroll"))); 1049 addChild_Widget(values, iClob(makeToggle_Widget("prefs.smoothscroll")));