Skip to content

Commit

Permalink
Merge branch 'release/v2.3.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Dec 24, 2022
2 parents 2c1d0bd + 175017e commit 8c25095
Show file tree
Hide file tree
Showing 1,128 changed files with 104,848 additions and 13,596 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/license_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
persist-credentials: false
- uses: WillAbides/[email protected]
with:
go-version: '1.18.x'
go-version: '1.19.x'

- name: Install lian
run: go install lucor.dev/lian@latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mobile_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [1.14.x, 1.17.x]
go-version: [1.14.x, 1.19.x]

steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
persist-credentials: false
- uses: WillAbides/[email protected]
with:
go-version: '1.17.x'
go-version: '1.19.x'

- name: Get dependencies
run: |
sudo apt-get update && sudo apt-get install gcc libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libx11-dev xorg-dev
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
go install honnef.co/go/tools/cmd/[email protected].0
go install honnef.co/go/tools/cmd/[email protected].3
- name: Cleanup repository
run: rm -rf vendor/
Expand All @@ -31,7 +31,7 @@ jobs:
run: go vet -tags ci ./...

- name: Goimports
run: test -z $(goimports -e -d . | tee /dev/stderr)
run: test -z "$(goimports -e -d . | tee /dev/stderr)"

- name: Gocyclo
run: gocyclo -over 30 .
Expand Down
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,54 @@
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.3.0 - 24 December 2022

### Added

