diff --git a/CHANGES.md b/CHANGES.md index 7db885ac0..61e57bd40 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -40,6 +40,7 @@ - Fix deleted files appear in search results [Taiga #5002](https://tree.taiga.io/project/penpot/issue/5002) - Fix problem with selected colors and texts [Taiga #5051](https://tree.taiga.io/project/penpot/issue/5051) - Fix problem when assigning color from palette or assets [Taiga #5050](https://tree.taiga.io/project/penpot/issue/5050) +- Fix shortcuts for alignment [Taiga #5030](https://tree.taiga.io/project/penpot/issue/5030) ### :heart: Community contributions by (Thank you!) - To @ondrejkonec: for contributing to the code with: diff --git a/frontend/src/app/main/data/workspace/text/shortcuts.cljs b/frontend/src/app/main/data/workspace/text/shortcuts.cljs index 5ef7850ee..61f2c7908 100644 --- a/frontend/src/app/main/data/workspace/text/shortcuts.cljs +++ b/frontend/src/app/main/data/workspace/text/shortcuts.cljs @@ -202,22 +202,22 @@ (st/emit! (dwu/commit-undo-transaction undo-id))))) (def shortcuts - {: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"})} - :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"})} - :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"})} - :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"})} + {: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")) + :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")) + :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")) + :command (ds/c-mod "alt+j") + :subsections [:text-editor] + :fn #(update-attrs-when-no-readonly {:text-align "justify"})} :underline {:tooltip (ds/meta "u") :command (ds/c-mod "u") diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/text.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/text.cljs index 70e539d73..9cbfc528c 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/text.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/text.cljs @@ -11,6 +11,7 @@ [app.common.uuid :as uuid] [app.main.data.workspace.changes :as dch] [app.main.data.workspace.libraries :as dwl] + [app.main.data.workspace.shortcuts :as sc] [app.main.data.workspace.texts :as dwt] [app.main.data.workspace.undo :as dwu] [app.main.fonts :as fonts] @@ -25,8 +26,6 @@ [cuerdas.core :as str] [rumext.v2 :as mf])) - - (mf/defc text-align-options [{:keys [values on-change on-blur] :as props}] (let [{:keys [text-align]} values @@ -38,22 +37,22 @@ ;; --- Align [:div.align-icons [:span.tooltip.tooltip-bottom - {:alt (tr "workspace.options.text-options.align-left") + {:alt (tr "workspace.options.text-options.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") + {:alt (tr "workspace.options.text-options.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") + {:alt (tr "workspace.options.text-options.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") + {:alt (tr "workspace.options.text-options.align-justify" (sc/get-tooltip :text-align-justify)) :class (dom/classnames :current (= "justify" text-align)) :on-click #(handle-change % "justify")} i/text-align-justify]])) @@ -149,13 +148,13 @@ i/minus] [:span.tooltip.tooltip-bottom - {:alt (tr "workspace.options.text-options.underline") + {:alt (tr "workspace.options.text-options.underline" (sc/get-tooltip :underline)) :class (dom/classnames :current (= "underline" text-decoration)) :on-click #(handle-change % "underline")} i/underline] [:span.tooltip.tooltip-bottom - {:alt (tr "workspace.options.text-options.strikethrough") + {:alt (tr "workspace.options.text-options.strikethrough" (sc/get-tooltip :line-through)) :class (dom/classnames :current (= "line-through" text-decoration)) :on-click #(handle-change % "line-through")} i/strikethrough]]))