diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index fd3fb8505..17611090d 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -9,6 +9,7 @@ "core:default", "core:window:allow-show", "core:window:allow-hide", + "core:window:allow-set-theme", "dialog:default", "dialog:allow-save", "dialog:allow-open", diff --git a/src/App.vue b/src/App.vue index 7f19ca192..e5d96ebc3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -20,6 +20,7 @@ import { useConnectionStore } from "@/stores/connectionStore"; import { useQueryStore } from "@/stores/queryStore"; import { useHistoryStore } from "@/stores/historyStore"; import { setLocale, currentLocale, type Locale } from "@/i18n"; +import { getCurrentWindow, type Theme } from "@tauri-apps/api/window"; import * as api from "@/lib/tauri"; const { t } = useI18n(); @@ -187,6 +188,7 @@ const isDark = ref(localStorage.getItem("dbx-theme") === "dark"); function applyTheme() { document.documentElement.classList.toggle("dark", isDark.value); + getCurrentWindow().setTheme(isDark.value ? "dark" as Theme : "light" as Theme); } function toggleTheme() { diff --git a/src/components/grid/DataGrid.vue b/src/components/grid/DataGrid.vue index f1b0fe77e..a57c97d06 100644 --- a/src/components/grid/DataGrid.vue +++ b/src/components/grid/DataGrid.vue @@ -315,6 +315,10 @@ function onEditKeydown(e: KeyboardEvent) { function addRow() { newRows.value.push(props.result.columns.map(() => null)); + nextTick(() => { + const el = getScrollerElement(); + if (el) el.scrollTop = el.scrollHeight; + }); } function deleteSelectedRow() {