summaryrefslogtreecommitdiffstats
path: root/native/src/lib.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-10-08 03:13:41 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-10-08 03:13:41 +0200
commit10e10e5e06841574425d2633f1c2916733f7b4ff (patch)
tree0407a0136973a201fe44bfc1a94268544a2f8eb5 /native/src/lib.rs
parenta0234d5bcea5b25f575af01d3a8e0296b2d0395c (diff)
downloadiced-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.rs12
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};