Skip to content

Commit 040623c

Browse files
authored
Merge pull request fyne-io#5188 from andydotxyz/release/v2.5.2
Proposed v2.5.2 release
2 parents 9419b14 + 572a799 commit 040623c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+338
-232
lines changed

.github/workflows/license_check.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
- uses: actions/checkout@v4
1111
with:
1212
persist-credentials: false
13-
- uses: WillAbides/setup-go-faster@v1.13.0
13+
- uses: WillAbides/setup-go-faster@v1
1414
with:
15-
go-version: '1.21.x'
15+
go-version: '1.23.x'
1616

1717
- name: Install lian
1818
run: go install lucor.dev/lian@latest

.github/workflows/mobile_tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
go-version: ['1.19.x', '1.21.x']
12+
go-version: ['1.19.x', '1.23.x']
1313

1414
steps:
1515
- uses: actions/checkout@v4
1616
with:
1717
persist-credentials: false
18-
- uses: WillAbides/setup-go-faster@v1.13.0
18+
- uses: WillAbides/setup-go-faster@v1
1919
with:
2020
go-version: ${{ matrix.go-version }}
2121

.github/workflows/platform_tests.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
go-version: ['1.19.x', '1.21.x']
12+
go-version: ['1.19.x', '1.23.x']
1313
os: [ubuntu-latest, macos-latest]
1414
include:
1515
- os: ubuntu-latest
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v4
2222
with:
2323
persist-credentials: false
24-
- uses: WillAbides/setup-go-faster@v1.13.0
24+
- uses: WillAbides/setup-go-faster@v1
2525
with:
2626
go-version: ${{ matrix.go-version }}
2727

@@ -51,12 +51,12 @@ jobs:
5151
strategy:
5252
fail-fast: false
5353
matrix:
54-
go-version: ['1.20.x', '1.21.x']
54+
go-version: ['1.20.x', '1.22.x']
5555
steps:
5656
- uses: actions/checkout@v4
5757
with:
5858
persist-credentials: false
59-
- uses: WillAbides/setup-go-faster@v1.13.0
59+
- uses: WillAbides/setup-go-faster@v1
6060
with:
6161
go-version: ${{ matrix.go-version }}
6262

.github/workflows/static_analysis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
- uses: actions/checkout@v4
1414
with:
1515
persist-credentials: false
16-
- uses: WillAbides/setup-go-faster@v1.13.0
16+
- uses: WillAbides/setup-go-faster@v1
1717
with:
18-
go-version: '1.21.x'
18+
go-version: '1.23.x'
1919

2020
- name: Get dependencies
2121
run: >-
@@ -33,7 +33,7 @@ jobs:
3333
run: |
3434
go install golang.org/x/tools/cmd/goimports@latest
3535
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
36-
go install honnef.co/go/tools/cmd/staticcheck@v0.4.6
36+
go install honnef.co/go/tools/cmd/staticcheck@v0.5.1
3737
go install github.com/mattn/goveralls@latest
3838
3939
- name: Vet

.github/workflows/web_tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
with:
1515
persist-credentials: false
16-
- uses: WillAbides/setup-go-faster@v1.13.0
16+
- uses: WillAbides/setup-go-faster@v1
1717
with:
1818
go-version: '1.19.x'
1919

CHANGELOG.md

