diff --git a/frontend/src/uxbox/main/ui/workspace.cljs b/frontend/src/uxbox/main/ui/workspace.cljs index eff40b22a4..2cbe577b8b 100644 --- a/frontend/src/uxbox/main/ui/workspace.cljs +++ b/frontend/src/uxbox/main/ui/workspace.cljs @@ -137,8 +137,11 @@ (history-dialog page) ;; Rules - (horizontal-rule) - (vertical-rule) + (when (contains? flags :rules) + (horizontal-rule)) + + (when (contains? flags :rules) + (vertical-rule)) ;; Canvas [:section.workspace-canvas diff --git a/frontend/src/uxbox/main/ui/workspace/header.cljs b/frontend/src/uxbox/main/ui/workspace/header.cljs index db0ec06e3f..0b9bab3826 100644 --- a/frontend/src/uxbox/main/ui/workspace/header.cljs +++ b/frontend/src/uxbox/main/ui/workspace/header.cljs @@ -119,9 +119,9 @@ i/image]] [:ul.options-btn [:li.tooltip.tooltip-bottom - {:alt "Ruler (Ctrl + R)" - :class (when (contains? flags :ruler) "selected") - :on-click (partial toggle :ruler)} + {:alt "Rules" + :class (when (contains? flags :rules) "selected") + :on-click (partial toggle :rules)} i/ruler] [:li.tooltip.tooltip-bottom {:alt "Grid (Ctrl + G)" diff --git a/frontend/src/uxbox/main/ui/workspace/sidebar/drawtools.cljs b/frontend/src/uxbox/main/ui/workspace/sidebar/drawtools.cljs index 3a8ca93a3e..a113d0dafa 100644 --- a/frontend/src/uxbox/main/ui/workspace/sidebar/drawtools.cljs +++ b/frontend/src/uxbox/main/ui/workspace/sidebar/drawtools.cljs @@ -87,11 +87,7 @@ {:icon i/pencil :help (tr "ds.help.path") :shape +draw-tool-curve+ - :priority 6} - {:icon i/ruler-tool - :help (tr "ds.help.path") - :shape +draw-tool-curve+ - :priority 7}]) + :priority 6}]) ;; --- Draw Toolbox (Component) @@ -104,9 +100,12 @@ {:mixins [mx/static mx/reactive]} [] (let [drawing-tool (mx/react refs/selected-drawing-tool) + flags (mx/react refs/flags) close #(st/emit! (dw/toggle-flag :drawtools)) tools (->> (into [] +draw-tools+) - (sort-by (comp :priority second)))] + (sort-by (comp :priority second))) + toggle-flag #(st/emit! (dw/toggle-flag %))] + [:div#form-tools.tool-window.drawing-tools [:div.tool-window-bar [:div.tool-window-icon i/window] @@ -120,4 +119,11 @@ :class (when selected? "selected") :key (str i) :on-click (partial select-for-draw (:shape props))} - (:icon props)])]])) + (:icon props)]) + + [:div.tool-btn.tooltip.tooltip-hover + {:alt "Ruler" + :on-click (partial toggle-flag :ruler) + :class (when (contains? flags :ruler) "selected")} + i/ruler-tool]]])) +