From 7344bb19dc7e90103dec5c6a18feca132eb09a11 Mon Sep 17 00:00:00 2001 From: eezd Date: Wed, 21 Oct 2026 15:57:33 +0800 Subject: [PATCH] Polish sidebar controls, font input and tab menus --- web/src/app/SettingsDialog.vue | 17 +++++++++++++---- web/src/app/Sidebar.vue | 1 - web/src/app/TabBar.vue | 14 ++++++++++---- web/src/app/app.css | 3 +++ web/src/app/settings.ts | 3 +-- 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/web/src/app/SettingsDialog.vue b/web/src/app/SettingsDialog.vue index b332eea..919e3f6 100644 --- a/web/src/app/SettingsDialog.vue +++ b/web/src/app/SettingsDialog.vue @@ -6,7 +6,7 @@ import Icon, { type IconName } from './Icon.vue' import AppearanceSettings from './AppearanceSettings.vue' import PluginsPanel from './PluginsPanel.vue' import { installApp, installPrompt } from './pwa' -import { CONTENT_WIDTHS, FONT_SIZES, TAB_SIZES, loadSettings, settings, updateSettings, type Settings } from './settings' +import { CONTENT_WIDTHS, TAB_SIZES, loadSettings, settings, updateSettings, type Settings } from './settings' import SharePanel from './SharePanel.vue' import TokensPanel from './TokensPanel.vue' import TrashPanel from './TrashPanel.vue' @@ -73,6 +73,17 @@ async function change(patch: Partial) { } } +function changeFont(event: Event) { + const input = event.target as HTMLInputElement + const value = input.valueAsNumber + if (!Number.isFinite(value) || value <= 0) { + toast('字号必须为正数') + input.value = String(settings.fontSize) + return + } + if (value !== settings.fontSize) void change({ fontSize: value }) +} + // ---- 修改登录密码 ---- const pw = ref({ current: '', next: '', confirm: '' }) const pwError = ref('') @@ -119,9 +130,7 @@ async function changePassword() {
字号 - +
正文宽度 diff --git a/web/src/app/Sidebar.vue b/web/src/app/Sidebar.vue index f70f5ec..2298176 100644 --- a/web/src/app/Sidebar.vue +++ b/web/src/app/Sidebar.vue @@ -54,7 +54,6 @@ function onRootDrop(e: DragEvent) {

还没有笔记

-
diff --git a/web/src/app/TabBar.vue b/web/src/app/TabBar.vue index ef3d33e..ae789de 100644 --- a/web/src/app/TabBar.vue +++ b/web/src/app/TabBar.vue @@ -1,5 +1,5 @@