Merge branch 'review-fix/pr127' into integration/prs-local-test-20260913
# Conflicts: # .github/workflows/linux-lua.yml
This commit is contained in:
commit
21c12e0fbf
17 files changed
+171
-59
No files matched your search
@@ -941,6 +941,9 @@ pub struct RuntimeSettings {
|
||||
/// 系统外观变化时自动在主题家族的深浅成员间切换(默认关,尊重显式选择)。
|
||||
pub follow_system_theme: bool,
|
||||
pub font_family: Option<String>,
|
||||
pub font_family_cjk: Option<String>,
|
||||
pub ui_font_family: Option<String>,
|
||||
pub ui_font_size_px: Option<f32>,
|
||||
/// **逻辑像素**(旧壳写盘语义:设置页 spinner 与 Ctrl+滚轮缩放持久化时
|
||||
/// 已除以 scale factor)。`None` = 跟随 nebula.toml 的 `font.size`(pt)。
|
||||
pub font_size_px: Option<f32>,
|
||||
@@ -1083,6 +1086,9 @@ impl RuntimeSettings {
|
||||
.unwrap_or_default(),
|
||||
follow_system_theme: raw.bool_on("follow_system_theme").unwrap_or(false),
|
||||
font_family: raw.value("font_family").map(str::to_owned),
|
||||
font_family_cjk: raw.value("font_family_cjk").map(str::to_owned),
|
||||
ui_font_family: raw.value("ui_font_family").map(str::to_owned),
|
||||
ui_font_size_px: raw.f32("ui_font_size").map(|size| size.clamp(10.0, 24.0)),
|
||||
font_size_px: raw.f32("font_size").map(|size| size.clamp(4.0, 96.0)),
|
||||
cursor_shape: raw.value("cursor_shape").and_then(CursorShapeName::from_settings),
|
||||
cursor_blink: raw.bool_on("cursor_blink"),
|
||||
@@ -1308,6 +1314,9 @@ mod tests {
|
||||
completion_style=popup\n\
|
||||
shell=pwsh\n\
|
||||
font_family=Maple Mono Normal NF CN\n\
|
||||
ui_font_family=Arial\n\
|
||||
ui_font_size=18\n\
|
||||
font_family_cjk=PingFang SC\n\
|
||||
font_size=16.3\n\
|
||||
cursor_shape=beam\n\
|
||||
cursor_blink=1\n\
|
||||
@@ -1343,6 +1352,9 @@ mod tests {
|
||||
assert_eq!(settings.language, LanguagePref::ZhCn);
|
||||
assert_eq!(settings.theme, ThemeName::SilverLight);
|
||||
assert_eq!(settings.font_family.as_deref(), Some("Maple Mono Normal NF CN"));
|
||||
assert_eq!(settings.font_family_cjk.as_deref(), Some("PingFang SC"));
|
||||
assert_eq!(settings.ui_font_family.as_deref(), Some("Arial"));
|
||||
assert_eq!(settings.ui_font_size_px, Some(18.0));
|
||||
// font_size 键存的是逻辑像素(旧壳写盘语义),不做 pt 换算。
|
||||
assert_eq!(settings.font_size_px, Some(16.3));
|
||||
assert_eq!(settings.cursor_shape, Some(CursorShapeName::Beam));
|
||||
@@ -1386,6 +1398,9 @@ mod tests {
|
||||
assert_eq!(settings.language, LanguagePref::System);
|
||||
assert_eq!(settings.theme, ThemeName::Nord);
|
||||
assert_eq!(settings.font_family, None);
|
||||
assert_eq!(settings.font_family_cjk, None);
|
||||
assert_eq!(settings.ui_font_family, None);
|
||||
assert_eq!(settings.ui_font_size_px, None);
|
||||
assert!(!settings.copy_on_select);
|
||||
assert!(settings.multiline_paste_confirm, "多行粘贴确认默认开(上游兼容)");
|
||||
assert!(settings.tab_close_visible, "标签关闭按钮默认可见(上游兼容)");
|
||||
|
||||
@@ -10,6 +10,9 @@ const RESET_KEYS: &[&str] = &[
|
||||
"app_icon",
|
||||
"follow_system_theme",
|
||||
"font_family",
|
||||
"font_family_cjk",
|
||||
"ui_font_family",
|
||||
"ui_font_size",
|
||||
"font_size",
|
||||
"cursor_shape",
|
||||
"cursor_blink",
|
||||
|
||||
Reference in new issue
Block a user