From 9bc19cf3b0da342f1bfb55cb7fe440b0a64099f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=89=91=E5=87=9B?= <2993354@qq.com> Date: Wed, 17 Jun 2026 17:39:38 +0800 Subject: [PATCH] fix: apply editor font to document preview --- .../src/components/document/DocumentBrowser.vue | 12 ++++++++++-- apps/desktop/src/lib/documentViewerFontStyle.ts | 11 +++++++++++ .../app-tests/documentViewerFontStyle.test.ts | 17 +++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 apps/desktop/src/lib/documentViewerFontStyle.ts create mode 100644 packages/app-tests/documentViewerFontStyle.test.ts diff --git a/apps/desktop/src/components/document/DocumentBrowser.vue b/apps/desktop/src/components/document/DocumentBrowser.vue index 5cbb861a62..fcdc063f4e 100644 --- a/apps/desktop/src/components/document/DocumentBrowser.vue +++ b/apps/desktop/src/components/document/DocumentBrowser.vue @@ -14,6 +14,7 @@ import DataGrid from "@/components/grid/DataGrid.vue"; import QueryLoadingState from "@/components/common/QueryLoadingState.vue"; import * as api from "@/lib/api"; import { clampSearchSplitWidth } from "@/lib/dataGridSearchSplit"; +import { documentViewerFontStyle } from "@/lib/documentViewerFontStyle"; import { buildDocumentFilterCondition, combineDocumentFilterConditions, currentDocumentFilterJson, defaultDocumentFilterRule, documentFilterModeNeedsValue, documentFilterModeOptions, documentStoreProviderFor, type DocumentFilterMode, type DocumentFilterRule } from "@/lib/documentStoreProvider"; import { normalizeResultPageSize } from "@/lib/paginationPageSize"; import { useSettingsStore } from "@/stores/settingsStore"; @@ -73,6 +74,7 @@ const tableFindPaneStyle = computed(() => { if (tableFindPaneWidth.value == null) return {}; return { flex: `0 0 ${tableFindPaneWidth.value}px` }; }); +const documentFontStyle = computed(() => documentViewerFontStyle(settingsStore.editorSettings)); const documentStoreLabels = computed(() => ({ documentsLabel: documentStoreProvider.value.documentsLabel({ total: total.value, t }), queryPreview: documentQueryPreview.value, @@ -1108,7 +1110,7 @@ function resetTableSearchSplitWidth() {
-
+
{
@@ -1120,7 +1122,7 @@ function resetTableSearchSplitWidth() {
-
+              
             
@@ -1137,12 +1139,18 @@ function resetTableSearchSplitWidth() {