diff options
author | 2019-10-08 03:13:41 +0200 | |
---|---|---|
committer | 2019-10-08 03:13:41 +0200 | |
commit | 10e10e5e06841574425d2633f1c2916733f7b4ff (patch) | |
tree | 0407a0136973a201fe44bfc1a94268544a2f8eb5 /native/src/lib.rs | |
parent | a0234d5bcea5b25f575af01d3a8e0296b2d0395c (diff) | |
download | iced-10e10e5e06841574425d2633f1c2916733f7b4ff.tar.gz iced-10e10e5e06841574425d2633f1c2916733f7b4ff.tar.bz2 iced-10e10e5e06841574425d2633f1c2916733f7b4ff.zip |
Make `iced_core::Button` customizable
Now it supports:
- Any kind of content
- Custom border radius
- Custom background
Diffstat (limited to 'native/src/lib.rs')
-rw-r--r-- | native/src/lib.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/native/src/lib.rs b/native/src/lib.rs index 6067f49d..18ce3a37 100644 --- a/native/src/lib.rs +++ b/native/src/lib.rs @@ -89,14 +89,14 @@ //! # impl button::Renderer for Renderer { //! # fn node<Message>( //! # &self, -//! # _button: &Button<'_, Message> +//! # _button: &Button<'_, Message, Self> //! # ) -> Node { //! # Node::new(Style::default()) //! # } //! # //! # fn draw<Message>( //! # &mut self, -//! # _button: &Button<'_, Message>, +//! # _button: &Button<'_, Message, Self>, //! # _layout: Layout<'_>, //! # _cursor_position: Point, //! # ) {} @@ -125,7 +125,7 @@ //! .push( //! // The increment button. We tell it to produce an //! // `IncrementPressed` message when pressed -//! Button::new(&mut self.increment_button, "+") +//! Button::new(&mut self.increment_button, Text::new("+")) //! .on_press(Message::IncrementPressed), //! ) //! .push( @@ -135,7 +135,7 @@ //! .push( //! // The decrement button. We tell it to produce a //! // `DecrementPressed` message when pressed -//! Button::new(&mut self.decrement_button, "-") +//! Button::new(&mut self.decrement_button, Text::new("-")) //! .on_press(Message::DecrementPressed), //! ) //! } @@ -212,7 +212,9 @@ mod user_interface; pub(crate) use iced_core::Vector; -pub use iced_core::{Align, Color, Justify, Length, Point, Rectangle}; +pub use iced_core::{ + Align, Background, Color, Justify, Length, Point, Rectangle, +}; #[doc(no_inline)] pub use stretch::{geometry::Size, number::Number}; |