add icons to dialog buttons
This commit is contained in:
@@ -78,7 +78,7 @@ func NewAddEditServerDialog(title string, cancelable bool, prefillServer *backen
|
|||||||
nickField := widget.NewEntryWithData(binding.BindString(&a.Nickname))
|
nickField := widget.NewEntryWithData(binding.BindString(&a.Nickname))
|
||||||
nickField.SetPlaceHolder(lang.L("My Server"))
|
nickField.SetPlaceHolder(lang.L("My Server"))
|
||||||
nickField.OnSubmitted = func(_ string) { focusHandler(hostField) }
|
nickField.OnSubmitted = func(_ string) { focusHandler(hostField) }
|
||||||
a.submitBtn = widget.NewButton(lang.L("Enter"), a.doSubmit)
|
a.submitBtn = widget.NewButtonWithIcon(lang.L("Enter"), theme.ConfirmIcon(), a.doSubmit)
|
||||||
a.submitBtn.Importance = widget.HighImportance
|
a.submitBtn.Importance = widget.HighImportance
|
||||||
a.promptText = widget.NewRichTextWithText("")
|
a.promptText = widget.NewRichTextWithText("")
|
||||||
a.promptText.Hidden = true
|
a.promptText.Hidden = true
|
||||||
@@ -88,7 +88,7 @@ func NewAddEditServerDialog(title string, cancelable bool, prefillServer *backen
|
|||||||
bottomRow = container.NewHBox(
|
bottomRow = container.NewHBox(
|
||||||
a.promptText,
|
a.promptText,
|
||||||
layout.NewSpacer(),
|
layout.NewSpacer(),
|
||||||
widget.NewButton(lang.L("Cancel"), a.onCancel),
|
widget.NewButtonWithIcon(lang.L("Cancel"), theme.CancelIcon(), a.onCancel),
|
||||||
a.submitBtn)
|
a.submitBtn)
|
||||||
} else {
|
} else {
|
||||||
bottomRow = container.NewHBox(
|
bottomRow = container.NewHBox(
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"fyne.io/fyne/v2/data/binding"
|
"fyne.io/fyne/v2/data/binding"
|
||||||
"fyne.io/fyne/v2/lang"
|
"fyne.io/fyne/v2/lang"
|
||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
|
"fyne.io/fyne/v2/theme"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
"github.com/dweymouth/supersonic/backend/mediaprovider"
|
"github.com/dweymouth/supersonic/backend/mediaprovider"
|
||||||
)
|
)
|
||||||
@@ -36,25 +37,28 @@ func NewEditPlaylistDialog(playlist *mediaprovider.Playlist, showPublicCheck boo
|
|||||||
isPublicCheck.Hidden = !showPublicCheck
|
isPublicCheck.Hidden = !showPublicCheck
|
||||||
nameEntry := widget.NewEntryWithData(binding.BindString(&e.Name))
|
nameEntry := widget.NewEntryWithData(binding.BindString(&e.Name))
|
||||||
descriptionEntry := widget.NewEntryWithData(binding.BindString(&e.Description))
|
descriptionEntry := widget.NewEntryWithData(binding.BindString(&e.Description))
|
||||||
deleteBtn := widget.NewButton(lang.L("Delete Playlist"), func() {
|
deleteBtn := widget.NewButtonWithIcon(lang.L("Delete Playlist"), theme.DeleteIcon(), func() {
|
||||||
if e.OnDeletePlaylist != nil {
|
if e.OnDeletePlaylist != nil {
|
||||||
e.OnDeletePlaylist()
|
e.OnDeletePlaylist()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
submitBtn := widget.NewButton(lang.L("OK"), func() {
|
submitBtn := widget.NewButtonWithIcon(lang.L("OK"), theme.ConfirmIcon(), func() {
|
||||||
if e.OnUpdateMetadata != nil {
|
if e.OnUpdateMetadata != nil {
|
||||||
e.OnUpdateMetadata()
|
e.OnUpdateMetadata()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
submitBtn.Importance = widget.HighImportance
|
submitBtn.Importance = widget.HighImportance
|
||||||
cancelBtn := widget.NewButton(lang.L("Cancel"), func() {
|
cancelBtn := widget.NewButtonWithIcon(lang.L("Cancel"), theme.CancelIcon(), func() {
|
||||||
if e.OnCanceled != nil {
|
if e.OnCanceled != nil {
|
||||||
e.OnCanceled()
|
e.OnCanceled()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
title := widget.NewLabel(lang.L("Edit Playlist"))
|
||||||
|
title.Alignment = fyne.TextAlignCenter
|
||||||
|
title.TextStyle.Bold = true
|
||||||
e.container = container.NewVBox(
|
e.container = container.NewVBox(
|
||||||
container.NewHBox(layout.NewSpacer(), widget.NewLabel(lang.L("Edit Playlist")), layout.NewSpacer()),
|
title,
|
||||||
container.New(layout.NewFormLayout(),
|
container.New(layout.NewFormLayout(),
|
||||||
widget.NewLabel(lang.L("Name")),
|
widget.NewLabel(lang.L("Name")),
|
||||||
nameEntry,
|
nameEntry,
|
||||||
@@ -72,7 +76,7 @@ func NewEditPlaylistDialog(playlist *mediaprovider.Playlist, showPublicCheck boo
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e *EditPlaylistDialog) MinSize() fyne.Size {
|
func (e *EditPlaylistDialog) MinSize() fyne.Size {
|
||||||
return fyne.NewSize(300, e.BaseWidget.MinSize().Height)
|
return fyne.NewSize(400, e.BaseWidget.MinSize().Height)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *EditPlaylistDialog) CreateRenderer() fyne.WidgetRenderer {
|
func (e *EditPlaylistDialog) CreateRenderer() fyne.WidgetRenderer {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ func NewLoginDialog(servers []*backend.ServerConfig, pwFetch PasswordFetchFunc)
|
|||||||
editBtn := widget.NewButtonWithIcon("", theme.DocumentCreateIcon(), l.onEditServer)
|
editBtn := widget.NewButtonWithIcon("", theme.DocumentCreateIcon(), l.onEditServer)
|
||||||
newBtn := widget.NewButtonWithIcon("", theme.ContentAddIcon(), l.onNewServer)
|
newBtn := widget.NewButtonWithIcon("", theme.ContentAddIcon(), l.onNewServer)
|
||||||
deleteBtn := widget.NewButtonWithIcon("", theme.DeleteIcon(), func() { l.onDeleteServer(l.serverSelect.SelectedIndex()) })
|
deleteBtn := widget.NewButtonWithIcon("", theme.DeleteIcon(), func() { l.onDeleteServer(l.serverSelect.SelectedIndex()) })
|
||||||
l.submitBtn = widget.NewButton(lang.L("OK"), l.onSubmit)
|
l.submitBtn = widget.NewButtonWithIcon(lang.L("OK"), theme.ConfirmIcon(), l.onSubmit)
|
||||||
l.submitBtn.Importance = widget.HighImportance
|
l.submitBtn.Importance = widget.HighImportance
|
||||||
l.promptText = widget.NewRichTextWithText("")
|
l.promptText = widget.NewRichTextWithText("")
|
||||||
l.promptText.Segments[0].(*widget.TextSegment).Style.ColorName = theme.ColorNameError
|
l.promptText.Segments[0].(*widget.TextSegment).Style.ColorName = theme.ColorNameError
|
||||||
|
|||||||
Reference in New Issue
Block a user