From 9edfe8b931fde5ba0bbfc1d63b02e7927dbc8899 Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Thu, 27 Oct 2022 19:31:51 +0100 Subject: [PATCH] add icon size --- defaults/settings.toml | 1 + lapce-data/src/config.rs | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/defaults/settings.toml b/defaults/settings.toml index 959f57eb..18c3d764 100644 --- a/defaults/settings.toml +++ b/defaults/settings.toml @@ -44,6 +44,7 @@ shell = "" [ui] font-family = "" font-size = 13 +icon-size = 0 header-height = 35 status-height = 25 tab-min-width = 100 diff --git a/lapce-data/src/config.rs b/lapce-data/src/config.rs index bf7fb15f..b49e4349 100644 --- a/lapce-data/src/config.rs +++ b/lapce-data/src/config.rs @@ -451,6 +451,9 @@ pub struct UIConfig { #[field_names(desc = "Set the UI base font size")] font_size: usize, + #[field_names(desc = "Set the icon size in the UI")] + icon_size: usize, + #[field_names( desc = "Set the header height for panel header and editor tab header" )] @@ -496,7 +499,11 @@ pub fn font_size(&self) -> usize { } pub fn icon_size(&self) -> usize { - self.font_size + 2 + if self.icon_size == 0 { + self.font_size() + 2 + } else { + self.icon_size.max(6).min(32) + } } pub fn header_height(&self) -> usize {