Make iced_core::Button customizable
Now it supports: - Any kind of content - Custom border radius - Custom background
This commit is contained in:
parent
a0234d5bce
commit
10e10e5e06
35 changed files with 288 additions and 160 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use crate::{Primitive, Renderer};
|
||||
use iced_native::{text, Layout, Node, Style, Text};
|
||||
use iced_native::{text, Color, Layout, Node, Style, Text};
|
||||
|
||||
use wgpu_glyph::{GlyphCruncher, Section};
|
||||
|
||||
|
|
@ -72,6 +72,9 @@ impl text::Renderer for Renderer {
|
|||
content: text.content.clone(),
|
||||
size: f32::from(text.size.unwrap_or(20)),
|
||||
bounds: layout.bounds(),
|
||||
color: text.color.unwrap_or(Color::BLACK),
|
||||
horizontal_alignment: text.horizontal_alignment,
|
||||
vertical_alignment: text.vertical_alignment,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue