Skip to content

Commit

Permalink
Merge branch 'release/v2.4.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Oct 9, 2023
2 parents be9cd4b + 6c63361 commit 4ca1bb0
Show file tree
Hide file tree
Showing 49 changed files with 684 additions and 358 deletions.
30 changes: 27 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,33 @@
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.4.1 - 8 October 2023

### Fixed

* Left key on tree now collapses open branch
* Avoid memory leak in Android driver code
* Entry Field on Android in Landscape Mode Shows "0" (#4036)
* DocTabs Indicator remains visible after last tab is removed (#4220)
* Some SVG resources don't update appearance correctly with the theme (#3900)
* Fix mobile simulation builds on OpenBSD
* Fix alignment of menu button on mobile
* Fix Compilation with Android NDK r26
* Clicking table headers causes high CPU consumption (#4264)
* Frequent clicking on table may cause the program to not respond (#4210)
* Application stops responding when scrolling a table (#4263)
* Possible crash parsing malformed JSON color (#4270)
* NewFolderOpen: incomplete filenames (#2165)
* Resolve issue where storage.List could crash with short URI (#4271)
* TextTruncateEllipsis abnormally truncates strings with multi-byte UTF-8 characters (#4283)
* Last character doesn't appear in Select when there is a special character (#4293)
* Resolve random crash in DocTab (#3909)
* Selecting items from a list caused the keyboard to popup on Android (#4236)


## 2.4.0 - 1 September 2023

## Added
### Added

* Rounded corners in rectangle (#1090)
* Support for emoji in text
Expand Down Expand Up @@ -43,7 +67,7 @@ More detailed release notes can be found on the [releases page](https://github.c
* Add `--pprof` option to fyne build commands to enable profiling
* Support compiling from Android (termux)

## Changed
### Changed

* Go 1.17 or later is now required.
* Theme updated for rounded corners on buttons and input widgets
Expand All @@ -60,7 +84,7 @@ More detailed release notes can be found on the [releases page](https://github.c
* Improving performance of lookup for theme data
* Improved application startup time

## Fixed
### Fixed

* Rendering performance enhancements
* `dialog.NewProgressInfinite` is deprecated, but dialog.NewCustom isn't equivalent
Expand Down
10 changes: 5 additions & 5 deletions app/app_mobile_and.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ jobject getSystemService(uintptr_t jni_env, uintptr_t ctx, char *service) {
JNIEnv *env = (JNIEnv*)jni_env;
jstring serviceStr = (*env)->NewStringUTF(env, service);

jclass ctxClass = (*env)->GetObjectClass(env, ctx);
jclass ctxClass = (*env)->GetObjectClass(env, (jobject)ctx);
jmethodID getSystemService = find_method(env, ctxClass, "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;");

return (jobject)(*env)->CallObjectMethod(env, ctx, getSystemService, serviceStr);
return (jobject)(*env)->CallObjectMethod(env, (jobject)ctx, getSystemService, serviceStr);
}

int nextId = 1;
Expand Down Expand Up @@ -81,7 +81,7 @@ void openURL(uintptr_t java_vm, uintptr_t jni_env, uintptr_t ctx, char *url) {

jclass contextClass = find_class(env, "android/content/Context");
jmethodID start = find_method(env, contextClass, "startActivity", "(Landroid/content/Intent;)V");
(*env)->CallVoidMethod(env, ctx, start, intent);
(*env)->CallVoidMethod(env, (jobject)ctx, start, intent);
}

void sendNotification(uintptr_t java_vm, uintptr_t jni_env, uintptr_t ctx, char *title, char *body) {
Expand All @@ -94,7 +94,7 @@ void sendNotification(uintptr_t java_vm, uintptr_t jni_env, uintptr_t ctx, char
jobject builder = (*env)->NewObject(env, cls, constructor, ctx);

jclass mgrCls = find_class(env, "android/app/NotificationManager");
jobject mgr = getSystemService(env, ctx, "notification");
jobject mgr = getSystemService((uintptr_t)env, ctx, "notification");

if (isOreoOrLater(env)) {
jstring channelId = (*env)->NewStringUTF(env, "fyne-notif");
Expand Down Expand Up @@ -128,4 +128,4 @@ void sendNotification(uintptr_t java_vm, uintptr_t jni_env, uintptr_t ctx, char
jmethodID notify = find_method(env, mgrCls, "notify", "(ILandroid/app/Notification;)V");
(*env)->CallVoidMethod(env, mgr, notify, nextId, notif);
nextId++;
}
}
12 changes: 6 additions & 6 deletions cmd/fyne/commands/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@ type Command interface {
type Getter = commands.Getter

// NewGetter returns a command that can handle the download and install of GUI apps built using Fyne.
// It depends on a Go and C compiler installed at this stage and takes a single, package, parameter to identify the app.
// It depends on a Go and C compiler installed.
func NewGetter() *Getter {
return &Getter{}
return commands.NewGetter()
}

// NewBundler returns a command that can bundle resources into Go code.
//
// Deprecated: A better version will be exposed in the future.
func NewBundler() Command {
return &commands.Bundler{}
return commands.NewBundler()
}

// NewInstaller returns an install command that can install locally built Fyne apps.
//
// Deprecated: A better version will be exposed in the future.
func NewInstaller() Command {
return &commands.Installer{}
return commands.NewInstaller()
}

// NewPackager returns a packager command that can wrap executables into full GUI app packages.
//
// Deprecated: A better version will be exposed in the future.
func NewPackager() Command {
return &commands.Packager{}
return commands.NewPackager()
}

// NewReleaser returns a command that can adapt app packages for distribution.
//
// Deprecated: A better version will be exposed in the future.
func NewReleaser() Command {
return &commands.Releaser{}
return commands.NewReleaser()
}
8 changes: 8 additions & 0 deletions cmd/fyne/commands/command_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package commands

import "testing"

func TestNewGetter(t *testing.T) {
g := NewGetter()
g.SetAppID("io.fyne.text") // would crash if not set up internally correctly
}
17 changes: 11 additions & 6 deletions cmd/fyne/internal/commands/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ type Builder struct {
runner runner
}

// NewBuilder returns a command that can handle the build of GUI apps built using Fyne.
func NewBuilder() *Builder {
return &Builder{appData: &appData{}}
}

// Build returns the cli command for building fyne applications
func Build() *cli.Command {
b := &Builder{appData: &appData{}}
b := NewBuilder()

return &cli.Command{
Name: "build",
Expand Down Expand Up @@ -137,7 +142,7 @@ func checkVersion(output string, versionConstraint *version.ConstraintGroup) err
}

func isWeb(goos string) bool {
return goos == "gopherjs" || goos == "wasm"
return goos == "js" || goos == "wasm"
}

func checkGoVersion(runner runner, versionConstraint *version.ConstraintGroup) error {
Expand Down Expand Up @@ -197,7 +202,7 @@ func (b *Builder) build() error {
goos = targetOS()
}

if goos == "gopherjs" && runtime.GOOS == "windows" {
if goos == "js" && runtime.GOOS == "windows" {
return errors.New("gopherjs doesn't support Windows. Only wasm target is supported for the web output. You can also use fyne-cross to solve this")
}

Expand Down Expand Up @@ -262,7 +267,7 @@ func (b *Builder) build() error {
tags = append(tags, "release")
}
if len(tags) > 0 {
if goos == "gopherjs" {
if goos == "js" {
args = append(args, "--tags")
} else {
args = append(args, "-tags")
Expand All @@ -280,7 +285,7 @@ func (b *Builder) build() error {
versionConstraint = version.NewConstrainGroupFromString(">=1.17")
env = append(env, "GOARCH=wasm")
env = append(env, "GOOS=js")
} else if goos == "gopherjs" {
} else if goos == "js" {
_, err := b.runner.runOutput("version")
if err != nil {
fmt.Fprintf(os.Stderr, "Can not execute `gopherjs version`. Please do `go install github.com/gopherjs/gopherjs@latest`.\n")
Expand Down Expand Up @@ -359,7 +364,7 @@ func (b *Builder) updateAndGetGoExecutable(goos string) runner {
fyneGoModRunner = newCommand(goBin)
b.runner = fyneGoModRunner
} else {
if goos != "gopherjs" {
if goos != "js" {
b.runner = newCommand("go")
} else {
b.runner = newCommand("gopherjs")
Expand Down
2 changes: 1 addition & 1 deletion cmd/fyne/internal/commands/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func Test_BuildGopherJSReleaseVersion(t *testing.T) {
}

gopherJSBuildTest := &testCommandRuns{runs: expected, t: t}
b := &Builder{appData: &appData{}, os: "gopherjs", srcdir: "myTest", release: true, runner: gopherJSBuildTest}
b := &Builder{appData: &appData{}, os: "js", srcdir: "myTest", release: true, runner: gopherJSBuildTest}
err := b.build()
if runtime.GOOS == "windows" {
assert.NotNil(t, err)
Expand Down
5 changes: 5 additions & 0 deletions cmd/fyne/internal/commands/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ type Bundler struct {
noheader bool
}

// NewBundler returns a command that can handle the bundling assets into a GUI app binary.
func NewBundler() *Bundler {
return &Bundler{}
}

// AddFlags adds all the command line flags for passing to the Bundler.
//
// Deprecated: Access to the individual cli commands are being removed.
Expand Down
2 changes: 1 addition & 1 deletion cmd/fyne/internal/commands/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type Getter struct {
}

// NewGetter returns a command that can handle the download and install of GUI apps built using Fyne.
// It depends on a Go and C compiler installed at this stage and takes a single, package, parameter to identify the app.
// It depends on a Go and C compiler installed at this stage.
func NewGetter() *Getter {
return &Getter{appData: &appData{}}
}
Expand Down
7 changes: 6 additions & 1 deletion cmd/fyne/internal/commands/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

// Install returns the cli command for installing fyne applications
func Install() *cli.Command {
i := &Installer{appData: &appData{}}
i := NewInstaller()

return &cli.Command{
Name: "install",
Expand Down Expand Up @@ -73,6 +73,11 @@ type Installer struct {
release bool
}

// NewInstaller returns a command that can install a GUI apps built using Fyne from local source code.
func NewInstaller() *Installer {
return &Installer{appData: &appData{}}
}

// AddFlags adds the flags for interacting with the Installer.
//
// Deprecated: Access to the individual cli commands are being removed.
Expand Down
2 changes: 1 addition & 1 deletion cmd/fyne/internal/commands/package-web.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (p *Packager) packageWasm() error {
}

func (p *Packager) packageGopherJS() error {
appDir := util.EnsureSubDir(p.dir, "gopherjs")
appDir := util.EnsureSubDir(p.dir, "js")

tpl := webData{
AppName: p.Name,
Expand Down
13 changes: 9 additions & 4 deletions cmd/fyne/internal/commands/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (

// Package returns the cli command for packaging fyne applications
func Package() *cli.Command {
p := &Packager{appData: &appData{}}
p := NewPackager()

return &cli.Command{
Name: "package",
Expand All @@ -41,7 +41,7 @@ func Package() *cli.Command {
&cli.StringFlag{
Name: "target",
Aliases: []string{"os"},
Usage: "The mobile platform to target (android, android/arm, android/arm64, android/amd64, android/386, ios, iossimulator, wasm, gopherjs, web).",
Usage: "The mobile platform to target (android, android/arm, android/arm64, android/amd64, android/386, ios, iossimulator, wasm, js, web).",
Destination: &p.os,
},
&cli.StringFlag{
Expand Down Expand Up @@ -140,6 +140,11 @@ type Packager struct {
linuxAndBSDMetadata *metadata.LinuxAndBSD
}

// NewPackager returns a command that can handle the packaging a GUI apps built using Fyne from local source code.
func NewPackager() *Packager {
return &Packager{appData: &appData{}}
}

// AddFlags adds the flags for interacting with the package command.
//
// Deprecated: Access to the individual cli commands are being removed.
Expand Down Expand Up @@ -243,7 +248,7 @@ func (p *Packager) buildPackage(runner runner, tags []string) ([]string, error)
}

bGopherJS := &Builder{
os: "gopherjs",
os: "js",
srcdir: p.srcDir,
target: p.exe + ".js",
release: p.release,
Expand Down Expand Up @@ -322,7 +327,7 @@ func (p *Packager) doPackage(runner runner) error {
return p.packageIOS(p.os, tags)
case "wasm":
return p.packageWasm()
case "gopherjs":
case "js":
return p.packageGopherJS()
case "web":
return p.packageWeb()
Expand Down
22 changes: 11 additions & 11 deletions cmd/fyne/internal/commands/package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func Test_buildPackageGopherJS(t *testing.T) {

p := &Packager{
appData: &appData{},
os: "gopherjs",
os: "js",
srcDir: "myTest",
exe: "myTest.js",
release: true,
Expand Down Expand Up @@ -394,7 +394,7 @@ func Test_PackageGopherJS(t *testing.T) {
Name: "myTest",
icon: "myTest.png",
},
os: "gopherjs",
os: "js",
srcDir: "myTest",
dir: "myTestTarget",
exe: "myTest.js",
Expand All @@ -409,7 +409,7 @@ func Test_PackageGopherJS(t *testing.T) {

expectedEnsureSubDirRuns := mockEnsureSubDirRuns{
expected: []mockEnsureSubDir{
{"myTestTarget", "gopherjs", "myTestTarget/gopherjs"},
{"myTestTarget", "js", "myTestTarget/js"},
},
}
utilEnsureSubDirMock = func(parent, name string) string {
Expand All @@ -428,12 +428,12 @@ func Test_PackageGopherJS(t *testing.T) {

expectedWriteFileRuns := mockWriteFileRuns{
expected: []mockWriteFile{
{filepath.Join("myTestTarget", "gopherjs", "index.html"), nil},
{filepath.Join("myTestTarget", "gopherjs", "spinner_light.gif"), nil},
{filepath.Join("myTestTarget", "gopherjs", "spinner_dark.gif"), nil},
{filepath.Join("myTestTarget", "gopherjs", "light.css"), nil},
{filepath.Join("myTestTarget", "gopherjs", "dark.css"), nil},
{filepath.Join("myTestTarget", "gopherjs", "webgl-debug.js"), nil},
{filepath.Join("myTestTarget", "js", "index.html"), nil},
{filepath.Join("myTestTarget", "js", "spinner_light.gif"), nil},
{filepath.Join("myTestTarget", "js", "spinner_dark.gif"), nil},
{filepath.Join("myTestTarget", "js", "light.css"), nil},
{filepath.Join("myTestTarget", "js", "dark.css"), nil},
{filepath.Join("myTestTarget", "js", "webgl-debug.js"), nil},
},
}
utilWriteFileMock = func(target string, _ []byte) error {
Expand All @@ -442,8 +442,8 @@ func Test_PackageGopherJS(t *testing.T) {

expectedCopyFileRuns := mockCopyFileRuns{
expected: []mockCopyFile{
{source: "myTest.png", target: filepath.Join("myTestTarget", "gopherjs", "icon.png")},
{source: "myTest.js", target: filepath.Join("myTestTarget", "gopherjs", "myTest.js")},
{source: "myTest.png", target: filepath.Join("myTestTarget", "js", "icon.png")},
{source: "myTest.js", target: filepath.Join("myTestTarget", "js", "myTest.js")},
},
}
utilCopyFileMock = func(source, target string) error {
Expand Down
10 changes: 8 additions & 2 deletions cmd/fyne/internal/commands/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ var macAppStoreCategories = []string{

// Release returns the cli command for bundling release builds of fyne applications
func Release() *cli.Command {
r := &Releaser{}
r.appData = &appData{}
r := NewReleaser()

return &cli.Command{
Name: "release",
Expand Down Expand Up @@ -149,6 +148,13 @@ type Releaser struct {
password string
}

// NewReleaser returns a command that can handle the packaging a GUI apps for release from local Fyne source code.
func NewReleaser() *Releaser {
r := &Releaser{}
r.appData = &appData{}
return r
}

// AddFlags adds the flags for interacting with the release command.
//
// Deprecated: Access to the individual cli commands are being removed.
Expand Down
Loading

0 comments on commit 4ca1bb0

Please sign in to comment.