feat: state platform metrics and chrome in theme
This commit is contained in:
@@ -60,8 +60,15 @@ impl OmarchyTheme {
|
||||
variant: self.variant,
|
||||
accent: self.accent,
|
||||
palette: self.palette,
|
||||
control_radius: None,
|
||||
input_height: None,
|
||||
control_radius: Some(gpui::px(9.)),
|
||||
overlay_radius: Some(gpui::px(15.)),
|
||||
sm_radius: Some(gpui::px(6.)),
|
||||
control_height: Some(gpui::px(34.)),
|
||||
input_height: Some(gpui::px(34.)),
|
||||
menu_item_height: Some(gpui::px(32.)),
|
||||
switch_height: Some(gpui::px(26.)),
|
||||
switch_width: Some(gpui::px(46.)),
|
||||
switch_knob: Some(gpui::px(20.)),
|
||||
titlebar_height: None,
|
||||
root_font_size: None,
|
||||
accessibility,
|
||||
@@ -215,6 +222,23 @@ color15 = \"#635d6f\"
|
||||
assert_eq!(theme.variant, ThemeVariant::Light);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn omarchy_shares_the_gnome_control_metrics() {
|
||||
let theme = OmarchyTheme::parse(TOKYO_NIGHT).expect("parses");
|
||||
let system = theme.into_system(Default::default());
|
||||
|
||||
assert_eq!(system.control_height, Some(gpui::px(34.)));
|
||||
assert_eq!(system.input_height, Some(gpui::px(34.)));
|
||||
assert_eq!(system.menu_item_height, Some(gpui::px(32.)));
|
||||
assert_eq!(system.control_radius, Some(gpui::px(9.)));
|
||||
assert_eq!(system.overlay_radius, Some(gpui::px(15.)));
|
||||
assert_eq!(system.switch_height, Some(gpui::px(26.)));
|
||||
assert_eq!(system.switch_width, Some(gpui::px(46.)));
|
||||
assert_eq!(system.switch_knob, Some(gpui::px(20.)));
|
||||
assert_eq!(system.titlebar_height, None);
|
||||
assert_eq!(system.root_font_size, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn non_toml_text_is_rejected() {
|
||||
assert!(OmarchyTheme::parse("not a theme").is_none());
|
||||
|
||||
Reference in New Issue
Block a user