Use f32 for border_width and border_radius
This commit is contained in:
parent
ea1a7248d2
commit
f41eacc3dc
32 changed files with 134 additions and 134 deletions
|
|
@ -6,8 +6,8 @@ use iced_core::{Background, Color, Vector};
|
|||
pub struct Style {
|
||||
pub shadow_offset: Vector,
|
||||
pub background: Option<Background>,
|
||||
pub border_radius: u16,
|
||||
pub border_width: u16,
|
||||
pub border_radius: f32,
|
||||
pub border_width: f32,
|
||||
pub border_color: Color,
|
||||
pub text_color: Color,
|
||||
}
|
||||
|
|
@ -17,8 +17,8 @@ impl std::default::Default for Style {
|
|||
Self {
|
||||
shadow_offset: Vector::default(),
|
||||
background: None,
|
||||
border_radius: 0,
|
||||
border_width: 0,
|
||||
border_radius: 0.0,
|
||||
border_width: 0.0,
|
||||
border_color: Color::TRANSPARENT,
|
||||
text_color: Color::BLACK,
|
||||
}
|
||||
|
|
@ -72,8 +72,8 @@ impl StyleSheet for Default {
|
|||
Style {
|
||||
shadow_offset: Vector::new(0.0, 0.0),
|
||||
background: Some(Background::Color([0.87, 0.87, 0.87].into())),
|
||||
border_radius: 2,
|
||||
border_width: 1,
|
||||
border_radius: 2.0,
|
||||
border_width: 1.0,
|
||||
border_color: [0.7, 0.7, 0.7].into(),
|
||||
text_color: Color::BLACK,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ use iced_core::{Background, Color};
|
|||
pub struct Style {
|
||||
pub background: Background,
|
||||
pub checkmark_color: Color,
|
||||
pub border_radius: u16,
|
||||
pub border_width: u16,
|
||||
pub border_radius: f32,
|
||||
pub border_width: f32,
|
||||
pub border_color: Color,
|
||||
}
|
||||
|
||||
|
|
@ -25,8 +25,8 @@ impl StyleSheet for Default {
|
|||
Style {
|
||||
background: Background::Color(Color::from_rgb(0.95, 0.95, 0.95)),
|
||||
checkmark_color: Color::from_rgb(0.3, 0.3, 0.3),
|
||||
border_radius: 5,
|
||||
border_width: 1,
|
||||
border_radius: 5.0,
|
||||
border_width: 1.0,
|
||||
border_color: Color::from_rgb(0.6, 0.6, 0.6),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ use iced_core::{Background, Color};
|
|||
pub struct Style {
|
||||
pub text_color: Option<Color>,
|
||||
pub background: Option<Background>,
|
||||
pub border_radius: u16,
|
||||
pub border_width: u16,
|
||||
pub border_radius: f32,
|
||||
pub border_width: f32,
|
||||
pub border_color: Color,
|
||||
}
|
||||
|
||||
|
|
@ -16,8 +16,8 @@ impl std::default::Default for Style {
|
|||
Self {
|
||||
text_color: None,
|
||||
background: None,
|
||||
border_radius: 0,
|
||||
border_width: 0,
|
||||
border_radius: 0.0,
|
||||
border_width: 0.0,
|
||||
border_color: Color::TRANSPARENT,
|
||||
}
|
||||
}
|
||||
|
|
@ -36,8 +36,8 @@ impl StyleSheet for Default {
|
|||
Style {
|
||||
text_color: None,
|
||||
background: None,
|
||||
border_radius: 0,
|
||||
border_width: 0,
|
||||
border_radius: 0.0,
|
||||
border_width: 0.0,
|
||||
border_color: Color::TRANSPARENT,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use iced_core::{Background, Color};
|
|||
pub struct Style {
|
||||
pub text_color: Color,
|
||||
pub background: Background,
|
||||
pub border_width: u16,
|
||||
pub border_width: f32,
|
||||
pub border_color: Color,
|
||||
pub selected_text_color: Color,
|
||||
pub selected_background: Background,
|
||||
|
|
@ -16,7 +16,7 @@ impl std::default::Default for Style {
|
|||
Self {
|
||||
text_color: Color::BLACK,
|
||||
background: Background::Color([0.87, 0.87, 0.87].into()),
|
||||
border_width: 1,
|
||||
border_width: 1.0,
|
||||
border_color: [0.7, 0.7, 0.7].into(),
|
||||
selected_text_color: Color::WHITE,
|
||||
selected_background: Background::Color([0.4, 0.4, 1.0].into()),
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ use iced_core::{Background, Color};
|
|||
pub struct Style {
|
||||
pub text_color: Color,
|
||||
pub background: Background,
|
||||
pub border_radius: u16,
|
||||
pub border_width: u16,
|
||||
pub border_radius: f32,
|
||||
pub border_width: f32,
|
||||
pub border_color: Color,
|
||||
pub icon_size: f32,
|
||||
}
|
||||
|
|
@ -17,8 +17,8 @@ impl std::default::Default for Style {
|
|||
Self {
|
||||
text_color: Color::BLACK,
|
||||
background: Background::Color([0.87, 0.87, 0.87].into()),
|
||||
border_radius: 0,
|
||||
border_width: 1,
|
||||
border_radius: 0.0,
|
||||
border_width: 1.0,
|
||||
border_color: [0.7, 0.7, 0.7].into(),
|
||||
icon_size: 0.7,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use iced_core::{Background, Color};
|
|||
pub struct Style {
|
||||
pub background: Background,
|
||||
pub bar: Background,
|
||||
pub border_radius: u16,
|
||||
pub border_radius: f32,
|
||||
}
|
||||
|
||||
/// A set of rules that dictate the style of a progress bar.
|
||||
|
|
@ -21,7 +21,7 @@ impl StyleSheet for Default {
|
|||
Style {
|
||||
background: Background::Color(Color::from_rgb(0.6, 0.6, 0.6)),
|
||||
bar: Background::Color(Color::from_rgb(0.3, 0.9, 0.3)),
|
||||
border_radius: 5,
|
||||
border_radius: 5.0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use iced_core::{Background, Color};
|
|||
pub struct Style {
|
||||
pub background: Background,
|
||||
pub dot_color: Color,
|
||||
pub border_width: u16,
|
||||
pub border_width: f32,
|
||||
pub border_color: Color,
|
||||
}
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ impl StyleSheet for Default {
|
|||
Style {
|
||||
background: Background::Color(Color::from_rgb(0.95, 0.95, 0.95)),
|
||||
dot_color: Color::from_rgb(0.3, 0.3, 0.3),
|
||||
border_width: 1,
|
||||
border_width: 1.0,
|
||||
border_color: Color::from_rgb(0.6, 0.6, 0.6),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ pub struct Style {
|
|||
/// The width (thickness) of the rule line.
|
||||
pub width: u16,
|
||||
/// The radius of the line corners.
|
||||
pub radius: u16,
|
||||
pub radius: f32,
|
||||
/// The [`FillMode`] of the rule.
|
||||
///
|
||||
/// [`FillMode`]: enum.FillMode.html
|
||||
|
|
@ -94,7 +94,7 @@ impl StyleSheet for Default {
|
|||
Style {
|
||||
color: [0.6, 0.6, 0.6, 0.51].into(),
|
||||
width: 1,
|
||||
radius: 0,
|
||||
radius: 0.0,
|
||||
fill_mode: FillMode::Percent(90.0),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ use iced_core::{Background, Color};
|
|||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct Scrollbar {
|
||||
pub background: Option<Background>,
|
||||
pub border_radius: u16,
|
||||
pub border_width: u16,
|
||||
pub border_radius: f32,
|
||||
pub border_width: f32,
|
||||
pub border_color: Color,
|
||||
pub scroller: Scroller,
|
||||
}
|
||||
|
|
@ -15,8 +15,8 @@ pub struct Scrollbar {
|
|||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct Scroller {
|
||||
pub color: Color,
|
||||
pub border_radius: u16,
|
||||
pub border_width: u16,
|
||||
pub border_radius: f32,
|
||||
pub border_width: f32,
|
||||
pub border_color: Color,
|
||||
}
|
||||
|
||||
|
|
@ -40,13 +40,13 @@ impl StyleSheet for Default {
|
|||
fn active(&self) -> Scrollbar {
|
||||
Scrollbar {
|
||||
background: None,
|
||||
border_radius: 5,
|
||||
border_width: 0,
|
||||
border_radius: 5.0,
|
||||
border_width: 0.0,
|
||||
border_color: Color::TRANSPARENT,
|
||||
scroller: Scroller {
|
||||
color: [0.0, 0.0, 0.0, 0.7].into(),
|
||||
border_radius: 5,
|
||||
border_width: 0,
|
||||
border_radius: 5.0,
|
||||
border_width: 0.0,
|
||||
border_color: Color::TRANSPARENT,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,15 +13,15 @@ pub struct Style {
|
|||
pub struct Handle {
|
||||
pub shape: HandleShape,
|
||||
pub color: Color,
|
||||
pub border_width: u16,
|
||||
pub border_width: f32,
|
||||
pub border_color: Color,
|
||||
}
|
||||
|
||||
/// The shape of the handle of a slider.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum HandleShape {
|
||||
Circle { radius: u16 },
|
||||
Rectangle { width: u16, border_radius: u16 },
|
||||
Circle { radius: f32 },
|
||||
Rectangle { width: u16, border_radius: f32 },
|
||||
}
|
||||
|
||||
/// A set of rules that dictate the style of a slider.
|
||||
|
|
@ -45,11 +45,11 @@ impl StyleSheet for Default {
|
|||
handle: Handle {
|
||||
shape: HandleShape::Rectangle {
|
||||
width: 8,
|
||||
border_radius: 4,
|
||||
border_radius: 4.0,
|
||||
},
|
||||
color: Color::from_rgb(0.95, 0.95, 0.95),
|
||||
border_color: Color::from_rgb(0.6, 0.6, 0.6),
|
||||
border_width: 1,
|
||||
border_width: 1.0,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ use iced_core::{Background, Color};
|
|||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct Style {
|
||||
pub background: Background,
|
||||
pub border_radius: u16,
|
||||
pub border_width: u16,
|
||||
pub border_radius: f32,
|
||||
pub border_width: f32,
|
||||
pub border_color: Color,
|
||||
}
|
||||
|
||||
|
|
@ -14,8 +14,8 @@ impl std::default::Default for Style {
|
|||
fn default() -> Self {
|
||||
Self {
|
||||
background: Background::Color(Color::WHITE),
|
||||
border_radius: 0,
|
||||
border_width: 0,
|
||||
border_radius: 0.0,
|
||||
border_width: 0.0,
|
||||
border_color: Color::TRANSPARENT,
|
||||
}
|
||||
}
|
||||
|
|
@ -47,8 +47,8 @@ impl StyleSheet for Default {
|
|||
fn active(&self) -> Style {
|
||||
Style {
|
||||
background: Background::Color(Color::WHITE),
|
||||
border_radius: 5,
|
||||
border_width: 1,
|
||||
border_radius: 5.0,
|
||||
border_width: 1.0,
|
||||
border_color: Color::from_rgb(0.7, 0.7, 0.7),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue