From 8af83bf93f0bb6701c185356ec251d17073c12ec Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 16 Dec 2020 21:56:24 +0100 Subject: [PATCH] Slight tweak of the default `Style` and font sizes --- CHANGELOG.md | 1 + egui/src/paint/fonts.rs | 2 +- egui/src/style.rs | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3986565c..948a5a69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed 🔧 +* Slight tweak of the default `Style` and font sizes. * `SidePanel::left` and `TopPanel::top` now takes `impl Hash` as first argument. * `ui.image` now takes `impl Into` as a `size` argument. * Made some more fields of `RawInput` optional. diff --git a/egui/src/paint/fonts.rs b/egui/src/paint/fonts.rs index 01d3258b..4d952500 100644 --- a/egui/src/paint/fonts.rs +++ b/egui/src/paint/fonts.rs @@ -136,7 +136,7 @@ impl FontDefinitions { family_and_size.insert(TextStyle::Small, (FontFamily::VariableWidth, 10.0)); family_and_size.insert(TextStyle::Body, (FontFamily::VariableWidth, 14.0)); family_and_size.insert(TextStyle::Button, (FontFamily::VariableWidth, 16.0)); - family_and_size.insert(TextStyle::Heading, (FontFamily::VariableWidth, 24.0)); + family_and_size.insert(TextStyle::Heading, (FontFamily::VariableWidth, 20.0)); family_and_size.insert(TextStyle::Monospace, (FontFamily::Monospace, 13.0)); // 13 for `ProggyClean` Self { diff --git a/egui/src/style.rs b/egui/src/style.rs index 66d97b86..0ff47bed 100644 --- a/egui/src/style.rs +++ b/egui/src/style.rs @@ -232,7 +232,7 @@ impl Default for Style { spacing: Spacing::default(), interaction: Interaction::default(), visuals: Visuals::default(), - animation_time: 1.0 / 15.0, + animation_time: 1.0 / 12.0, } } } @@ -241,11 +241,11 @@ impl Default for Spacing { fn default() -> Self { Self { item_spacing: vec2(8.0, 3.0), - window_padding: vec2(6.0, 6.0), + window_padding: vec2(4.0, 4.0), button_padding: vec2(3.0, 1.0), indent: 25.0, interact_size: vec2(40.0, 20.0), - slider_width: 140.0, + slider_width: 100.0, text_edit_width: 280.0, icon_width: 16.0, icon_spacing: 1.0, @@ -294,7 +294,7 @@ impl Default for Widgets { fn default() -> Self { Self { active: WidgetVisuals { - bg_fill: Srgba::black_alpha(128), + bg_fill: Rgba::luminance_alpha(0.10, 0.5).into(), bg_stroke: Stroke::new(2.0, WHITE), corner_radius: 4.0, fg_fill: srgba(120, 120, 200, 255), @@ -315,11 +315,11 @@ impl Default for Widgets { fg_stroke: Stroke::new(1.0, Srgba::gray(200)), // Should NOT look grayed out! }, disabled: WidgetVisuals { - bg_fill: TRANSPARENT, + bg_fill: Rgba::luminance_alpha(0.02, 0.5).into(), bg_stroke: Stroke::new(0.5, Srgba::gray(70)), corner_radius: 4.0, fg_fill: srgba(50, 50, 50, 255), - fg_stroke: Stroke::new(1.0, Srgba::gray(128)), // Should look grayed out + fg_stroke: Stroke::new(1.0, Srgba::gray(140)), // Should look grayed out }, noninteractive: WidgetVisuals { bg_stroke: Stroke::new(1.0, Rgba::white_alpha(0.06)),