+22
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,28 @@
33
This file lists the main changes with each version of the Fyne toolkit.
44
More detailed release notes can be found on the [releases page](https://github.com/fyne-io/fyne/releases).
55

6+
## 2.5.2 - 14 October 2024
7+
8+
### Fixed
9+
10+
* Sometimes fyne fails to setup dark mode on Windows (#4758)
11+
* Memory leak in fontMetrics cache on desktop driver (#4010)
12+
* Fix possible crash with badly formatted json translation
13+
* Tree widget doesn't display higher elements until a user selects one (#5095, #4346)
14+
* Update to the latest breaking API changes in go-text
15+
* Fix wrapping / truncation of multi-font text runs (#4998)
16+
* Test window title is not always set (#5116)
17+
* Deadlock in Button CreateRenderer() (#5114)
18+
* Fix possible crash in theme watching for windows
19+
* Fix issue with Movies folder on darwin file dialog
20+
* widget.Entry: validate when pasting from clipboard (#5058, #5028)
21+
* Reduce contention in some widget locks
22+
* Add Swedish translation
23+
* Improvements to documentation
24+
* Improved temp check for windows/msys
25+
* Fix split in a theme override container
26+
27+
628
## 2.5.1 - 24 August 2024
729

830
### Fixed

animation.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type Animation struct {
4545
}
4646

4747
// NewAnimation creates a very basic animation where the callback function will be called for every
48-
// rendered frame between time.Now() and the specified duration. The callback values start at 0.0 and
48+
// rendered frame between [time.Now] and the specified duration. The callback values start at 0.0 and
4949
// will be 1.0 when the animation completes.
5050
//
5151
// Since: 2.0

app.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77

88
// An App is the definition of a graphical application.
99
// Apps can have multiple windows, by default they will exit when all windows
10-
// have been closed. This can be modified using SetMaster() or SetCloseIntercept().
11-
// To start an application you need to call Run() somewhere in your main() function.
12-
// Alternatively use the window.ShowAndRun() function for your main window.
10+
// have been closed. This can be modified using SetMaster or SetCloseIntercept.
11+
// To start an application you need to call Run somewhere in your main function.
12+
// Alternatively use the [fyne.io/fyne/v2.Window.ShowAndRun] function for your main window.
1313
type App interface {
1414
// Create a new window for the application.
1515
// The first window to open is considered the "master" and when closed
@@ -27,7 +27,7 @@ type App interface {
2727
// SetIcon sets the icon resource used for this application instance.
2828
SetIcon(Resource)
2929

30-
// Run the application - this starts the event loop and waits until Quit()
30+
// Run the application - this starts the event loop and waits until [App.Quit]
3131
// is called or the last window closes.
3232
// This should be called near the end of a main() function as it will block.
3333
Run()
@@ -43,7 +43,7 @@ type App interface {
4343
Driver() Driver
4444

4545
// UniqueID returns the application unique identifier, if set.
46-
// This must be set for use of the Preferences() functions... see NewWithId(string)
46+
// This must be set for use of the [App.Preferences]. see [NewWithID].
4747
UniqueID() string
4848

4949
// SendNotification sends a system notification that will be displayed in the operating system's notification area.
@@ -75,7 +75,7 @@ type App interface {
7575
CloudProvider() CloudProvider // get the (if any) configured provider
7676

7777
// SetCloudProvider allows developers to specify how this application should integrate with cloud services.
78-
// See `fyne.io/cloud` package for implementation details.
78+
// See [fyne.io/cloud] package for implementation details.
7979
//
8080
// Since: 2.3
8181
SetCloudProvider(CloudProvider) // configure cloud for this app

app/app_desktop_darwin.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ func themeChanged() {
5353
fyne.CurrentApp().Settings().(*settings).setupTheme()
5454
}
5555

56-
func watchTheme() {
56+
func watchTheme(_ *settings) {
5757
C.watchTheme()
5858
}

app/app_goxjs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var themeChanged = js.FuncOf(func(this js.Value, args []js.Value) interface{} {
6161
return nil
6262
})
6363

64-
func watchTheme() {
64+
func watchTheme(_ *settings) {
6565
js.Global().Call("matchMedia", "(prefers-color-scheme: dark)").Call("addEventListener", "change", themeChanged)
6666
}
6767
func stopWatchingTheme() {

app/app_other.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ func (a *fyneApp) SendNotification(_ *fyne.Notification) {
2323
fyne.LogError("Refusing to show notification for unknown operating system", nil)
2424
}
2525

26-
func watchTheme() {
26+
func watchTheme(_ *settings) {
2727
// no-op
2828
}

app/app_windows.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ func runScript(name, script string) {
9595
fyne.LogError("Failed to launch windows notify script", err)
9696
}
9797
}
98-
func watchTheme() {
99-
go internalapp.WatchTheme(fyne.CurrentApp().Settings().(*settings).setupTheme)
98+
99+
func watchTheme(s *settings) {
100+
go internalapp.WatchTheme(s.setupTheme)
100101
}

app/app_xdg.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,17 @@ func rootConfigDir() string {
119119
return filepath.Join(desktopConfig, "fyne")
120120
}
121121

122-
func watchTheme() {
122+
func watchTheme(s *settings) {
123123
go func() {
124124
// Theme lookup hangs on some desktops. Update theme variant cache from within goroutine.
125125
internalapp.CurrentVariant.Store(uint64(findFreedesktopColorScheme()))
126-
fyne.CurrentApp().Settings().(*settings).setupTheme()
126+
s.setupTheme()
127127

128128
portalSettings.OnSignalSettingChanged(func(changed portalSettings.Changed) {
129129
if changed.Namespace == "org.freedesktop.appearance" && changed.Key == "color-scheme" {
130130
themeVariant := colorSchemeToThemeVariant(appearance.ColorScheme(changed.Value.(uint32)))
131131
internalapp.CurrentVariant.Store(uint64(themeVariant))
132-
fyne.CurrentApp().Settings().(*settings).setupTheme()
132+
s.setupTheme()
133133
}
134134
})
135135
}()

app/meta_development.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func getProjectPath() string {
5555
}
5656

5757
temp := os.TempDir()
58-
if strings.Contains(exe, temp) { // this happens with "go run"
58+
if strings.Contains(exe, temp) || strings.Contains(exe, "go-build") { // this happens with "go run"
5959
return work
6060
}
6161

app/settings_desktop.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ func watchFile(path string, callback func()) *fsnotify.Watcher {
6262
func (s *settings) watchSettings() {
6363
s.watcher = watchFile(s.schema.StoragePath(), s.fileChanged)
6464

65-
watchTheme()
65+
a := fyne.CurrentApp()
66+
if a != nil && s != nil && a.Settings() == s { // ignore if testing
67+
watchTheme(s)
68+
}
6669
}
6770

6871
func (s *settings) stopWatching() {

app/settings_goxjs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func watchFile(path string, callback func()) {
1717
}
1818

1919
func (s *settings) watchSettings() {
20-
watchTheme()
20+
watchTheme(s)
2121
}
2222

2323
func (s *settings) stopWatching() {

canvas.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package fyne
22

33
import "image"
44

5-
// Canvas defines a graphical canvas to which a CanvasObject or Container can be added.
5+
// Canvas defines a graphical canvas to which a [CanvasObject] or Container can be added.
66
// Each canvas has a scale which is automatically applied during the render process.
77
type Canvas interface {
88
Content() CanvasObject
@@ -31,7 +31,7 @@ type Canvas interface {
3131
// Size returns the current size of this canvas
3232
Size() Size
3333
// Scale returns the current scale (multiplication factor) this canvas uses to render
34-
// The pixel size of a CanvasObject can be found by multiplying by this value.
34+
// The pixel size of a [CanvasObject] can be found by multiplying by this value.
3535
Scale() float32
3636

3737
// Overlays returns the overlay stack.

canvasobject.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,27 @@ type CanvasObject interface {
3636
Refresh()
3737
}
3838

39-
// Disableable describes any CanvasObject that can be disabled.
39+
// Disableable describes any [CanvasObject] that can be disabled.
4040
// This is primarily used with objects that also implement the Tappable interface.
4141
type Disableable interface {
4242
Enable()
4343
Disable()
4444
Disabled() bool
4545
}
4646

47-
// DoubleTappable describes any CanvasObject that can also be double tapped.
47+
// DoubleTappable describes any [CanvasObject] that can also be double tapped.
4848
type DoubleTappable interface {
4949
DoubleTapped(*PointEvent)
5050
}
5151

52-
// Draggable indicates that a CanvasObject can be dragged.
52+
// Draggable indicates that a [CanvasObject] can be dragged.
5353
// This is used for any item that the user has indicated should be moved across the screen.
5454
type Draggable interface {
5555
Dragged(*DragEvent)
5656
DragEnd()
5757
}
5858

59-
// Focusable describes any CanvasObject that can respond to being focused.
59+
// Focusable describes any [CanvasObject] that can respond to being focused.
6060
// It will receive the FocusGained and FocusLost events appropriately.
6161
// When focused it will also have TypedRune called as text is input and
6262
// TypedKey called when other keys are pressed.
@@ -75,18 +75,18 @@ type Focusable interface {
7575
TypedKey(*KeyEvent)
7676
}
7777

78-
// Scrollable describes any CanvasObject that can also be scrolled.
78+
// Scrollable describes any [CanvasObject] that can also be scrolled.
7979
// This is mostly used to implement the widget.ScrollContainer.
8080
type Scrollable interface {
8181
Scrolled(*ScrollEvent)
8282
}
8383

84-
// SecondaryTappable describes a CanvasObject that can be right-clicked or long-tapped.
84+
// SecondaryTappable describes a [CanvasObject] that can be right-clicked or long-tapped.
8585
type SecondaryTappable interface {
8686
TappedSecondary(*PointEvent)
8787
}
8888

89-
// Shortcutable describes any CanvasObject that can respond to shortcut commands (quit, cut, copy, and paste).
89+
// Shortcutable describes any [CanvasObject] that can respond to shortcut commands (quit, cut, copy, and paste).
9090
type Shortcutable interface {
9191
TypedShortcut(Shortcut)
9292
}
@@ -95,12 +95,12 @@ type Shortcutable interface {
9595
//
9696
// Since: 2.1
9797
type Tabbable interface {
98-
// AcceptsTab() is a hook called by the key press handling logic.
98+
// AcceptsTab is a hook called by the key press handling logic.
9999
// If it returns true then the Tab key events will be sent using TypedKey.
100100
AcceptsTab() bool
101101
}
102102

103-
// Tappable describes any CanvasObject that can also be tapped.
103+
// Tappable describes any [CanvasObject] that can also be tapped.
104104
// This should be implemented by buttons etc that wish to handle pointer interactions.
105105
type Tappable interface {
106106
Tapped(*PointEvent)

cloud.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package fyne
22

33
// CloudProvider specifies the identifying information of a cloud provider.
4-
// This information is mostly used by the `fyne.io/cloud ShowSettings' user flow.
4+
// This information is mostly used by the [fyne.io/cloud.ShowSettings] user flow.
55
//
66
// Since: 2.3
77
type CloudProvider interface {

cmd/fyne/internal/mobile/binres/binres_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"bytes"
99
"encoding"
1010
"encoding/xml"
11+
"errors"
1112
"fmt"
1213
"math"
1314
"os"
@@ -246,7 +247,7 @@ func compareElements(have, want *XML) error {
246247
}
247248
}
248249
if buf.Len() > 0 {
249-
return fmt.Errorf(buf.String())
250+
return errors.New(buf.String())
250251
}
251252
return nil
252253
}

0 commit comments

Comments
 (0)