Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add icons to the theme type setting #122

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions website/src/views/ViewSettings.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import {
mdiDatabaseImportOutline,
mdiDesktopClassic,
mdiInformationOutline,
mdiKeyOutline,
mdiMessageAlertOutline,
Expand All @@ -10,9 +11,10 @@ import {
mdiTuneVariant,
mdiUpdate,
mdiWeatherNight,
mdiWeatherSunny,
} from '@mdi/js'
import { storeToRefs } from 'pinia'
import { ref } from 'vue'
import { computed, ref } from 'vue'

import SettingsAbout from '@/components/SettingsAbout.vue'
import SettingsBaseAction from '@/components/SettingsBaseAction.vue'
Expand All @@ -25,7 +27,7 @@ import SettingsSelectMenuSnack from '@/components/SettingsSelectMenuSnack.vue'
import SettingsSelectTheme from '@/components/SettingsSelectTheme.vue'
import SettingsSetDataCollection from '@/components/SettingsSetDataCollection.vue'
import SettingsSetMoodleToken from '@/components/SettingsSetMoodleToken.vue'
import { useSettingsStore } from '@/stores/settings'
import { ThemeType, useSettingsStore } from '@/stores/settings'
import {
localizeAccentColorName,
localizeDataCollection,
Expand Down Expand Up @@ -66,6 +68,19 @@ const setMoodleTokenDialog = ref(false)
const aboutDialog = ref(false)
const feedbackDialog = ref(false)

const themeTypeIcon = computed(() => {
switch (themeType.value) {
case ThemeType.System:
return mdiDesktopClassic
case ThemeType.Light:
return mdiWeatherSunny
case ThemeType.Dark:
return mdiWeatherNight
default:
return mdiWeatherNight
}
})

const appVersion = import.meta.env.VITE_VERSION

function updateApp() {
Expand Down Expand Up @@ -129,7 +144,7 @@ function updateApp() {
v-model="selectThemeDialog"
label="Barvna tema"
:messages="localizeThemeType(themeType)"
:icon="mdiWeatherNight"
:icon="themeTypeIcon"
/>

<SettingsBaseAction
Expand Down