Skip to content

Commit aecf7c5

Browse files
committed
remove another special case
1 parent 46403ef commit aecf7c5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

renderer/src/web/Config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,13 @@ function upgradeConfig (_config: Config): Config {
413413
const settings = config.widgets.find(w => w.wmType === 'settings') as widget.Widget
414414
settings.wmTitle = '{icon=fa-cog}'
415415

416+
// make sure icon for settings comes first in the widget menu
417+
config.widgets.sort((a, b) => {
418+
if (a.wmType === 'settings') return -1
419+
if (b.wmType === 'settings') return 1
420+
return 0
421+
})
422+
416423
config.configVersion = 17
417424
}
418425

renderer/src/web/overlay/WidgetMenu.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ export default defineComponent({
7979
const wm = inject<WidgetManager>('wm')!
8080
8181
const widgets = computed(() => {
82-
return [
83-
wm.widgets.value.find(widget => widget.wmType === 'settings')!,
84-
...wm.widgets.value.filter(widget => widget.wmType !== 'settings')
85-
].filter(widget =>
82+
return wm.widgets.value.filter(widget =>
8683
!widget.wmFlags.includes('menu::skip') &&
8784
(props.config.alwaysShow || (widget.wmWants === 'hide'))
8885
).map((widget) => {

0 commit comments

Comments
 (0)