mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-08 02:45:38 +00:00
widget/material: fix IconButton padding
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -71,7 +71,7 @@ func (t *Theme) IconButton(icon *Icon) IconButton {
|
|||||||
Background: t.Color.Primary,
|
Background: t.Color.Primary,
|
||||||
Icon: icon,
|
Icon: icon,
|
||||||
Size: unit.Dp(56),
|
Size: unit.Dp(56),
|
||||||
Padding: unit.Dp(20),
|
Padding: unit.Dp(16),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ func (b IconButton) Layout(gtx *layout.Context, button *widget.Button) {
|
|||||||
st := layout.Stack{}
|
st := layout.Stack{}
|
||||||
ico := st.Rigid(gtx, func() {
|
ico := st.Rigid(gtx, func() {
|
||||||
layout.UniformInset(b.Padding).Layout(gtx, func() {
|
layout.UniformInset(b.Padding).Layout(gtx, func() {
|
||||||
size := gtx.Px(b.Size) - gtx.Px(b.Padding)
|
size := gtx.Px(b.Size) - 2*gtx.Px(b.Padding)
|
||||||
if b.Icon != nil {
|
if b.Icon != nil {
|
||||||
b.Icon.Layout(gtx, unit.Px(float32(size)))
|
b.Icon.Layout(gtx, unit.Px(float32(size)))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user