Skip to content

Commit

Permalink
Merge branch 'release/v1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Jun 21, 2019
2 parents 884e61d + 60f68f2 commit 78cdfc5
Show file tree
Hide file tree
Showing 242 changed files with 11,920 additions and 1,891 deletions.
35 changes: 33 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
.idea

### Project Specific
cmd/fyne/fyne
cmd/fyne_demo/fyne_demo
cmd/hello/hello

### Go
# Output of the coverage tool
*.out

### macOS
# General
.DS_Store

# Thumbnails
._*

### JetBrains
.idea

### Vim
# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]

# Session
Session.vim

# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
14 changes: 9 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,21 @@ before_script:
- go get github.com/mattn/goveralls

script:
- test -z $(gofmt -s -l $NO_VENDOR)
- test -z $(gofmt -s -e -d $NO_VENDOR | tee /dev/stderr)
# enable go modules only for 1.12.x
- if [[ "$TRAVIS_GO_VERSION" == 1.12* ]]; then export GO111MODULE=on; fi
# test vendor folder only for 1.12.x on osx
- if [[ "$TRAVIS_GO_VERSION" == 1.12* && "$TRAVIS_OS_NAME" == "osx" ]]; then export GOFLAGS=-mod=vendor; fi
- go test -tags ci ./...
- go vet -tags ci -unsafeptr=false ./...
- golint -set_exit_status $(go list -tags ci ./...) || exit 1
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit; fi'
- go test -tags ci -covermode=atomic -coverprofile=coverage.out ./...
- $(go env GOPATH | awk 'BEGIN{FS=":"} {print $1}')/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN
- golint -set_exit_status $(go list -tags ci ./...)
- |
set -e
if [ "$TRAVIS_PULL_REQUEST" == "false" && -n "$COVERALLS_TOKEN" ]
then
go test -tags ci -covermode=atomic -coverprofile=coverage.out ./...
$(go env GOPATH | awk 'BEGIN{FS=":"} {print $1}')/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN
fi
env:
global:
Expand Down
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ Andy Williams <andy@andy.xyz>
Steve OConnor <steveoc64@gmail.com>
Luca Corbo <lu.corbo@gmail.com>
Paul Hovey <paul@paulhovey.org>
Charles Corbett <nafredy@gmail.com>
Tilo Prütz <tilo@pruetz.net>
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,43 @@
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).

## 1.1

### Added

