From 03f87ade3c106e8e060d0dc655413b6489b56122 Mon Sep 17 00:00:00 2001 From: Dongcheng Lin Date: Sun, 15 Nov 2026 01:11:03 +0900 Subject: [PATCH] feat(app): follow the system accent color and add snap haptics --- crates/app/Cargo.toml | 2 +- crates/app/src/ui/canvas/chrome.rs | 6 +- crates/app/src/ui/canvas/mod.rs | 10 +- crates/app/src/ui/canvas/snap_feedback.rs | 76 +++++++++ crates/app/src/ui/mod.rs | 1 + crates/app/src/ui/properties/sections.rs | 2 +- crates/app/src/ui/settings_dialog/chrome.rs | 9 +- crates/app/src/ui/system_accent.rs | 149 ++++++++++++++++++ crates/app/src/ui/system_accent_tests.rs | 119 ++++++++++++++ .../src/content/docs/reference/preferences.md | 10 +- .../docs/zh-cn/reference/preferences.md | 11 +- 11 files changed, 380 insertions(+), 15 deletions(-) create mode 100644 crates/app/src/ui/canvas/snap_feedback.rs create mode 100644 crates/app/src/ui/system_accent.rs create mode 100644 crates/app/src/ui/system_accent_tests.rs diff --git a/crates/app/Cargo.toml b/crates/app/Cargo.toml index 13d7dee9..b4fcef01 100644 --- a/crates/app/Cargo.toml +++ b/crates/app/Cargo.toml @@ -54,7 +54,7 @@ libc.workspace = true [target.'cfg(target_os = "macos")'.dependencies] muda.workspace = true objc2 = "0.6" -objc2-app-kit = { version = "0.3", default-features = false, features = ["std", "NSWindow", "NSApplication"] } +objc2-app-kit = { version = "0.3", default-features = false, features = ["std", "NSApplication", "NSColor", "NSColorSpace", "NSHapticFeedback", "NSWindow", "objc2-core-foundation"] } objc2-foundation = { version = "0.3", default-features = false, features = ["std", "NSObject", "NSAppleEventManager", "NSAppleEventDescriptor", "NSNotification", "NSString", "NSURL"] } [target.'cfg(windows)'.build-dependencies] diff --git a/crates/app/src/ui/canvas/chrome.rs b/crates/app/src/ui/canvas/chrome.rs index 9f1cbc91..51999dc8 100644 --- a/crates/app/src/ui/canvas/chrome.rs +++ b/crates/app/src/ui/canvas/chrome.rs @@ -71,7 +71,7 @@ fn with_alpha(color: Color32, alpha: u8) -> Color32 { Color32::from_rgba_unmultiplied(color.r(), color.g(), color.b(), alpha) } -fn blend(foreground: Color32, background: Color32, amount: f32) -> Color32 { +pub(crate) fn blend(foreground: Color32, background: Color32, amount: f32) -> Color32 { let mix = |a: u8, b: u8| (a as f32 * (1.0 - amount) + b as f32 * amount).round() as u8; Color32::from_rgb( mix(foreground.r(), background.r()), @@ -80,7 +80,7 @@ fn blend(foreground: Color32, background: Color32, amount: f32) -> Color32 { ) } -fn contrast_adjusted(mut color: Color32, background: Color32, minimum: f32) -> Color32 { +pub(crate) fn contrast_adjusted(mut color: Color32, background: Color32, minimum: f32) -> Color32 { let target = if relative_luminance(background) > 0.45 { Color32::BLACK } else { @@ -95,7 +95,7 @@ fn contrast_adjusted(mut color: Color32, background: Color32, minimum: f32) -> C color } -fn contrast_ratio(a: Color32, b: Color32) -> f32 { +pub(crate) fn contrast_ratio(a: Color32, b: Color32) -> f32 { let (lighter, darker) = if relative_luminance(a) >= relative_luminance(b) { (relative_luminance(a), relative_luminance(b)) } else { diff --git a/crates/app/src/ui/canvas/mod.rs b/crates/app/src/ui/canvas/mod.rs index 4ce90ff5..356f1266 100644 --- a/crates/app/src/ui/canvas/mod.rs +++ b/crates/app/src/ui/canvas/mod.rs @@ -37,7 +37,7 @@ mod board_marquee; mod board_notes; mod board_sheet; mod breadcrumb; -mod chrome; +pub(super) mod chrome; mod craft_regions; mod craft_results; mod cursors; @@ -70,6 +70,7 @@ mod regions; mod render_detail; mod slices; mod snap; +mod snap_feedback; mod spotlight; mod symmetry; mod tiling; @@ -167,7 +168,11 @@ pub fn render_central(app: &mut PlotiumApp, ui: &mut Ui) { let rect = geometry.board_rect; let painter = painter.with_clip_rect(rect); store_navigation_rect(ui.ctx(), rect); - let chrome = ChromeStyle::from_visuals(ui.visuals(), app.settings.appearance.canvas_accent); + let accent = app.settings.appearance.canvas_accent.unwrap_or_else(|| { + let accent = super::system_accent::canvas_default(ui.ctx(), ui.visuals()); + [accent.r(), accent.g(), accent.b()] + }); + let chrome = ChromeStyle::from_visuals(ui.visuals(), Some(accent)); consume_board_reveal(app, ui.ctx()); drive_board_fit(app, ui, &geometry); @@ -258,6 +263,7 @@ pub fn render_central(app: &mut PlotiumApp, ui: &mut Ui) { } } } + snap_feedback::update(ui.ctx(), &app.session.ui.snap_guides); // A tile drop may remove the now-empty source canvas and switch focus to the // target in the same UI pass. Refresh both values before any post-interaction // painting; the old index can otherwise refer to a different canvas or be out diff --git a/crates/app/src/ui/canvas/snap_feedback.rs b/crates/app/src/ui/canvas/snap_feedback.rs new file mode 100644 index 00000000..64989fa8 --- /dev/null +++ b/crates/app/src/ui/canvas/snap_feedback.rs @@ -0,0 +1,76 @@ +//! Trackpad feedback when a drag snaps to an alignment guide. +//! +//! The guide lines are the feedback on every platform; macOS adds a haptic tap +//! through `NSHapticFeedbackManager`, which does nothing without a Force Touch +//! trackpad. + +use egui::{Context, Id}; +use plotium_core::layout::SnapGuide; + +const SHOWN: &str = "plotium_snap_feedback_guides"; + +/// Compares the guides left after this frame's interaction handling with those +/// of the previous frame. Interaction code may set and clear guides within one +/// frame, so only the settled result is compared. +pub(super) fn update(ctx: &Context, guides: &[SnapGuide]) { + let previous = ctx.data_mut(|data| { + let previous = data.get_temp::>(Id::new(SHOWN)); + if previous.as_deref() != Some(guides) { + data.insert_temp(Id::new(SHOWN), guides.to_vec()); + } + previous.unwrap_or_default() + }); + if newly_engaged(&previous, guides) { + platform::alignment(); + } +} + +/// A guide that was not showing has appeared. Holding a snap keeps the same +/// guide, so one engagement gives one tap. +fn newly_engaged(previous: &[SnapGuide], current: &[SnapGuide]) -> bool { + current.iter().any(|guide| !previous.contains(guide)) +} + +#[cfg(target_os = "macos")] +mod platform { + use objc2_app_kit::{ + NSHapticFeedbackManager, NSHapticFeedbackPattern, NSHapticFeedbackPerformanceTime, + NSHapticFeedbackPerformer, + }; + + pub(super) fn alignment() { + NSHapticFeedbackManager::defaultPerformer().performFeedbackPattern_performanceTime( + NSHapticFeedbackPattern::Alignment, + NSHapticFeedbackPerformanceTime::DrawCompleted, + ); + } +} + +#[cfg(not(target_os = "macos"))] +mod platform { + pub(super) fn alignment() {} +} + +#[cfg(test)] +mod tests { + use super::*; + + fn guide(vertical: bool, pos: f32) -> SnapGuide { + SnapGuide { vertical, pos } + } + + #[test] + fn engaging_a_guide_fires_once_while_it_is_held() { + let x = guide(true, 72.0); + assert!(newly_engaged(&[], &[x])); + assert!(!newly_engaged(&[x], &[x])); + assert!(!newly_engaged(&[x], &[])); + } + + #[test] + fn a_second_axis_or_a_different_line_fires_again() { + let x = guide(true, 72.0); + assert!(newly_engaged(&[x], &[x, guide(false, 36.0)])); + assert!(newly_engaged(&[x], &[guide(true, 144.0)])); + } +} diff --git a/crates/app/src/ui/mod.rs b/crates/app/src/ui/mod.rs index 4e3fe30d..1cb2f136 100644 --- a/crates/app/src/ui/mod.rs +++ b/crates/app/src/ui/mod.rs @@ -53,6 +53,7 @@ mod settings_dialog; mod shortcuts; mod sidebars; mod switcher; +mod system_accent; #[cfg(not(target_os = "macos"))] mod title_bar; pub(crate) mod tools; diff --git a/crates/app/src/ui/properties/sections.rs b/crates/app/src/ui/properties/sections.rs index 804ffe3a..d7ebf1cf 100644 --- a/crates/app/src/ui/properties/sections.rs +++ b/crates/app/src/ui/properties/sections.rs @@ -511,7 +511,7 @@ fn render_section( .iter_mut() .find(|row| row.presentation.id == app_preferences::ACCENT_COLOR) { - let theme = ui.visuals().selection.bg_fill; + let theme = crate::ui::system_accent::canvas_default(ui.ctx(), ui.visuals()); let color = PropertyValue::Color(plotium_figure::Color::rgb(theme.r(), theme.g(), theme.b())); row.set.value = AggregateValue::Uniform(color.clone()); diff --git a/crates/app/src/ui/settings_dialog/chrome.rs b/crates/app/src/ui/settings_dialog/chrome.rs index f27bed25..e064f4b5 100644 --- a/crates/app/src/ui/settings_dialog/chrome.rs +++ b/crates/app/src/ui/settings_dialog/chrome.rs @@ -7,6 +7,8 @@ use egui_phosphor::regular as icon; use plotium_core::settings::ThemeMode; use plotium_core::state::{SettingsCategory, SettingsDialog}; +use crate::ui::system_accent; + #[derive(Clone, Copy, Debug, PartialEq, Eq)] struct ChromeGeometry { control: u8, @@ -74,9 +76,11 @@ pub(crate) fn apply_chrome_theme(ctx: &egui::Context, mode: ThemeMode) { ThemeMode::Dark => egui::ThemePreference::Dark, }; ctx.set_theme(pref); + let accent = system_accent::read(); for theme in [egui::Theme::Light, egui::Theme::Dark] { ctx.style_mut_of(theme, |style| { apply_chrome_geometry(style, ChromeGeometry::current()); + system_accent::apply(&mut style.visuals, accent); // Disabled widgets keep the normal button fill and fade only via // `disabled_alpha`. Stock egui swaps in the near-panel // `noninteractive` fill, which makes light-theme buttons *brighten* @@ -88,12 +92,15 @@ pub(crate) fn apply_chrome_theme(ctx: &egui::Context, mode: ThemeMode) { ctx.data_mut(|data| { data.insert_temp(egui::Id::new("plotium_applied_chrome_theme"), mode); }); + system_accent::record(ctx, accent); } pub(crate) fn sync_chrome_theme(ctx: &egui::Context, mode: ThemeMode) { let applied = ctx.data(|data| data.get_temp::(egui::Id::new("plotium_applied_chrome_theme"))); - if applied != Some(mode) { + let accent_changed = + system_accent::regained_focus(ctx) && system_accent::read() != system_accent::applied(ctx); + if applied != Some(mode) || accent_changed { apply_chrome_theme(ctx, mode); } } diff --git a/crates/app/src/ui/system_accent.rs b/crates/app/src/ui/system_accent.rs new file mode 100644 index 00000000..d2171e58 --- /dev/null +++ b/crates/app/src/ui/system_accent.rs @@ -0,0 +1,149 @@ +//! The operating system's accent colour, applied to selection chrome. +//! +//! macOS and Windows expose a user-chosen accent; Linux has no portable source, +//! so it keeps egui's stock blue. The accent is re-read whenever the window +//! regains focus, which is how a change made in System Settings arrives. + +use egui::{Color32, Context, Id, Visuals}; + +use super::canvas::chrome::{blend, contrast_adjusted, contrast_ratio}; + +const APPLIED: &str = "plotium_applied_system_accent"; +const FOCUSED: &str = "plotium_system_accent_window_focused"; + +/// Selected text and selected-row labels are body text. +const SELECTED_TEXT_CONTRAST: f32 = 4.5; +/// Keeps a selected row distinguishable from the panel; egui's stock fills +/// sit around 1.5. +const FILL_CONTRAST: f32 = 1.3; +/// Matches the contrast of egui's stock link colour, which also tints Ribbon +/// glyphs, so a system accent never reads weaker than the default. +const LINK_CONTRAST: f32 = 3.0; + +/// Reads the platform accent. `None` keeps egui's defaults. +pub(crate) fn read() -> Option { + platform::read() +} + +/// The accent the chrome was last styled with. +pub(crate) fn applied(ctx: &Context) -> Option { + ctx.data(|data| data.get_temp::>(Id::new(APPLIED))) + .flatten() +} + +/// What canvas chrome follows when no `canvas_accent` is set: the system +/// accent, else the theme's selection fill. +pub(crate) fn canvas_default(ctx: &Context, visuals: &Visuals) -> Color32 { + applied(ctx).unwrap_or(visuals.selection.bg_fill) +} + +pub(super) fn record(ctx: &Context, accent: Option) { + ctx.data_mut(|data| data.insert_temp(Id::new(APPLIED), accent)); +} + +/// True on the first frame after the window regains focus. +pub(super) fn regained_focus(ctx: &Context) -> bool { + let focused = ctx.input(|input| input.focused); + let previous = ctx.data_mut(|data| { + let previous = data.get_temp::(Id::new(FOCUSED)); + data.insert_temp(Id::new(FOCUSED), focused); + previous + }); + focused && previous == Some(false) +} + +/// Styles selection and link colours from `accent`, or restores egui's +/// defaults when there is none. +pub(super) fn apply(visuals: &mut Visuals, accent: Option) { + let stock = if visuals.dark_mode { + Visuals::dark() + } else { + Visuals::light() + }; + let Some(accent) = accent else { + visuals.selection = stock.selection; + visuals.hyperlink_color = stock.hyperlink_color; + return; + }; + let background = visuals.panel_fill; + let tint = if visuals.dark_mode { + blend(accent, background, 0.45) + } else { + blend(accent, background, 0.6) + }; + // A near-white or near-black custom accent would otherwise vanish into the + // panel and hide which row is selected. + let fill = contrast_adjusted(tint, background, FILL_CONTRAST); + let label_seed = if visuals.dark_mode { + blend(accent, Color32::WHITE, 0.7) + } else { + accent + }; + visuals.selection.bg_fill = fill; + visuals.selection.stroke.color = readable_on(label_seed, fill, SELECTED_TEXT_CONTRAST); + visuals.hyperlink_color = contrast_adjusted(accent, background, LINK_CONTRAST); +} + +/// `contrast_adjusted` stops after a fixed number of steps; fall back to black +/// or white so selected text is always readable on a mid-tone accent fill. +fn readable_on(seed: Color32, background: Color32, minimum: f32) -> Color32 { + let adjusted = contrast_adjusted(seed, background, minimum); + if contrast_ratio(adjusted, background) >= minimum { + return adjusted; + } + if contrast_ratio(Color32::BLACK, background) >= contrast_ratio(Color32::WHITE, background) { + Color32::BLACK + } else { + Color32::WHITE + } +} + +#[cfg(target_os = "macos")] +mod platform { + use egui::Color32; + use objc2_app_kit::{NSColor, NSColorSpace}; + + pub(super) fn read() -> Option { + // `controlAccentColor` is a dynamic colour whose space is unspecified; + // components are only defined after converting to a concrete space. + let color = + NSColor::controlAccentColor().colorUsingColorSpace(&NSColorSpace::sRGBColorSpace())?; + let channel = |value: f64| (value.clamp(0.0, 1.0) * 255.0).round() as u8; + Some(Color32::from_rgb( + channel(color.redComponent()), + channel(color.greenComponent()), + channel(color.blueComponent()), + )) + } +} + +#[cfg(windows)] +mod platform { + use egui::Color32; + use windows_sys::Win32::Graphics::Dwm::DwmGetColorizationColor; + + pub(super) fn read() -> Option { + let mut color = 0_u32; + let mut opaque = 0; + // SAFETY: both out-pointers refer to live locals for the call. + let result = unsafe { DwmGetColorizationColor(&mut color, &mut opaque) }; + if result < 0 { + log::warn!("Reading the Windows accent colour failed: HRESULT {result:#x}"); + return None; + } + // 0xAARRGGBB; the alpha is DWM's glass opacity, not part of the accent. + let [_, r, g, b] = color.to_be_bytes(); + Some(Color32::from_rgb(r, g, b)) + } +} + +#[cfg(not(any(target_os = "macos", windows)))] +mod platform { + pub(super) fn read() -> Option { + None + } +} + +#[cfg(test)] +#[path = "system_accent_tests.rs"] +mod tests; diff --git a/crates/app/src/ui/system_accent_tests.rs b/crates/app/src/ui/system_accent_tests.rs new file mode 100644 index 00000000..1971c2df --- /dev/null +++ b/crates/app/src/ui/system_accent_tests.rs @@ -0,0 +1,119 @@ +use super::*; + +/// macOS accent choices (light and dark variants), Windows' default, and +/// extremes a custom Windows accent can reach. +const ACCENTS: [[u8; 3]; 14] = [ + [0, 122, 255], + [10, 132, 255], + [175, 82, 222], + [255, 45, 85], + [255, 59, 48], + [255, 149, 0], + [255, 204, 0], + [40, 205, 65], + [142, 142, 147], + [0, 120, 212], + [255, 255, 255], + [0, 0, 0], + [128, 128, 128], + [0, 255, 255], +]; + +fn themes() -> [Visuals; 2] { + [Visuals::light(), Visuals::dark()] +} + +#[test] +fn selected_text_stays_readable_for_every_accent() { + for [r, g, b] in ACCENTS { + for mut visuals in themes() { + apply(&mut visuals, Some(Color32::from_rgb(r, g, b))); + let ratio = contrast_ratio(visuals.selection.stroke.color, visuals.selection.bg_fill); + assert!( + ratio >= SELECTED_TEXT_CONTRAST, + "accent {r},{g},{b} dark={} gives {ratio:.2}", + visuals.dark_mode + ); + } + } +} + +#[test] +fn links_keep_the_stock_contrast_for_every_accent() { + for [r, g, b] in ACCENTS { + for mut visuals in themes() { + apply(&mut visuals, Some(Color32::from_rgb(r, g, b))); + let ratio = contrast_ratio(visuals.hyperlink_color, visuals.panel_fill); + assert!( + ratio >= LINK_CONTRAST, + "accent {r},{g},{b} dark={} gives {ratio:.2}", + visuals.dark_mode + ); + } + } +} + +#[test] +fn the_selection_fill_stands_out_from_the_panel_for_every_accent() { + for [r, g, b] in ACCENTS { + for mut visuals in themes() { + apply(&mut visuals, Some(Color32::from_rgb(r, g, b))); + let ratio = contrast_ratio(visuals.selection.bg_fill, visuals.panel_fill); + assert!( + ratio >= FILL_CONTRAST, + "accent {r},{g},{b} dark={} gives {ratio:.2}", + visuals.dark_mode + ); + } + } +} + +#[test] +fn the_selection_fill_carries_the_accent_hue() { + let blue = Color32::from_rgb(0, 122, 255); + for mut visuals in themes() { + apply(&mut visuals, Some(blue)); + let fill = visuals.selection.bg_fill; + assert!(fill.b() > fill.r() && fill.b() > fill.g(), "{fill:?}"); + } +} + +#[test] +fn no_accent_restores_the_stock_colours() { + for stock in themes() { + let mut visuals = stock.clone(); + apply(&mut visuals, Some(Color32::from_rgb(255, 59, 48))); + apply(&mut visuals, None); + assert_eq!(visuals.selection, stock.selection); + assert_eq!(visuals.hyperlink_color, stock.hyperlink_color); + } +} + +#[test] +fn reapplying_the_same_accent_is_stable() { + let accent = Some(Color32::from_rgb(175, 82, 222)); + for mut visuals in themes() { + apply(&mut visuals, accent); + let first = visuals.clone(); + apply(&mut visuals, accent); + assert_eq!(visuals, first); + } +} + +#[test] +fn focus_regain_fires_once_per_transition() { + let ctx = Context::default(); + let frame = |focused: bool| { + let input = egui::RawInput { + focused, + ..Default::default() + }; + let mut fired = false; + let _ = ctx.run_ui(input, |ui| fired = regained_focus(ui.ctx())); + fired + }; + assert!(!frame(true), "the first frame has no previous focus state"); + assert!(!frame(false)); + assert!(frame(true)); + assert!(!frame(true)); +} diff --git a/docs/src/content/docs/reference/preferences.md b/docs/src/content/docs/reference/preferences.md index 3b64bdc9..d857dec6 100644 --- a/docs/src/content/docs/reference/preferences.md +++ b/docs/src/content/docs/reference/preferences.md @@ -17,7 +17,8 @@ saved preferences except your recent-files list. AI connection preferences are d - **Object snapping** — snap plots and shapes to page and object guides, and snap whole pages and table sheets to nearby frame edges and the standard gap between frames. You can also toggle this from the **Arrange** tab. Hold `Alt` to - bypass snapping for one drag. + bypass snapping for one drag. On macOS, a Force Touch trackpad also gives a + light tap when a plot or shape snaps to a guide. - **Equal scale for homonuclear 2D imports** — when both axes are frequency axes of the same nucleus, start an imported spectrum with equal F1/F2 scale if the wider range is no more than twice the narrower range. The imported @@ -40,10 +41,13 @@ saved preferences except your recent-files list. AI connection preferences are d - **Chrome theme** — light, dark, or follow the system appearance. This styles the application window; the look of your figures is set per canvas - with canvas themes. + with canvas themes. On macOS and Windows, selections and highlights use the + system accent color and update when you return to Plotium after changing it; + Linux uses Plotium's default blue. - **Canvas accent** — the color of selection outlines and handles, the layout grid, margin guides, and drag-to-tile previews. Pick a color, or use **Follow - theme** to take it from the chrome theme. Snap guides keep a contrasting + theme** to take it from the system accent color (macOS and Windows) or the + chrome theme. Snap guides keep a contrasting color of their own so they stay distinct, and figure content and exported colors are never affected. - **UI scale** — the size of all interface text and controls, per display. diff --git a/docs/src/content/docs/zh-cn/reference/preferences.md b/docs/src/content/docs/zh-cn/reference/preferences.md index 7e5ab38f..b69eca3e 100644 --- a/docs/src/content/docs/zh-cn/reference/preferences.md +++ b/docs/src/content/docs/zh-cn/reference/preferences.md @@ -14,7 +14,8 @@ AI 连接启用状态和权限会持久保存,详见下文。 显示短暂提醒。可以恢复跟随、忽略本次提醒或关闭后续提醒;关闭后成果计数和错误提示仍然保留。 - **Object snapping**——让图形和形状吸附到页面与对象参考线,并让整个页面和 数据表吸附到邻近框架的边缘及框架间的标准间距。也可在 **Arrange** 页签中切换。按住 - `Alt` 可仅为本次拖动绕过吸附。 + `Alt` 可仅为本次拖动绕过吸附。在 macOS 上,图形或形状吸附到参考线时, + Force Touch 触控板还会轻震一下。 - **Equal scale for homonuclear 2D imports**——导入两个坐标轴均为同一种 频率单位且核种相同的 2D 谱时,若较宽轴不超过较窄轴的 2 倍,则初始使用 F1/F2 等比例坐标。即使之后更改此偏好设置,已导入的图仍会保留原设置; @@ -32,10 +33,12 @@ AI 连接启用状态和权限会持久保存,详见下文。 ## Appearance(外观) - **Chrome theme**——浅色、深色或跟随系统。它设置的是应用窗口的外观; - 图形本身的外观由各画布的画布主题决定。 + 图形本身的外观由各画布的画布主题决定。在 macOS 和 Windows 上,选中和高亮 + 使用系统强调色,更改后回到 Plotium 即更新;Linux 使用 Plotium 默认的蓝色。 - **Canvas accent**——选择框与控制柄、布局网格、页边距参考线和拖放平铺 - 预览的颜色。可自选颜色,也可用 **Follow theme** 跟随应用主题。吸附 - 参考线始终使用另一种对比色以便区分;图形内容和导出配色不受影响。 + 预览的颜色。可自选颜色,也可用 **Follow theme** 跟随系统强调色(macOS + 和 Windows)或应用主题。吸附参考线始终使用另一种对比色以便区分;图形 + 内容和导出配色不受影响。 - **UI scale**——界面文字和控件的大小,按显示器分别设置。自动模式根据 显示器报告的像素密度选择物理上可读的尺寸;手动选项和 `Ctrl` + `+` / `Ctrl` + `-` 快捷键只覆盖当前显示器。