From 6ea438146d33a9c1e12ac850eef5ea2ea05961a2 Mon Sep 17 00:00:00 2001 From: Daniel Compton Date: Thu, 4 Jan 2018 09:35:14 +1300 Subject: [PATCH] Make settings wrench orange when opening settings panel --- .../re_frame/trace/images/orange-wrench.svg | 14 ++++++++++++++ src/day8/re_frame/trace/view/container.cljs | 17 ++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 resources/day8/re_frame/trace/images/orange-wrench.svg diff --git a/resources/day8/re_frame/trace/images/orange-wrench.svg b/resources/day8/re_frame/trace/images/orange-wrench.svg new file mode 100644 index 0000000..fa79786 --- /dev/null +++ b/resources/day8/re_frame/trace/images/orange-wrench.svg @@ -0,0 +1,14 @@ + +Vector +Created using Figma + + + + + + + + + diff --git a/src/day8/re_frame/trace/view/container.cljs b/src/day8/re_frame/trace/view/container.cljs index 510467b..711ff33 100644 --- a/src/day8/re_frame/trace/view/container.cljs +++ b/src/day8/re_frame/trace/view/container.cljs @@ -21,16 +21,17 @@ (def open-external (macros/slurp-macro "day8/re_frame/trace/images/logout.svg")) (def settings-svg (macros/slurp-macro "day8/re_frame/trace/images/wrench.svg")) +(def orange-settings-svg (macros/slurp-macro "day8/re_frame/trace/images/orange-wrench.svg")) (def pause-svg (macros/slurp-macro "day8/re_frame/trace/images/pause.svg")) (def outer-margins {:margin (str "0px " common/gs-19s)}) (defn devtools-inner [traces opts] - (let [selected-tab (rf/subscribe [:settings/selected-tab]) - panel-type (:panel-type opts) - external-window? (= panel-type :popup) - unloading? (rf/subscribe [:global/unloading?]) - show-tabs? (not= @selected-tab :settings)] + (let [selected-tab (rf/subscribe [:settings/selected-tab]) + panel-type (:panel-type opts) + external-window? (= panel-type :popup) + unloading? (rf/subscribe [:global/unloading?]) + showing-settings? (= @selected-tab :settings)] [:div.panel-content {:style {:width "100%" :display "flex" :flex-direction "column" :background-color common/standard-background-color}} [rc/h-box @@ -56,14 +57,16 @@ [:img.nav-icon {:title "Settings" :src (str "data:image/svg+xml;utf8," - settings-svg) + (if showing-settings? + orange-settings-svg + settings-svg)) :on-click #(rf/dispatch [:settings/toggle-settings])}] (when-not external-window? [:img.nav-icon.active {:src (str "data:image/svg+xml;utf8," open-external) :on-click #(rf/dispatch-sync [:global/launch-external])}])]]]] - (when show-tabs? + (when-not showing-settings? [rc/h-box :class "panel-content-tabs" :justify :between