From eabfa5014211a64df1cf17b1066b2495bd93e83e Mon Sep 17 00:00:00 2001 From: elhombretecla Date: Wed, 18 May 2016 16:57:26 +0200 Subject: [PATCH] restyle shape selected controls --- src/uxbox/ui/shapes/core.cljs | 8 ++-- src/uxbox/ui/workspace/selection.cljs | 54 ++++++++++++--------------- 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/src/uxbox/ui/shapes/core.cljs b/src/uxbox/ui/shapes/core.cljs index 49fce455f..60874ab9a 100644 --- a/src/uxbox/ui/shapes/core.cljs +++ b/src/uxbox/ui/shapes/core.cljs @@ -11,12 +11,12 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (def ^:const +circle-props+ - {:r 5 - :style {:fillOpacity "0.5" + {:r 6 + :style {:fillOpacity "1" :strokeWidth "1px" :vectorEffect "non-scaling-stroke"} - :fill "#333" - :stroke "#333"}) + :fill "#78dbbe" + :stroke "#3f9d81"}) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Implementation Api diff --git a/src/uxbox/ui/workspace/selection.cljs b/src/uxbox/ui/workspace/selection.cljs index ee65891e4..95481f6fa 100644 --- a/src/uxbox/ui/workspace/selection.cljs +++ b/src/uxbox/ui/workspace/selection.cljs @@ -52,38 +52,30 @@ [:g.controls [:rect.main {:x x :y y :width width :height height :stroke-dasharray "5,5" :style {:stroke "#333" :fill "transparent" :stroke-opacity "1"}}] - [:rect.top - {:fill "#333" - :on-mouse-up #(on-mouse-up 5 %) + [:circle.top + (merge uusc/+circle-props+ + {:on-mouse-up #(on-mouse-up 5 %) :on-mouse-down #(on-mouse-down 5 %) - :x (- (+ x (/ width 2)) 7) - :width 14 - :height 3 - :y (- y 5)}] - [:rect.right - {:fill "#333" - :on-mouse-up #(on-mouse-up 6 %) - :on-mouse-down #(on-mouse-down 6 %) - :y (- (+ y (/ height 2)) 7) - :width 3 - :height 14 - :x (+ x width 2)}] - [:rect.bottom - {:fill "#333" - :on-mouse-up #(on-mouse-up 7 %) - :on-mouse-down #(on-mouse-down 7 %) - :x (- (+ x (/ width 2)) 7) - :width 14 - :height 3 - :y (+ y height 2)}] - [:rect.left - {:fill "#333" - :on-mouse-up #(on-mouse-up 8 %) - :on-mouse-down #(on-mouse-down 8 %) - :y (- (+ y (/ height 2)) 7) - :width 3 - :height 14 - :x (- x 5)}] + :cx (+ x (/ width 2)) + :cy (- y 2)})] + [:circle.right + (merge uusc/+circle-props+ + {:on-mouse-up #(on-mouse-up 6 %) + :on-mouse-down #(on-mouse-down 6 %) + :cy (+ y (/ height 2)) + :cx (+ x width 1)})] + [:circle.bottom + (merge uusc/+circle-props+ + {:on-mouse-up #(on-mouse-up 7 %) + :on-mouse-down #(on-mouse-down 7 %) + :cx (+ x (/ width 2)) + :cy (+ y height 2)})] + [:circle.left + (merge uusc/+circle-props+ + {:on-mouse-up #(on-mouse-up 8 %) + :on-mouse-down #(on-mouse-down 8 %) + :cy (+ y (/ height 2)) + :cx (- x 3)})] [:circle.top-left (merge uusc/+circle-props+ {:on-mouse-up #(on-mouse-up 1 %)