use rounded image corners (TODO: allow disabling this)

This commit is contained in:
Drew Weymouth
2025-11-15 10:35:17 -08:00
parent 9f399a447c
commit c14342eff8
14 changed files with 30 additions and 12 deletions
+6 -8
View File
@@ -15,11 +15,11 @@ type ThemedRectangle struct {
rect *canvas.Rectangle
ColorName fyne.ThemeColorName
Translucent bool
BorderWidth float32
BorderColorName fyne.ThemeColorName
CornerRadiusName fyne.ThemeSizeName
ColorName fyne.ThemeColorName
Translucent bool
BorderWidth float32
BorderColorName fyne.ThemeColorName
CornerRadius float32
}
func NewThemedRectangle(colorName fyne.ThemeColorName) *ThemedRectangle {
@@ -43,9 +43,7 @@ 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.rect.CornerRadius = t.CornerRadius
t.BaseWidget.Refresh()
}