Skip to content

Commit 69d6952

Browse files
committed
add loading indicator
1 parent fbdf5cc commit 69d6952

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

src/renderer/animations.css

+6
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,9 @@
6868
transform: translateX(calc(100% + var(--viewport-padding)));
6969
}
7070
}
71+
72+
@keyframes spin {
73+
100% {
74+
transform:rotate(360deg);
75+
}
76+
}

src/renderer/styles.css

+8
Original file line numberDiff line numberDiff line change
@@ -519,3 +519,11 @@ pre {
519519
.close-button {
520520
@apply icon-button absolute top-3 right-3 !important;
521521
}
522+
523+
.loading {
524+
position: absolute;
525+
top: 50%;
526+
left: 50%;
527+
margin: -9px 0 0 -9px;
528+
animation: spin 4s linear infinite;
529+
}

src/renderer/toolbar/status.cljs

+7-1
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,18 @@
9999

100100
(defn root []
101101
(let [zoom @(rf/subscribe [:document/zoom])
102-
timeline? @(rf/subscribe [:panel/visible? :timeline])]
102+
timeline? @(rf/subscribe [:panel/visible? :timeline])
103+
loading? @(rf/subscribe [:worker/loading?])]
103104
[:<>
104105
[:div.toolbar.bg-primary
105106
[color-v/picker]
106107
[:div.grow.text-xs.truncate.mx-1
107108
@(rf/subscribe [:message])]
109+
(when loading?
110+
[:<>
111+
[:span.icon-button.relative
112+
[comp/icon "refresh" {:class "loading"}]]
113+
[:span.v-divider]])
108114
(into [:<>]
109115
(map (fn [{:keys [title active? icon action]}]
110116
[comp/radio-icon-button {:title title

src/renderer/worker/subs.cljs

+6
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@
1010
:worker/tasks
1111
:<- [:worker]
1212
:-> :tasks)
13+
14+
(rf/reg-sub
15+
:worker/loading?
16+
:<- [:worker/tasks]
17+
(fn [tasks]
18+
(seq tasks)))

0 commit comments

Comments
 (0)