-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Libertai/enh/darkmode
- dark mode - persistent storage for personas - persistent settings - enhanced UX
- Loading branch information
Showing
30 changed files
with
464 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<template> | ||
<q-btn-dropdown | ||
:label="modelsStore.selectedModel.name.substring(0, 12) + '..'" | ||
class="text-semibold icon-md border-primary-highlight" | ||
dropdown-icon="img:icons/svg/chevron-down_lighten.svg" | ||
size="md" | ||
color="primary" | ||
no-caps | ||
rounded | ||
unelevated | ||
> | ||
<q-list> | ||
<q-item | ||
v-for="model in modelsStore.models" | ||
:key="model.id" | ||
v-close-popup | ||
clickable | ||
@click="modelsStore.setModel(model)" | ||
> | ||
<q-item-section> | ||
<q-item-label> | ||
{{ model.name }} | ||
</q-item-label> | ||
</q-item-section> | ||
</q-item> | ||
</q-list> | ||
</q-btn-dropdown> | ||
<!-- | ||
<q-btn-dropdown | ||
:icon="$q.screen.gt.sm ? 'img:icons/svg/engine.svg' : ''" | ||
:label="modelsStore.selectedModel.name.substring(0, 12) + '..'" | ||
class="border-primary-highlight" | ||
color="primary" | ||
no-caps | ||
rounded | ||
text-color="white" | ||
unelevated | ||
> | ||
<q-list> | ||
<q-item | ||
v-for="model in modelsStore.models" | ||
:key="model.id" | ||
v-close-popup | ||
clickable | ||
@click="modelsStore.setModel(model)" | ||
> | ||
<q-item-section> | ||
<q-item-label> | ||
{{ model.name }} | ||
</q-item-label> | ||
</q-item-section> | ||
</q-item> | ||
</q-list> | ||
</q-btn-dropdown> | ||
--> | ||
</template> | ||
|
||
<script setup> | ||
import { useModelsStore } from '../stores/models-store'; | ||
const modelsStore = useModelsStore(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<template> | ||
<q-btn | ||
:icon="darkmode ? 'img:icons/svg/light_mode.svg' : 'img:icons/svg/dark_mode.svg'" | ||
class="q-pa-xs" | ||
flat | ||
@click="darkmode = !darkmode" | ||
/> | ||
</template> | ||
|
||
<script> | ||
import { useSettingsStore } from 'src/stores/settings'; | ||
import { defineComponent, ref, watch } from 'vue'; | ||
import { useQuasar } from 'quasar'; | ||
export default defineComponent({ | ||
name: 'ToggleTheme', | ||
setup() { | ||
const settings = useSettingsStore(); | ||
const $q = useQuasar(); | ||
console.log('settings', settings.darkmode); | ||
const darkmode = ref(settings.darkmode); | ||
$q.dark.set(settings.darkmode); | ||
console.log('Dark mode', $q.dark.isActive); // true, false | ||
watch( | ||
() => darkmode.value, | ||
async (value) => { | ||
console.log('update storage'); | ||
//$q.dark.set(darkmode.value); | ||
$q.dark.set(value); | ||
settings.darkmode = value; | ||
}, | ||
); | ||
return { | ||
darkmode, | ||
}; | ||
}, | ||
}); | ||
</script> |
Oops, something went wrong.