Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Jan 22, 2021
2 parents a899f7f + 651acad commit ec966e7
Show file tree
Hide file tree
Showing 522 changed files with 6,518 additions and 3,881 deletions.
1 change: 1 addition & 0 deletions .godocdown.import
@@ -0,0 +1 @@
fyne.io/fyne/v2
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,6 +1,6 @@
language: go

go_import_path: fyne.io/fyne
go_import_path: fyne.io/fyne/v2

addons:
apt:
Expand Down
2 changes: 2 additions & 0 deletions AUTHORS
Expand Up @@ -7,3 +7,5 @@ Tilo Prütz <tilo@pruetz.net>
Stephen Houston <smhouston88@gmail.com>
Storm Hess <stormhess@gloryskulls.com>
Stuart Scott <stuart.murray.scott@gmail.com>
Jacob Alzén <>
Charles A. Daniels <charles@cdaniels.net>
50 changes: 42 additions & 8 deletions CHANGELOG.md
Expand Up @@ -3,19 +3,20 @@
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 - Ongoing
## 2.0 - 22 January 2021

### Changes that are not backward compatible

These changes likely break some apps, please read the
These changes may break some apps, please read the
[upgrading doc](https://developer.fyne.io/api/v2.0/upgrading) for more info
The import path is now `fyne.io/fyne/v2` when you are ready to make the update.

* Coordinate system to float32
* Size and Position units were changed from int to float32
* `Text.TextSize` moved to float32 and `fyne.MeasureText` now takes a float32 size parameter
* Removed `Size.Union` (use `Size.Max` instead)
* Added fyne.Delta for difference based X, Y representation
* DraggedEvent.DraggedX and DraggedX (int, int) to DraggedEvent.Dragged (Delta)
* Added fyne.Delta for difference-based X, Y float32 representation
* DraggedEvent.DraggedX and DraggedY (int, int) to DraggedEvent.Dragged (Delta)
* ScrollEvent.DeltaX and DeltaY (int, int) moved to ScrollEvent.Scrolled (Delta)

* Theme API update
Expand All @@ -38,25 +39,58 @@ These changes likely break some apps, please read the
- `widget.ScrollContainer` (now `container.Scroll`)
- `widget.SplitContainer` (now `container.Spilt`)
- `widget.Group` (replaced by `widget.Card`)
- `widget.Box` (now `container.NewH/VBox`)
- `widget.Box` (now `container.NewH/VBox`, with `Children` field moved to `Objects`)
- `widget.TabContainer` and `widget.AppTabs` (now `container.AppTabs`)
* Many deprecated fields have been removed, replacements listed in API docs 1.4
- for specific information you can browse https://developer.fyne.io/api/v1.4/

### Added

* Data binding API to connect data sources to widgets and sync data
- Add preferences data binding and `Preferences.AddChangeListener`
- Add bind support to `Check`, `Entry`, `Label`, `List`, `ProgressBar` and `Slider` widgets
* Animation API for handling smooth element transitions
- Add animations to buttons, tabs and entry cursor
* Storage repository API for connecting custom file sources
- Add storage functions `Copy`, `Delete` and `Move` for `URI`
- Add `CanRead`, `CanWrite` and `CanList` to storage APIs
* New Theme API for easier customisation of apps
- Add ability for custom themes to support light/dark preference
- Support for custom icons in theme definition
- New `theme.FromLegacy` helper to use old theme API definitions
* Add fyne.Vector for managing x/y float32 coordinates
* Add MouseButtonTertiary for middle mouse button events on desktop
* Add fyne.Vector for simple x/y coordinates
* Add `canvas.ImageScaleFastest` for faster, less precise, scaling
* Add new `dialog.Form` that will phase out `dialog.Entry`
* Add keyboard control for main menu
* Add `Scroll.OnScrolled` event for seeing changes in scroll container
* Add `TextStyle` and `OnSubmitted` to `Entry` widget
* Add support for `HintText` and showing validation errors in `Form` widget
* Added basic support for tab character in `Entry`, `Label` and `TextGrid`

### Changed

* Coordinate system is now float32 - see breaking changes above
* ScrollEvent and DragEvent moved to Delta from (int, int)

* Change bundled resources to use more efficient string storage
* Desktop left and right mouse buttons renamed to MouseButtonPrimary and MouseButtonSecondary
* Left and Right mouse buttons on Desktop are being moved to `MouseButtonPrimary` and `MouseButtonSecondary`
* Many optimisations and widget performance enhancements

* Moving to new `container.New()` and `container.NewWithoutLayout()` constructors (replacing `fyne.NewContainer` and `fyne.NewContainerWithoutLayout`)
* Moving storage APIs `OpenFileFromURI`, `SaveFileToURI` and `ListerForURI` to `Reader`, `Writer` and `List` functions

### Fixed

* Validating a widget in widget.Form before renderer was created could cause a panic
* Added file and folder support for mobile simulation support (#1470)
* Appending options to a disabled widget.RadioGroup shows them as enabled (#1697)
* Toggling toolbar icons does not refresh (#1809)
* Black screen when slide up application on iPhone (#1610)
* Properly align Label in FormItem (#1531)
* Mobile dropdowns are too low (#1771)
* Cursor does not go down to next line with wrapping (#1737)
* MacOS Notifications are not shown on subsequent app runs after first run due to duplicate identifier (#1699)
* Entry: while adding text beyond visible reagion there is no auto-scroll (#912)


## 1.4.3 - 4 January 2021
Expand Down
33 changes: 17 additions & 16 deletions README.md
@@ -1,9 +1,9 @@
<p align="center">
<a href="https://pkg.go.dev/fyne.io/fyne?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/v1.4.3" title="1.4.3 Release" rel="nofollow"><img src="https://img.shields.io/badge/version-1.4.3-blue.svg?style=flat" alt="1.4.3 release"></a>
<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.0" title="2.0.0 Release" rel="nofollow"><img src="https://img.shields.io/badge/version-2.0.0-blue.svg?style=flat" alt="2.0.0 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"><img src="https://goreportcard.com/badge/fyne.io/fyne" alt="Code Status" /></a>
<a href="https://goreportcard.com/report/fyne.io/fyne/v2"><img src="https://goreportcard.com/badge/fyne.io/fyne/v2" alt="Code Status" /></a>
<a href="https://github.com/fyne-io/fyne/actions"><img src="https://github.com/fyne-io/fyne/workflows/Platform%20Tests/badge.svg" alt="Build Status" /></a>
<a href='https://coveralls.io/github/fyne-io/fyne?branch=develop'><img src='https://coveralls.io/repos/github/fyne-io/fyne/badge.svg?branch=develop' alt='Coverage Status' /></a>
</p>
Expand All @@ -14,12 +14,13 @@
It is designed to build applications that run on desktop and mobile devices with a
single codebase.

Version 1.4 is the current release - it introduced high performance collection widgets,
Card, Separator and FileIcon widgets as well as a folder open dialog.
It also saw a theme refresh updating the colors and button styles for a more
material design look.
We are now working towards [2.0](https://github.com/fyne-io/fyne/milestone/6)
which aims to add data bindings, animations and more!
Version 2.0 is the current release of the Fyne API, this represented the first release since
1.0 that may break some API usage. It also added new features including data binding, animation,
storage repositories and a new more flexible theme API.
We also refreshed the default theme, adding animations, a focus colour and
redesigning the Entry, Select, SelectEntry, ProgressBar and ProgressBarInfinite widgets.
We are now working towards the next [big release](https://github.com/fyne-io/fyne/milestone/14)
and more news will follow in our news feeds and GitHub project.

# Prerequisites

Expand All @@ -29,13 +30,13 @@ 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
$ go get fyne.io/fyne/v2

# Widget demo

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

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

And you should see something like this (after you click a few buttons):
Expand All @@ -62,9 +63,9 @@ Open a new file and you're ready to write your first app!
package main

import (
"fyne.io/fyne/app"
"fyne.io/fyne/container"
"fyne.io/fyne/widget"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
)

func main() {
Expand Down Expand Up @@ -108,7 +109,7 @@ 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 get fyne.io/fyne/cmd/fyne
$ go get fyne.io/fyne/v2/cmd/fyne
$ fyne install

# Packaging a release
Expand All @@ -125,7 +126,7 @@ The above command will create a '.ipa' file that can then be uploaded to the iOS

# Documentation

More documentation is available at the [Fyne developer website](https://developer.fyne.io/) or on [pkg.go.dev](https://pkg.go.dev/fyne.io/fyne?tab=doc).
More documentation is available at the [Fyne developer website](https://developer.fyne.io/) or on [pkg.go.dev](https://pkg.go.dev/fyne.io/fyne/v2?tab=doc).

# Examples

Expand Down
14 changes: 7 additions & 7 deletions animation.go
Expand Up @@ -10,32 +10,32 @@ type AnimationCurve func(float32) float32

// AnimationRepeatForever is an AnimationCount value that indicates it should not stop looping.
//
// Since 2.0.0
// Since: 2.0
const AnimationRepeatForever = -1

var (
// AnimationEaseInOut is the default easing, it starts slowly, accelerates to the middle and slows to the end.
//
// Since 2.0.0
// Since: 2.0
AnimationEaseInOut = animationEaseInOut
// AnimationEaseIn starts slowly and accelerates to the end.
//
// Since 2.0.0
// Since: 2.0
AnimationEaseIn = animationEaseIn
// AnimationEaseOut starts at speed and slows to the end.
//
// Since 2.0.0
// Since: 2.0
AnimationEaseOut = animationEaseOut
// AnimationLinear is a linear mapping for animations that progress uniformly through their duration.
//
// Since 2.0.0
// Since: 2.0
AnimationLinear = animationLinear
)

// Animation represents an animated element within a Fyne canvas.
// These animations may control individual objects or entire scenes.
//
// Since 2.0.0
// Since: 2.0
type Animation struct {
AutoReverse bool
Curve AnimationCurve
Expand All @@ -48,7 +48,7 @@ type Animation struct {
// rendered frame between time.Now() and the specified duration. The callback values start at 0.0 and
// will be 1.0 when the animation completes.
//
// Since 2.0.0
// Since: 2.0
func NewAnimation(d time.Duration, fn func(float32)) *Animation {
return &Animation{Duration: d, Tick: fn}
}
Expand Down
8 changes: 4 additions & 4 deletions app/app.go
@@ -1,17 +1,17 @@
// Package app provides app implementations for working with Fyne graphical interfaces.
// The fastest way to get started is to call app.New() which will normally load a new desktop application.
// If the "ci" tag is passed to go (go run -tags ci myapp.go) it will run an in-memory application.
package app // import "fyne.io/fyne/app"
package app // import "fyne.io/fyne/v2/app"

import (
"fmt"
"os/exec"
"sync"
"time"

"fyne.io/fyne"
"fyne.io/fyne/internal"
helper "fyne.io/fyne/internal/app"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/internal"
helper "fyne.io/fyne/v2/internal/app"
)

// Declare conformity with App interface
Expand Down
4 changes: 2 additions & 2 deletions app/app_darwin.go
Expand Up @@ -25,8 +25,8 @@ import (
"strings"
"unsafe"

"fyne.io/fyne"
"fyne.io/fyne/theme"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
)

func defaultVariant() fyne.ThemeVariant {
Expand Down
2 changes: 1 addition & 1 deletion app/app_debug.go
Expand Up @@ -2,6 +2,6 @@

package app

import "fyne.io/fyne"
import "fyne.io/fyne/v2"

const buildMode = fyne.BuildDebug
4 changes: 2 additions & 2 deletions app/app_gl.go
Expand Up @@ -3,8 +3,8 @@
package app

import (
"fyne.io/fyne"
"fyne.io/fyne/internal/driver/glfw"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/internal/driver/glfw"
)

// NewWithID returns a new app instance using the appropriate runtime driver.
Expand Down
4 changes: 2 additions & 2 deletions app/app_mobile.go
Expand Up @@ -5,8 +5,8 @@
package app

import (
"fyne.io/fyne"
"fyne.io/fyne/internal/driver/gomobile"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/internal/driver/gomobile"
)

// NewWithID returns a new app instance using the appropriate runtime driver.
Expand Down
4 changes: 2 additions & 2 deletions app/app_mobile_and.go
Expand Up @@ -20,8 +20,8 @@ import (

mobileApp "github.com/fyne-io/mobile/app"

"fyne.io/fyne"
"fyne.io/fyne/theme"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
)

func defaultVariant() fyne.ThemeVariant {
Expand Down
4 changes: 2 additions & 2 deletions app/app_mobile_ios.go
Expand Up @@ -20,8 +20,8 @@ import (
"path/filepath"
"unsafe"

"fyne.io/fyne"
"fyne.io/fyne/theme"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
)

func defaultVariant() fyne.ThemeVariant {
Expand Down
4 changes: 2 additions & 2 deletions app/app_other.go
Expand Up @@ -6,8 +6,8 @@ import (
"errors"
"net/url"

"fyne.io/fyne"
"fyne.io/fyne/theme"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
)

func defaultVariant() fyne.ThemeVariant {
Expand Down
2 changes: 1 addition & 1 deletion app/app_release.go
Expand Up @@ -2,6 +2,6 @@

package app

import "fyne.io/fyne"
import "fyne.io/fyne/v2"

const buildMode = fyne.BuildRelease
6 changes: 3 additions & 3 deletions app/app_software.go
Expand Up @@ -3,9 +3,9 @@
package app

import (
"fyne.io/fyne"
"fyne.io/fyne/internal/painter/software"
"fyne.io/fyne/test"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/internal/painter/software"
"fyne.io/fyne/v2/test"
)

// NewWithID returns a new app instance using the test (headless) driver.
Expand Down
2 changes: 1 addition & 1 deletion app/app_standard.go
Expand Up @@ -2,6 +2,6 @@

package app

import "fyne.io/fyne"
import "fyne.io/fyne/v2"

const buildMode = fyne.BuildStandard
4 changes: 2 additions & 2 deletions app/app_test.go
Expand Up @@ -6,8 +6,8 @@ import (
"strings"
"testing"

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

Expand Down
4 changes: 2 additions & 2 deletions app/app_windows.go
Expand Up @@ -16,8 +16,8 @@ import (

"golang.org/x/sys/windows/registry"

"fyne.io/fyne"
"fyne.io/fyne/theme"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
)

const notificationTemplate = `$title = "%s"
Expand Down
4 changes: 2 additions & 2 deletions app/app_xdg.go
Expand Up @@ -12,8 +12,8 @@ import (

"github.com/godbus/dbus/v5"

"fyne.io/fyne"
"fyne.io/fyne/theme"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
)

func defaultVariant() fyne.ThemeVariant {
Expand Down

0 comments on commit ec966e7

Please sign in to comment.