mirror of
https://github.com/penpot/penpot.git
synced 2025-05-20 18:56:12 +02:00
Merge pull request #3306 from penpot/eva-fix-shortcuts
🐛 Fix shortcuts translation error
This commit is contained in:
commit
119b3e7884
25 changed files with 167 additions and 134 deletions
|
@ -356,12 +356,14 @@
|
|||
:toggle-grid {:tooltip (ds/meta "'")
|
||||
;;https://github.com/ccampbell/mousetrap/issues/85
|
||||
:command [(ds/c-mod "'") (ds/c-mod "219")]
|
||||
:show-command (ds/c-mod "'")
|
||||
:subsections [:main-menu]
|
||||
:fn #(st/emit! (toggle-layout-flag :display-grid))}
|
||||
|
||||
:toggle-snap-grid {:tooltip (ds/meta-shift "'")
|
||||
;;https://github.com/ccampbell/mousetrap/issues/85
|
||||
:command [(ds/c-mod "shift+'") (ds/c-mod "shift+219")]
|
||||
:show-command (ds/c-mod "shift+'")
|
||||
:subsections [:main-menu]
|
||||
:fn #(st/emit! (toggle-layout-flag :snap-grid))}
|
||||
|
||||
|
|
|
@ -202,24 +202,24 @@
|
|||
(st/emit! (dwu/commit-undo-transaction undo-id)))))
|
||||
|
||||
(def shortcuts
|
||||
{:text-align-left {:tooltip (ds/meta (ds/alt "l"))
|
||||
{:text-align-left {:tooltip (ds/meta (ds/alt "L"))
|
||||
:command (ds/c-mod "alt+l")
|
||||
:subsections [:text-editor]
|
||||
:fn #(update-attrs-when-no-readonly {:text-align "left"})}
|
||||
:text-align-right {:tooltip (ds/meta (ds/alt "r"))
|
||||
:text-align-right {:tooltip (ds/meta (ds/alt "R"))
|
||||
:command (ds/c-mod "alt+r")
|
||||
:subsections [:text-editor]
|
||||
:fn #(update-attrs-when-no-readonly {:text-align "right"})}
|
||||
:text-align-center {:tooltip (ds/meta (ds/alt "t"))
|
||||
:text-align-center {:tooltip (ds/meta (ds/alt "T"))
|
||||
:command (ds/c-mod "alt+t")
|
||||
:subsections [:text-editor]
|
||||
:fn #(update-attrs-when-no-readonly {:text-align "center"})}
|
||||
:text-align-justify {:tooltip (ds/meta (ds/alt "j"))
|
||||
:text-align-justify {:tooltip (ds/meta (ds/alt "J"))
|
||||
:command (ds/c-mod "alt+j")
|
||||
:subsections [:text-editor]
|
||||
:fn #(update-attrs-when-no-readonly {:text-align "justify"})}
|
||||
|
||||
:underline {:tooltip (ds/meta "u")
|
||||
:underline {:tooltip (ds/meta "U")
|
||||
:command (ds/c-mod "u")
|
||||
:subsections [:text-editor]
|
||||
:fn #(update-attrs-when-no-readonly {:text-decoration "toggle-underline"})}
|
||||
|
|
|
@ -35,22 +35,22 @@
|
|||
;; --- Align
|
||||
[:div.align-icons
|
||||
[:span.tooltip.tooltip-bottom
|
||||
{:alt (tr "workspace.options.text-options.align-left" (sc/get-tooltip :text-align-left))
|
||||
{:alt (tr "workspace.options.text-options.text-align-left" (sc/get-tooltip :text-align-left))
|
||||
:class (dom/classnames :current (= "left" text-align))
|
||||
:on-click #(handle-change % "left")}
|
||||
i/text-align-left]
|
||||
[:span.tooltip.tooltip-bottom
|
||||
{:alt (tr "workspace.options.text-options.align-center" (sc/get-tooltip :text-align-center))
|
||||
{:alt (tr "workspace.options.text-options.text-align-center" (sc/get-tooltip :text-align-center))
|
||||
:class (dom/classnames :current (= "center" text-align))
|
||||
:on-click #(handle-change % "center")}
|
||||
i/text-align-center]
|
||||
[:span.tooltip.tooltip-bottom
|
||||
{:alt (tr "workspace.options.text-options.align-right" (sc/get-tooltip :text-align-right))
|
||||
{:alt (tr "workspace.options.text-options.text-align-right" (sc/get-tooltip :text-align-right))
|
||||
:class (dom/classnames :current (= "right" text-align))
|
||||
:on-click #(handle-change % "right")}
|
||||
i/text-align-right]
|
||||
[:span.tooltip.tooltip-bottom
|
||||
{:alt (tr "workspace.options.text-options.align-justify" (sc/get-tooltip :text-align-justify))
|
||||
{:alt (tr "workspace.options.text-options.text-align-justify" (sc/get-tooltip :text-align-justify))
|
||||
:class (dom/classnames :current (= "justify" text-align))
|
||||
:on-click #(handle-change % "justify")}
|
||||
i/text-align-justify]]))
|
||||
|
|
|
@ -168,6 +168,10 @@
|
|||
;; shortcuts.start-editing
|
||||
;; shortcuts.start-measure
|
||||
;; shortcuts.stop-measure
|
||||
;; shortcuts.text-align-center
|
||||
;; shortcuts.text-align-left
|
||||
;; shortcuts.text-align-justify
|
||||
;; shortcuts.text-align-right
|
||||
;; shortcuts.thumbnail-set
|
||||
;; shortcuts.toggle-alignment
|
||||
;; shortcuts.toggle-assets
|
||||
|
@ -276,7 +280,7 @@
|
|||
(for [command-translate sorted-filtered]
|
||||
(let [sc-by-translate (first (filter #(= (:translation (second %)) command-translate) elements))
|
||||
[command comand-info] sc-by-translate
|
||||
content (:command comand-info)]
|
||||
content (or (:show-command comand-info)(:command comand-info))]
|
||||
[:li {:class (css :shortcuts-name)
|
||||
:key command-translate}
|
||||
[:span {:class (css :command-name)}
|
||||
|
@ -288,7 +292,7 @@
|
|||
(for [command-translate sorted-filtered]
|
||||
(let [sc-by-translate (first (filter #(= (:translation (second %)) command-translate) elements))
|
||||
[command comand-info] sc-by-translate
|
||||
content (:command comand-info)]
|
||||
content (or (:show-command comand-info) (:command comand-info))]
|
||||
[:li.shortcut-name {:key command-translate}
|
||||
[:span.command-name command-translate]
|
||||
[:& shortcuts-keys {:content content
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue