Add Visuals::menu_rounding

This commit is contained in:
Emil Ernerfeldt 2022-12-13 15:44:27 +01:00
parent 4a72abc8ec
commit 0ba2d8ca1d
2 changed files with 14 additions and 7 deletions

View file

@ -72,7 +72,7 @@ impl Frame {
pub fn menu(style: &Style) -> Self {
Self {
inner_margin: style.spacing.menu_margin,
rounding: style.visuals.widgets.noninteractive.rounding,
rounding: style.visuals.menu_rounding,
shadow: style.visuals.popup_shadow,
fill: style.visuals.window_fill(),
stroke: style.visuals.window_stroke(),
@ -82,8 +82,8 @@ impl Frame {
pub fn popup(style: &Style) -> Self {
Self {
inner_margin: style.spacing.window_margin,
rounding: style.visuals.widgets.noninteractive.rounding,
inner_margin: style.spacing.menu_margin,
rounding: style.visuals.menu_rounding,
shadow: style.visuals.popup_shadow,
fill: style.visuals.window_fill(),
stroke: style.visuals.window_stroke(),

View file

@ -471,6 +471,8 @@ pub struct Visuals {
pub window_fill: Color32,
pub window_stroke: Stroke,
pub menu_rounding: Rounding,
/// Panel background color
pub panel_fill: Color32,
@ -722,6 +724,8 @@ impl Visuals {
window_fill: Color32::from_gray(27),
window_stroke: Stroke::new(1.0, Color32::from_gray(60)),
menu_rounding: Rounding::same(6.0),
panel_fill: Color32::from_gray(27),
popup_shadow: Shadow::small_dark(),
@ -1243,6 +1247,8 @@ impl Visuals {
window_fill,
window_stroke,
menu_rounding,
panel_fill,
popup_shadow,
@ -1267,14 +1273,15 @@ impl Visuals {
});
ui.collapsing("Window", |ui| {
// Common shortcuts
ui_color(ui, window_fill, "Fill");
stroke_ui(ui, window_stroke, "Outline");
rounding_ui(ui, window_rounding);
shadow_ui(ui, window_shadow, "Shadow");
shadow_ui(ui, popup_shadow, "Shadow (small menus and popups)");
});
ui.collapsing("Menus and popups", |ui| {
rounding_ui(ui, menu_rounding);
shadow_ui(ui, popup_shadow, "Shadow");
});
ui.collapsing("Widgets", |ui| widgets.ui(ui));