Skip to main content

Fyne v2.8 released with GPU shapes, richer text and lots more...

·4 mins

We are delighted to announce the release of Fyne v2.8.0! This is our biggest release for some time - more than 1,000 commits from 39 contributors, touching over 800 files across the toolkit.

Three headline features lead the way: a much richer set of GPU accelerated drawing primitives, a RichText widget that understands far more Markdown, and new window APIs for developers building on multi-monitor desktops. Let’s take a look.

1. New shapes, shaders and shadows
#

The canvas package has grown a lot. Alongside the shapes you already know there are now Ellipse, BezierCurve, ArbitraryPolygon, Blur and Shader objects. Circles, rectangles and ellipses can also have a hardware accelerated Shadow, so depth no longer costs you a stack of images or a slow software blur.

Fyne 2.8 canvas objects - shapes with shadows, bezier curves, a shader and a blur region

Everything in that image is a standard canvas object, drawn on the GPU. Adding a shadow is as simple as setting a field:

circle := canvas.NewCircle(theme.Color(theme.ColorNamePrimary))
circle.Shadow = canvas.Shadow{
	Color:      color.NRGBA{A: 0x88},
	BlurRadius: 16,
	Offset:     fyne.NewPos(4, 8),
	Variant:    canvas.DropShadow,
}

The Shader object is the one we are most excited to see used. Supply a GLSL fragment shader (one source for desktop OpenGL and one for OpenGL ES, mobile and web) and Fyne will draw it inside the object’s bounds like any other primitive. Pair it with canvas.NewShaderAnimation and the time uniform advances for you - the ray marched cube above is a single canvas object sitting in a regular Fyne container. Textures and named uniforms are supported too, so transitions and effects can be driven from your app code.

Note that the old Polygon type has been renamed RegularPolygon for clarity, now that ArbitraryPolygon sits alongside it.

2. RichText and Markdown grow up
#

The RichText widget - and therefore every Markdown document you load into it - now supports tables, checkbox task lists, strikethrough, nested lists and nested block quotes. Text rendering also gained underline and strikethrough styles, and code blocks look far cleaner than before.

RichText in Fyne 2.8 showing a Markdown table, task list, nested quotes and a code block

That entire document is still a single call:

rich := widget.NewRichTextFromMarkdown(doc)

Under the hood the RichText renderer had a significant performance overhaul as well, so long documents scroll more smoothly than they did in 2.7.

3. Windows that know about your desktop
#

Desktop apps have gained real control over how and where their windows appear. A new desktop.Window interface adds RequestAlwaysOnTop, RequestPosition and RequestFullScreenSecondary - the last of these being ideal for presentation or media apps that want a control panel on the main display and full screen content on a second monitor.

if dw, ok := win.(desktop.Window); ok {
	dw.RequestPosition(120, 80)
	dw.RequestAlwaysOnTop()
}

Internal windows got attention as well, with new stacking APIs (RaiseToTop and Top on MultipleWindows) plus Title and Content fields on InnerWindow.

Inner windows stacked in Fyne 2.8, with a form showing the new Required field marker

You may also spot the new Required support on FormItem in that screenshot, marking a field that must be completed before a Form will validate.

And there is plenty more
#

A release this size cannot be summed up in three features. Also landing in v2.8:

  • Accessibility support - a first pass, currently off by default. Build with -tags accessibility to try it and tell us how it goes.
  • Scheduled notifications - a new API to have notifications delivered at a future time.
  • Cache API for temporary resources, including CacheResourceFromURLString.
  • Multi-touch drag reporting in the mobile driver.
  • HighlightItem on the collection widgets, new diagonal resize cursors, and secondary cut/copy/paste shortcuts on Unix.
  • AppTabs on mobile now render with smaller icons and text, more in-keeping with the platform.

There are some changes to be aware of when upgrading. Fyne now requires Go 1.22 as a minimum, which means we no longer support Windows 7 or 8, or macOS 10.14 and earlier. Wayland is now picked automatically at runtime on Linux, popups no longer include padding by default, and Circle always draws a true circle centred in the space it is given. Apps that have not yet migrated to the fyne.Do threading model will now warn on launch - see our goroutines documentation for how to complete that.

On top of all of that are more than 150 other fixes and performance improvements, from Android content URI handling to text wrapping, animation timing, macOS 26 window placement and much more. The full list is in the release notes.

Get it now
#

Upgrading is a single command:

go get fyne.io/fyne/v2@v2.8.0
go mod tidy

Huge thanks to the 39 contributors who made this release happen, and to everyone who reported issues and tested along the way. We cannot wait to see what you draw with it - do share your apps and shaders with us!

Happy Coding!