Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fyne-io/fyne
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.3.1
Choose a base ref
...
head repository: fyne-io/fyne
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.3.2
Choose a head ref
  • 6 commits
  • 5 files changed
  • 1 contributor

Commits on Jul 11, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    89771d2 View commit details
  2. Copy the full SHA
    00478f0 View commit details
  3. Copy the full SHA
    4473ad9 View commit details
  4. Let's replace v1.3.1

    andydotxyz committed Jul 11, 2020
    Copy the full SHA
    0137ffd View commit details
  5. Fix tests for Windows OS

    andydotxyz committed Jul 11, 2020
    Copy the full SHA
    b909a1a View commit details
  6. Copy the full SHA
    0207996 View commit details
Showing with 62 additions and 7 deletions.
  1. +1 −1 CHANGELOG.md
  2. +3 −3 internal/driver/glfw/canvas_test.go
  3. +53 −0 internal/driver/glfw/file_test.go
  4. +1 −0 internal/driver/glfw/testdata/text.txt
  5. +4 −3 internal/driver/glfw/window.go
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
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.3.1 - 7 July 2020
## 1.3.2 - 11 July 2020

### Added

6 changes: 3 additions & 3 deletions internal/driver/glfw/canvas_test.go
Original file line number Diff line number Diff line change
@@ -365,7 +365,7 @@ func Test_glCanvas_ContentChangeWithoutMinSizeChangeDoesNotLayout(t *testing.T)
func Test_glCanvas_InsufficientSizeDoesntTriggerResizeIfSizeIsAlreadyMaxedOut(t *testing.T) {
w := createWindow("Test").(*window)
c := w.Canvas().(*glCanvas)
c.Resize(fyne.NewSize(100, 100))
w.Resize(fyne.NewSize(200, 100))
popUpContent := canvas.NewRectangle(color.Black)
popUpContent.SetMinSize(fyne.NewSize(1000, 10))
popUp := widget.NewPopUp(popUpContent, c)
@@ -376,12 +376,12 @@ func Test_glCanvas_InsufficientSizeDoesntTriggerResizeIfSizeIsAlreadyMaxedOut(t

assert.Equal(t, fyne.NewSize(1000, 10), popUpContent.Size())
assert.Equal(t, fyne.NewSize(1000, 10).Add(fyne.NewSize(theme.Padding()*2, theme.Padding()*2)), popUp.MinSize())
assert.Equal(t, fyne.NewSize(100, 100), popUp.Size())
assert.Equal(t, fyne.NewSize(200, 100), popUp.Size())

repaintWindow(w)

assert.Equal(t, fyne.NewSize(1000, 10), popUpContent.Size())
assert.Equal(t, fyne.NewSize(100, 100), popUp.Size())
assert.Equal(t, fyne.NewSize(200, 100), popUp.Size())
}

func Test_glCanvas_walkTree(t *testing.T) {
53 changes: 53 additions & 0 deletions internal/driver/glfw/file_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// +build !ci !windows

package glfw

import (
"io/ioutil"
"os"
"path/filepath"
"testing"

"github.com/stretchr/testify/assert"

"fyne.io/fyne"
"fyne.io/fyne/storage"
)

func TestGLDriver_FileReaderForURI(t *testing.T) {
uri, _ := testURI("text.txt")
read, err := NewGLDriver().FileReaderForURI(uri)
defer read.Close()

assert.Nil(t, err)
assert.Equal(t, uri, read.URI())

data, err := ioutil.ReadAll(read)
assert.Nil(t, err)
assert.Equal(t, "content", string(data))
}

func TestGLDriver_FileReaderForURI_Again(t *testing.T) { // a bug blanked files
TestGLDriver_FileReaderForURI(t)
}

func TestGLDriver_FileWriterForURI(t *testing.T) {
uri, path := testURI("text2.txt")
defer os.Remove(path)
write, err := NewGLDriver().FileWriterForURI(uri)
defer write.Close()

assert.Nil(t, err)
assert.Equal(t, uri, write.URI())

count, err := write.Write([]byte("another"))
assert.Equal(t, 7, count)
assert.Nil(t, err)
}

func testURI(file string) (fyne.URI, string) {
path, _ := filepath.Abs(filepath.Join("testdata", file))
uri := storage.NewURI("file://" + path)

return uri, path
}
1 change: 1 addition & 0 deletions internal/driver/glfw/testdata/text.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
content
7 changes: 4 additions & 3 deletions internal/driver/glfw/window.go
Original file line number Diff line number Diff line change
@@ -356,6 +356,10 @@ func (w *window) doShow() {
w.visible = true
w.viewLock.Unlock()
w.viewport.SetTitle(w.title)

if w.centered {
w.doCenterOnScreen() // lastly center if that was requested
}
w.viewport.Show()

// save coordinates
@@ -1201,9 +1205,6 @@ func (w *window) create() {
}
// order of operation matters so we do these last items in order
w.viewport.SetSize(w.width, w.height) // ensure we requested latest size
if w.centered {
w.doCenterOnScreen() // lastly center if that was requested
}
})
}