onboard to new custom padded box layouts

This commit is contained in:
Drew Weymouth
2024-05-24 16:57:49 -07:00
parent 883c1f738d
commit 819f42dac0
15 changed files with 22 additions and 212 deletions
+2 -3
View File
@@ -9,7 +9,6 @@ import (
"github.com/dweymouth/supersonic/backend/mediaprovider"
"github.com/dweymouth/supersonic/sharedutil"
"github.com/dweymouth/supersonic/ui/controller"
"github.com/dweymouth/supersonic/ui/layouts"
myTheme "github.com/dweymouth/supersonic/ui/theme"
"github.com/dweymouth/supersonic/ui/util"
"github.com/dweymouth/supersonic/ui/widgets"
@@ -280,10 +279,10 @@ func NewAlbumPageHeader(page *AlbumPage) *AlbumPageHeader {
// TODO: there's got to be a way to make this less convoluted. Custom layout?
a.container = util.AddHeaderBackground(
container.NewBorder(nil, nil, a.cover, nil,
container.New(&layouts.VboxCustomPadding{ExtraPad: -10},
container.New(layout.NewCustomPaddedVBoxLayout(theme.Padding()-10),
a.titleLabel,
container.NewVBox(
container.New(&layouts.VboxCustomPadding{ExtraPad: -12}, artistReleaseTypeLine, a.genreLabel, a.miscLabel),
container.New(layout.NewCustomPaddedVBoxLayout(theme.Padding()-12), artistReleaseTypeLine, a.genreLabel, a.miscLabel),
container.NewVBox(
container.NewHBox(util.NewHSpace(2), playButton, shuffleBtn, menuBtn),
container.NewHBox(util.NewHSpace(2), a.toggleFavButton),
+1 -2
View File
@@ -8,7 +8,6 @@ import (
"github.com/dweymouth/supersonic/backend/mediaprovider"
"github.com/dweymouth/supersonic/sharedutil"
"github.com/dweymouth/supersonic/ui/controller"
"github.com/dweymouth/supersonic/ui/layouts"
myTheme "github.com/dweymouth/supersonic/ui/theme"
"github.com/dweymouth/supersonic/ui/util"
"github.com/dweymouth/supersonic/ui/widgets"
@@ -448,7 +447,7 @@ func (a *ArtistPageHeader) createContainer() {
a.container = util.AddHeaderBackground(
container.NewBorder(nil, nil, a.artistImage, nil,
container.NewVBox(
container.New(&layouts.VboxCustomPadding{ExtraPad: -10},
container.New(layout.NewCustomPaddedVBoxLayout(theme.Padding()-10),
a.titleDisp, a.biographyDisp, a.similarArtists),
btnContainer),
))
+1 -2
View File
@@ -8,7 +8,6 @@ import (
"github.com/dweymouth/supersonic/backend/mediaprovider"
"github.com/dweymouth/supersonic/sharedutil"
"github.com/dweymouth/supersonic/ui/controller"
"github.com/dweymouth/supersonic/ui/layouts"
myTheme "github.com/dweymouth/supersonic/ui/theme"
"github.com/dweymouth/supersonic/ui/util"
"github.com/dweymouth/supersonic/ui/widgets"
@@ -291,7 +290,7 @@ func NewPlaylistPageHeader(page *PlaylistPage) *PlaylistPageHeader {
a.container = util.AddHeaderBackground(
container.NewBorder(nil, nil, a.image, nil,
container.NewVBox(a.titleLabel, container.New(&layouts.VboxCustomPadding{ExtraPad: -10},
container.NewVBox(a.titleLabel, container.New(layout.NewCustomPaddedVBoxLayout(theme.Padding()-10),
a.descriptionLabel,
a.ownerLabel,
a.trackTimeLabel),