Skip to content

Commit

Permalink
Merge branch 'release/v2.0.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Apr 1, 2021
2 parents d8f29c2 + c42bea5 commit 912f723
Show file tree
Hide file tree
Showing 95 changed files with 1,885 additions and 709 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,35 @@
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.0.2 - 1 April 2021

### Changed

* Text can now be copied from a disable Entry using keyboard shortcuts

### Fixed

* Slider offset position could be incorrect for mobile apps
* Correct error in example code
* When graphics init fails then don't try to continue running (#1593)
* Don't show global settings on mobile in fyne_demo as it's not supported (#2062)
* Empty selection would render small rectangle in Entry
* Do not show validation state for disabled Entry
* dialog.ShowFileSave did not support mobile (#2076)
* Fix issue that storage could not write to files on iOS and Android
* mobile app could crash in some focus calls
* Duplicate symbol error when compiling for Android with NDK 23 (#2064)
* Add internet permission by default for Android apps (#1715)
* Child and Parent support in storage were missing for mobile appps
* Various crashes with Entry and multiline selections (including #1989)
* Slider calls OnChanged for each value between steps (#1748)
* fyne command doesn't remove temporary binary from src (#1910)
* Advanced Color picker on mobile keeps updating values forever after sliding (#2075)
* exec.Command and widget.Button combination not working (#1857)
* After clicking a link on macOS, click everywhere in the app will be linked (#2112)
* Text selection - Shift+Tab bug (#1787)


## 2.0.1 - 4 March 2021

### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
<p align="center">
<a href="https://pkg.go.dev/fyne.io/fyne/v2?tab=doc" title="Go API Reference" rel="nofollow"><img src="https://img.shields.io/badge/go-documentation-blue.svg?style=flat" alt="Go API Reference"></a>
<a href="https://github.com/fyne-io/fyne/releases/tag/v2.0.1" title="2.0.1 Release" rel="nofollow"><img src="https://img.shields.io/badge/version-2.0.1-blue.svg?style=flat" alt="2.0.1 release"></a>
<a href="https://github.com/fyne-io/fyne/releases/tag/v2.0.2" title="2.0.2 Release" rel="nofollow"><img src="https://img.shields.io/badge/version-2.0.2-blue.svg?style=flat" alt="2.0.2 release"></a>
<a href='http://gophers.slack.com/messages/fyne'><img src='https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=blue' alt='Join us on Slack' /></a>
<br />
<a href="https://goreportcard.com/report/fyne.io/fyne/v2"><img src="https://goreportcard.com/badge/fyne.io/fyne/v2" alt="Code Status" /></a>
Expand Down
3 changes: 3 additions & 0 deletions app/app.go
Expand Up @@ -90,6 +90,9 @@ func (app *fyneApp) Storage() fyne.Storage {
}

func (app *fyneApp) Preferences() fyne.Preferences {
if app.uniqueID == "" {
fyne.LogError("Preferences API requires a unique ID, use app.NewWithID()", nil)
}
return app.prefs
}

Expand Down
3 changes: 2 additions & 1 deletion app/app_mobile_and.go
Expand Up @@ -16,6 +16,7 @@ import (
"log"
"net/url"
"os"
"path/filepath"
"unsafe"

mobileApp "github.com/fyne-io/mobile/app"
Expand Down Expand Up @@ -54,5 +55,5 @@ func rootConfigDir() string {
return "/data/data" // probably won't work, but we can't make a better guess
}

return filesDir
return filepath.Join(filesDir, "fyne")
}
4 changes: 2 additions & 2 deletions app/preferences_android.go
Expand Up @@ -7,12 +7,12 @@ import "path/filepath"
// storagePath returns the location of the settings storage
func (p *preferences) storagePath() string {
// we have no global storage, use app global instead - rootConfigDir looks up in app_mobile_and.go
return filepath.Join(rootConfigDir(), "storage", "preferences.json")
return filepath.Join(p.app.storageRoot(), "preferences.json")
}

// storageRoot returns the location of the app storage
func (a *fyneApp) storageRoot() string {
return filepath.Join(rootConfigDir(), a.uniqueID)
return rootConfigDir() // we are in a sandbox, so no app ID added to this path
}

func (p *preferences) watch() {
Expand Down
4 changes: 4 additions & 0 deletions canvas/image.go
Expand Up @@ -71,6 +71,10 @@ func (i *Image) Alpha() float64 {
// Resize on an image will scale the content or reposition it according to FillMode.
// It will normally cause a Refresh to ensure the pixels are recalculated.
func (i *Image) Resize(s fyne.Size) {
if s == i.Size() {
return
}

i.baseObject.Resize(s)

Refresh(i)
Expand Down
4 changes: 4 additions & 0 deletions canvas/raster.go
Expand Up @@ -34,6 +34,10 @@ func (r *Raster) Alpha() float64 {
// Resize on a raster image causes the new size to be set and then calls Refresh.
// This causes the underlying data to be recalculated and a new output to be drawn.
func (r *Raster) Resize(s fyne.Size) {
if s == r.Size() {
return
}

r.baseObject.Resize(s)
Refresh(r)
}
Expand Down
9 changes: 9 additions & 0 deletions cmd/fyne/commands/package.go
Expand Up @@ -3,6 +3,7 @@ package commands
import (
"flag"
"fmt"
"log"
"strconv"
"strings"

Expand Down Expand Up @@ -105,6 +106,7 @@ func (p *packager) doPackage() error {
if !util.Exists(p.exe) {
return fmt.Errorf("unable to build directory to expected executable, %s", p.exe)
}
defer p.removeBuild()
}

switch p.os {
Expand All @@ -123,6 +125,13 @@ func (p *packager) doPackage() error {
}
}

func (p *packager) removeBuild() {
err := os.Remove(p.exe)
if err != nil {
log.Println("Unable to remove temporary build file", p.exe)
}
}

func (p *packager) validate() error {
if p.os == "" {
p.os = targetOS()
Expand Down

0 comments on commit 912f723

Please sign in to comment.