@@ -15,6 +15,7 @@ import IconClose from '~/components/icons/IconCloseSmall.vue';
15
15
import IconPencil from ' ~/components/icons/IconPencil.vue' ;
16
16
17
17
import SettingsFormItem from ' ~/components/views/settings/SettingsFormItem.vue' ;
18
+ import { loadingHysteresisOptions } from ' ~/models/loading-hysteresis.model' ;
18
19
import { pageSizeOptions , pageSizeOptionsWithZero } from ' ~/models/page-size.model' ;
19
20
import { ProgressType } from ' ~/models/progress-type.model' ;
20
21
import { Route } from ' ~/models/router.model' ;
@@ -53,6 +54,7 @@ const {
53
54
progressType,
54
55
enableRatings,
55
56
backgroundColor,
57
+ loadingHysteresis,
56
58
} = useExtensionSettingsStoreRefs ();
57
59
58
60
const { getIcon, fetchLists } = useListsStore ();
@@ -75,6 +77,14 @@ const listOptions = computed<ListOption[]>(() =>
75
77
})),
76
78
);
77
79
80
+ const loadingOption = computed (() =>
81
+ loadingHysteresisOptions .map (({ label , value }) => ({
82
+ label:
83
+ typeof label === ' string' ? i18n (label , ' common' , ' loading' , ' hysteresis' ) : label ,
84
+ value ,
85
+ })),
86
+ );
87
+
78
88
const renderLabel = (option : ListOption ) => [
79
89
h (NIcon , {
80
90
style: {
@@ -139,29 +149,6 @@ const onColor = () => {
139
149
140
150
<template >
141
151
<div ref =" container" class =" tabs-container" >
142
- <!-- Default tab -->
143
- <SettingsFormItem :label =" i18n('label_default_tab')" >
144
- <div class =" form-button" >
145
- <input ref =" picker" v-model =" backgroundColor" type =" color" class =" color-picker" />
146
- <NButtonGroup
147
- class =" color-picker-button-group"
148
- :style =" { '--color-picker': backgroundColor }"
149
- >
150
- <NButton round tertiary @click =" onColor" >
151
- Picker
152
- <template #icon >
153
- <NIcon ><IconPencil /></NIcon >
154
- </template >
155
- </NButton >
156
- <NButton circle tertiary type =" error" @click =" backgroundColor = 'transparent'" >
157
- <template #icon >
158
- <NIcon ><IconClose /></NIcon >
159
- </template >
160
- </NButton >
161
- </NButtonGroup >
162
- </div >
163
- </SettingsFormItem >
164
-
165
152
<!-- Default tab -->
166
153
<SettingsFormItem :label =" i18n('label_default_tab')" >
167
154
<NSelect
@@ -187,6 +174,38 @@ const onColor = () => {
187
174
multiple
188
175
/>
189
176
</SettingsFormItem >
177
+ <!-- Loading bar -->
178
+ <SettingsFormItem :label =" i18n('label_loading_bar')" >
179
+ <NSelect
180
+ v-model:value =" loadingHysteresis"
181
+ class =" loading-bar"
182
+ :to =" container"
183
+ :options =" loadingOption"
184
+ />
185
+ </SettingsFormItem >
186
+
187
+ <!-- Background color -->
188
+ <SettingsFormItem :label =" i18n('label_background_color')" >
189
+ <div class =" form-button" >
190
+ <input ref =" picker" v-model =" backgroundColor" type =" color" class =" color-picker" />
191
+ <NButtonGroup
192
+ class =" color-picker-button-group"
193
+ :style =" { '--color-picker': backgroundColor }"
194
+ >
195
+ <NButton round tertiary @click =" onColor" >
196
+ Picker
197
+ <template #icon >
198
+ <NIcon ><IconPencil /></NIcon >
199
+ </template >
200
+ </NButton >
201
+ <NButton circle tertiary type =" error" @click =" backgroundColor = 'transparent'" >
202
+ <template #icon >
203
+ <NIcon ><IconClose /></NIcon >
204
+ </template >
205
+ </NButton >
206
+ </NButtonGroup >
207
+ </div >
208
+ </SettingsFormItem >
190
209
191
210
<!-- Restore tab -->
192
211
<SettingsFormItem :label =" i18n('label_restore_tab')" >
@@ -396,6 +415,10 @@ const onColor = () => {
396
415
min-width : 5.5rem ;
397
416
}
398
417
418
+ .loading-bar {
419
+ width : 10rem ;
420
+ }
421
+
399
422
.hidden-form-item {
400
423
max-height : 0 ;
401
424
overflow : hidden ;
0 commit comments