From 64091bb84c0ef68cc02ce7b2ece202d37999e277 Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Mon, 1 May 2023 17:56:13 -0700 Subject: [PATCH] cleanup from bad merge conflict 1: fix build errors --- ui/browsing/genrepage.go | 2 +- ui/mainwindow.go | 1 + ui/theme/theme.go | 19 ++++++++++++------- ui/widgets/tracklist.go | 3 +-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ui/browsing/genrepage.go b/ui/browsing/genrepage.go index 2d23272..a5b840f 100644 --- a/ui/browsing/genrepage.go +++ b/ui/browsing/genrepage.go @@ -94,7 +94,7 @@ func restoreGenrePage(saved *savedGenrePage) *GenrePage { SizeName: theme.SizeNameHeadingText, } g.playRandom = widget.NewButtonWithIcon("Play random", myTheme.ShuffleIcon, g.playRandomSongs) - g.grid = widgets.NewAlbumGridFromState(saved.gridState) + g.grid = widgets.NewGridViewFromState(saved.gridState) g.searcher = widgets.NewSearcher() g.searcher.OnSearched = g.OnSearched g.searcher.Entry.Text = saved.searchText diff --git a/ui/mainwindow.go b/ui/mainwindow.go index 66a95ab..c2248be 100644 --- a/ui/mainwindow.go +++ b/ui/mainwindow.go @@ -3,6 +3,7 @@ package ui import ( "fmt" "supersonic/backend" + "supersonic/res" "supersonic/ui/browsing" "supersonic/ui/controller" "supersonic/ui/os" diff --git a/ui/theme/theme.go b/ui/theme/theme.go index dcd4ec5..130a8f8 100644 --- a/ui/theme/theme.go +++ b/ui/theme/theme.go @@ -16,6 +16,17 @@ import ( const ColorNamePageBackground fyne.ThemeColorName = "PageBackground" +const ( + IconNameNowPlaying fyne.ThemeIconName = "NowPlaying" + IconNameFavorite fyne.ThemeIconName = "Favorite" + IconNameNotFavorite fyne.ThemeIconName = "NotFavorite" + IconNameAlbum fyne.ThemeIconName = "Album" + IconNameArtist fyne.ThemeIconName = "Artist" + IconNameGenre fyne.ThemeIconName = "Genre" + IconNamePlaylist fyne.ThemeIconName = "Playlist" + IconNameShuffle fyne.ThemeIconName = "Shuffle" +) + type AppearanceMode string const ( @@ -82,7 +93,6 @@ func (m *MyTheme) Color(name fyne.ThemeColorName, _ fyne.ThemeVariant) color.Col return theme.DefaultTheme().Color(name, variant) } -<<<<<<< HEAD func (m *MyTheme) Icon(name fyne.ThemeIconName) fyne.Resource { variant := m.getVariant() switch name { @@ -176,11 +186,6 @@ func (m MyTheme) createThemeIcons() { ShuffleIcon = myThemedResource{myTheme: m, darkVariant: res.ResShuffleInvertSvg, lightVariant: res.ResShuffleSvg} } -func (m MyTheme) Icon(name fyne.ThemeIconName) fyne.Resource { - return theme.DefaultTheme().Icon(name) -} - -<<<<<<< HEAD func (m *MyTheme) Font(style fyne.TextStyle) fyne.Resource { switch style { case fyne.TextStyle{}: @@ -219,7 +224,7 @@ func (m *MyTheme) Size(name fyne.ThemeSizeName) float32 { func (m *MyTheme) getVariant() fyne.ThemeVariant { v := "Dark" // default if config has invalid or missing setting - if sharedutil.StringSliceContains( + if sharedutil.SliceContains( []string{string(AppearanceLight), string(AppearanceDark), string(AppearanceAuto)}, m.config.Appearance) { v = m.config.Appearance diff --git a/ui/widgets/tracklist.go b/ui/widgets/tracklist.go index 684a414..d4fc921 100644 --- a/ui/widgets/tracklist.go +++ b/ui/widgets/tracklist.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "strconv" + "sync" "time" "supersonic/sharedutil" @@ -11,8 +12,6 @@ import ( "supersonic/ui/os" myTheme "supersonic/ui/theme" "supersonic/ui/util" - "sync" - "time" "fyne.io/fyne/v2" "fyne.io/fyne/v2/container"