From 15e62ff6493c568ab2d7e94b8a256f1d129003e6 Mon Sep 17 00:00:00 2001 From: Eva Date: Fri, 27 Jan 2023 12:54:18 +0100 Subject: [PATCH] :bug: Remove copy all button in fills and strokes --- .../styles/main/partials/inspect.scss | 8 +++++-- .../ui/viewer/inspect/attributes/fill.cljs | 19 ++++++++-------- .../ui/viewer/inspect/attributes/stroke.cljs | 22 +++++++++---------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/frontend/resources/styles/main/partials/inspect.scss b/frontend/resources/styles/main/partials/inspect.scss index 8e0eaa949..28d4fb9fc 100644 --- a/frontend/resources/styles/main/partials/inspect.scss +++ b/frontend/resources/styles/main/partials/inspect.scss @@ -314,11 +314,15 @@ } } - .attributes-shadow-block { + .attributes-shadow-block, + .attributes-stroke-block, + .attributes-fill-block { border-top: 1px solid $color-gray-60; } - .attributes-shadow-blocks :first-child { + .attributes-shadow-blocks :first-child, + .attributes-stroke-blocks :first-child, + .attributes-fill-blocks :first-child { border-top: none; } } diff --git a/frontend/src/app/main/ui/viewer/inspect/attributes/fill.cljs b/frontend/src/app/main/ui/viewer/inspect/attributes/fill.cljs index 29784559c..500ddd500 100644 --- a/frontend/src/app/main/ui/viewer/inspect/attributes/fill.cljs +++ b/frontend/src/app/main/ui/viewer/inspect/attributes/fill.cljs @@ -6,7 +6,6 @@ (ns app.main.ui.viewer.inspect.attributes.fill (:require - [app.main.ui.components.copy-button :refer [copy-button]] [app.main.ui.viewer.inspect.attributes.common :refer [color-row]] [app.util.code-gen :as cg] [app.util.color :as uc] @@ -40,10 +39,11 @@ (let [color-format (mf/use-state :hex) color (shape->color shape)] - [:& color-row {:color color - :format @color-format - :on-change-format #(reset! color-format %) - :copy-data (copy-data shape)}])) + [:div.attributes-fill-block + [:& color-row {:color color + :format @color-format + :on-change-format #(reset! color-format %) + :copy-data (copy-data shape)}]])) (mf/defc fill-panel [{:keys [shapes]}] @@ -51,14 +51,13 @@ (when (seq shapes) [:div.attributes-block [:div.attributes-block-title - [:div.attributes-block-title-text (tr "inspect.attributes.fill")] - (when (= (count shapes) 1) - [:& copy-button {:data (copy-data (first shapes))}])] + [:div.attributes-block-title-text (tr "inspect.attributes.fill")]] - (for [shape shapes] + [:div.attributes-fill-blocks + (for [shape shapes] (if (seq (:fills shape)) (for [value (:fills shape [])] [:& fill-block {:key (str "fill-block-" (:id shape) value) :shape value}]) [:& fill-block {:key (str "fill-block-only" (:id shape)) - :shape shape}]))]))) + :shape shape}]))]]))) diff --git a/frontend/src/app/main/ui/viewer/inspect/attributes/stroke.cljs b/frontend/src/app/main/ui/viewer/inspect/attributes/stroke.cljs index f38b2c4aa..34e1f70bc 100644 --- a/frontend/src/app/main/ui/viewer/inspect/attributes/stroke.cljs +++ b/frontend/src/app/main/ui/viewer/inspect/attributes/stroke.cljs @@ -55,12 +55,7 @@ [{:keys [shape]}] (let [color-format (mf/use-state :hex) color (shape->color shape)] - [:* - [:& color-row {:color color - :format @color-format - :copy-data (copy-color-data shape) - :on-change-format #(reset! color-format %)}] - + [:div.attributes-stroke-block (let [{:keys [stroke-style stroke-alignment]} shape stroke-style (if (= stroke-style :svg) :solid stroke-style) stroke-alignment (or stroke-alignment :center)] @@ -78,7 +73,11 @@ ;; inspect.attributes.stroke.alignment.inner ;; inspect.attributes.stroke.alignment.outer [:div.attributes-label (->> stroke-alignment d/name (str "inspect.attributes.stroke.alignment.") (tr))] - [:& copy-button {:data (copy-stroke-data shape)}]])])) + [:& copy-button {:data (copy-stroke-data shape)}]]) + [:& color-row {:color color + :format @color-format + :copy-data (copy-color-data shape) + :on-change-format #(reset! color-format %)}]])) (mf/defc stroke-panel [{:keys [shapes]}] @@ -86,14 +85,13 @@ (when (seq shapes) [:div.attributes-block [:div.attributes-block-title - [:div.attributes-block-title-text (tr "inspect.attributes.stroke")] - (when (= (count shapes) 1) - [:& copy-button {:data (copy-stroke-data (first shapes))}])] + [:div.attributes-block-title-text (tr "inspect.attributes.stroke")]] - (for [shape shapes] + [:div.attributes-stroke-blocks + (for [shape shapes] (if (seq (:strokes shape)) (for [value (:strokes shape [])] [:& stroke-block {:key (str "stroke-color-" (:id shape) value) :shape value}]) [:& stroke-block {:key (str "stroke-color-only" (:id shape)) - :shape shape}]))]))) + :shape shape}]))]])))