Store button styles in Button

This commit is contained in:
Richard Feldman 2022-02-23 08:35:09 -05:00
parent f1b7c7383f
commit 90a25efbd8
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798
4 changed files with 27 additions and 7 deletions

View file

@ -550,6 +550,7 @@ fn add_drawable(
match elem.tag() {
Button => {
let button = unsafe { &elem.entry().button };
let styles = button.styles;
let child_bounds = add_drawable(&*button.child, bounds, drawables, glyph_brush);
drawables.push(Drawable {
@ -557,9 +558,9 @@ fn add_drawable(
offset: (0.0, 0.0).into(),
// TODO let buttons specify this
content: DrawableContent::FillRect {
color: (0.2, 0.2, 0.5, 1.0),
border_width: 10.0,
border_color: (0.2, 0.5, 0.5, 1.0),
color: styles.bg_color,
border_width: styles.border_width,
border_color: styles.border_color,
},
});