0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 23:18:48 -05:00

Minor rename on toolboxes components.

This commit is contained in:
Andrey Antukh 2015-12-27 15:28:08 +02:00
parent 3aafaf4665
commit 7aa80860b8

View file

@ -4,17 +4,21 @@
[uxbox.router :as r]
[uxbox.rstore :as rs]
[uxbox.state :as s]
[uxbox.shapes :as shapes]
[uxbox.library :as library]
[uxbox.util.data :refer (read-string)]
[uxbox.data.workspace :as dw]
[uxbox.ui.workspace.base :as wb]
[uxbox.ui.icons :as i]
[uxbox.ui.mixins :as mx]
[uxbox.ui.dom :as dom]
[uxbox.ui.util :as util]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Draw Tools
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(def ^:staric draw-tools
(def ^:staric +draw-tools+
{:rect
{:icon i/box
:help "Box (Ctrl + B)"
@ -32,11 +36,11 @@
;; Draw Tool Box
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn draw-toolbox-render
(defn draw-tools-render
[open-toolboxes]
(let [workspace (rum/react wb/workspace-state)
close #(rs/emit! (dw/toggle-toolbox :draw))
tools (->> (into [] draw-tools)
tools (->> (into [] +draw-tools+)
(sort-by (comp :priority second)))]
(html
[:div#form-tools.tool-window
@ -52,20 +56,10 @@
:on-click (constantly nil)}
(:icon props)])]])))
;; #_(for [tool (t/sorted-tools (rum/react t/drawing-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
(def ^:static draw-tools
(util/component
{:render draw-toolbox-render
:name "draw-toolbox"
{:render draw-tools-render
:name "draw-tools"
:mixins [mx/static rum/reactive]}))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -75,9 +69,7 @@
(defn layers-render
[]
(let [workspace (rum/react wb/workspace-state)
close #(rs/emit! (dw/toggle-toolbox :layers))
tools (->> (into [] draw-tools)
(sort-by (comp :priority second)))]
close #(rs/emit! (dw/toggle-toolbox :layers))]
(html
[:div#layers.tool-window
[:div.tool-window-bar