Add (hidden) settings panel

This commit is contained in:
Daniel Compton 2017-12-19 10:45:48 +13:00
parent a56dcd6ed0
commit 68d88cc94b
4 changed files with 21 additions and 1 deletions

View File

@ -106,3 +106,4 @@ If you want to work on re-frame-trace, see [DEVELOPERS.md](DEVELOPERS.md).
* [reload](https://thenounproject.com/adnen.kadri/collection/arrows/?i=798299) by Adnen Kadri from the Noun Project
* [Camera](https://thenounproject.com/search/?q=snapshot&i=200965) by Christian Shannon from the Noun Project
* [Delete](https://thenounproject.com/term/delete/926276) by logan from the Noun Project
* [Settings](https://thenounproject.com/search/?q=settings&i=1169241) by arjuazka from the Noun Project

View File

@ -0,0 +1 @@
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" x="0px" y="0px" viewBox="0 0 100 100"><g transform="translate(0,-952.36218)"><path style="text-indent:0;text-transform:none;direction:ltr;block-progression:tb;baseline-shift:baseline;color:#000000;enable-background:accumulate;" d="m 42.507626,964.36218 c -1.04395,0.001 -1.87492,0.92426 -2,1.75 l -0.8125,7.28125 c -0.69361,0.2655 -1.37216,0.53548 -2.03125,0.84375 l -5.71875,-4.5625 c -0.75387,-0.60977 -1.96297,-0.55287 -2.65625,0.125 l -11.3125,11.3125 c -0.70355,0.68844 -0.77528,1.92217 -0.15625,2.6875 l 4.5625,5.71875 c -0.30613,0.65553 -0.57998,1.34156 -0.84375,2.03125 l -7.25,0.8125 c -0.97225,0.10705 -1.78703,1.02189 -1.78125,2 l 0,15.99992 c 0.009,0.9677 0.81934,1.8629 1.78125,1.9688 l 7.25,0.8125 c 0.26722,0.6987 0.53314,1.3988 0.84375,2.0625 l -4.5625,5.7187 c -0.60176,0.7613 -0.5306,1.9709 0.15625,2.6563 l 11.3125,11.3125 c 0.68542,0.6868 1.89503,0.758 2.65625,0.1562 l 5.75,-4.5937 c 0.65236,0.3046 1.31382,0.581 2,0.8437 l 0.8125,7.2813 c 0.10705,0.9722 1.02189,1.787 2,1.7812 l 16,0 c 0.97811,0.01 1.89295,-0.809 2,-1.7812 l 0.8125,-7.2813 c 0.68618,-0.2627 1.34764,-0.5391 2,-0.8437 l 5.75,4.5937 c 0.76122,0.6018 1.97083,0.5306 2.65625,-0.1562 l 11.3125,-11.3125 c 0.68685,-0.6854 0.75801,-1.895 0.15625,-2.6563 l -4.5625,-5.7187 c 0.31061,-0.6637 0.57653,-1.3638 0.84375,-2.0625 l 7.25,-0.8125 c 0.96191,-0.1059 1.77184,-1.0011 1.78125,-1.9688 l 0,-15.99992 c 0.006,-0.97811 -0.809,-1.89295 -1.78125,-2 l -7.25,-0.8125 c -0.26377,-0.6897 -0.53762,-1.37572 -0.84375,-2.03125 l 4.5625,-5.71875 c 0.61903,-0.76533 0.5473,-1.99906 -0.15625,-2.6875 l -11.3125,-11.3125 c -0.69328,-0.67787 -1.90238,-0.73477 -2.65625,-0.125 l -5.71875,4.5625 c -0.65909,-0.30827 -1.33764,-0.57825 -2.03125,-0.84375 l -0.8125,-7.28125 c -0.12116,-0.96126 -1.03116,-1.75751 -2,-1.75 l -16,0 z m 1.8125,4 12.375,0 0.75,6.625 c 0.0942,0.75177 0.6534,1.42531 1.375,1.65625 1.34126,0.43406 2.65143,1.03035 3.9375,1.6875 0.68019,0.34675 1.55956,0.25754 2.15625,-0.21875 l 5.28125,-4.1875 8.75,8.75 -4.1875,5.28125 c -0.47629,0.59669 -0.5655,1.47606 -0.21875,2.15625 0.65716,1.28612 1.22221,2.56501 1.65625,3.90625 0.23531,0.73024 0.92478,1.29203 1.6875,1.375 l 6.625,0.75 0,12.40617 -6.625,0.75 c -0.76272,0.083 -1.45219,0.6448 -1.6875,1.375 -0.43405,1.3413 -0.9991,2.6202 -1.65625,3.9063 -0.35975,0.6874 -0.26999,1.5849 0.21875,2.1875 l 4.1875,5.25 -8.78125,8.7812 -5.25,-4.1875 c -0.59669,-0.4763 -1.47606,-0.5655 -2.15625,-0.2187 -1.2861,0.6571 -2.59627,1.2222 -3.9375,1.6562 -0.7216,0.231 -1.28077,0.9045 -1.375,1.6563 l -0.75,6.6562 -12.375,0 -0.75,-6.6562 c -0.0942,-0.7518 -0.6534,-1.4253 -1.375,-1.6563 -1.34123,-0.434 -2.6514,-0.9991 -3.9375,-1.6562 -0.68019,-0.3468 -1.55956,-0.2576 -2.15625,0.2187 l -5.25,4.1875 -8.78125,-8.7812 4.1875,-5.25 c 0.48874,-0.6026 0.5785,-1.5001 0.21875,-2.1875 -0.65715,-1.2861 -1.2222,-2.565 -1.65625,-3.9063 -0.23531,-0.7302 -0.92478,-1.292 -1.6875,-1.375 l -6.625,-0.75 0,-12.40617 6.625,-0.75 c 0.76272,-0.083 1.45219,-0.64476 1.6875,-1.375 0.43406,-1.34125 0.99909,-2.62014 1.65625,-3.90625 0.34675,-0.68019 0.25754,-1.55956 -0.21875,-2.15625 l -4.1875,-5.28125 8.75,-8.75 5.28125,4.1875 c 0.59669,0.47629 1.47606,0.5655 2.15625,0.21875 1.28607,-0.65715 2.59624,-1.25344 3.9375,-1.6875 0.7216,-0.23094 1.28077,-0.90448 1.375,-1.65625 l 0.75,-6.625 z m 6.1875,16 c -9.91745,0 -18,8.08251 -18,17.99992 0,9.9174 8.08257,18 18,18 9.91743,0 18,-8.0826 18,-18 0,-9.91741 -8.08255,-17.99992 -18,-17.99992 z m 0,4 c 7.75567,0 14,6.24425 14,13.99992 0,7.7557 -6.24431,14 -14,14 -7.75569,0 -14,-6.2443 -14,-14 0,-7.75567 6.24433,-13.99992 14,-13.99992 z" fill="#000000" fill-opacity="1" stroke="none" marker="none" visibility="visible" display="inline" overflow="visible"/></g></svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -5,6 +5,7 @@
[day8.re-frame.trace.view.app-db :as app-db]
[day8.re-frame.trace.view.traces :as traces]
[day8.re-frame.trace.view.subs :as subs]
[day8.re-frame.trace.view.settings :as settings]
[re-frame.trace]
[reagent.core :as r]
[day8.re-frame.trace.utils.re-com :as rc]))
@ -20,6 +21,8 @@
(def snapshot (macros/slurp-macro "day8/re_frame/trace/images/snapshot.svg"))
(def snapshot-ready (macros/slurp-macro "day8/re_frame/trace/images/snapshot-ready.svg"))
(def settings-svg (macros/slurp-macro "day8/re_frame/trace/images/settings.svg"))
(defn devtools-inner [traces opts]
(let [selected-tab (rf/subscribe [:settings/selected-tab])
panel-type (:panel-type opts)
@ -33,10 +36,18 @@
:justify :between
:children
[[rc/h-box
:align :center
:children
[(tab-button :traces "Traces")
(tab-button :app-db "App DB")
(tab-button :subs "Subs")]]
(tab-button :subs "Subs")
#_[:img.nav-icon
{:title "Settings"
:src (str "data:image/svg+xml;utf8,"
settings-svg)
:on-click #(rf/dispatch [:settings/selected-tab :settings])}]]]
[rc/h-box
:align :center
:children
@ -69,4 +80,5 @@
:traces [traces/render-trace-panel traces]
:app-db [app-db/render-state db/app-db]
:subs [subs/subs-panel]
:settings [settings/render]
[app-db/render-state db/app-db])]))

View File

@ -0,0 +1,6 @@
(ns day8.re-frame.trace.view.settings)
(defn render []
[:h1 "Settings"]
)