feat(segmented-button): Configurable background and hover styling

This commit is contained in:
Michael Aaron Murphy 2022-12-28 19:27:05 +01:00 committed by Ashley Wulber
parent f84410608b
commit 3454483345
3 changed files with 93 additions and 24 deletions

View file

@ -6,16 +6,23 @@ use iced_core::{Background, BorderRadius, Color};
/// The appearance of a [`SegmentedButton`].
#[derive(Clone, Copy)]
pub struct Appearance {
pub background: Option<Background>,
pub border_color: Color,
pub border_radius: BorderRadius,
pub border_width: f32,
pub button_active: ButtonAppearance,
pub button_inactive: ButtonAppearance,
pub button_hover: ButtonAppearance,
}
/// The appearance of a button in the [`SegmentedButton`]
#[derive(Clone, Copy)]
pub struct ButtonAppearance {
pub background: Option<Background>,
pub border_radius: BorderRadius,
pub border_bottom: Option<(f32, Color)>,
pub border_radius_first: BorderRadius,
pub border_radius_middle: BorderRadius,
pub border_radius_last: BorderRadius,
pub text_color: Color,
}