remove extra padding around artist grid view
This commit is contained in:
@@ -33,15 +33,15 @@ type FavoritesPage struct {
|
|||||||
nowPlayingID string
|
nowPlayingID string
|
||||||
pendingViewSwitch bool
|
pendingViewSwitch bool
|
||||||
|
|
||||||
grid *widgets.GridView
|
grid *widgets.GridView
|
||||||
searchGrid *widgets.GridView
|
searchGrid *widgets.GridView
|
||||||
artistListCtr *fyne.Container
|
artistGrid *widgets.GridView
|
||||||
tracklistCtr *fyne.Container
|
tracklistCtr *fyne.Container
|
||||||
searcher *widgets.SearchEntry
|
searcher *widgets.SearchEntry
|
||||||
filterBtn *widgets.AlbumFilterButton
|
filterBtn *widgets.AlbumFilterButton
|
||||||
titleDisp *widget.RichText
|
titleDisp *widget.RichText
|
||||||
toggleBtns *widgets.ToggleButtonGroup
|
toggleBtns *widgets.ToggleButtonGroup
|
||||||
container *fyne.Container
|
container *fyne.Container
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewFavoritesPage(cfg *backend.FavoritesPageConfig, contr *controller.Controller, mp mediaprovider.MediaProvider, pm *backend.PlaybackManager, im *backend.ImageManager) *FavoritesPage {
|
func NewFavoritesPage(cfg *backend.FavoritesPageConfig, contr *controller.Controller, mp mediaprovider.MediaProvider, pm *backend.PlaybackManager, im *backend.ImageManager) *FavoritesPage {
|
||||||
@@ -144,7 +144,7 @@ func (a *FavoritesPage) Reload() {
|
|||||||
iter := a.mp.IterateAlbums("", a.filter)
|
iter := a.mp.IterateAlbums("", a.filter)
|
||||||
a.grid.Reset(widgets.NewGridViewAlbumIterator(iter))
|
a.grid.Reset(widgets.NewGridViewAlbumIterator(iter))
|
||||||
}
|
}
|
||||||
if a.tracklistCtr != nil || a.artistListCtr != nil {
|
if a.tracklistCtr != nil || a.artistGrid != nil {
|
||||||
go func() {
|
go func() {
|
||||||
// re-fetch starred info from server
|
// re-fetch starred info from server
|
||||||
starred, err := a.mp.GetFavorites()
|
starred, err := a.mp.GetFavorites()
|
||||||
@@ -161,13 +161,12 @@ func (a *FavoritesPage) Reload() {
|
|||||||
tr.Refresh()
|
tr.Refresh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if a.artistListCtr != nil {
|
if a.artistGrid != nil {
|
||||||
// refresh favorite artists view
|
// refresh favorite artists view
|
||||||
al := a.artistListCtr.Objects[0].(*widgets.GridView)
|
a.artistGrid.ResetFixed(buildArtistGridViewModel(starred.Artists))
|
||||||
al.ResetFixed(buildArtistGridViewModel(starred.Artists))
|
|
||||||
if a.toggleBtns.ActivatedButtonIndex() == 1 {
|
if a.toggleBtns.ActivatedButtonIndex() == 1 {
|
||||||
// favorite artists view is visible
|
// favorite artists view is visible
|
||||||
al.Refresh()
|
a.artistGrid.Refresh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
@@ -259,7 +258,7 @@ func (a *FavoritesPage) onShowFavoriteArtists() {
|
|||||||
a.cfg.InitialView = "Artists" // save setting
|
a.cfg.InitialView = "Artists" // save setting
|
||||||
a.searcher.Entry.Hide() // disable search on artists for now
|
a.searcher.Entry.Hide() // disable search on artists for now
|
||||||
a.filterBtn.Hide()
|
a.filterBtn.Hide()
|
||||||
if a.artistListCtr == nil {
|
if a.artistGrid == nil {
|
||||||
if a.pendingViewSwitch {
|
if a.pendingViewSwitch {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -274,17 +273,14 @@ func (a *FavoritesPage) onShowFavoriteArtists() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
model := buildArtistGridViewModel(fav.Artists)
|
model := buildArtistGridViewModel(fav.Artists)
|
||||||
artistGrid := widgets.NewFixedGridView(model, a.im, myTheme.ArtistIcon)
|
a.artistGrid = widgets.NewFixedGridView(model, a.im, myTheme.ArtistIcon)
|
||||||
a.contr.ConnectArtistGridActions(artistGrid)
|
a.contr.ConnectArtistGridActions(a.artistGrid)
|
||||||
a.artistListCtr = container.New(
|
a.container.Objects[0] = a.artistGrid
|
||||||
&layouts.MaxPadLayout{PadLeft: 15, PadRight: 15, PadTop: 5, PadBottom: 15},
|
|
||||||
artistGrid)
|
|
||||||
a.container.Objects[0] = a.artistListCtr
|
|
||||||
a.Refresh()
|
a.Refresh()
|
||||||
a.pendingViewSwitch = false
|
a.pendingViewSwitch = false
|
||||||
}()
|
}()
|
||||||
} else {
|
} else {
|
||||||
a.container.Objects[0] = a.artistListCtr
|
a.container.Objects[0] = a.artistGrid
|
||||||
a.Refresh()
|
a.Refresh()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user