Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fyne-io/fyne
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.2.3
Choose a base ref
...
head repository: fyne-io/fyne
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.2.4
Choose a head ref

Commits on Jul 13, 2022

  1. Minor cleanup of radio item

    Jacalz committed Jul 13, 2022
    Copy the full SHA
    f21a1d2 View commit details
  2. Copy the full SHA
    e52ef36 View commit details
  3. Fix the last little test

    Jacalz committed Jul 13, 2022
    Copy the full SHA
    d0f567e View commit details
  4. Merge pull request #3137 from Jacalz/fix/radio-focus-indicator

    Fix incorrect size and position for radio focus indicator
    Jacalz authored Jul 13, 2022
    Copy the full SHA
    bbe9e72 View commit details

Commits on Jul 15, 2022

  1. Update notes on version

    andydotxyz committed Jul 15, 2022
    Copy the full SHA
    1cd7a3e View commit details
  2. Fontface race fix

    krbs authored and andydotxyz committed Jul 15, 2022
    Copy the full SHA
    c7b9ed9 View commit details

Commits on Jul 23, 2022

  1. Copy the full SHA
    c5e035a View commit details
  2. Copy the full SHA
    3100dd2 View commit details
  3. Copy the full SHA
    142dc6c View commit details
  4. Copy the full SHA
    a59731d View commit details
  5. Fix test on windows

    andydotxyz committed Jul 23, 2022
    Copy the full SHA
    81f5a73 View commit details
  6. Fix test on windows typo

    andydotxyz committed Jul 23, 2022
    Copy the full SHA
    19ca858 View commit details
  7. Copy the full SHA
    6606652 View commit details
  8. Copy the full SHA
    98f367e View commit details
  9. Copy the full SHA
    aa56e10 View commit details

Commits on Jul 24, 2022

  1. Another windows test fix

    andydotxyz committed Jul 24, 2022
    Copy the full SHA
    5248b46 View commit details
  2. Merge pull request #3158 from andydotxyz/fix/missingmetaicon

    Fix build error when using 'fyne build' and no icon
    andydotxyz authored Jul 24, 2022
    Copy the full SHA
    46b735d View commit details

Commits on Jul 25, 2022

  1. And build fix

    andydotxyz committed Jul 25, 2022
    Copy the full SHA
    ef4de17 View commit details

Commits on Nov 1, 2022

  1. Merge pull request #3346 from fyne-io/bugs/mobile-package-release

    Make difference between package -release and release on mobile.
    Bluebugs authored and Cedric BAIL committed Nov 1, 2022
    Copy the full SHA
    d5e8bf0 View commit details
  2. Merge pull request #3219 from Bluebugs/features/detect-available-minAPI

    Features/detect available min api
    Bluebugs authored and Cedric BAIL committed Nov 1, 2022
    Copy the full SHA
    21817fa View commit details
  3. Update ChangeLog accordingly.

    Cedric BAIL committed Nov 1, 2022
    Copy the full SHA
    80bc2bf View commit details
  4. Merge pull request #3365 from Bluebugs/release/v2.2.x

    Release v2.2.4
    Bluebugs authored Nov 1, 2022
    Copy the full SHA
    4d37b1c View commit details

Commits on Nov 5, 2022

  1. Copy the full SHA
    20b77cb View commit details
  2. Merge pull request #3380 from andydotxyz/fix/systraymobilesim

    Fix issue with mobile simulation when systray used
    andydotxyz authored Nov 5, 2022
    Copy the full SHA
    0e8fca6 View commit details

Commits on Nov 8, 2022

  1. Update changelog with last PR added to release 2.2.4

    Cedric BAIL committed Nov 8, 2022
    Copy the full SHA
    f97c8cd View commit details

Commits on Nov 9, 2022

  1. Include all change in CHANGELOG.md

    Cedric BAIL committed Nov 9, 2022
    Copy the full SHA
    bdebbed View commit details
  2. Merge pull request #3388 from Bluebugs/changelog/update-v2.2.4

    Update changelog with last PR added to release 2.2.4
    Bluebugs authored Nov 9, 2022
    Copy the full SHA
    04b3427 View commit details
