From cf0230072c01ea9523f4d98a3656f5c975b3f347 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 26 May 2022 23:07:34 +0200 Subject: Rename `Variant` to `Style` and `Style` to `Appearance` --- pure/src/widget/button.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'pure/src/widget/button.rs') diff --git a/pure/src/widget/button.rs b/pure/src/widget/button.rs index 45f4a6aa..dd7688e2 100644 --- a/pure/src/widget/button.rs +++ b/pure/src/widget/button.rs @@ -12,7 +12,7 @@ use iced_native::{ Clipboard, Layout, Length, Padding, Point, Rectangle, Shell, }; -pub use iced_style::button::{Style, StyleSheet}; +pub use iced_style::button::{Appearance, StyleSheet}; use button::State; @@ -60,14 +60,13 @@ where width: Length, height: Length, padding: Padding, - variant: ::Variant, + style: ::Style, } impl<'a, Message, Renderer> Button<'a, Message, Renderer> where Renderer: iced_native::Renderer, Renderer::Theme: StyleSheet, - ::Variant: Default, { /// Creates a new [`Button`] with the given content. pub fn new(content: impl Into>) -> Self { @@ -77,7 +76,7 @@ where width: Length::Shrink, height: Length::Shrink, padding: Padding::new(5), - variant: ::Variant::default(), + style: ::Style::default(), } } @@ -110,9 +109,9 @@ where /// Sets the style variant of this [`Button`]. pub fn style( mut self, - variant: ::Variant, + style: ::Style, ) -> Self { - self.variant = variant; + self.style = style; self } } @@ -123,7 +122,6 @@ where Message: 'a + Clone, Renderer: 'a + iced_native::Renderer, Renderer::Theme: StyleSheet, - ::Variant: Copy, { fn tag(&self) -> tree::Tag { tree::Tag::of::() @@ -217,7 +215,7 @@ where cursor_position, self.on_press.is_some(), theme, - self.variant, + self.style, || tree.state.downcast_ref::(), ); @@ -269,7 +267,6 @@ where Message: Clone + 'a, Renderer: iced_native::Renderer + 'a, Renderer::Theme: StyleSheet, - ::Variant: Copy, { fn into(self) -> Element<'a, Message, Renderer> { Element::new(self) -- cgit