rebase to Fyne 2.5 prerelease and onboard to new CustomPaddedLayout

This commit is contained in:
Drew Weymouth
2024-05-24 16:48:53 -07:00
parent 9308aa1ceb
commit 883c1f738d
16 changed files with 133 additions and 86 deletions
+1 -2
View File
@@ -16,7 +16,6 @@ import (
"fyne.io/fyne/v2/widget"
"github.com/dweymouth/supersonic/backend/mediaprovider"
"github.com/dweymouth/supersonic/sharedutil"
"github.com/dweymouth/supersonic/ui/layouts"
myTheme "github.com/dweymouth/supersonic/ui/theme"
"github.com/dweymouth/supersonic/ui/util"
)
@@ -309,7 +308,7 @@ func NewGenreFilterSubsection(onChanged func([]string), initialSelectedGenres []
filterRow := container.NewBorder(nil, nil, nil, container.NewHBox(g.allBtn, g.noneBtn), g.filterText)
g.container = container.NewBorder(g.genresTitleLine, nil, nil, nil,
container.New(&layouts.MaxPadLayout{PadLeft: 5, PadRight: 5},
container.New(&layout.CustomPaddedLayout{LeftPadding: 5, RightPadding: 5},
container.NewBorder(filterRow, nil, nil, nil, g.genreListView),
),
)
+3 -2
View File
@@ -11,6 +11,7 @@ import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/widget"
)
@@ -110,9 +111,9 @@ func (n *NowPlayingCard) onAddToPlaylist() {
}
func (n *NowPlayingCard) CreateRenderer() fyne.WidgetRenderer {
c := container.New(&layouts.MaxPadLayout{PadLeft: -4},
c := container.New(&layout.CustomPaddedLayout{LeftPadding: -4},
container.NewBorder(nil, nil, n.cover, nil,
container.New(&layouts.MaxPadLayout{PadTop: -2},
container.New(&layout.CustomPaddedLayout{TopPadding: -2},
container.New(&layouts.VboxCustomPadding{ExtraPad: -13}, n.trackName, n.artistName, n.albumName))),
)
return widget.NewSimpleRenderer(c)