Преглед изворни кода

fix: missing accent color picker

charlie пре 2 година
родитељ
комит
bcd81c3ec9
2 измењених фајлова са 16 додато и 4 уклоњено
  1. 12 0
      src/main/frontend/handler/events.cljs
  2. 4 4
      src/main/frontend/modules/shortcut/config.cljs

+ 12 - 0
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)

+ 4 - 4
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