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: v2.3.3
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: v2.3.4
Choose a head ref

Commits on Mar 24, 2023

  1. Update systray to fix root submenus on darwin

    Fixes #3759
    Andy Williams committed Mar 24, 2023
    Copy the full SHA
    b12a7ac View commit details

Commits on Mar 26, 2023

  1. Don't use mobile dep in desktop env

    Andy Williams committed Mar 26, 2023
    Copy the full SHA
    949fdb4 View commit details

Commits on Mar 29, 2023

  1. Copy the full SHA
    f9f3e5d View commit details
  2. Copy the full SHA
    a1edc48 View commit details

Commits on Apr 1, 2023

  1. Copy the full SHA
    2e7ec09 View commit details
  2. Merge pull request #3778 from Jacalz/boxes

    Improve the VBox and HBox documentation
    Jacalz authored Apr 1, 2023
    Copy the full SHA
    52ae56c View commit details

Commits on Apr 3, 2023

  1. Update systray to get windows fixes

    Fixes #3760
    andydotxyz committed Apr 3, 2023
    Copy the full SHA
    692f76f View commit details

Commits on Apr 28, 2023

  1. Copy the full SHA
    c98ff2e View commit details
  2. AUTHORS: Update the email for Jacalz

    Jacalz authored and andydotxyz committed Apr 28, 2023
    Copy the full SHA
    6cfff57 View commit details
  3. layout: Reduce allocations for VBox and HBox with spacers

    The boxlayout code was heap-allocating a slice of canvas objects  to keep track of sliders. However, it only had to keep track of the count.
    Jacalz authored and andydotxyz committed Apr 28, 2023
    Copy the full SHA
    d8d2c65 View commit details
  4. Copy the full SHA
    cbff586 View commit details
  5. Don't force menu to refresh when we hover

    If it can be avoided
    andydotxyz committed Apr 28, 2023
    Copy the full SHA
    50a2a40 View commit details
  6. Use an array as we are only using its content in a linear way.

    Cedric BAIL authored and andydotxyz committed Apr 28, 2023
    Copy the full SHA
    4ddd31b View commit details
  7. Cache theme.Padding() as it is a costly call.

    Cedric BAIL authored and andydotxyz committed Apr 28, 2023
    Copy the full SHA
    07c6029 View commit details
  8. Copy the full SHA
    e241e1b View commit details
  9. Avoid calling theme function in RichText too often as it is costly.

    This reduce the time spend in lock from 6% to 4% which is not
    negligeable. From the trace, it seems that we are taking the RichText
    propertyLock to often and that cause another 2 points. Another PR should
    review those and reduce the amount of time calling the locking
    mechanism.
    Cedric BAIL authored and andydotxyz committed Apr 28, 2023
    Copy the full SHA
    df8abd9 View commit details
  10. Remove dead code in test.

    Cedric BAIL authored and andydotxyz committed Apr 28, 2023
    Copy the full SHA
    ff63baf View commit details
  11. Correct offset according to previous behavior.

    Jumping to a requested position was actually done on exact bundary,
    correct this.
    Cedric BAIL authored and andydotxyz committed Apr 28, 2023
    Copy the full SHA
    936120c View commit details
  12. Reduce allocation and array bound check.

    Cedric BAIL authored and andydotxyz committed Apr 28, 2023
    Copy the full SHA
    ad9e174 View commit details
  13. Copy the full SHA
    bc6eb62 View commit details
  14. Simplify and optimize code further.

    Cedric BAIL authored and andydotxyz committed Apr 28, 2023
    Copy the full SHA
    cc089cd View commit details
  15. Remove use of negation.

    Cedric BAIL authored and andydotxyz committed Apr 28, 2023
    Copy the full SHA
    cfe043b View commit details
  16. Pick newer go-text with lower memory allocation.

    Cedric BAIL authored and andydotxyz committed Apr 28, 2023
    Copy the full SHA
    56878c0 View commit details
  17. Create new common Repaint method

    Move refresh to repaint where appropriate
    And update on moves.
    
    Fixes #2205
    andydotxyz committed Apr 28, 2023
    Copy the full SHA
    02cae29 View commit details
  18. Proposed v2.3.4 changes

    andydotxyz committed Apr 28, 2023
    Copy the full SHA
    8faea26 View commit details
  19. Copy the full SHA
    ff08b25 View commit details
  20. Copy the full SHA
    09431a4 View commit details
  21. Add test file updates

    andydotxyz committed Apr 28, 2023
    Copy the full SHA
    c7a5324 View commit details
  22. Copy the full SHA
    725475f View commit details
  23. Final list ready

    andydotxyz committed Apr 28, 2023
    Copy the full SHA
    c8fe322 View commit details
  24. Copy the full SHA
    2c98ab5 View commit details
  25. Copy the full SHA
    1446752 View commit details
  26. Fix method ordering

    andydotxyz committed Apr 28, 2023
    Copy the full SHA
    dac956b View commit details
  27. Copy the full SHA
    2cc9d2e View commit details
  28. Copy the full SHA
    d30f691 View commit details

