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.SetPlaceHolder(lang.L("My Server"))
|
||||
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.promptText = widget.NewRichTextWithText("")
|
||||
a.promptText.Hidden = true
|
||||
@@ -88,7 +88,7 @@ func NewAddEditServerDialog(title string, cancelable bool, prefillServer *backen
|
||||
bottomRow = container.NewHBox(
|
||||
a.promptText,
|
||||
layout.NewSpacer(),
|
||||
widget.NewButton(lang.L("Cancel"), a.onCancel),
|
||||
widget.NewButtonWithIcon(lang.L("Cancel"), theme.CancelIcon(), a.onCancel),
|
||||
a.submitBtn)
|
||||
} else {
|
||||
bottomRow = container.NewHBox(
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"fyne.io/fyne/v2/data/binding"
|
||||
"fyne.io/fyne/v2/lang"
|
||||
"fyne.io/fyne/v2/layout"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/dweymouth/supersonic/backend/mediaprovider"
|
||||
)
|
||||
@@ -36,25 +37,28 @@ func NewEditPlaylistDialog(playlist *mediaprovider.Playlist, showPublicCheck boo
|
||||
isPublicCheck.Hidden = !showPublicCheck
|
||||
nameEntry := widget.NewEntryWithData(binding.BindString(&e.Name))
|
||||
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 {
|
||||
e.OnDeletePlaylist()
|
||||
}
|
||||
})
|
||||
submitBtn := widget.NewButton(lang.L("OK"), func() {
|
||||
submitBtn := widget.NewButtonWithIcon(lang.L("OK"), theme.ConfirmIcon(), func() {
|
||||
if e.OnUpdateMetadata != nil {
|
||||
e.OnUpdateMetadata()
|
||||
}
|
||||
})
|
||||
submitBtn.Importance = widget.HighImportance
|
||||
cancelBtn := widget.NewButton(lang.L("Cancel"), func() {
|
||||
cancelBtn := widget.NewButtonWithIcon(lang.L("Cancel"), theme.CancelIcon(), func() {
|
||||
if e.OnCanceled != nil {
|
||||
e.OnCanceled()
|
||||
}
|
||||
})
|
||||
|
||||
title := widget.NewLabel(lang.L("Edit Playlist"))
|
||||
title.Alignment = fyne.TextAlignCenter
|
||||
title.TextStyle.Bold = true
|
||||
e.container = container.NewVBox(
|
||||
container.NewHBox(layout.NewSpacer(), widget.NewLabel(lang.L("Edit Playlist")), layout.NewSpacer()),
|
||||
title,
|
||||
container.New(layout.NewFormLayout(),
|
||||
widget.NewLabel(lang.L("Name")),
|
||||
nameEntry,
|
||||
@@ -72,7 +76,7 @@ func NewEditPlaylistDialog(playlist *mediaprovider.Playlist, showPublicCheck boo
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
@@ -58,7 +58,7 @@ func NewLoginDialog(servers []*backend.ServerConfig, pwFetch PasswordFetchFunc)
|
||||
editBtn := widget.NewButtonWithIcon("", theme.DocumentCreateIcon(), l.onEditServer)
|
||||
newBtn := widget.NewButtonWithIcon("", theme.ContentAddIcon(), l.onNewServer)
|
||||
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.promptText = widget.NewRichTextWithText("")
|
||||
l.promptText.Segments[0].(*widget.TextSegment).Style.ColorName = theme.ColorNameError
|
||||
|
||||
Reference in New Issue
Block a user