Rename Variant to Style and Style to Appearance

This commit is contained in:
Héctor Ramón Jiménez 2022-05-26 23:07:34 +02:00
parent 7f3b7075db
commit cf0230072c
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
12 changed files with 91 additions and 99 deletions

View file

@ -3,7 +3,7 @@ use iced_core::Color;
/// The appearance of a slider.
#[derive(Debug, Clone, Copy)]
pub struct Style {
pub struct Appearance {
pub rail_colors: (Color, Color),
pub handle: Handle,
}
@ -26,14 +26,14 @@ pub enum HandleShape {
/// A set of rules that dictate the style of a slider.
pub trait StyleSheet {
type Variant: Default + Copy;
type Style: Default + Copy;
/// Produces the style of an active slider.
fn active(&self, variant: Self::Variant) -> Style;
fn active(&self, style: Self::Style) -> Appearance;
/// Produces the style of an hovered slider.
fn hovered(&self, variant: Self::Variant) -> Style;
fn hovered(&self, style: Self::Style) -> Appearance;
/// Produces the style of a slider that is being dragged.
fn dragging(&self, variant: Self::Variant) -> Style;
fn dragging(&self, style: Self::Style) -> Appearance;
}