Skip to content

Commit fceeede

Browse files
authored
More ergonomic settings (#34)
1 parent ed76ac2 commit fceeede

File tree

2 files changed

+45
-49
lines changed

2 files changed

+45
-49
lines changed

src/components/SettingItem.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ defineProps<Props>()
3636
&-title {
3737
color: var(--text);
3838
font-size: 14px;
39+
padding-left: 15px;
3940
}
4041
4142
&-right {

src/pages/SettingsPage.vue

Lines changed: 44 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { useKey } from '../composables/useKey'
1616
import { useTauriEvent } from '../composables/useTauriEvent'
1717
import Separator from '../components/Separator.vue'
1818
import Tooltip from '../components/Tooltip.vue'
19-
import { useElementNavigation } from '../composables/useElementNavigation'
2019
import SlotRef from '../components/SlotRef.vue'
2120
import MenuItems, { menuItem } from '../components/MenuItems.vue'
2221
import Popover from '../components/Popover.vue'
@@ -90,14 +89,6 @@ async function handleUpdateShowSystemNotifications(value: boolean) {
9089
showSystemNotifications.value = value
9190
}
9291
93-
const container = ref<HTMLElement | null>(null)
94-
useElementNavigation({
95-
target: container,
96-
targetQuery: 'button:not(.settings-header-back-button)',
97-
navigateNextHotkey: 'down',
98-
navigatePreviousHotkey: 'up',
99-
})
100-
10192
const selectedColorText = computedEager(() => {
10293
switch (AppStorage.get('colorPreference')) {
10394
case ColorPreference.System:
@@ -150,7 +141,6 @@ function handleScroll(e: Event) {
150141

151142
<template>
152143
<div
153-
ref="container"
154144
class="settings"
155145
@scroll="handleScroll"
156146
>
@@ -187,7 +177,37 @@ function handleScroll(e: Event) {
187177
dot
188178
style="margin-bottom: 20px;"
189179
>
190-
Notifications
180+
Appearance
181+
</PageHeader>
182+
183+
<SettingItem title="Theme">
184+
<SlotRef>
185+
<template #default>
186+
<AppButton>
187+
{{ selectedColorText }}
188+
189+
<template #icon>
190+
<Icons.ChevronDown />
191+
</template>
192+
</AppButton>
193+
</template>
194+
195+
<template #ref="{ el }">
196+
<Popover
197+
:target="el"
198+
:wowerlayOptions="{ position: 'bottom-end' }"
199+
>
200+
<MenuItems :items="selectColorItems" />
201+
</Popover>
202+
</template>
203+
</SlotRef>
204+
</SettingItem>
205+
206+
<PageHeader
207+
dot
208+
style="margin: 20px 0px;"
209+
>
210+
System
191211
</PageHeader>
192212

193213
<SettingItem title="Sounds">
@@ -208,24 +228,6 @@ function handleScroll(e: Event) {
208228

209229
<Separator style="margin: 2px auto" />
210230

211-
<SettingItem title="Show only participating">
212-
<Switch
213-
:modelValue="showOnlyParticipating"
214-
@update:modelValue="showOnlyParticipating = $event"
215-
/>
216-
</SettingItem>
217-
218-
<Separator style="margin: 2px auto" />
219-
220-
<SettingItem title="Show read notifications">
221-
<Switch
222-
:modelValue="showReadNotifications"
223-
@update:modelValue="showReadNotifications = $event"
224-
/>
225-
</SettingItem>
226-
227-
<Separator style="margin: 2px auto" />
228-
229231
<SettingItem title="Show system notifications">
230232
<Switch
231233
:modelValue="showSystemNotifications"
@@ -237,30 +239,23 @@ function handleScroll(e: Event) {
237239
dot
238240
style="margin: 20px 0px;"
239241
>
240-
Appearance
242+
Notifications
241243
</PageHeader>
242244

243-
<SettingItem title="Theme">
244-
<SlotRef>
245-
<template #default>
246-
<AppButton>
247-
{{ selectedColorText }}
245+
<SettingItem title="Show only participating">
246+
<Switch
247+
:modelValue="showOnlyParticipating"
248+
@update:modelValue="showOnlyParticipating = $event"
249+
/>
250+
</SettingItem>
248251

249-
<template #icon>
250-
<Icons.ChevronDown />
251-
</template>
252-
</AppButton>
253-
</template>
252+
<Separator style="margin: 2px auto" />
254253

255-
<template #ref="{ el }">
256-
<Popover
257-
:target="el"
258-
:wowerlayOptions="{ position: 'bottom-end' }"
259-
>
260-
<MenuItems :items="selectColorItems" />
261-
</Popover>
262-
</template>
263-
</SlotRef>
254+
<SettingItem title="Show read notifications">
255+
<Switch
256+
:modelValue="showReadNotifications"
257+
@update:modelValue="showReadNotifications = $event"
258+
/>
264259
</SettingItem>
265260
</div>
266261
</div>

0 commit comments

Comments
 (0)