feat(settings): preview theme and UI fonts on hover
This commit is contained in:
8 files changed
+194
-17
No files matched your search
@@ -118,6 +118,7 @@ import { shouldBlockAppNativeSelectAll } from "@/lib/common/clipboard";
|
||||
import { APP_FONT_SANS_CSS_VAR, DATA_GRID_FONT_FAMILY_CSS_VAR, DEFAULT_DATA_GRID_FONT_FAMILY, DEFAULT_UI_FONT_FAMILY } from "@/lib/app/appFonts";
|
||||
import { DATA_GRID_TYPE_COLOR_KEYS, dataGridTypeColorCssVar, resolveActiveDataGridTypeColors } from "@/lib/dataGrid/dataGridTypeColorScheme";
|
||||
import { rankSavedSqlHistory } from "@/lib/savedSql/savedSqlHistory";
|
||||
import { useUiFontFamilyPreview } from "@/composables/useUiFontFamilyPreview";
|
||||
import { savedSqlErrorMessage } from "@/lib/savedSql/savedSqlErrors";
|
||||
import { savedSqlDefaultTargetForWrite } from "@/lib/savedSql/savedSqlExecutionTarget";
|
||||
import { countActiveUpdateBlockingTasks } from "@/lib/app/appUpdateTaskGuard";
|
||||
@@ -171,6 +172,7 @@ const { t } = useI18n();
|
||||
const connectionStore = useConnectionStore();
|
||||
const queryStore = useQueryStore();
|
||||
const settingsStore = useSettingsStore();
|
||||
const { uiFontFamilyPreview } = useUiFontFamilyPreview();
|
||||
const savedSqlStore = useSavedSqlStore();
|
||||
const promptTemplateStore = usePromptTemplateStore();
|
||||
const recentConnectionIds = ref<readonly string[]>(parseRecentConnectionIds(safeLocalStorageGet(RECENT_CONNECTION_IDS_STORAGE_KEY)));
|
||||
@@ -1128,7 +1130,7 @@ function applyDataGridTypeColors() {
|
||||
}
|
||||
|
||||
const appUiFontFamilyStyle = computed<Record<string, string>>(() => {
|
||||
const fontFamily = settingsStore.editorSettings.uiFontFamily || DEFAULT_UI_FONT_FAMILY;
|
||||
const fontFamily = uiFontFamilyPreview.value || settingsStore.editorSettings.uiFontFamily || DEFAULT_UI_FONT_FAMILY;
|
||||
return {
|
||||
[APP_FONT_SANS_CSS_VAR]: fontFamily,
|
||||
fontFamily: `var(${APP_FONT_SANS_CSS_VAR}, ${DEFAULT_UI_FONT_FAMILY})`,
|
||||
@@ -1189,8 +1191,12 @@ watch(
|
||||
);
|
||||
|
||||
watch(
|
||||
() => settingsStore.editorSettings.uiFontFamily,
|
||||
(fontFamily) => {
|
||||
[() => settingsStore.editorSettings.uiFontFamily, uiFontFamilyPreview],
|
||||
([fontFamily, preview]) => {
|
||||
if (preview) {
|
||||
applyUiFontFamily(preview);
|
||||
return;
|
||||
}
|
||||
applyUiFontFamily(fontFamily);
|
||||
},
|
||||
{ immediate: true },
|
||||
|
||||
Reference in new issue
Block a user