use rounded rectangles where appropriate; switch deprecated Max to Stack layout

This commit is contained in:
Drew Weymouth
2023-11-02 22:02:44 -07:00
parent 618da02b29
commit 565295a88a
7 changed files with 19 additions and 11 deletions
+8 -4
View File
@@ -15,10 +15,11 @@ type ThemedRectangle struct {
rect *canvas.Rectangle
ColorName fyne.ThemeColorName
Translucent bool
BorderWidth float32
BorderColorName fyne.ThemeColorName
ColorName fyne.ThemeColorName
Translucent bool
BorderWidth float32
BorderColorName fyne.ThemeColorName
CornerRadiusName fyne.ThemeSizeName
}
func NewThemedRectangle(colorName fyne.ThemeColorName) *ThemedRectangle {
@@ -42,6 +43,9 @@ func (t *ThemedRectangle) Refresh() {
t.rect.FillColor = fc
t.rect.StrokeWidth = t.BorderWidth
t.rect.StrokeColor = theme.Color(t.BorderColorName, settings.ThemeVariant())
if t.CornerRadiusName != "" {
t.rect.CornerRadius = theme.Size(t.CornerRadiusName)
}
t.BaseWidget.Refresh()
}