use rounded rectangles where appropriate; switch deprecated Max to Stack layout
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user