Skip to content

Commit

Permalink
Merge branch 'release/v2.5.x' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Aug 24, 2024
2 parents 4182cb2 + 7d81356 commit de71490
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 16 deletions.
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,28 @@ More detailed release notes can be found on the [releases page](https://github.c
* Odd looking SelectEntry with long PlaceHolder (#4430)


## 2.5.1 - Ongoing
## 2.5.1 - 24 August 2024

### Fixed

* Apps with translations in new languages would not be recognised (#5015)
* App ID can be ignored from metadata file with go build/run
* Typing Chinese characters in widget.Entry and perform undo/redo crashes the app (#5001)
* Assets would render Low-DPI before attaching to a canvas
* Single click in file dialog enters two directories (#5053)
* Light/Dark mode detection no longer works on Ubuntu with Fyne 2.5 (#5029)
* Scroll acceleration logic causes scrolling to "jump" suddenly on macOS (#5067)
* SetSystemTrayMenu doesn't work when run in goroutine (#5039)
* stack overflow when calling SetRowHeight in table UpdateCell callback (#5007)
* Resizing List causes visible items to refresh instead of resize (#4080)
* Child widget with Hoverable() interface keeps parent widget's Tapped() function from being called. (#3906)
* App Translation file is ignored / tries to load BR (#5015, #5040)
* Missing theme variant auto-switching (dark/light) for Windows (#4537)
* Get DoubleTapDelay from the OS if an API is available (#4448)
* Entry cursor is not visible with animations off (#4508)
* Redundant justify-content properties in CSS for centered-container class (#5045)
* Update go-text/render to avoid crashing when rendering certain bitmap fonts (#5042)
* Using container.NewThemeOverride leaks memory until window closing (#5000)


## 2.5.0 - 14 July 2024
Expand Down Expand Up @@ -91,6 +107,7 @@ More detailed release notes can be found on the [releases page](https://github.c
* Add missed truncation mode for hyperlink (#4335)
* AppTab does not display blue indicator line if you create it empty and then Append items to it later.
* Many optimisations in animation, draw speed, layout and widget size calculations
* DocTabItem update text doesn't update the underline select bar (graphic glitch) (#3106)


## 2.4.5 - 15 April 2024
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
It is designed to build applications that run on desktop and mobile devices with a
single codebase.

Version 2.4 is the current release of the Fyne API, it added rounded corners, emoji,
layout debug support and table headers, along with a large number of
smaller feature additions.
We are now working towards the next big release, codenamed
[Elgin](https://github.com/fyne-io/fyne/milestone/21)
and more news will follow in our news feeds and GitHub project.

# Prerequisites

To develop apps using Fyne you will need Go version 1.17 or later, a C compiler and your system's development tools.
Expand Down
3 changes: 3 additions & 0 deletions canvas/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ func (i *Image) renderSVG(width, height float32) (image.Image, error) {
if c != nil {
// We want real output pixel count not just the screen coordinate space (i.e. macOS Retina)
screenWidth, screenHeight = c.PixelCoordinateForPosition(fyne.Position{X: width, Y: height})
} else { // no canvas info, assume HiDPI
screenWidth *= 2
screenHeight *= 2
}

tex := cache.GetSvg(i.name(), i, screenWidth, screenHeight)
Expand Down
3 changes: 1 addition & 2 deletions dialog/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ func (f *fileDialog) setView(view ViewLayout) {
fyne.CurrentApp().Preferences().SetInt(viewLayoutKey, int(view))
var selectF func(id int)
choose := func(id int) {
selectF(id)
if file, ok := f.getDataItem(id); ok {
f.selectedID = id
f.setSelected(file, id)
Expand All @@ -555,7 +554,7 @@ func (f *fileDialog) setView(view ViewLayout) {
parent := id == 0 && len(dir.Path()) < len(f.dir.Path())
_, isDir := dir.(fyne.ListableURI)
o.(*fileDialogItem).setLocation(dir, isDir || parent, parent)
o.(*fileDialogItem).choose = choose
o.(*fileDialogItem).choose = selectF
o.(*fileDialogItem).id = id
o.(*fileDialogItem).open = f.open.OnTapped
}
Expand Down
21 changes: 19 additions & 2 deletions dialog/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"
"testing"

intWidget "fyne.io/fyne/v2/internal/widget"
"github.com/stretchr/testify/assert"

"fyne.io/fyne/v2"
Expand Down Expand Up @@ -689,11 +690,9 @@ func TestSetFileNameBeforeShow(t *testing.T) {
dOpen.Show()

assert.NotEqual(t, "testfile.zip", dOpen.dialog.fileName.(*widget.Label).Text)

}

func TestSetFileNameAfterShow(t *testing.T) {

win := test.NewTempWindow(t, widget.NewLabel("Content"))
dSave := NewFileSave(func(fyne.URIWriteCloser, error) {}, win)
dSave.Show()
Expand All @@ -707,7 +706,25 @@ func TestSetFileNameAfterShow(t *testing.T) {
dOpen.SetFileName("testfile.zip")

assert.NotEqual(t, "testfile.zip", dOpen.dialog.fileName.(*widget.Label).Text)
}

func TestTapParent_GoesUpOne(t *testing.T) {
win := test.NewTempWindow(t, widget.NewLabel("Content"))
d := NewFileOpen(func(fyne.URIReadCloser, error) {}, win)
home, _ := os.UserHomeDir()
homeURI, _ := storage.ListerForURI(storage.NewFileURI(home))
parentURI, _ := storage.Parent(homeURI)

d.SetView(GridView)
d.SetLocation(homeURI)
d.Show()

items := test.WidgetRenderer(d.dialog.files)
item := items.Objects()[0].(*intWidget.Scroll).Content.(*fyne.Container).Objects[0]
parent := test.WidgetRenderer(item.(fyne.Widget)).Objects()[1].(*fileDialogItem)
test.Tap(parent)

assert.Equal(t, d.dialog.dir.String(), parentURI.String())
}

func TestCreateNewFolderInDir(t *testing.T) {
Expand Down
10 changes: 9 additions & 1 deletion dialog/information.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package dialog

import (
"unicode"
"unicode/utf8"

"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/lang"
Expand Down Expand Up @@ -35,7 +38,12 @@ func ShowInformation(title, message string, parent fyne.Window) {
// The message is extracted from the provided error (should not be nil).
// After creation you should call Show().
func NewError(err error, parent fyne.Window) Dialog {
return createInformationDialog(lang.L("Error"), err.Error(), theme.ErrorIcon(), parent)
dialogText := err.Error()
r, size := utf8.DecodeRuneInString(dialogText)
if r != utf8.RuneError {
dialogText = string(unicode.ToUpper(r)) + dialogText[size:]
}
return createInformationDialog(lang.L("Error"), dialogText, theme.ErrorIcon(), parent)
}

// ShowError shows a dialog over the specified window for an application error.
Expand Down
18 changes: 18 additions & 0 deletions dialog/information_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/test"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -109,3 +110,20 @@ func TestDialog_ErrorCallback(t *testing.T) {
assert.True(t, tapped)
assert.True(t, information.win.Hidden)
}

func TestDialog_ErrorCapitalize(t *testing.T) {
err := errors.New("here is an error msg")
d := NewError(err, test.NewTempWindow(t, nil))
assert.Equal(t, d.(*dialog).content.(*widget.Label).Text,
"Here is an error msg")

err = errors.New("這是一條錯誤訊息")
d = NewError(err, test.NewTempWindow(t, nil))
assert.Equal(t, d.(*dialog).content.(*widget.Label).Text,
"這是一條錯誤訊息")

err = errors.New("")
d = NewError(err, test.NewTempWindow(t, nil))
assert.Equal(t, d.(*dialog).content.(*widget.Label).Text,
"")
}
4 changes: 3 additions & 1 deletion internal/driver/glfw/scroll_speed_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
package glfw

const (
scrollAccelerateRate = float64(5)
// MacOS applies its own scroll accelerate curve, so set
// scrollAccelerateRate to 1 for no acceleration effect
scrollAccelerateRate = float64(1)
scrollAccelerateCutoff = float64(5)
scrollSpeed = float32(10)
)
4 changes: 2 additions & 2 deletions internal/driver/glfw/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -809,9 +809,9 @@ func (w *window) processFocused(focus bool) {
}
}
curWindow = w
w.canvas.FocusGained()
w.QueueEvent(w.canvas.FocusGained)
} else {
w.canvas.FocusLost()
w.QueueEvent(w.canvas.FocusLost)
w.mouseLock.Lock()
w.mousePos = fyne.Position{}
w.mouseLock.Unlock()
Expand Down

0 comments on commit de71490

Please sign in to comment.