Showing with 182 additions and 109 deletions.
  1. +13 −0 CHANGELOG.md
  2. +3 −4 README.md
  3. +6 −2 app/app_xdg.go
  4. +23 −9 cmd/fyne/internal/commands/build.go
  5. +6 −6 cmd/fyne/internal/commands/build_test.go
  6. +2 −2 cmd/fyne/internal/commands/package-mobile.go
  7. +6 −6 cmd/fyne/internal/commands/package.go
  8. +29 −0 cmd/fyne/internal/commands/package_test.go
  9. +5 −2 cmd/fyne/internal/commands/release.go
  10. +6 −2 cmd/fyne/internal/mobile/build.go
  11. +19 −12 cmd/fyne/internal/mobile/env.go
  12. +1 −1 internal/driver/mobile/app/darwin_ios.m
  13. +5 −0 internal/painter/font.go
  14. +7 −12 widget/radio_item.go
  15. +1 −1 widget/radio_item_test.go
  16. +3 −3 widget/testdata/radio_group/disabled_append_none_selected.xml
  17. +2 −2 widget/testdata/radio_group/disabled_none_selected.xml
  18. +3 −3 widget/testdata/radio_group/focus_a_focused_b_selected.xml
  19. +3 −3 widget/testdata/radio_group/focus_a_focused_none_selected.xml
  20. +3 −3 widget/testdata/radio_group/focus_b_focused_b_selected.xml
  21. +3 −3 widget/testdata/radio_group/focus_b_focused_none_selected.xml
  22. +3 −3 widget/testdata/radio_group/focus_disabled_none_selected.xml
  23. +3 −3 widget/testdata/radio_group/focus_none_focused_b_selected.xml
  24. +3 −3 widget/testdata/radio_group/focus_none_focused_none_selected.xml
  25. +2 −2 widget/testdata/radio_group/layout_multiple.xml
  26. +2 −2 widget/testdata/radio_group/layout_multiple_disabled.xml
  27. +2 −2 widget/testdata/radio_group/layout_multiple_horizontal.xml
  28. +2 −2 widget/testdata/radio_group/layout_multiple_horizontal_disabled.xml
  29. +2 −2 widget/testdata/radio_group/layout_multiple_selected.xml
  30. +2 −2 widget/testdata/radio_group/layout_multiple_selected_disabled.xml
  31. +2 −2 widget/testdata/radio_group/layout_multiple_selected_horizontal.xml
  32. +2 −2 widget/testdata/radio_group/layout_multiple_selected_horizontal_disabled.xml
  33. +1 −1 widget/testdata/radio_group/layout_single.xml
  34. +1 −1 widget/testdata/radio_group/layout_single_disabled.xml
  35. +1 −1 widget/testdata/radio_group/layout_single_horizontal.xml
  36. +1 −1 widget/testdata/radio_group/layout_single_horizontal_disabled.xml
  37. +1 −1 widget/testdata/radio_group/layout_single_selected.xml
  38. +1 −1 widget/testdata/radio_group/layout_single_selected_disabled.xml
  39. +1 −1 widget/testdata/radio_group/layout_single_selected_horizontal.xml
  40. +1 −1 widget/testdata/radio_group/layout_single_selected_horizontal_disabled.xml
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,19 @@
This file lists the main changes with each version of the Fyne toolkit.
More detailed release notes can be found on the [releases page](https://github.com/fyne-io/fyne/releases).

## 2.2.4 - 1 November 2022

### Fixes

* Iphone incorrect click coordinates in zoomed screen view (#3122)
* CachedFontFace seems to be causing crash (#3134)
* Fix possible compile error if "fyne build" is used without icon metadata
* Detect and use recent Android NDK toolchain
* Handle fyne package -release and fyne release properly for Android and iOS
* Fix issue with mobile simulation when systray used
* Fix incorrect size and position for radio focus indicator (#3137)


## 2.2.3 - 8 July 2022

### Fixed
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -14,11 +14,10 @@
It is designed to build applications that run on desktop and mobile devices with a
single codebase.

Version 2.1 is the current release of the Fyne API, it introduced RichText
and the DocTabs container, as well as the document storage API and FyneApp.toml
metadata support.
Version 2.2 is the current release of the Fyne API, it added system tray support,
`App.Metadata` as well as richer menus and support for building WASM apps.
We are now working towards the next big release, codenamed
[bowmore](https://github.com/fyne-io/fyne/milestone/15)
[cragganmore](https://github.com/fyne-io/fyne/milestone/17)
and more news will follow in our news feeds and GitHub project.

# Prerequisites
8 changes: 6 additions & 2 deletions app/app_xdg.go
Original file line number Diff line number Diff line change
@@ -98,13 +98,17 @@ func (a *fyneApp) cachedIconPath() string {
// SetSystemTrayMenu creates a system tray item and attaches the specified menu.
// By default this will use the application icon.
func (a *fyneApp) SetSystemTrayMenu(menu *fyne.Menu) {
a.Driver().(systrayDriver).SetSystemTrayMenu(menu)
if desk, ok := a.Driver().(systrayDriver); ok { // don't use this on mobile tag
desk.SetSystemTrayMenu(menu)
}
}

// SetSystemTrayIcon sets a custom image for the system tray icon.
// You should have previously called `SetSystemTrayMenu` to initialise the menu icon.
func (a *fyneApp) SetSystemTrayIcon(icon fyne.Resource) {
a.Driver().(systrayDriver).SetSystemTrayIcon(icon)
if desk, ok := a.Driver().(systrayDriver); ok { // don't use this on mobile tag
desk.SetSystemTrayIcon(icon)
}
}

func rootConfigDir() string {
32 changes: 23 additions & 9 deletions cmd/fyne/internal/commands/build.go
Original file line number Diff line number Diff line change
@@ -183,7 +183,14 @@ func (b *Builder) build() error {
}
}

close, err := injectMetadataIfPossible(fyneGoModRunner, b.srcdir, b.appData, b.icon, createMetadataInitFile)
if b.icon == "" {
defaultIcon := filepath.Join(b.srcdir, "Icon.png")
if util.Exists(defaultIcon) {
b.icon = defaultIcon
}
}

close, err := injectMetadataIfPossible(fyneGoModRunner, b.srcdir, b.appData, createMetadataInitFile)
if err != nil {
fyne.LogError("Failed to inject metadata init file, omitting metadata", err)
} else if close != nil {
@@ -202,12 +209,12 @@ func (b *Builder) build() error {

if goos == "windows" {
if b.release {
args = append(args, "-ldflags", "-s -w -H=windowsgui ")
args = append(args, "-ldflags", "-s -w -H=windowsgui", "-trimpath")
} else {
args = append(args, "-ldflags", "-H=windowsgui ")
}
} else if b.release {
args = append(args, "-ldflags", "-s -w ")
args = append(args, "-ldflags", "-s -w", "-trimpath")
}
}

@@ -260,7 +267,7 @@ func (b *Builder) build() error {
return err
}

func createMetadataInitFile(srcdir string, app *appData, icon string) (func(), error) {
func createMetadataInitFile(srcdir string, app *appData) (func(), error) {
data, err := metadata.LoadStandard(srcdir)
if err == nil {
mergeMetadata(app, data)
@@ -275,16 +282,23 @@ func createMetadataInitFile(srcdir string, app *appData, icon string) (func(), e

err = templates.FyneMetadataInit.Execute(metadataInitFile, app)
if err == nil {
if icon != "" {
writeResource(icon, "fyneMetadataIcon", metadataInitFile)
iconResName := "fyneMetadataIcon"
if app.icon != "" {
writeResource(app.icon, iconResName, metadataInitFile)
} else {
v := fmt.Sprintf("var %s = (fyne.Resource)(nil)\n", iconResName)
_, err = metadataInitFile.Write([]byte(v))
if err != nil {
fyne.LogError("Error writing icon placeholder", err)
}
}
}

return func() { os.Remove(metadataInitFilePath) }, err
}

func injectMetadataIfPossible(runner runner, srcdir string, app *appData, icon string,
createMetadataInitFile func(srcdir string, app *appData, icon string) (func(), error)) (func(), error) {
func injectMetadataIfPossible(runner runner, srcdir string, app *appData,
createMetadataInitFile func(srcdir string, app *appData) (func(), error)) (func(), error) {
fyneGoModVersion, err := getFyneGoModVersion(runner)
if err != nil {
return nil, err
@@ -296,7 +310,7 @@ func injectMetadataIfPossible(runner runner, srcdir string, app *appData, icon s
return nil, nil
}

return createMetadataInitFile(srcdir, app, icon)
return createMetadataInitFile(srcdir, app)
}

func targetOS() string {
12 changes: 6 additions & 6 deletions cmd/fyne/internal/commands/build_test.go
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ func Test_BuildWasmVersion(t *testing.T) {
{
expectedValue: expectedValue{args: []string{"mod", "edit", "-json"}},
mockReturn: mockReturn{
ret: []byte("{ \"Module\": { \"Path\": \"fyne.io/fyne/v2\"}"),
ret: []byte("{ \"Module\": { \"Path\": \"fyne.io/fyne/v2\"} }"),
},
},
{
@@ -134,7 +134,7 @@ func Test_BuildWasmReleaseVersion(t *testing.T) {
{
expectedValue: expectedValue{args: []string{"mod", "edit", "-json"}},
mockReturn: mockReturn{
ret: []byte("{ \"Module\": { \"Path\": \"fyne.io/fyne/v2\"}"),
ret: []byte("{ \"Module\": { \"Path\": \"fyne.io/fyne/v2\"} }"),
},
},
{
@@ -168,7 +168,7 @@ func Test_BuildGopherJSReleaseVersion(t *testing.T) {
{
expectedValue: expectedValue{args: []string{"mod", "edit", "-json"}},
mockReturn: mockReturn{
ret: []byte("{ \"Module\": { \"Path\": \"fyne.io/fyne/v2\"}"),
ret: []byte("{ \"Module\": { \"Path\": \"fyne.io/fyne/v2\"} }"),
},
},
{
@@ -205,7 +205,7 @@ func Test_BuildWasmOldVersion(t *testing.T) {
{
expectedValue: expectedValue{args: []string{"mod", "edit", "-json"}},
mockReturn: mockReturn{
ret: []byte("{ \"Module\": { \"Path\": \"fyne.io/fyne/v2\"}"),
ret: []byte("{ \"Module\": { \"Path\": \"fyne.io/fyne/v2\"} }"),
},
},
{
@@ -244,8 +244,8 @@ func Test_FyneGoMod(t *testing.T) {
called := false

fyneGoModTest := &testCommandRuns{runs: expected, t: t}
injectMetadataIfPossible(fyneGoModTest, "myTest", &appData{}, "",
func(string, *appData, string) (func(), error) {
injectMetadataIfPossible(fyneGoModTest, "myTest", &appData{},
func(string, *appData) (func(), error) {
called = true
return func() {}, nil
})
4 changes: 2 additions & 2 deletions cmd/fyne/internal/commands/package-mobile.go
Original file line number Diff line number Diff line change
@@ -16,11 +16,11 @@ import (
)

func (p *Packager) packageAndroid(arch string) error {
return mobile.RunNewBuild(arch, p.AppID, p.icon, p.Name, p.AppVersion, p.AppBuild, p.release, "", "")
return mobile.RunNewBuild(arch, p.AppID, p.icon, p.Name, p.AppVersion, p.AppBuild, p.release, p.distribution, "", "")
}

func (p *Packager) packageIOS(target string) error {
err := mobile.RunNewBuild(target, p.AppID, p.icon, p.Name, p.AppVersion, p.AppBuild, p.release, p.certificate, p.profile)
err := mobile.RunNewBuild(target, p.AppID, p.icon, p.Name, p.AppVersion, p.AppBuild, p.release, p.distribution, p.certificate, p.profile)
if err != nil {
return err
}
12 changes: 6 additions & 6 deletions cmd/fyne/internal/commands/package.go
Original file line number Diff line number Diff line change
@@ -119,11 +119,11 @@ func Package() *cli.Command {
// Packager wraps executables into full GUI app packages.
type Packager struct {
*appData
srcDir, dir, exe, os string
install, release bool
certificate, profile string // optional flags for releasing
tags, category string
tempDir string
srcDir, dir, exe, os string
install, release, distribution bool
certificate, profile string // optional flags for releasing
tags, category string
tempDir string
}

// AddFlags adds the flags for interacting with the package command.
@@ -276,7 +276,7 @@ func (p *Packager) doPackage(runner runner) error {
}
}
if util.IsMobile(p.os) { // we don't use the normal build command for mobile so inject before gomobile...
close, err := injectMetadataIfPossible(newCommand("go"), p.dir, p.appData, p.icon, createMetadataInitFile)
close, err := injectMetadataIfPossible(newCommand("go"), p.dir, p.appData, createMetadataInitFile)
if err != nil {
fyne.LogError("Failed to inject metadata init file, omitting metadata", err)
} else if close != nil {
29 changes: 29 additions & 0 deletions cmd/fyne/internal/commands/package_test.go
Original file line number Diff line number Diff line change
@@ -263,6 +263,20 @@ func Test_buildPackageGopherJS(t *testing.T) {
},
}

expectedExistRuns := mockExistRuns{
expected: []mockExist{
{"myTest/Icon.png", false},
{"myTest.wasm", false},
{"myTest.wasm", true},
},
}
if runtime.GOOS == "windows" {
expectedExistRuns.expected[0].path = "myTest\\Icon.png"
}
utilExistsMock = func(path string) bool {
return expectedExistRuns.verifyExpectation(t, path)
}

p := &Packager{
appData: &appData{},
os: "gopherjs",
@@ -431,6 +445,21 @@ func Test_BuildPackageWeb(t *testing.T) {
},
}

expectedExistRuns := mockExistRuns{
expected: []mockExist{
{"myTest/Icon.png", false},
{"myTest/Icon.png", false},
{"myTest", false},
},
}
if runtime.GOOS == "windows" {
expectedExistRuns.expected[0].path = "myTest\\Icon.png"
expectedExistRuns.expected[1].path = "myTest\\Icon.png"
}
utilExistsMock = func(path string) bool {
return expectedExistRuns.verifyExpectation(t, path)
}

p := &Packager{
appData: &appData{},
os: "web",
7 changes: 5 additions & 2 deletions cmd/fyne/internal/commands/release.go
Original file line number Diff line number Diff line change
@@ -175,6 +175,8 @@ func (r *Releaser) Run(params []string) {
fmt.Fprintf(os.Stderr, "%s\n", err.Error())
return
}

r.Packager.distribution = true
r.Packager.release = true

if err := r.beforePackage(); err != nil {
@@ -192,13 +194,14 @@ func (r *Releaser) releaseAction(_ *cli.Context) error {
return err
}

r.Packager.distribution = true
r.Packager.release = true

if err := r.beforePackage(); err != nil {
return err
}

err := r.Packager.packageWithoutValidate()
if err != nil {
if err := r.Packager.packageWithoutValidate(); err != nil {
return err
}

8 changes: 6 additions & 2 deletions cmd/fyne/internal/mobile/build.go
Original file line number Diff line number Diff line change
@@ -273,10 +273,14 @@ var (
)

// RunNewBuild executes a new mobile build for the specified configuration
func RunNewBuild(target, appID, icon, name, version string, build int, release bool, cert, profile string) error {
func RunNewBuild(target, appID, icon, name, version string, build int, release, distribution bool, cert, profile string) error {
buildTarget = target
buildBundleID = appID
buildRelease = release
buildRelease = distribution
if release {
buildLdflags = "-w"
buildTrimpath = true
}

cmd := cmdBuild
cmd.Flag = flag.FlagSet{}
31 changes: 19 additions & 12 deletions cmd/fyne/internal/mobile/env.go
Original file line number Diff line number Diff line change
@@ -357,24 +357,31 @@ type ndkToolchain struct {
clangPrefix string
}

func (tc *ndkToolchain) ClangPrefix() string {
if buildAndroidAPI < tc.minAPI {
func (tc *ndkToolchain) ClangPrefix(api int) string {
if api < tc.minAPI {
return fmt.Sprintf("%s%d", tc.clangPrefix, tc.minAPI)
}
return fmt.Sprintf("%s%d", tc.clangPrefix, buildAndroidAPI)
return fmt.Sprintf("%s%d", tc.clangPrefix, api)
}

func (tc *ndkToolchain) Path(ndkRoot, toolName string) string {
var pref string
switch toolName {
case "clang", "clang++":
pref = tc.ClangPrefix()
case "nm":
pref = "llvm"
default:
pref = tc.toolPrefix
for api := buildAndroidAPI; api < 99; api++ {
var pref string
switch toolName {
case "clang", "clang++":
pref = tc.ClangPrefix(api)
case "nm":
pref = "llvm"
default:
pref = tc.toolPrefix
}

toolPath := filepath.Join(ndkRoot, "toolchains", "llvm", "prebuilt", archNDK(), "bin", pref+"-"+toolName)
if util.Exists(toolPath) {
return toolPath
}
}
return filepath.Join(ndkRoot, "toolchains", "llvm", "prebuilt", archNDK(), "bin", pref+"-"+toolName)
return ""
}

type ndkConfig map[string]ndkToolchain // map: GOOS->androidConfig.
2 changes: 1 addition & 1 deletion internal/driver/mobile/app/darwin_ios.m
Original file line number Diff line number Diff line change
@@ -167,7 +167,7 @@ - (void)glkView:(GLKView *)view drawInRect:(CGRect)rect {
#define TOUCH_TYPE_END 2 // touch.TypeEnd

static void sendTouches(int change, NSSet* touches) {
CGFloat scale = [UIScreen mainScreen].scale;
CGFloat scale = [UIScreen mainScreen].nativeScale;
for (UITouch* touch in touches) {
CGPoint p = [touch locationInView:touch.view];
sendTouch((GoUintptr)touch, (GoUintptr)change, p.x*scale, p.y*scale);
5 changes: 5 additions & 0 deletions internal/painter/font.go
Original file line number Diff line number Diff line change
@@ -61,13 +61,17 @@ func CachedFontFace(style fyne.TextStyle, opts *truetype.Options) font.Face {
}

comp := val.(*fontCacheItem)
comp.facesMutex.RLock()
face := comp.faces[*opts]
comp.facesMutex.RUnlock()
if face == nil {
f1 := truetype.NewFace(comp.font, opts)
f2 := truetype.NewFace(comp.fallback, opts)
face = newFontWithFallback(f1, f2, comp.font, comp.fallback)

comp.facesMutex.Lock()
comp.faces[*opts] = face
comp.facesMutex.Unlock()
}

return face
@@ -294,6 +298,7 @@ type ttfFont interface {
type fontCacheItem struct {
font, fallback *truetype.Font
faces map[truetype.Options]font.Face
facesMutex sync.RWMutex
}

var fontCache = &sync.Map{} // map[fyne.TextStyle]*fontCacheItem
Loading