diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-21 11:09:17 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-21 11:09:17 +0300 |
commit | aa3690044d7096c20a6608a5c7fb0546d407da5a (patch) | |
tree | 8b31a1e021834ad86d60e58c5eaba33e548c7f4f | |
parent | 8c1ccfed06a4b986d1a4addd8c173ad6bb4d6691 (diff) |
Keybindings for split view menu
The split view keys now have keybindings. The default bindings for
horizontal/vertical were changed to conform to Emacs (3/2).
IssueID #278
-rw-r--r-- | po/en.po | 24 | ||||
-rw-r--r-- | res/lang/de.bin | bin | 20430 -> 20844 bytes | |||
-rw-r--r-- | res/lang/en.bin | bin | 19153 -> 19567 bytes | |||
-rw-r--r-- | res/lang/es.bin | bin | 21146 -> 21560 bytes | |||
-rw-r--r-- | res/lang/fi.bin | bin | 21120 -> 21534 bytes | |||
-rw-r--r-- | res/lang/fr.bin | bin | 21636 -> 22050 bytes | |||
-rw-r--r-- | res/lang/ia.bin | bin | 21337 -> 21751 bytes | |||
-rw-r--r-- | res/lang/ie.bin | bin | 20508 -> 20922 bytes | |||
-rw-r--r-- | res/lang/pl.bin | bin | 22141 -> 22555 bytes | |||
-rw-r--r-- | res/lang/ru.bin | bin | 32219 -> 32633 bytes | |||
-rw-r--r-- | res/lang/sr.bin | bin | 30798 -> 31212 bytes | |||
-rw-r--r-- | res/lang/tok.bin | bin | 19542 -> 19956 bytes | |||
-rw-r--r-- | res/lang/zh_Hans.bin | bin | 18301 -> 18715 bytes | |||
-rw-r--r-- | res/lang/zh_Hant.bin | bin | 18375 -> 18789 bytes | |||
-rw-r--r-- | src/ui/keys.c | 12 | ||||
-rw-r--r-- | src/ui/root.c | 4 |
16 files changed, 38 insertions, 2 deletions
@@ -1375,6 +1375,30 @@ msgstr "Set view split mode" | |||
1375 | msgid "keys.split.next" | 1375 | msgid "keys.split.next" |
1376 | msgstr "Switch focus to next split" | 1376 | msgstr "Switch focus to next split" |
1377 | 1377 | ||
1378 | msgid "keys.split.menu.merge" | ||
1379 | msgstr "Split view menu: Merge tabs" | ||
1380 | |||
1381 | msgid "keys.split.menu.swap" | ||
1382 | msgstr "Split view menu: Swap sides" | ||
1383 | |||
1384 | msgid "keys.split.menu.horiz" | ||
1385 | msgstr "Split view menu: Horizontal" | ||
1386 | |||
1387 | msgid "keys.split.menu.horiz12" | ||
1388 | msgstr "Split view menu: Horizontal 1:2" | ||
1389 | |||
1390 | msgid "keys.split.menu.horiz21" | ||
1391 | msgstr "Split view menu: Horizontal 2:1" | ||
1392 | |||
1393 | msgid "keys.split.menu.vert" | ||
1394 | msgstr "Split view menu: Vertical" | ||
1395 | |||
1396 | msgid "keys.split.menu.vert12" | ||
1397 | msgstr "Split view menu: Vertical 1:2" | ||
1398 | |||
1399 | msgid "keys.split.menu.vert21" | ||
1400 | msgstr "Split view menu: Vertical 2:1" | ||
1401 | |||
1378 | msgid "keys.hoverurl" | 1402 | msgid "keys.hoverurl" |
1379 | msgstr "Toggle show URL on hover" | 1403 | msgstr "Toggle show URL on hover" |
1380 | 1404 | ||
diff --git a/res/lang/de.bin b/res/lang/de.bin index 59bde344..d42d4cfc 100644 --- a/res/lang/de.bin +++ b/res/lang/de.bin | |||
Binary files differ | |||
diff --git a/res/lang/en.bin b/res/lang/en.bin index a8093411..4b7c1af3 100644 --- a/res/lang/en.bin +++ b/res/lang/en.bin | |||
Binary files differ | |||
diff --git a/res/lang/es.bin b/res/lang/es.bin index c582efdc..815cc7b0 100644 --- a/res/lang/es.bin +++ b/res/lang/es.bin | |||
Binary files differ | |||
diff --git a/res/lang/fi.bin b/res/lang/fi.bin index 1e155087..6d1eaa78 100644 --- a/res/lang/fi.bin +++ b/res/lang/fi.bin | |||
Binary files differ | |||
diff --git a/res/lang/fr.bin b/res/lang/fr.bin index 1a88c420..c18cbc99 100644 --- a/res/lang/fr.bin +++ b/res/lang/fr.bin | |||
Binary files differ | |||
diff --git a/res/lang/ia.bin b/res/lang/ia.bin index c5800ec2..c47e3104 100644 --- a/res/lang/ia.bin +++ b/res/lang/ia.bin | |||
Binary files differ | |||
diff --git a/res/lang/ie.bin b/res/lang/ie.bin index 0b4d5414..974a1310 100644 --- a/res/lang/ie.bin +++ b/res/lang/ie.bin | |||
Binary files differ | |||
diff --git a/res/lang/pl.bin b/res/lang/pl.bin index 48f16b05..dd047ff9 100644 --- a/res/lang/pl.bin +++ b/res/lang/pl.bin | |||
Binary files differ | |||
diff --git a/res/lang/ru.bin b/res/lang/ru.bin index 48a9c7d8..ad2ad465 100644 --- a/res/lang/ru.bin +++ b/res/lang/ru.bin | |||
Binary files differ | |||
diff --git a/res/lang/sr.bin b/res/lang/sr.bin index 111528b5..9c512c31 100644 --- a/res/lang/sr.bin +++ b/res/lang/sr.bin | |||
Binary files differ | |||
diff --git a/res/lang/tok.bin b/res/lang/tok.bin index d06b4356..24378b1c 100644 --- a/res/lang/tok.bin +++ b/res/lang/tok.bin | |||
Binary files differ | |||
diff --git a/res/lang/zh_Hans.bin b/res/lang/zh_Hans.bin index 27c269f6..c1a0d4f7 100644 --- a/res/lang/zh_Hans.bin +++ b/res/lang/zh_Hans.bin | |||
Binary files differ | |||
diff --git a/res/lang/zh_Hant.bin b/res/lang/zh_Hant.bin index e78942bf..adeaceeb 100644 --- a/res/lang/zh_Hant.bin +++ b/res/lang/zh_Hant.bin | |||
Binary files differ | |||
diff --git a/src/ui/keys.c b/src/ui/keys.c index 42d0d613..8af7867c 100644 --- a/src/ui/keys.c +++ b/src/ui/keys.c | |||
@@ -188,6 +188,7 @@ static void clear_Keys_(iKeys *d) { | |||
188 | enum iBindFlag { | 188 | enum iBindFlag { |
189 | argRepeat_BindFlag = iBit(1), | 189 | argRepeat_BindFlag = iBit(1), |
190 | argRelease_BindFlag = iBit(2), | 190 | argRelease_BindFlag = iBit(2), |
191 | noDirectTrigger_BindFlag = iBit(3), /* can only be triggered via LabelWidget */ | ||
191 | }; | 192 | }; |
192 | 193 | ||
193 | /* TODO: This indirection could be used for localization, although all UI strings | 194 | /* TODO: This indirection could be used for localization, although all UI strings |
@@ -227,6 +228,14 @@ static const struct { int id; iMenuItem bind; int flags; } defaultBindings_[] = | |||
227 | { 81, { "${keys.tab.next}", nextTab_KeyShortcut, "tabs.next" }, 0 }, | 228 | { 81, { "${keys.tab.next}", nextTab_KeyShortcut, "tabs.next" }, 0 }, |
228 | { 90, { "${keys.split.menu}", SDLK_j, KMOD_PRIMARY, "splitmenu.open" }, 0 }, | 229 | { 90, { "${keys.split.menu}", SDLK_j, KMOD_PRIMARY, "splitmenu.open" }, 0 }, |
229 | { 91, { "${keys.split.next}", SDLK_TAB, KMOD_CTRL, "keyroot.next", }, 0 }, | 230 | { 91, { "${keys.split.next}", SDLK_TAB, KMOD_CTRL, "keyroot.next", }, 0 }, |
231 | { 92, { "${keys.split.menu.merge}", '1', 0, "ui.split arg:0", }, noDirectTrigger_BindFlag }, | ||
232 | { 93, { "${keys.split.menu.swap}", SDLK_x, 0, "ui.split swap:1", }, noDirectTrigger_BindFlag }, | ||
233 | { 94, { "${keys.split.menu.horiz}", '3', 0, "ui.split arg:3 axis:0", }, noDirectTrigger_BindFlag }, | ||
234 | { 95, { "${keys.split.menu.horiz12}", SDLK_d, 0, "ui.split arg:1 axis:0", }, noDirectTrigger_BindFlag }, | ||
235 | { 96, { "${keys.split.menu.horiz21}", SDLK_e, 0, "ui.split arg:2 axis:0", }, noDirectTrigger_BindFlag }, | ||
236 | { 97, { "${keys.split.menu.vert}", '2', 0, "ui.split arg:3 axis:1", }, noDirectTrigger_BindFlag }, | ||
237 | { 98, { "${keys.split.menu.vert12}", SDLK_f, 0, "ui.split arg:1 axis:1", }, noDirectTrigger_BindFlag }, | ||
238 | { 99, { "${keys.split.menu.vert21}", SDLK_r, 0, "ui.split arg:2 axis:1", }, noDirectTrigger_BindFlag }, | ||
230 | { 100,{ "${keys.hoverurl}", '/', KMOD_PRIMARY, "prefs.hoverlink.toggle" }, 0 }, | 239 | { 100,{ "${keys.hoverurl}", '/', KMOD_PRIMARY, "prefs.hoverlink.toggle" }, 0 }, |
231 | /* The following cannot currently be changed (built-in duplicates). */ | 240 | /* The following cannot currently be changed (built-in duplicates). */ |
232 | #if defined (iPlatformApple) | 241 | #if defined (iPlatformApple) |
@@ -432,6 +441,9 @@ iBool processEvent_Keys(const SDL_Event *ev) { | |||
432 | if (ev->type == SDL_KEYDOWN || ev->type == SDL_KEYUP) { | 441 | if (ev->type == SDL_KEYDOWN || ev->type == SDL_KEYUP) { |
433 | const iBinding *bind = find_Keys_(d, ev->key.keysym.sym, keyMods_Sym(ev->key.keysym.mod)); | 442 | const iBinding *bind = find_Keys_(d, ev->key.keysym.sym, keyMods_Sym(ev->key.keysym.mod)); |
434 | if (bind) { | 443 | if (bind) { |
444 | if (bind->flags & noDirectTrigger_BindFlag) { | ||
445 | return iFalse; | ||
446 | } | ||
435 | if (ev->type == SDL_KEYUP) { | 447 | if (ev->type == SDL_KEYUP) { |
436 | if (bind->flags & argRelease_BindFlag) { | 448 | if (bind->flags & argRelease_BindFlag) { |
437 | postCommandf_Root(root, "%s release:1", cstr_String(&bind->command)); | 449 | postCommandf_Root(root, "%s release:1", cstr_String(&bind->command)); |
diff --git a/src/ui/root.c b/src/ui/root.c index 9a089992..2a2130d8 100644 --- a/src/ui/root.c +++ b/src/ui/root.c | |||
@@ -1308,11 +1308,11 @@ void createUserInterface_Root(iRoot *d) { | |||
1308 | { "${menu.split.merge}", '1', 0, "ui.split arg:0" }, | 1308 | { "${menu.split.merge}", '1', 0, "ui.split arg:0" }, |
1309 | { "${menu.split.swap}", SDLK_x, 0, "ui.split swap:1" }, | 1309 | { "${menu.split.swap}", SDLK_x, 0, "ui.split swap:1" }, |
1310 | { "---", 0, 0, NULL }, | 1310 | { "---", 0, 0, NULL }, |
1311 | { "${menu.split.horizontal}", '2', 0, "ui.split arg:3 axis:0" }, | 1311 | { "${menu.split.horizontal}", '3', 0, "ui.split arg:3 axis:0" }, |
1312 | { "${menu.split.horizontal} 1:2", SDLK_d, 0, "ui.split arg:1 axis:0" }, | 1312 | { "${menu.split.horizontal} 1:2", SDLK_d, 0, "ui.split arg:1 axis:0" }, |
1313 | { "${menu.split.horizontal} 2:1", SDLK_e, 0, "ui.split arg:2 axis:0" }, | 1313 | { "${menu.split.horizontal} 2:1", SDLK_e, 0, "ui.split arg:2 axis:0" }, |
1314 | { "---", 0, 0, NULL }, | 1314 | { "---", 0, 0, NULL }, |
1315 | { "${menu.split.vertical}", '3', 0, "ui.split arg:3 axis:1" }, | 1315 | { "${menu.split.vertical}", '2', 0, "ui.split arg:3 axis:1" }, |
1316 | { "${menu.split.vertical} 1:2", SDLK_f, 0, "ui.split arg:1 axis:1" }, | 1316 | { "${menu.split.vertical} 1:2", SDLK_f, 0, "ui.split arg:1 axis:1" }, |
1317 | { "${menu.split.vertical} 2:1", SDLK_r, 0, "ui.split arg:2 axis:1" }, | 1317 | { "${menu.split.vertical} 2:1", SDLK_r, 0, "ui.split arg:2 axis:1" }, |
1318 | }, 10); | 1318 | }, 10); |