add settings option to choose startup page

This commit is contained in:
Drew Weymouth
2023-04-29 20:51:45 -07:00
parent ae1b767255
commit a9263c8d4e
3 changed files with 25 additions and 7 deletions
+9 -2
View File
@@ -62,6 +62,13 @@ func NewSettingsDialog(config *backend.Config, audioDeviceList []player.AudioDev
}
func (s *SettingsDialog) createGeneralTab() *container.TabItem {
startupPage := widget.NewSelect(backend.SupportedStartupPages, func(choice string) {
s.config.Application.StartupPage = choice
})
startupPage.SetSelected(s.config.Application.StartupPage)
if startupPage.Selected == "" {
startupPage.SetSelectedIndex(0)
}
closeToTray := widget.NewCheckWithData("Close to system tray",
binding.BindBool(&s.config.Application.CloseToSystemTray))
if !s.config.Application.EnableSystemTray {
@@ -154,8 +161,8 @@ func (s *SettingsDialog) createGeneralTab() *container.TabItem {
scrobbleEnabled.Checked = s.config.Scrobbling.Enabled
return container.NewTabItem("General", container.NewVBox(
systemTrayEnable,
closeToTray,
container.New(layout.NewFormLayout(), widget.NewLabel("Startup page"), startupPage),
container.NewHBox(systemTrayEnable, closeToTray),
s.newSectionSeparator(),
widget.NewRichText(&widget.TextSegment{Text: "Scrobbling", Style: boldStyle}),