mirror of
https://github.com/Apologieze/Benri.git
synced 2026-01-18 17:17:21 +01:00
Add rounded corner and padding
This commit is contained in:
2
main.go
2
main.go
@@ -204,7 +204,7 @@ func initMainApp() {
|
||||
/*if themeVariant == theme.VariantDark {
|
||||
grayScaleList = 220
|
||||
}*/
|
||||
listContainer := container.NewStack(canvas.NewRectangle(color.RGBA{R: grayScaleList, G: grayScaleList, B: grayScaleList, A: 255}), listDisplay)
|
||||
listContainer := container.NewPadded(&canvas.Rectangle{FillColor: color.RGBA{R: grayScaleList, G: grayScaleList, B: grayScaleList, A: 255}, CornerRadius: 10}, listDisplay)
|
||||
|
||||
leftSide := container.NewBorder(vbox, nil, nil, nil, listContainer)
|
||||
|
||||
|
||||
14
theme.go
14
theme.go
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"image/color"
|
||||
)
|
||||
|
||||
@@ -12,5 +13,18 @@ type forcedVariant struct {
|
||||
}
|
||||
|
||||
func (f *forcedVariant) Color(name fyne.ThemeColorName, _ fyne.ThemeVariant) color.Color {
|
||||
/*if name == theme.ColorNameBackground {
|
||||
return color.White
|
||||
}*/
|
||||
theme.SelectionRadiusSize()
|
||||
return f.Theme.Color(name, f.variant)
|
||||
}
|
||||
|
||||
func (f *forcedVariant) Size(s fyne.ThemeSizeName) float32 {
|
||||
if s == theme.SizeNameSelectionRadius {
|
||||
return 10
|
||||
} else if s == theme.SizeNameSeparatorThickness {
|
||||
return 2
|
||||
}
|
||||
return f.Theme.Size(s)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user