2026-01-02 14:14:59 +08:00
|
|
|
<template>
|
2026-02-02 13:54:31 +08:00
|
|
|
<MainLayout />
|
2026-02-04 14:14:40 +08:00
|
|
|
<Settings v-if="showSettings" @close="showSettings = false" />
|
2026-01-02 14:14:59 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-02-04 14:14:40 +08:00
|
|
|
import { ref, provide, onMounted } from 'vue';
|
2026-02-02 13:54:31 +08:00
|
|
|
import MainLayout from './layout/MainLayout.vue';
|
2026-02-04 14:14:40 +08:00
|
|
|
import Settings from './components/Settings.vue';
|
|
|
|
|
|
|
|
|
|
const showSettings = ref(false);
|
|
|
|
|
|
|
|
|
|
// Provide to child components
|
|
|
|
|
provide('openSettings', () => { showSettings.value = true; });
|
|
|
|
|
|
|
|
|
|
// Apply saved theme on app startup
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
if (window.electronAPI?.settings) {
|
|
|
|
|
const settings = await window.electronAPI.settings.getAll();
|
|
|
|
|
document.documentElement.setAttribute('data-theme', settings.theme);
|
|
|
|
|
document.documentElement.style.setProperty('--color-accent', settings.accentColor);
|
|
|
|
|
}
|
|
|
|
|
});
|
2026-01-02 14:14:59 +08:00
|
|
|
</script>
|
|
|
|
|
|
2026-02-02 13:54:31 +08:00
|
|
|
<style>
|
|
|
|
|
@import "./styles/main.css";
|
|
|
|
|
</style>
|