* Shiny new theme that was designed for us
* Improved text handling to support non-latin alphabets
* Add cloud storage and preference support
* Add menu icon and submenu support to system tray menus
* More button importance levels `ErrorImportance`, `WarningImportance`
* Support disabling of `AppTabs` and `DocTabs` items
* Add image support to rich text (#2366)
* Add CheckGroup.Remove (#3124)

### Changed

* The buttons on the default theme are no longer transparent, but we added more button importance types
* Expose a storage.ErrNotExists for non existing documents (#3083)
* Update `go-gl/glfw` to build against latest Glfw 3.3.8
* List items in `widget.List` now implement the Focusable interface

### Fixed

* Displaying unicode or different language like Bengali doesn't work (#598)
* Cannot disable container.TabItem (#1904)
* Update Linux/XDG application theme to follow the FreeDesktop Dark Style Preference (#2657)
* Running `fyne package -os android` needs NDK 16/19c (#3066)
* Caret position lost when resizing a MultilineEntry (#3024)
* Fix possible crash in table resize (#3369)
* Memory usage surge when selecting/appending MultilineEntry text (#3426)
* Fyne bundle does not support appending when parameter is a directory
* Crash parsing invalid file URI (#3275)
* Systray apps on macOS can only be terminated via the systray menu quit button (#3395)
* Wayland Scaling support: sizes and distances are scaled wrong (#2850)
* Google play console minimum API level 31 (#3375)
* Data bound entry text replacing selection is ignored (#3340)
* Split Container does not respect item's Visible status (#3232)
* Android - Entry - OnSubmitted is not working (#3267)
* Can't set custom CGO_CFLAGS and CGO_LDFLAGS with "fyne package" on darwin (#3276)
* Text line not displayed in RichText (#3117)
* Segfault when adding items directly in form struct (#3153)
* Preferences RemoveValue does not save (#3229)
* Create new folder directly from FolderDialog (#3174)
* Slider drag handle is clipped off at minimum size (#2966)
* Entry text "flickering" while typing (#3461)
* Rendering of not changed canvas objects after an event (#3211)
* Form dialog not displaying hint text and validation errors (#2781)


## 2.2.4 - 9 November 2022

### Fixes
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ To manage this we have various checks and processes in place that everyone shoul
* Imports should be ordered according to the GoImports spec - you can use the `goimports` tool instead of `gofmt`.
* Everything should have a unit test attached (as much as possible, to keep our coverage up)

For detailed Code style, check [Contributing](https://github.com/fyne-io/fyne/wiki/Contributing#code-style) in our wiki please.

# Decision Process

The following points apply to our decision making process:
Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
It is designed to build applications that run on desktop and mobile devices with a
single codebase.

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.
Version 2.3 is the current release of the Fyne API, it added a refined theme design,
cloud storage, improved text handling for international languages and many
smaller feature additions.
We are now working towards the next big release, codenamed
[cragganmore](https://github.com/fyne-io/fyne/milestone/17)
[Dalwhinnie](https://github.com/fyne-io/fyne/milestone/18)
and more news will follow in our news feeds and GitHub project.

# Prerequisites
Expand All @@ -28,14 +29,14 @@ If you're not sure if that's all installed or you don't know how then check out

Using the standard go tools you can install Fyne's core library using:

$ go get fyne.io/fyne/v2
go get fyne.io/fyne/v2

# Widget demo

To run a showcase of the features of Fyne execute the following:

$ go install fyne.io/fyne/v2/cmd/fyne_demo@latest
$ fyne_demo
go install fyne.io/fyne/v2/cmd/fyne_demo@latest
fyne_demo

(For Go versions earlier than v1.16 use `go get fyne.io/fyne/v2/cmd/fyne_demo`)

Expand Down Expand Up @@ -92,7 +93,7 @@ func main() {

And you can run that simply as:

$ go run main.go
go run main.go

It should look like this:

Expand All @@ -113,7 +114,7 @@ It should look like this:

There is a helpful mobile simulation mode that gives a hint of how your app would work on a mobile device:

$ go run -tags mobile main.go
go run -tags mobile main.go

Another option is to use `fyne` command, see [Packaging for mobile](#packaging-for-mobile).

Expand All @@ -123,8 +124,8 @@ Using `go install` will copy the executable into your go `bin` dir.
To install the application with icons etc into your operating system's standard
application location you can use the fyne utility and the "install" subcommand.

$ go install fyne.io/fyne/v2/cmd/fyne@latest
$ fyne install
go install fyne.io/fyne/v2/cmd/fyne@latest
fyne install

(for Go versions before v1.16 use `go get fyne.io/fyne/v2/cmd/fyne`)

Expand All @@ -135,16 +136,16 @@ To do this we can use the fyne utility "package" subcommand.
You will need to add appropriate parameters as prompted, but the basic command is shown below.
Once packaged you can install using the platform development tools or the fyne "install" subcommand.

$ fyne package -os android -appID my.domain.appname
$ fyne install -os android
fyne package -os android -appID my.domain.appname
fyne install -os android

The built Android application can run either in a real device or an Android emulator.
However, building for iOS is slightly different.
If the "-os" argument is "ios", it is build only for a real iOS device.
Specify "-os" to "iossimulator" allows the application be able to run in an iOS simulator:

$ fyne package -os ios -appID my.domain.appname
$ fyne package -os iossimulator -appID my.domain.appname
fyne package -os ios -appID my.domain.appname
fyne package -os iossimulator -appID my.domain.appname

# Preparing a release

Expand Down
18 changes: 18 additions & 0 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ type App interface {
//
// Since: 2.2
Metadata() AppMetadata

// CloudProvider returns the current app cloud provider,
// if one has been registered by the developer or chosen by the user.
//
// Since: 2.3
CloudProvider() CloudProvider // get the (if any) configured provider

// SetCloudProvider allows developers to specify how this application should integrate with cloud services.
// See `fyne.io/cloud` package for implementation details.
//
// Since: 2.3
SetCloudProvider(CloudProvider) // configure cloud for this app
}

// app contains an App variable, but due to atomic.Value restrictions on
Expand Down Expand Up @@ -109,6 +121,12 @@ type AppMetadata struct {
Build int
// Icon contains, if present, a resource of the icon that was bundled at build time.
Icon Resource
// Release if true this binary was build in release mode
// Since 2.3
Release bool
// Custom contain the custom metadata defined either in FyneApp.toml or on the compile command line
// Since 2.3
Custom map[string]string
}

// Lifecycle represents the various phases that an app can transition through.
Expand Down
42 changes: 30 additions & 12 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@ type fyneApp struct {
icon fyne.Resource
uniqueID string

cloud fyne.CloudProvider
lifecycle fyne.Lifecycle
settings *settings
storage *store
storage fyne.Storage
prefs fyne.Preferences

running uint32 // atomic, 1 == running, 0 == stopped
exec func(name string, arg ...string) *execabs.Cmd
}

func (a *fyneApp) CloudProvider() fyne.CloudProvider {
return a.cloud
}

func (a *fyneApp) Icon() fyne.Resource {
if a.icon != nil {
return a.icon
Expand Down Expand Up @@ -104,6 +109,14 @@ func (a *fyneApp) Lifecycle() fyne.Lifecycle {
return a.lifecycle
}

func (a *fyneApp) newDefaultPreferences() fyne.Preferences {
p := fyne.Preferences(newPreferences(a))
if pref, ok := p.(interface{ load() }); ok && a.uniqueID != "" {
pref.load()
}
return p
}

// New returns a new application instance with the default driver and no unique ID (unless specified in FyneApp.toml)
func New() fyne.App {
if meta.ID == "" {
Expand All @@ -112,23 +125,28 @@ func New() fyne.App {
return NewWithID(meta.ID)
}

func newAppWithDriver(d fyne.Driver, id string) fyne.App {
newApp := &fyneApp{uniqueID: id, driver: d, exec: execabs.Command, lifecycle: &app.Lifecycle{}}
fyne.SetCurrentApp(newApp)
newApp.settings = loadSettings()

newApp.prefs = newPreferences(newApp)
newApp.storage = &store{a: newApp}
func makeStoreDocs(id string, p fyne.Preferences, s *store) *internal.Docs {
if id != "" {
if pref, ok := newApp.prefs.(interface{ load() }); ok {
if pref, ok := p.(interface{ load() }); ok {
pref.load()
}

root, _ := newApp.storage.docRootURI()
newApp.storage.Docs = &internal.Docs{RootDocURI: root}
root, _ := s.docRootURI()
return &internal.Docs{RootDocURI: root}
} else {
newApp.storage.Docs = &internal.Docs{} // an empty impl to avoid crashes
return &internal.Docs{} // an empty impl to avoid crashes
}
}

func newAppWithDriver(d fyne.Driver, id string) fyne.App {
newApp := &fyneApp{uniqueID: id, driver: d, exec: execabs.Command, lifecycle: &app.Lifecycle{}}
fyne.SetCurrentApp(newApp)

newApp.prefs = newApp.newDefaultPreferences()
newApp.settings = loadSettings()
store := &store{a: newApp}
store.Docs = makeStoreDocs(id, newApp.prefs, store)
newApp.storage = store

if !d.Device().IsMobile() {
newApp.settings.watchSettings()
Expand Down
14 changes: 0 additions & 14 deletions app/app_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,6 @@ func (a *fyneApp) SendNotification(n *fyne.Notification) {
fallbackNotification(n.Title, n.Content)
}

// 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) {
if desk, ok := a.Driver().(systrayDriver); ok {
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)
}

func escapeNotificationString(in string) string {
noSlash := strings.ReplaceAll(in, "\\", "\\\\")
return strings.ReplaceAll(noSlash, "\"", "\\\"")
Expand Down
14 changes: 14 additions & 0 deletions app/app_desktop_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ import (
"fyne.io/fyne/v2/theme"
)

// 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) {
if desk, ok := a.Driver().(systrayDriver); ok {
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)
}

func defaultVariant() fyne.ThemeVariant {
if C.isDarkMode() {
return theme.VariantDark
Expand Down
4 changes: 3 additions & 1 deletion app/app_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ package app
import (
"errors"
"net/url"
"os"
"path/filepath"

"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
Expand All @@ -16,7 +18,7 @@ func defaultVariant() fyne.ThemeVariant {
}

func rootConfigDir() string {
return "/tmp/fyne-test/"
return filepath.Join(os.TempDir(), "fyne-test")
}

func (a *fyneApp) OpenURL(_ *url.URL) error {
Expand Down
3 changes: 2 additions & 1 deletion app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"strings"
"testing"

"github.com/stretchr/testify/assert"

"fyne.io/fyne/v2"
_ "fyne.io/fyne/v2/test"
"github.com/stretchr/testify/assert"

"golang.org/x/sys/execabs"
)
Expand Down
Loading

0 comments on commit 8c25095

Please sign in to comment.