Slight tweak of the default Style and font sizes

This commit is contained in:
Emil Ernerfeldt 2020-12-16 21:56:24 +01:00
parent 709e711364
commit 8af83bf93f
3 changed files with 8 additions and 7 deletions

View file

@ -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<Vec2>` as a `size` argument.
* Made some more fields of `RawInput` optional.

View file

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

View file

@ -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)),