Commits on May 3, 2023

  1. Copy the full SHA
    6558290 View commit details
Showing 320 changed files with 21,276 additions and 44,629 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/platform_tests.yml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ jobs:
go-version: ${{ matrix.go-version }}

- 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 libwayland-dev libxkbcommon-dev bc
run: sudo apt-get update && sudo apt-get install gcc libgl1-mesa-dev libx11-dev xorg-dev libwayland-dev libxkbcommon-dev bc
if: ${{ runner.os == 'Linux' }}

- name: Tests
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ 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 <>
Jacob Alzén <jacalz@tutanota.com>
Charles A. Daniels <charles@cdaniels.net>
Pablo Fuentes <f.pablo1@hotmail.com>
Changkun Ou <hi@changkun.de>
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,12 +3,29 @@
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.4 - 3 May 2023

### Fixed

* Memory leak when switching theme (#3640)
* Systray MenuItem separators not rendered in macOS root menu (#3759)
* Systray leaks window handles on Windows (#3760)
* RadioGroup miscalculates label widths in horizontal mode (#3386)
* Start of selection in entry is shifted when moving too fast (#3804)
* Performance issue in widget.List (#3816)
* Moving canvas items (e.g. Images) does not cause canvas repaint (#2205)
* Minor graphic glitch with checkbox (#3792)
* VBox and HBox using heap memory that was not required
* Menu hover is slow on long menus


## 2.3.3 - 24 March 2023

### Fixed

* Linux, Windows and BSD builds could fail if gles was missing


## 2.3.2 - 20 March 2023

### Fixed
14 changes: 14 additions & 0 deletions canvas/canvas.go
Original file line number Diff line number Diff line change
@@ -13,3 +13,17 @@ func Refresh(obj fyne.CanvasObject) {
c.Refresh(obj)
}
}

// repaint instructs the containing canvas to redraw, even if nothing changed.
func repaint(obj fyne.CanvasObject) {
if fyne.CurrentApp() == nil || fyne.CurrentApp().Driver() == nil {
return
}

c := fyne.CurrentApp().Driver().CanvasForObject(obj)
if c != nil {
if paint, ok := c.(interface{ SetDirty() }); ok {
paint.SetDirty()
}
}
}
5 changes: 3 additions & 2 deletions canvas/circle.go
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ func NewCircle(color color.Color) *Circle {
func (c *Circle) Hide() {
c.Hidden = true

c.Refresh()
repaint(c)
}

// MinSize for a Circle simply returns Size{1, 1} as there is no
@@ -45,14 +45,15 @@ func (c *Circle) Move(pos fyne.Position) {
size := c.Size()
c.Position1 = pos
c.Position2 = fyne.NewPos(c.Position1.X+size.Width, c.Position1.Y+size.Height)
repaint(c)
}

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

// Refresh causes this object to be redrawn in it's current state
// Refresh causes this object to be redrawn with its configured state.
func (c *Circle) Refresh() {
Refresh(c)
}
36 changes: 33 additions & 3 deletions canvas/gradient.go
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@ import (
"image"
"image/color"
"math"

"fyne.io/fyne/v2"
)

// LinearGradient defines a Gradient travelling straight at a given angle.
@@ -57,7 +59,21 @@ func (g *LinearGradient) Generate(iw, ih int) image.Image {
return computeGradient(generator, iw, ih, g.StartColor, g.EndColor)
}

// Refresh causes this object to be redrawn in it's current state
// Hide will set this gradient to not be visible
func (g *LinearGradient) Hide() {
g.baseObject.Hide()

repaint(g)
}

// Move the gradient to a new position, relative to its parent / canvas
func (g *LinearGradient) Move(pos fyne.Position) {
g.baseObject.Move(pos)

repaint(g)
}

// Refresh causes this gradient to be redrawn with its configured state.
func (g *LinearGradient) Refresh() {
Refresh(g)
}
@@ -106,7 +122,21 @@ func (g *RadialGradient) Generate(iw, ih int) image.Image {
return computeGradient(generator, iw, ih, g.StartColor, g.EndColor)
}

// Refresh causes this object to be redrawn in it's current state
// Hide will set this gradient to not be visible
func (g *RadialGradient) Hide() {
g.baseObject.Hide()

repaint(g)
}

// Move the gradient to a new position, relative to its parent / canvas
func (g *RadialGradient) Move(pos fyne.Position) {
g.baseObject.Move(pos)

repaint(g)
}

// Refresh causes this gradient to be redrawn with its configured state.
func (g *RadialGradient) Refresh() {
Refresh(g)
}
@@ -161,7 +191,7 @@ func NewHorizontalGradient(start, end color.Color) *LinearGradient {
return g
}

// NewLinearGradient creates a linear gradient at a the specified angle.
// NewLinearGradient creates a linear gradient at the specified angle.
// The angle parameter is the degree angle along which the gradient is calculated.
// A NewHorizontalGradient uses 270 degrees and NewVerticalGradient is 0 degrees.
func NewLinearGradient(start, end color.Color, angle float64) *LinearGradient {
28 changes: 21 additions & 7 deletions canvas/image.go
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ const (
var _ fyne.CanvasObject = (*Image)(nil)

// Image describes a drawable image area that can render in a Fyne canvas
// The image may be a vector or a bitmap representation and it will fill the area.
// The image may be a vector or a bitmap representation, it will fill the area.
// The fill mode can be changed by setting FillMode to a different ImageFill.
type Image struct {
baseObject
@@ -68,6 +68,25 @@ func (i *Image) Alpha() float64 {
return 1.0 - i.Translucency
}

// Hide will set this image to not be visible
func (i *Image) Hide() {
i.baseObject.Hide()

repaint(i)
}

// Move the image object to a new position, relative to its parent top, left corner.
func (i *Image) Move(pos fyne.Position) {
i.baseObject.Move(pos)

repaint(i)
}

// Refresh causes this image to be redrawn with its configured state.
func (i *Image) Refresh() {
Refresh(i)
}

// 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) {
@@ -83,11 +102,6 @@ func (i *Image) Resize(s fyne.Size) {
Refresh(i)
}

// Refresh causes this object to be redrawn in it's current state
func (i *Image) Refresh() {
Refresh(i)
}

// NewImageFromFile creates a new image from a local file.
// Images returned from this method will scale to fit the canvas object.
// The method for scaling can be set using the Fill field.
@@ -124,7 +138,7 @@ func NewImageFromURI(uri fyne.URI) *Image {
}

// NewImageFromReader creates a new image from a data stream.
// The name parameter is required to uniquely identify this image (for caching etc).
// The name parameter is required to uniquely identify this image (for caching etc.).
// If the image in this io.Reader is an SVG, the name should end ".svg".
// Images returned from this method will scale to fit the canvas object.
// The method for scaling can be set using the Fill field.
9 changes: 5 additions & 4 deletions canvas/line.go
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ var _ fyne.CanvasObject = (*Line)(nil)
// an inverse slope (i.e. slope up vs down).
type Line struct {
Position1 fyne.Position // The current top-left position of the Line
Position2 fyne.Position // The current bottomright position of the Line
Position2 fyne.Position // The current bottom-right position of the Line
Hidden bool // Is this Line currently hidden

StrokeColor color.Color // The line stroke color
@@ -28,7 +28,7 @@ func (l *Line) Size() fyne.Size {
float32(math.Abs(float64(l.Position2.Y)-float64(l.Position1.Y))))
}

// Resize sets a new bottom-right position for the line object and it will then be refreshed.
// Resize sets a new bottom-right position for the line object, then it will then be refreshed.
func (l *Line) Resize(size fyne.Size) {
if size == l.Size() {
return
@@ -60,6 +60,7 @@ func (l *Line) Move(pos fyne.Position) {

l.Position1 = l.Position1.Add(fyne.NewPos(deltaX, deltaY))
l.Position2 = l.Position2.Add(fyne.NewPos(deltaX, deltaY))
repaint(l)
}

// MinSize for a Line simply returns Size{1, 1} as there is no
@@ -84,10 +85,10 @@ func (l *Line) Show() {
func (l *Line) Hide() {
l.Hidden = true

l.Refresh()
repaint(l)
}

// Refresh causes this object to be redrawn in it's current state
// Refresh causes this line to be redrawn with its configured state.
func (l *Line) Refresh() {
Refresh(l)
}
36 changes: 25 additions & 11 deletions canvas/raster.go
Original file line number Diff line number Diff line change
@@ -31,6 +31,20 @@ func (r *Raster) Alpha() float64 {
return 1.0 - r.Translucency
}

// Hide will set this raster to not be visible
func (r *Raster) Hide() {
r.baseObject.Hide()

repaint(r)
}

// Move the raster to a new position, relative to its parent / canvas
func (r *Raster) Move(pos fyne.Position) {
r.baseObject.Move(pos)

repaint(r)
}

// 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) {
@@ -42,7 +56,7 @@ func (r *Raster) Resize(s fyne.Size) {
Refresh(r)
}

// Refresh causes this object to be redrawn in it's current state
// Refresh causes this raster to be redrawn with its configured state.
func (r *Raster) Refresh() {
Refresh(r)
}
@@ -151,25 +165,25 @@ func NewRasterFromImage(img image.Image) *Raster {
// respect the user's pixel format (if possible)
var dst draw.Image
switch i := img.(type) {
case (*image.Alpha):
case *image.Alpha:
dst = image.NewAlpha(rect)
case (*image.Alpha16):
case *image.Alpha16:
dst = image.NewAlpha16(rect)
case (*image.CMYK):
case *image.CMYK:
dst = image.NewCMYK(rect)
case (*image.Gray):
case *image.Gray:
dst = image.NewGray(rect)
case (*image.Gray16):
case *image.Gray16:
dst = image.NewGray16(rect)
case (*image.NRGBA):
case *image.NRGBA:
dst = image.NewNRGBA(rect)
case (*image.NRGBA64):
case *image.NRGBA64:
dst = image.NewNRGBA64(rect)
case (*image.Paletted):
case *image.Paletted:
dst = image.NewPaletted(rect, i.Palette)
case (*image.RGBA):
case *image.RGBA:
dst = image.NewRGBA(rect)
case (*image.RGBA64):
case *image.RGBA64:
dst = image.NewRGBA64(rect)
default:
dst = image.NewRGBA(rect)
16 changes: 15 additions & 1 deletion canvas/rectangle.go
Original file line number Diff line number Diff line change
@@ -18,7 +18,21 @@ type Rectangle struct {
StrokeWidth float32 // The stroke width of the rectangle
}

// Refresh causes this object to be redrawn in it's current state
// Hide will set this rectangle to not be visible
func (r *Rectangle) Hide() {
r.baseObject.Hide()

repaint(r)
}

// Move the rectangle to a new position, relative to its parent / canvas
func (r *Rectangle) Move(pos fyne.Position) {
r.baseObject.Move(pos)

repaint(r)
}

// Refresh causes this rectangle to be redrawn with its configured state.
func (r *Rectangle) Refresh() {
Refresh(r)
}
18 changes: 16 additions & 2 deletions canvas/text.go
Original file line number Diff line number Diff line change
@@ -22,12 +22,26 @@ type Text struct {
TextStyle fyne.TextStyle // The style of the text content
}

// Hide will set this text to not be visible
func (t *Text) Hide() {
t.baseObject.Hide()

repaint(t)
}

// MinSize returns the minimum size of this text object based on its font size and content.
// This is normally determined by the render implementation.
func (t *Text) MinSize() fyne.Size {
return fyne.MeasureText(t.Text, t.TextSize, t.TextStyle)
}

// Move the text to a new position, relative to its parent / canvas
func (t *Text) Move(pos fyne.Position) {
t.baseObject.Move(pos)

repaint(t)
}

// Resize on a text updates the new size of this object, which may not result in a visual change, depending on alignment.
func (t *Text) Resize(s fyne.Size) {
if s == t.Size() {
@@ -39,11 +53,11 @@ func (t *Text) Resize(s fyne.Size) {
}

// SetMinSize has no effect as the smallest size this canvas object can be is based on its font size and content.
func (t *Text) SetMinSize(size fyne.Size) {
func (t *Text) SetMinSize(fyne.Size) {
// no-op
}

// Refresh causes this object to be redrawn in it's current state
// Refresh causes this text to be redrawn with its configured state.
func (t *Text) Refresh() {
Refresh(t)
}
17 changes: 17 additions & 0 deletions container.go
Original file line number Diff line number Diff line change
@@ -80,6 +80,7 @@ func (c *Container) Hide() {
}

c.Hidden = true
repaint(c)
}

// MinSize calculates the minimum size of a Container.
@@ -100,6 +101,7 @@ func (c *Container) MinSize() Size {
// Move the container (and all its children) to a new position, relative to its parent.
func (c *Container) Move(pos Position) {
c.position = pos
repaint(c)
}

// Position gets the current position of this Container, relative to its parent.
@@ -192,3 +194,18 @@ func (c *Container) layout() {

c.Layout.Layout(c.Objects, c.size)
}

// repaint instructs the containing canvas to redraw, even if nothing changed.
// This method is a duplicate of what is in `canvas/canvas.go` to avoid a dependency loop or public API.
func repaint(obj *Container) {
if CurrentApp() == nil || CurrentApp().Driver() == nil {
return
}

c := CurrentApp().Driver().CanvasForObject(obj)
if c != nil {
if paint, ok := c.(interface{ SetDirty() }); ok {
paint.SetDirty()
}
}
}
8 changes: 6 additions & 2 deletions container/layouts.go
Original file line number Diff line number Diff line change
@@ -75,7 +75,9 @@ func NewGridWrap(size fyne.Size, objects ...fyne.CanvasObject) *fyne.Container {
}

// NewHBox creates a new container with the specified objects and using the HBox layout.
// The objects will be placed in the container from left to right.
// The objects will be placed in the container from left to right and always displayed
// at their horizontal MinSize. Use a different layout if the objects are intended
// to be larger then their horizontal MinSize.
//
// Since: 1.4
func NewHBox(objects ...fyne.CanvasObject) *fyne.Container {
@@ -97,7 +99,9 @@ func NewPadded(objects ...fyne.CanvasObject) *fyne.Container {
}

// NewVBox creates a new container with the specified objects and using the VBox layout.
// The objects will be stacked in the container from top to bottom.
// The objects will be stacked in the container from top to bottom and always displayed
// at their vertical MinSize. Use a different layout if the objects are intended
// to be larger then their vertical MinSize.
//
// Since: 1.4
func NewVBox(objects ...fyne.CanvasObject) *fyne.Container {
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ module fyne.io/fyne/v2
go 1.14

require (
fyne.io/systray v1.10.1-0.20230312215936-7f71b037e260
fyne.io/systray v1.10.1-0.20230403195833-7dc3c09283d6
github.com/BurntSushi/toml v1.1.0
github.com/fredbi/uri v0.1.0
github.com/fsnotify/fsnotify v1.5.4
@@ -13,7 +13,7 @@ require (
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b
github.com/go-ole/go-ole v1.2.6
github.com/go-text/typesetting v0.0.0-20221212183139-1eb938670a1f
github.com/go-text/typesetting v0.0.0-20230405155246-bf9c697c6e16
github.com/godbus/dbus/v5 v5.1.0
github.com/goki/freetype v0.0.0-20220119013949-7a161fd3728c
github.com/gopherjs/gopherjs v1.17.2
@@ -27,11 +27,10 @@ require (
github.com/stretchr/testify v1.8.0
github.com/urfave/cli/v2 v2.4.0
github.com/yuin/goldmark v1.4.13
golang.org/x/image v0.0.0-20220601225756-64ec528b34cd
golang.org/x/image v0.3.0
golang.org/x/mobile v0.0.0-20211207041440-4e6c2922fdee
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
golang.org/x/text v0.6.0 // indirect
golang.org/x/tools v0.1.12
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
honnef.co/go/js/dom v0.0.0-20210725211120-f030747120f2
22 changes: 8 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
@@ -37,8 +37,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
fyne.io/systray v1.10.1-0.20230312215936-7f71b037e260 h1:hNHShALSK9F0n6iJoBNmXs1GW0AzOgkKvp8N4ECK59M=
fyne.io/systray v1.10.1-0.20230312215936-7f71b037e260/go.mod h1:oM2AQqGJ1AMo4nNqZFYU8xYygSBZkW2hmdJ7n4yjedE=
fyne.io/systray v1.10.1-0.20230403195833-7dc3c09283d6 h1:lHt8dm97Uy9ggtnt9N6XOlsp76wXmRAh3SjReWm1e2Q=
fyne.io/systray v1.10.1-0.20230403195833-7dc3c09283d6/go.mod h1:oM2AQqGJ1AMo4nNqZFYU8xYygSBZkW2hmdJ7n4yjedE=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I=
github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
@@ -49,11 +49,6 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/benoitkugler/pstokenizer v1.0.0/go.mod h1:l1G2Voirz0q/jj0TQfabNxVsa8HZXh/VMxFSRALWTiE=
github.com/benoitkugler/textlayout v0.3.0 h1:2ehWXEkgb6RUokTjXh1LzdGwG4dRP6X3dqhYYDYhUVk=
github.com/benoitkugler/textlayout v0.3.0/go.mod h1:o+1hFV+JSHBC9qNLIuwVoLedERU7sBPgEFcuSgfvi/w=
github.com/benoitkugler/textlayout-testdata v0.1.1 h1:AvFxBxpfrQd8v55qH59mZOJOQjtD6K2SFe9/HvnIbJk=
github.com/benoitkugler/textlayout-testdata v0.1.1/go.mod h1:i/qZl09BbUOtd7Bu/W1CAubRwTWrEXWq6JwMkw8wYxo=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@@ -103,8 +98,10 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b h1:GgabKamyOY
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-text/typesetting v0.0.0-20221212183139-1eb938670a1f h1:cWE//ddvZ7bZAYGtNi3+SPGvUFTeTRUL/TQ9LUnQOP0=
github.com/go-text/typesetting v0.0.0-20221212183139-1eb938670a1f/go.mod h1:/cmOXaoTiO+lbCwkTZBgCvevJpbFsZ5reXIpEJVh5MI=
github.com/go-text/typesetting v0.0.0-20230405155246-bf9c697c6e16 h1:DvHeDNqK8cxdZ7C6y88pt3uE7euZH7/LluzyfnUfH/Q=
github.com/go-text/typesetting v0.0.0-20230405155246-bf9c697c6e16/go.mod h1:zvWM81wAVW6QfVDI6yxfbCuoLnobSYTuMsrXU/u11y8=
github.com/go-text/typesetting-utils v0.0.0-20230326210548-458646692de6 h1:zAAA1U4ykFwqPbcj6YDxvq3F2g0wc/ngPfLJjkR/8zs=
github.com/go-text/typesetting-utils v0.0.0-20230326210548-458646692de6/go.mod h1:RaqFwjcYyM5BjbYGwON0H5K0UqwO3sJlo9ukKha80ZE=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
@@ -336,11 +333,9 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210504121937-7319ad40d33e/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20220601225756-64ec528b34cd h1:9NbNcTg//wfC5JskFW4Z3sqwVnjmJKHxLAol1bW2qgw=
golang.org/x/image v0.0.0-20220601225756-64ec528b34cd/go.mod h1:doUCurBvlfPMKfmIpRIywoHmhN3VyhnoFDbvIEWF4hY=
golang.org/x/image v0.3.0 h1:HTDXbdK9bjfSWkPzDJIw89W8CAtfFGduujWs33NLLsg=
golang.org/x/image v0.3.0/go.mod h1:fXd9211C/0VTlYuAcOhW8dY/RtEJqODXOWBDpmYBf+A=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -404,7 +399,6 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211118161319-6a13c67c3ce4/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0=
20 changes: 18 additions & 2 deletions internal/widget/base.go
Original file line number Diff line number Diff line change
@@ -71,9 +71,10 @@ func (w *Base) Position() fyne.Position {
// Note this should not be used if the widget is being managed by a Layout within a Container.
func (w *Base) Move(pos fyne.Position) {
w.propertyLock.Lock()
defer w.propertyLock.Unlock()

w.position = pos
w.propertyLock.Unlock()

Repaint(w.super())
}

// MinSize for the widget - it should never be resized below this value.
@@ -158,3 +159,18 @@ func (w *Base) super() fyne.Widget {
w.propertyLock.RUnlock()
return impl
}

// Repaint instructs the containing canvas to redraw, even if nothing changed.
// This method is a duplicate of what is in `canvas/canvas.go` to avoid a dependency loop or public API.
func Repaint(obj fyne.CanvasObject) {
if fyne.CurrentApp() == nil || fyne.CurrentApp().Driver() == nil {
return
}

c := fyne.CurrentApp().Driver().CanvasForObject(obj)
if c != nil {
if paint, ok := c.(interface{ SetDirty() }); ok {
paint.SetDirty()
}
}
}
20 changes: 12 additions & 8 deletions layout/boxlayout.go
Original file line number Diff line number Diff line change
@@ -13,13 +13,17 @@ type boxLayout struct {
}

// NewHBoxLayout returns a horizontal box layout for stacking a number of child
// canvas objects or widgets left to right.
// canvas objects or widgets left to right. The objects are always displayed
// at their horizontal MinSize. Use a different layout if the objects are intended
// to be larger then their horizontal MinSize.
func NewHBoxLayout() fyne.Layout {
return &boxLayout{true}
}

// NewVBoxLayout returns a vertical box layout for stacking a number of child
// canvas objects or widgets top to bottom.
// canvas objects or widgets top to bottom. The objects are always displayed
// at their vertical MinSize. Use a different layout if the objects are intended
// to be larger then their vertical MinSize.
func NewVBoxLayout() fyne.Layout {
return &boxLayout{false}
}
@@ -57,15 +61,15 @@ func (g *boxLayout) isSpacer(obj fyne.CanvasObject) bool {
// is full width but the height is the minimum required.
// Any spacers added will pad the view, sharing the space if there are two or more.
func (g *boxLayout) Layout(objects []fyne.CanvasObject, size fyne.Size) {
spacers := make([]fyne.CanvasObject, 0)
spacers := 0
total := float32(0)
for _, child := range objects {
if !child.Visible() {
continue
}

if g.isSpacer(child) {
spacers = append(spacers, child)
spacers++
continue
}
if g.horizontal {
@@ -78,13 +82,13 @@ func (g *boxLayout) Layout(objects []fyne.CanvasObject, size fyne.Size) {
x, y := float32(0), float32(0)
var extra float32
if g.horizontal {
extra = size.Width - total - (theme.Padding() * float32(len(objects)-len(spacers)-1))
extra = size.Width - total - (theme.Padding() * float32(len(objects)-spacers-1))
} else {
extra = size.Height - total - (theme.Padding() * float32(len(objects)-len(spacers)-1))
extra = size.Height - total - (theme.Padding() * float32(len(objects)-spacers-1))
}
extraCell := float32(0)
if len(spacers) > 0 {
extraCell = extra / float32(len(spacers))
if spacers > 0 {
extraCell = extra / float32(spacers)
}

for _, child := range objects {
24 changes: 17 additions & 7 deletions theme/bundled-icons.go
4 changes: 3 additions & 1 deletion theme/gen.go
Original file line number Diff line number Diff line change
@@ -88,9 +88,11 @@ func main() {
bundleIcon("menu-expand", f)

bundleIcon("check-box", f)
bundleIcon("check-box-blank", f)
bundleIcon("check-box-checked", f)
bundleIcon("check-box-fill", f)
bundleIcon("radio-button", f)
bundleIcon("radio-button-checked", f)
bundleIcon("radio-button-fill", f)

bundleIcon("content-add", f)
bundleIcon("content-remove", f)
6 changes: 4 additions & 2 deletions theme/icons.go
Original file line number Diff line number Diff line change
@@ -462,10 +462,12 @@ var (
IconNameMenu: NewThemedResource(menuIconRes),
IconNameMenuExpand: NewThemedResource(menuexpandIconRes),

IconNameCheckButton: NewThemedResource(checkboxblankIconRes),
IconNameCheckButtonChecked: NewThemedResource(checkboxIconRes),
IconNameCheckButton: NewThemedResource(checkboxIconRes),
IconNameCheckButtonChecked: NewThemedResource(checkboxcheckedIconRes),
"iconNameCheckButtonFill": NewThemedResource(checkboxfillIconRes),
IconNameRadioButton: NewThemedResource(radiobuttonIconRes),
IconNameRadioButtonChecked: NewThemedResource(radiobuttoncheckedIconRes),
"iconNameRadioButtonFill": NewThemedResource(radiobuttonfillIconRes),

IconNameContentAdd: NewThemedResource(contentaddIconRes),
IconNameContentClear: NewThemedResource(cancelIconRes),
58 changes: 0 additions & 58 deletions theme/icons/check-box-blank.svg

This file was deleted.

9 changes: 9 additions & 0 deletions theme/icons/check-box-checked.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions theme/icons/check-box-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 2 additions & 51 deletions theme/icons/check-box.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion theme/icons/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 2 additions & 52 deletions theme/icons/radio-button-checked.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions theme/icons/radio-button-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 2 additions & 51 deletions theme/icons/radio-button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions theme/icons_test.go
Original file line number Diff line number Diff line change
@@ -199,12 +199,12 @@ func Test_SearchReplaceIcon_FileSource(t *testing.T) {

func Test_CheckButtonIcon_FileSource(t *testing.T) {
result := CheckButtonIcon().Name()
assert.Equal(t, "foreground_check-box-blank.svg", result)
assert.Equal(t, "foreground_check-box.svg", result)
}

func Test_CheckButtonCheckedIcon_FileSource(t *testing.T) {
result := CheckButtonCheckedIcon().Name()
assert.Equal(t, "foreground_check-box.svg", result)
assert.Equal(t, "foreground_check-box-checked.svg", result)
}

func Test_RadioButtonIcon_FileSource(t *testing.T) {
12 changes: 7 additions & 5 deletions vendor/fyne.io/systray/systray_darwin.m
6 changes: 6 additions & 0 deletions vendor/fyne.io/systray/systray_windows.go
21 changes: 0 additions & 21 deletions vendor/github.com/benoitkugler/textlayout/LICENSE

This file was deleted.

21 changes: 0 additions & 21 deletions vendor/github.com/benoitkugler/textlayout/fonts/LICENSE

This file was deleted.

139 changes: 0 additions & 139 deletions vendor/github.com/benoitkugler/textlayout/fonts/binaryreader/reader.go

This file was deleted.

474 changes: 0 additions & 474 deletions vendor/github.com/benoitkugler/textlayout/fonts/fonts.go

This file was deleted.

17,705 changes: 0 additions & 17,705 deletions vendor/github.com/benoitkugler/textlayout/fonts/glyphsnames/glyphs.go

This file was deleted.

7 changes: 0 additions & 7 deletions vendor/github.com/benoitkugler/textlayout/fonts/readme.md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

458 changes: 0 additions & 458 deletions vendor/github.com/benoitkugler/textlayout/fonts/truetype/aat_state.go

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading