move donation link to top of whats new dialog
This commit is contained in:
+2
-2
@@ -25,7 +25,7 @@ func shortcutKey() string {
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
WhatsAdded = fmt.Sprintf(`
|
WhatsAdded = fmt.Sprintf(`
|
||||||
### Added
|
## Added
|
||||||
* New "Quick search" feature to search entire library from anywhere (%s+G shortcut)
|
* New "Quick search" feature to search entire library from anywhere (%s+G shortcut)
|
||||||
* Support for loading WEBP images
|
* Support for loading WEBP images
|
||||||
* UI Refresh from migrating to Fyne 2.4
|
* UI Refresh from migrating to Fyne 2.4
|
||||||
@@ -33,7 +33,7 @@ var (
|
|||||||
* Added playback setting to force-disable server transcoding`, shortcutKey())
|
* Added playback setting to force-disable server transcoding`, shortcutKey())
|
||||||
|
|
||||||
WhatsFixed = `
|
WhatsFixed = `
|
||||||
### Fixed
|
## Fixed
|
||||||
* UI hang when playback slow to begin after clicking on grid view play buttons
|
* UI hang when playback slow to begin after clicking on grid view play buttons
|
||||||
* Crash when removing from the currently playing track to end of play queue`
|
* Crash when removing from the currently playing track to end of play queue`
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
package dialogs
|
package dialogs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/url"
|
"fmt"
|
||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
"github.com/dweymouth/supersonic/res"
|
"github.com/dweymouth/supersonic/res"
|
||||||
"github.com/dweymouth/supersonic/ui/layouts"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type WhatsNewDialog struct {
|
type WhatsNewDialog struct {
|
||||||
@@ -20,8 +19,15 @@ func NewWhatsNewDialog() *WhatsNewDialog {
|
|||||||
return w
|
return w
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const donationTextTemplate = `Thank you for using Supersonic!
|
||||||
|
If you're enjoying the app and want to [show your support](%s),
|
||||||
|
donations are always appreciated and help motivate me to continue
|
||||||
|
delivering new features and improvements!`
|
||||||
|
|
||||||
func (w *WhatsNewDialog) CreateRenderer() fyne.WidgetRenderer {
|
func (w *WhatsNewDialog) CreateRenderer() fyne.WidgetRenderer {
|
||||||
objects := container.NewVBox()
|
donationPrompt := widget.NewRichTextFromMarkdown(fmt.Sprintf(donationTextTemplate, res.KofiURL))
|
||||||
|
donationPrompt.Wrapping = fyne.TextWrapWord
|
||||||
|
objects := container.NewVBox(donationPrompt)
|
||||||
if res.WhatsAdded != "" {
|
if res.WhatsAdded != "" {
|
||||||
added := widget.NewRichTextFromMarkdown(res.WhatsAdded)
|
added := widget.NewRichTextFromMarkdown(res.WhatsAdded)
|
||||||
added.Wrapping = fyne.TextWrapWord
|
added.Wrapping = fyne.TextWrapWord
|
||||||
@@ -33,19 +39,10 @@ func (w *WhatsNewDialog) CreateRenderer() fyne.WidgetRenderer {
|
|||||||
objects.Add(fixed)
|
objects.Add(fixed)
|
||||||
}
|
}
|
||||||
|
|
||||||
ghUrl, _ := url.Parse(res.GithubURL)
|
|
||||||
kofiUrl, _ := url.Parse(res.KofiURL)
|
|
||||||
githubKofi := container.NewCenter(
|
|
||||||
container.New(&layouts.HboxCustomPadding{DisableThemePad: true, ExtraPad: -10},
|
|
||||||
widget.NewHyperlink("Github page", ghUrl),
|
|
||||||
widget.NewLabel("·"),
|
|
||||||
widget.NewHyperlink("Support the project", kofiUrl)))
|
|
||||||
objects.Add(githubKofi)
|
|
||||||
|
|
||||||
c := container.NewVScroll(objects)
|
c := container.NewVScroll(objects)
|
||||||
return widget.NewSimpleRenderer(c)
|
return widget.NewSimpleRenderer(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *WhatsNewDialog) MinSize() fyne.Size {
|
func (w *WhatsNewDialog) MinSize() fyne.Size {
|
||||||
return fyne.NewSize(400, 250)
|
return fyne.NewSize(425, 275)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user