0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-10 00:58:26 -05:00

Add impl for new ruler button and add the abilty to hide rules.

This commit is contained in:
Andrey Antukh 2017-03-02 17:24:02 +01:00
parent e453841d66
commit 6666244061
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
3 changed files with 21 additions and 12 deletions

View file

@ -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

View file

@ -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)"

View file

@ -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]]]))