diff --git a/src/main/frontend/handler/events.cljs b/src/main/frontend/handler/events.cljs index ccce54533..a184c41f4 100644 --- a/src/main/frontend/handler/events.cljs +++ b/src/main/frontend/handler/events.cljs @@ -13,6 +13,7 @@ [frontend.commands :as commands] [frontend.components.class :as class-component] [frontend.components.cmdk :as cmdk] + [frontend.components.settings :as settings] [frontend.components.diff :as diff] [frontend.components.encryption :as encryption] [frontend.components.file-sync :as file-sync] @@ -341,6 +342,17 @@ (defmethod handle :modal/show-themes-modal [_] (plugin/open-select-theme!)) +(defmethod handle :modal/toggle-accent-colors-modal [_] + (let [label "accent-colors-picker"] + (if (or (= label (state/get-modal-id)) + (= label (some-> (state/get-sub-modals) (first) :modal/id))) + (state/close-sub-modal! label) + (state/set-sub-modal! + #(settings/modal-accent-colors-inner) + {:center? true + :id label + :label label})))) + (rum/defc modal-output [content] content) diff --git a/src/main/frontend/modules/shortcut/config.cljs b/src/main/frontend/modules/shortcut/config.cljs index 89bcd0858..e130a3723 100644 --- a/src/main/frontend/modules/shortcut/config.cljs +++ b/src/main/frontend/modules/shortcut/config.cljs @@ -773,8 +773,8 @@ :dev/show-page-data :dev/show-page-ast :dev/replace-graph-with-db-file - :ui/cycle-color - :ui/cycle-color-off]) + :ui/accent-colors-picker + :ui/accent-color-reset]) (with-meta {:before m/enable-when-not-editing-mode!})) :shortcut.handler/misc @@ -889,8 +889,8 @@ :ui/toggle-right-sidebar :ui/toggle-settings :ui/toggle-contents - :ui/cycle-color-off - :ui/cycle-color] + :ui/accent-colors-picker + :ui/accent-color-reset] :shortcut.category/whiteboard [:editor/new-whiteboard