* Menubar and PopUpMenu (#41)
* PopUp widgets (regular and modal) and canvas overlay support (#242)
* Add gradient (linear and radial) to canvas
* Add shadow support for overlays, buttons and scrollcontainer
* Text can now be selected (#67)
* Support moving through inputs with Tab / Shift-Tab (#82)
* canvas.Capture() to save the content of a canvas
* Horizontal layout for widget.Radio
* Select widget (#21)
* Add support for disabling widgets (#234)
* Support for changing icon color (#246)
* Button hover effect
* Pointer drag event to main API
* support for desktop mouse move events
* Add a new "hints" build tag that can suggest UI improvements

### Changed

* TabContainer tab location can now be set with SetTabLocation()
* Dialog windows now appear as modal popups within a window
* Don't add a button bar to a form if it has no buttons
* Moved driver/gl package to internal/driver/gl
* Clicking/Tapping in an entry will position the cursor
* A container with no layout will not change the position or size of it's content
* Update the fyne_demo app to reflect the expanding feature set

### Fixed

* Allow scrollbars to be dragged (#133)
* Unicode char input with Option key on macOS (#247)
* Resizng fixed size windows (#248)
* Fixed various bugs in window sizing and padding
* Button icons do not center align if label is empty (#284)


## 1.0.1 - 20 April 2019
Expand Down Expand Up @@ -34,6 +70,7 @@ More detailed release notes can be found on the [releases page](https://github.c
* Possible panic on app.Quit() (#175)
* Various caches and race condition issues (#194, #217, #209).


## 1.0 19 - March 2019

The first major release of the Fyne toolkit delivers a stable release of the
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<a href="https://godoc.org/fyne.io/fyne" title="GoDoc Reference" rel="nofollow"><img src="https://img.shields.io/badge/go-documentation-blue.svg?style=flat" alt="GoDoc Reference"></a>
<a href="https://github.com/fyne-io/fyne/releases/tag/v1.0.1" title="1.0.1 Release" rel="nofollow"><img src="https://img.shields.io/badge/version-1.0.1-blue.svg?style=flat" alt="1.0.1 release"></a>
<a href="https://github.com/fyne-io/fyne/releases/tag/v1.1.0" title="1.1 Release" rel="nofollow"><img src="https://img.shields.io/badge/version-1.1.0-blue.svg?style=flat" alt="1.1 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>
<a href='https://fossfi.sh/support-fyneio'><img src='https://img.shields.io/badge/$-support_us-orange.svg?labelWidth=20&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAkCAYAAADPRbkKAAAABmJLR0QA7wAyAD/CTveyAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAAB3RJTUUH4wMVCQ4LeuPReAAABDFJREFUWMPVmX9oVWUYxz/3tr5jbX9oYiZWSmNgoYYlUVqraYvIamlCg8pqUBTZr38qMhZZ0A8oIqKIiLJoJtEIsR+zki1mGqQwZTYkImtlgk5Wy7jPnbv90XPgcD3n3Lvdy731wOGc+77nec73Oe/zfp/nOTeVy+WolphZC3CVH9N9OAsMAzuBLkkHkmykKu2AmQGsAjYAC4pQ+QJ4WNJg1R0ws3pgI3DTJFVPAM8AGyRNVMUBB98DLCvBzLtAh6QTwUC6gmGzuUTwAGuBR8MD6QpFzwPAypi5v4HXgRXAEg+vLQm2njSzCyoWQmbWAPwAzIqY/gm4UdJAhN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Sw2pv4H3Ayg0FmbTMRAAAAAElFTkSuQmCC' alt='Support Fyne.io' /></a>
<br />
Expand All @@ -14,8 +14,10 @@

[Fyne](http://fyne.io) is an easy to use UI toolkit and app API written in Go. We use OpenGL (through the go-gl and go-glfw projects) to provide cross platform graphics.

Version 1.0.1 is the current release which was a bugfix and stability release.
We are now working towards 1.1 which will add new functionality.
Version 1.1 is the current release which added lots of new functionality
including gradients, shadows and new widgets.
We are now working towards 1.2 which will complete the basic UI toolkit
phase of development.

# Widget demo

Expand Down
37 changes: 5 additions & 32 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ import (
"sync"

"fyne.io/fyne"
helper "fyne.io/fyne/internal/app"
"fyne.io/fyne/theme"
"fyne.io/fyne/widget"
)

// Declare conformity with App interface
var _ fyne.App = (*fyneApp)(nil)

type fyneApp struct {
driver fyne.Driver
icon fyne.Resource
Expand Down Expand Up @@ -65,36 +68,6 @@ func (app *fyneApp) Settings() fyne.Settings {
return app.settings
}

func (app *fyneApp) applyThemeTo(content fyne.CanvasObject, canvas fyne.Canvas) {
if themed, ok := content.(fyne.Themeable); ok {
themed.ApplyTheme()
canvas.Refresh(content)
}
if wid, ok := content.(fyne.Widget); ok {
widget.Renderer(wid).ApplyTheme()
canvas.Refresh(content)

for _, o := range widget.Renderer(wid).Objects() {
app.applyThemeTo(o, canvas)
}
}
if c, ok := content.(*fyne.Container); ok {
for _, o := range c.Objects {
app.applyThemeTo(o, canvas)
}
canvas.Refresh(c)
}
}

func (app *fyneApp) applyTheme() {
for _, window := range app.driver.AllWindows() {
if window.Padded() {
window.Content().Move(fyne.NewPos(theme.Padding(), theme.Padding()))
}
app.applyThemeTo(window.Content(), window.Canvas())
}
}

func (app *fyneApp) setupTheme() {
env := os.Getenv("FYNE_THEME")
if env == "light" {
Expand All @@ -117,7 +90,7 @@ func NewAppWithDriver(d fyne.Driver) fyne.App {
go func() {
for {
<-listener
newApp.applyTheme()
helper.ApplyTheme(newApp)
}
}()

Expand Down
2 changes: 1 addition & 1 deletion app/app_gl.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package app

import (
"fyne.io/fyne"
"fyne.io/fyne/driver/gl"
"fyne.io/fyne/internal/driver/gl"
)

// New returns a new app instance using the OpenGL driver.
Expand Down
3 changes: 3 additions & 0 deletions app/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import (
"fyne.io/fyne"
)

// Declare conformity with Settings interface
var _ fyne.Settings = (*settings)(nil)

type settings struct {
themeLock sync.RWMutex
theme fyne.Theme
Expand Down
7 changes: 7 additions & 0 deletions canvas.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package fyne

import "image"

// Canvas defines a graphical canvas to which a CanvasObject or Container can be added.
// Each canvas has a scale which is automatically applied during the render process.
type Canvas interface {
Expand All @@ -14,9 +16,14 @@ type Canvas interface {
Scale() float32
SetScale(float32)

Overlay() CanvasObject
SetOverlay(CanvasObject)

OnTypedRune() func(rune)
SetOnTypedRune(func(rune))
OnTypedKey() func(*KeyEvent)
SetOnTypedKey(func(*KeyEvent))
AddShortcut(shortcut Shortcut, handler func(shortcut Shortcut))

Capture() image.Image
}
7 changes: 5 additions & 2 deletions canvas/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package canvas // import "fyne.io/fyne/canvas"

import "fyne.io/fyne"

// Declare conformity with CanvasObject interface
var _ fyne.CanvasObject = (*baseObject)(nil)

type baseObject struct {
size fyne.Size // The current size of the Rectangle
position fyne.Position // The current position of the Rectangle
Expand All @@ -21,12 +24,12 @@ func (r *baseObject) Resize(size fyne.Size) {
r.size = size
}

// CurrentPosition gets the current position of this rectangle object, relative to it's parent / canvas
// CurrentPosition gets the current position of this rectangle object, relative to its parent / canvas
func (r *baseObject) Position() fyne.Position {
return r.position
}

// Move the rectangle object to a new position, relative to it's parent / canvas
// Move the rectangle object to a new position, relative to its parent / canvas
func (r *baseObject) Move(pos fyne.Position) {
r.position = pos
}
Expand Down
7 changes: 5 additions & 2 deletions canvas/circle.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import (
"fyne.io/fyne"
)

// Declare conformity with CanvasObject interface
var _ fyne.CanvasObject = (*Circle)(nil)

// Circle describes a coloured circle primitive in a Fyne canvas
type Circle struct {
Position1 fyne.Position // The current top-left position of the Circle
Expand All @@ -27,12 +30,12 @@ func (l *Circle) Resize(size fyne.Size) {
l.Position2 = fyne.NewPos(l.Position1.X+size.Width, l.Position1.Y+size.Height)
}

// Position gets the current top-left position of this circle object, relative to it's parent / canvas
// Position gets the current top-left position of this circle object, relative to its parent / canvas
func (l *Circle) Position() fyne.Position {
return l.Position1
}

// Move the circle object to a new position, relative to it's parent / canvas
// Move the circle object to a new position, relative to its parent / canvas
func (l *Circle) Move(pos fyne.Position) {
size := l.Size()
l.Position1 = pos
Expand Down
28 changes: 28 additions & 0 deletions canvas/circle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"image/color"
"testing"

"fyne.io/fyne"

_ "fyne.io/fyne/test"
"github.com/stretchr/testify/assert"
)
Expand All @@ -22,3 +24,29 @@ func TestCircle_FillColor(t *testing.T) {

assert.Equal(t, c, circle.FillColor)
}

func TestCircle_Resize(t *testing.T) {
targetWidth := 50
targetHeight := 50
circle := NewCircle(color.White)
start := circle.Size()
assert.True(t, start.Height == 0)
assert.True(t, start.Width == 0)

circle.Resize(fyne.NewSize(targetWidth, targetHeight))
target := circle.Size()
assert.True(t, target.Height == targetHeight)
assert.True(t, target.Width == targetWidth)
}

func TestCircle_Move(t *testing.T) {
circle := NewCircle(color.White)
circle.Resize(fyne.NewSize(50, 50))

start := fyne.Position{X: 0, Y: 0}
assert.True(t, circle.Position() == start)

target := fyne.Position{X: 10, Y: 75}
circle.Move(target)
assert.True(t, circle.Position() == target)
}

0 comments on commit 78cdfc5

Please sign in to comment.