From 9ff309556897ba7d71aeb133c976b4a1c1f5caca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Tue, 24 Oct 2023 17:33:00 +0200 Subject: [PATCH] :sparkles: Hide asterisk for overriden copies, except when debugging --- .../styles/main/partials/sidebar-layers.scss | 4 ++ .../main/ui/workspace/sidebar/layer_name.cljs | 37 ++++++++++--------- .../main/ui/workspace/sidebar/layer_name.scss | 3 ++ frontend/src/app/util/debug.cljs | 9 ++--- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/frontend/resources/styles/main/partials/sidebar-layers.scss b/frontend/resources/styles/main/partials/sidebar-layers.scss index 461ddaea87..b07d260386 100644 --- a/frontend/resources/styles/main/partials/sidebar-layers.scss +++ b/frontend/resources/styles/main/partials/sidebar-layers.scss @@ -274,6 +274,10 @@ span.element-name { } } +span.element-name-touched { + color: $color-component; +} + .element-actions { display: flex; flex-shrink: 0; diff --git a/frontend/src/app/main/ui/workspace/sidebar/layer_name.cljs b/frontend/src/app/main/ui/workspace/sidebar/layer_name.cljs index e0322a9206..88af3c7e32 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/layer_name.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/layer_name.cljs @@ -12,6 +12,7 @@ [app.main.data.workspace :as dw] [app.main.store :as st] [app.main.ui.context :as ctx] + [app.util.debug :as dbg] [app.util.dom :as dom] [app.util.keyboard :as kbd] [cuerdas.core :as str] @@ -97,20 +98,22 @@ :on-key-down on-key-down :auto-focus true :default-value (d/nilv shape-name "")}] - [:span - {:class (if ^boolean new-css-system - (stl/css-case - :element-name true - :left-ellipsis has-path? - :selected selected? - :hidden hidden? - :type-comp type-comp - :type-frame type-frame) - (stl/css-case - "element-name" true - :left-ellipsis has-path?)) - :style {"--depth" depth "--parent-size" parent-size} - :ref ref - :on-double-click start-edit} - (d/nilv shape-name "") - (when ^boolean shape-touched? " *")]))) + [:* + [:span + {:class (if ^boolean new-css-system + (stl/css-case + :element-name true + :left-ellipsis has-path? + :selected selected? + :hidden hidden? + :type-comp type-comp + :type-frame type-frame) + (stl/css-case + "element-name" true + :left-ellipsis has-path?)) + :style {"--depth" depth "--parent-size" parent-size} + :ref ref + :on-double-click start-edit} + (d/nilv shape-name "")] + (when (and (dbg/enabled? :show-touched) ^boolean shape-touched?) + [:span {:class (stl/css new-css-system :element-name-touched)} "*"])]))) diff --git a/frontend/src/app/main/ui/workspace/sidebar/layer_name.scss b/frontend/src/app/main/ui/workspace/sidebar/layer_name.scss index c7f95086e7..3151b8101b 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/layer_name.scss +++ b/frontend/src/app/main/ui/workspace/sidebar/layer_name.scss @@ -38,3 +38,6 @@ border: 1px solid var(--input-border-color-focus); color: var(--layer-row-foreground-color); } +.element-name-touched { + color: var(--layer-row-component-foreground-color); +} diff --git a/frontend/src/app/util/debug.cljs b/frontend/src/app/util/debug.cljs index 4c6eb35bca..7fecae2192 100644 --- a/frontend/src/app/util/debug.cljs +++ b/frontend/src/app/util/debug.cljs @@ -70,6 +70,9 @@ ;; Show shape name and id :shape-titles + ;; Show an asterisk for touched copies + :show-touched + ;; :grid-layout }) @@ -92,9 +95,3 @@ (if (enabled? option) (disable! option) (enable! option))) - - - - - -