mirror of
https://github.com/penpot/penpot.git
synced 2025-02-02 12:28:54 -05:00
🐛 Fix problem with system shortcuts and application
This commit is contained in:
parent
d263dd52e9
commit
fee99a081b
3 changed files with 29 additions and 8 deletions
|
@ -20,6 +20,7 @@
|
||||||
- Fix problem with rotated blur [Taiga #1370](https://tree.taiga.io/project/penpot/issue/1370)
|
- 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)
|
- 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 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!)
|
### :heart: Community contributions by (Thank you!)
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,16 @@
|
||||||
(str "command+" shortcut)
|
(str "command+" shortcut)
|
||||||
(str "ctrl+" 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]
|
(defn bind-shortcuts [shortcuts bind-fn cb-fn]
|
||||||
(doseq [[key {:keys [command disabled fn]}] shortcuts]
|
(doseq [[key {:keys [command disabled fn]}] shortcuts]
|
||||||
(when-not disabled
|
(when-not disabled
|
||||||
|
@ -61,9 +71,19 @@
|
||||||
"Shift+")
|
"Shift+")
|
||||||
key))
|
key))
|
||||||
|
|
||||||
|
(defn alt [key]
|
||||||
|
(str
|
||||||
|
(if (cfg/check-platform? :macos)
|
||||||
|
mac-option
|
||||||
|
"Alt+")
|
||||||
|
key))
|
||||||
|
|
||||||
(defn meta-shift [key]
|
(defn meta-shift [key]
|
||||||
(-> key meta shift))
|
(-> key meta shift))
|
||||||
|
|
||||||
|
(defn meta-alt [key]
|
||||||
|
(-> key meta alt))
|
||||||
|
|
||||||
(defn supr []
|
(defn supr []
|
||||||
(if (cfg/check-platform? :macos)
|
(if (cfg/check-platform? :macos)
|
||||||
mac-delete
|
mac-delete
|
||||||
|
|
|
@ -44,20 +44,20 @@
|
||||||
(rx/empty))))))
|
(rx/empty))))))
|
||||||
|
|
||||||
(def shortcuts
|
(def shortcuts
|
||||||
{:toggle-layers {:tooltip (ds/meta "L")
|
{:toggle-layers {:tooltip (ds/alt "L")
|
||||||
:command (ds/c-mod "l")
|
:command (ds/a-mod "l")
|
||||||
:fn #(st/emit! (dw/go-to-layout :layers))}
|
:fn #(st/emit! (dw/go-to-layout :layers))}
|
||||||
|
|
||||||
:toggle-assets {:tooltip (ds/meta "I")
|
:toggle-assets {:tooltip (ds/alt "I")
|
||||||
:command (ds/c-mod "i")
|
:command (ds/a-mod "i")
|
||||||
:fn #(st/emit! (dw/go-to-layout :assets))}
|
:fn #(st/emit! (dw/go-to-layout :assets))}
|
||||||
|
|
||||||
:toggle-history {:tooltip (ds/meta "H")
|
:toggle-history {:tooltip (ds/alt "H")
|
||||||
:command (ds/c-mod "h")
|
:command (ds/a-mod "h")
|
||||||
:fn #(st/emit! (dw/go-to-layout :document-history))}
|
:fn #(st/emit! (dw/go-to-layout :document-history))}
|
||||||
|
|
||||||
:toggle-palette {:tooltip (ds/meta "P")
|
:toggle-palette {:tooltip (ds/alt "P")
|
||||||
:command (ds/c-mod "p")
|
:command (ds/a-mod "p")
|
||||||
:fn #(st/emit! (dw/toggle-layout-flags :colorpalette))}
|
:fn #(st/emit! (dw/toggle-layout-flags :colorpalette))}
|
||||||
|
|
||||||
:toggle-rules {:tooltip (ds/meta-shift "R")
|
:toggle-rules {:tooltip (ds/meta-shift "R")
|
||||||
|
|
Loading…
Add table
Reference in a new issue