Fix #625: Allow customization of grid card size
This commit is contained in:
@@ -36,6 +36,8 @@ const (
|
||||
var (
|
||||
ErrNoServers = errors.New("no servers set up")
|
||||
ErrAnotherInstance = errors.New("another instance is running")
|
||||
|
||||
appInstance *App
|
||||
)
|
||||
|
||||
type App struct {
|
||||
@@ -204,9 +206,14 @@ func StartupApp(appName, displayAppName, appVersion, appVersionTag, latestReleas
|
||||
|
||||
a.startConfigWriter(a.bgrndCtx)
|
||||
|
||||
appInstance = a
|
||||
return a, nil
|
||||
}
|
||||
|
||||
func AppInstance() *App {
|
||||
return appInstance
|
||||
}
|
||||
|
||||
func (a *App) IsFirstLaunch() bool {
|
||||
return a.isFirstLaunch
|
||||
}
|
||||
|
||||
@@ -89,6 +89,10 @@ type FavoritesPageConfig struct {
|
||||
ShowAlbumYears bool
|
||||
}
|
||||
|
||||
type GridViewConfig struct {
|
||||
CardSize float32
|
||||
}
|
||||
|
||||
type PlaylistPageConfig struct {
|
||||
TracklistColumns []string
|
||||
}
|
||||
@@ -154,6 +158,7 @@ type Config struct {
|
||||
ArtistPage ArtistPageConfig
|
||||
ArtistsPage ArtistsPageConfig
|
||||
FavoritesPage FavoritesPageConfig
|
||||
GridView GridViewConfig
|
||||
PlaylistPage PlaylistPageConfig
|
||||
PlaylistsPage PlaylistsPageConfig
|
||||
TracksPage TracksPageConfig
|
||||
@@ -215,6 +220,9 @@ func DefaultConfig(appVersionTag string) *Config {
|
||||
InitialView: "Albums",
|
||||
ShowAlbumYears: false,
|
||||
},
|
||||
GridView: GridViewConfig{
|
||||
CardSize: 200,
|
||||
},
|
||||
PlaylistPage: PlaylistPageConfig{
|
||||
TracklistColumns: []string{"Album", "Time", "Plays"},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user