diff --git a/frontend/resources/styles/main/partials/workspace-canvas.scss b/frontend/resources/styles/main/partials/workspace-canvas.scss index 1b365d5af..e95f90d3f 100644 --- a/frontend/resources/styles/main/partials/workspace-canvas.scss +++ b/frontend/resources/styles/main/partials/workspace-canvas.scss @@ -50,7 +50,7 @@ background-color: $color-dark-bg; border-radius: $br-small; color: $color-white; - font-size: $fs14; + font-size: $fs12; padding: 3px 8px; transition: none; text-align: center; diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index a92bae5db..d08ab4a19 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -47,14 +47,16 @@ {:project project :page page :selected #{} - :drawing nil}) + :drawing nil + :tooltip nil}) (assoc state :workspace {:project project :zoom 1 :page page :flags #{:sitemap :drawtools :layers :element-options} :selected #{} - :drawing nil}))) + :drawing nil + :tooltip nil}))) ptk/WatchEvent (watch [_ state s] diff --git a/frontend/src/uxbox/main/ui/workspace/canvas.cljs b/frontend/src/uxbox/main/ui/workspace/canvas.cljs index f5c9fbdb2..6d6f320b0 100644 --- a/frontend/src/uxbox/main/ui/workspace/canvas.cljs +++ b/frontend/src/uxbox/main/ui/workspace/canvas.cljs @@ -55,6 +55,20 @@ [:span {:alt "y"} (str "Y: " (:y coords "-"))]])) +;; --- Cursor tooltip + +(defn- get-shape-tooltip + "Return the shape tooltip text" + [shape] + (case (:type shape) + :icon "Click to place the Icon" + :image "Click to place the Image" + :rect "Drag to draw a Box" + :text "Drag to draw a Text Box" + :path "Click to draw a Path" + :circle "Drag to draw a Circle" + nil)) + (mx/defc cursor-tooltip {:mixins [mx/reactive mx/static]} [tooltip] @@ -164,7 +178,9 @@ page (mx/react wb/page-ref) flags (:flags workspace) drawing? (:drawing workspace) - tooltip (:tooltip workspace) + tooltip (if (:tooltip workspace) + (:tooltip workspace) + (get-shape-tooltip drawing?)) zoom (or (:zoom workspace) 1)] (letfn [(on-mouse-down [event] (dom/stop-propagation event)