add icon size

This commit is contained in:
Dongdong Zhou 2022-10-27 19:31:51 +01:00
parent 62080d1acf
commit 9edfe8b931
2 changed files with 9 additions and 1 deletions

View File

@ -44,6 +44,7 @@ shell = ""
[ui]
font-family = ""
font-size = 13
icon-size = 0
header-height = 35
status-height = 25
tab-min-width = 100

View File

@ -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 {