0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 15:09:10 -05:00

🐛 Fix problem with system shortcuts and application

This commit is contained in:
alonso.torres 2021-03-09 13:37:54 +01:00
parent d263dd52e9
commit fee99a081b
3 changed files with 29 additions and 8 deletions

View file

@ -20,6 +20,7 @@
- Fix problem with rotated blur [Taiga #1370](https://tree.taiga.io/project/penpot/issue/1370)
- Disables buttons in view mode for users without permissions [Taiga #1328](https://tree.taiga.io/project/penpot/issue/1328)
- Fix issue when undo after changing the artboard of a shape [Taiga #1304](https://tree.taiga.io/project/penpot/issue/1304)
- Fix problem with system shortcuts and application [#737](https://github.com/penpot/penpot/issues/737)
### :heart: Community contributions by (Thank you!)

View file

@ -39,6 +39,16 @@
(str "command+" shortcut)
(str "ctrl+" shortcut)))
(defn a-mod
"Adds the alt/option modifier to a shortcuts depending on the
operating system for the user"
[shortcut]
(str "alt+" shortcut))
(defn ca-mod
[shortcut]
(c-mod (a-mod shortcut)))
(defn bind-shortcuts [shortcuts bind-fn cb-fn]
(doseq [[key {:keys [command disabled fn]}] shortcuts]
(when-not disabled
@ -61,9 +71,19 @@
"Shift+")
key))
(defn alt [key]
(str
(if (cfg/check-platform? :macos)
mac-option
"Alt+")
key))
(defn meta-shift [key]
(-> key meta shift))
(defn meta-alt [key]
(-> key meta alt))
(defn supr []
(if (cfg/check-platform? :macos)
mac-delete

View file

@ -44,20 +44,20 @@
(rx/empty))))))
(def shortcuts
{:toggle-layers {:tooltip (ds/meta "L")
:command (ds/c-mod "l")
{:toggle-layers {:tooltip (ds/alt "L")
:command (ds/a-mod "l")
:fn #(st/emit! (dw/go-to-layout :layers))}
:toggle-assets {:tooltip (ds/meta "I")
:command (ds/c-mod "i")
:toggle-assets {:tooltip (ds/alt "I")
:command (ds/a-mod "i")
:fn #(st/emit! (dw/go-to-layout :assets))}
:toggle-history {:tooltip (ds/meta "H")
:command (ds/c-mod "h")
:toggle-history {:tooltip (ds/alt "H")
:command (ds/a-mod "h")
:fn #(st/emit! (dw/go-to-layout :document-history))}
:toggle-palette {:tooltip (ds/meta "P")
:command (ds/c-mod "p")
:toggle-palette {:tooltip (ds/alt "P")
:command (ds/a-mod "p")
:fn #(st/emit! (dw/toggle-layout-flags :colorpalette))}
:toggle-rules {:tooltip (ds/meta-shift "R")