Skip to content

Commit

Permalink
Update togglebutton layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
FloVanGH committed Feb 28, 2020
1 parent 24ce02b commit e5a9513
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/widgets/src/toggle_button.rs
Expand Up @@ -51,7 +51,10 @@ widget!(
pressed: bool,

/// Sets or shares the selected property.
selected: bool
selected: bool,

/// Sets or shares the spacing between icon and text.
spacing: f64
}
);

Expand All @@ -76,6 +79,7 @@ impl Template for ToggleButton {
.icon_size(fonts::ICON_FONT_SIZE_12)
.icon_brush(colors::LINK_WATER_COLOR)
.pressed(false)
.spacing(8.0)
.child(
MouseBehavior::create()
.pressed(id)
Expand All @@ -96,11 +100,12 @@ impl Template for ToggleButton {
.child(
Stack::create()
.orientation("horizontal")
.spacing(id)
.vertical_alignment("center")
.horizontal_alignment("center")
.child(
FontIconBlock::create()
.margin((0.0, 0.0, 2.0, 0.0))
.vertical_alignment("center")
.icon(id)
.icon_brush(id)
.icon_size(id)
Expand All @@ -109,6 +114,7 @@ impl Template for ToggleButton {
)
.child(
TextBlock::create()
.vertical_alignment("center")
.foreground(id)
.text(id)
.font_size(id)
Expand Down

0 comments on commit e5a9513

Please sign in to comment.