Skip to content

Commit

Permalink
move donation link to top of whats new dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Nov 7, 2023
1 parent 18320ce commit 4bbda87
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions res/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ func shortcutKey() string {

var (
WhatsAdded = fmt.Sprintf(`
### Added
## Added
* New "Quick search" feature to search entire library from anywhere (%s+G shortcut)
* Support for loading WEBP images
* UI Refresh from migrating to Fyne 2.4
* New [custom theme](https://github.com/dweymouth/supersonic/wiki/Custom-Themes) color keys: Hyperlink and PageHeader (theme file syntax "0.2")
* Added playback setting to force-disable server transcoding`, shortcutKey())

WhatsFixed = `
### Fixed
## Fixed
* 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`
)
23 changes: 10 additions & 13 deletions ui/dialogs/whatsnewdialog.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package dialogs

import (
"net/url"
"fmt"

"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
"github.com/dweymouth/supersonic/res"
"github.com/dweymouth/supersonic/ui/layouts"
)

type WhatsNewDialog struct {
Expand All @@ -20,8 +19,15 @@ func NewWhatsNewDialog() *WhatsNewDialog {
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 {
objects := container.NewVBox()
donationPrompt := widget.NewRichTextFromMarkdown(fmt.Sprintf(donationTextTemplate, res.KofiURL))
donationPrompt.Wrapping = fyne.TextWrapWord
objects := container.NewVBox(donationPrompt)
if res.WhatsAdded != "" {
added := widget.NewRichTextFromMarkdown(res.WhatsAdded)
added.Wrapping = fyne.TextWrapWord
Expand All @@ -33,19 +39,10 @@ func (w *WhatsNewDialog) CreateRenderer() fyne.WidgetRenderer {
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)
return widget.NewSimpleRenderer(c)
}

func (w *WhatsNewDialog) MinSize() fyne.Size {
return fyne.NewSize(400, 250)
return fyne.NewSize(425, 275)
}

0 comments on commit 4bbda87

Please sign in to comment.