diff options
author | 2019-10-08 03:13:41 +0200 | |
---|---|---|
committer | 2019-10-08 03:13:41 +0200 | |
commit | 10e10e5e06841574425d2633f1c2916733f7b4ff (patch) | |
tree | 0407a0136973a201fe44bfc1a94268544a2f8eb5 /wgpu/src/primitive.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 '')
-rw-r--r-- | wgpu/src/primitive.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/wgpu/src/primitive.rs b/wgpu/src/primitive.rs index f6730a1f..b664689b 100644 --- a/wgpu/src/primitive.rs +++ b/wgpu/src/primitive.rs @@ -1,4 +1,4 @@ -use iced_native::{Color, Rectangle}; +use iced_native::{text, Background, Color, Rectangle}; #[derive(Debug, Clone)] pub enum Primitive { @@ -9,16 +9,14 @@ pub enum Primitive { Text { content: String, bounds: Rectangle, + color: Color, size: f32, + horizontal_alignment: text::HorizontalAlignment, + vertical_alignment: text::VerticalAlignment, }, Quad { bounds: Rectangle, background: Background, + border_radius: u16, }, } - -#[derive(Debug, Clone, Copy, PartialEq)] -pub enum Background { - Color(Color), - // TODO: Add gradient and image variants -} |