mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 04:49:03 -05:00
Minor rename on toolboxes components.
This commit is contained in:
parent
3aafaf4665
commit
7aa80860b8
1 changed files with 11 additions and 19 deletions
|
@ -4,17 +4,21 @@
|
||||||
[uxbox.router :as r]
|
[uxbox.router :as r]
|
||||||
[uxbox.rstore :as rs]
|
[uxbox.rstore :as rs]
|
||||||
[uxbox.state :as s]
|
[uxbox.state :as s]
|
||||||
|
[uxbox.shapes :as shapes]
|
||||||
|
[uxbox.library :as library]
|
||||||
|
[uxbox.util.data :refer (read-string)]
|
||||||
[uxbox.data.workspace :as dw]
|
[uxbox.data.workspace :as dw]
|
||||||
[uxbox.ui.workspace.base :as wb]
|
[uxbox.ui.workspace.base :as wb]
|
||||||
[uxbox.ui.icons :as i]
|
[uxbox.ui.icons :as i]
|
||||||
[uxbox.ui.mixins :as mx]
|
[uxbox.ui.mixins :as mx]
|
||||||
|
[uxbox.ui.dom :as dom]
|
||||||
[uxbox.ui.util :as util]))
|
[uxbox.ui.util :as util]))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Draw Tools
|
;; Draw Tools
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(def ^:staric draw-tools
|
(def ^:staric +draw-tools+
|
||||||
{:rect
|
{:rect
|
||||||
{:icon i/box
|
{:icon i/box
|
||||||
:help "Box (Ctrl + B)"
|
:help "Box (Ctrl + B)"
|
||||||
|
@ -32,11 +36,11 @@
|
||||||
;; Draw Tool Box
|
;; Draw Tool Box
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(defn draw-toolbox-render
|
(defn draw-tools-render
|
||||||
[open-toolboxes]
|
[open-toolboxes]
|
||||||
(let [workspace (rum/react wb/workspace-state)
|
(let [workspace (rum/react wb/workspace-state)
|
||||||
close #(rs/emit! (dw/toggle-toolbox :draw))
|
close #(rs/emit! (dw/toggle-toolbox :draw))
|
||||||
tools (->> (into [] draw-tools)
|
tools (->> (into [] +draw-tools+)
|
||||||
(sort-by (comp :priority second)))]
|
(sort-by (comp :priority second)))]
|
||||||
(html
|
(html
|
||||||
[:div#form-tools.tool-window
|
[:div#form-tools.tool-window
|
||||||
|
@ -52,20 +56,10 @@
|
||||||
:on-click (constantly nil)}
|
:on-click (constantly nil)}
|
||||||
(:icon props)])]])))
|
(:icon props)])]])))
|
||||||
|
|
||||||
;; #_(for [tool (t/sorted-tools (rum/react t/drawing-tools))]
|
(def ^:static draw-tools
|
||||||
;; [:div.tool-btn.tooltip.tooltip-hover
|
|
||||||
;; {:alt (:text tool)
|
|
||||||
;; :class (when (= (rum/react ws/selected-tool)
|
|
||||||
;; [(:key tool)])
|
|
||||||
;; "selected")
|
|
||||||
;; :key (:key tool)
|
|
||||||
;; :on-click #(ws/toggle-tool! [(:key tool)])}
|
|
||||||
;; (:icon tool)])]])))
|
|
||||||
|
|
||||||
(def ^:static draw-toolbox
|
|
||||||
(util/component
|
(util/component
|
||||||
{:render draw-toolbox-render
|
{:render draw-tools-render
|
||||||
:name "draw-toolbox"
|
:name "draw-tools"
|
||||||
:mixins [mx/static rum/reactive]}))
|
:mixins [mx/static rum/reactive]}))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
@ -75,9 +69,7 @@
|
||||||
(defn layers-render
|
(defn layers-render
|
||||||
[]
|
[]
|
||||||
(let [workspace (rum/react wb/workspace-state)
|
(let [workspace (rum/react wb/workspace-state)
|
||||||
close #(rs/emit! (dw/toggle-toolbox :layers))
|
close #(rs/emit! (dw/toggle-toolbox :layers))]
|
||||||
tools (->> (into [] draw-tools)
|
|
||||||
(sort-by (comp :priority second)))]
|
|
||||||
(html
|
(html
|
||||||
[:div#layers.tool-window
|
[:div#layers.tool-window
|
||||||
[:div.tool-window-bar
|
[:div.tool-window-bar
|
||||||
|
|
Loading…
Add table
Reference in a new issue