The latest news from the Fyne community

v2.2 adds System Tray, App.Metadata and a preview of web driver

Jul 3, 2022

It’s been a long time coming, but we are thrilled to share the v2.2.0 release. There are so many amazing features added this release, not least system tray for desktop apps, app metadata, iOS simulator support and initial version of a driver for running apps through a web browser. Also check out the improved menu experience and support for more BSD OSes as well as support for Google Play .aab file format.

Added features

Lots of new features come with this release, but here is a dhow of the system tray feature - it will adapt to the operating system the app is running on.

You can get started as simply as:

	if desk, ok := a.(desktop.App); ok {
		m := fyne.NewMenu("MyApp",
			fyne.NewMenuItem("Hello", func() {
				log.Println("Hello")
			}))
		desk.SetSystemTrayMenu(m)
	}

Don’t forget to set an application icon, which is used by default. Or you can update to specific tray icon with SetSystemTrayIcon.

Also this release is the first chance to try running your Fyne app through a web browser window. You can try this out (make sure you update fyne command first!):

$ fyne serve
Serving myapp/web on HTTP port: 8080

And just load your web browser!

Note that at this time the web driver cannot handle multiple windows or the use of storage or preference code.

For more interest here is the full list of new features:

  • Add SetIcon method on ToolbarAction
  • Access compiled app metadata using new App.Metadata() method
  • Add support for System tray icon and menu
  • Support for Android Application Bundle (.aab)
  • Initial support for OpenBSD and NetBSD
  • Add keyboard shortcuts to menu
  • Add technical preview of web driver and fyne serve command
  • Added iossimulator build target
  • Allow dynamic themes via JSON templates
  • Custom hyperlink callback
  • Add support for .ico file when compiling for windows
  • Add binding.NewStringWithFormat
  • Add Entry.SetMinRowsVisible
  • Add Menu.Refresh() and MainMenu.Refresh()
  • Packages for Linux and BSD now support installing into the home directory
  • Add .RemoveAll() to containers
  • Add an AllString validator for chaining together string validators

Changed

The following items have changed and may require custom widgets or complex code to be updated accordingly.

  • Toolbar item constructors now return concrete types instead of ToolbarItem
  • Low importance buttons no longer draw button color as a background
  • ProgressBar widget height is now consistent with other widgets
  • Include check in DocTabs menu to show current tab
  • Don’t call OnScrolled if offset did not change
  • Prefer ANDROID_NDK_HOME over the ANDROID_HOME ndk-bundle location
  • Support serialisation / deserialisation of the widget tree
  • Better error reporting / handling when OpenGL is not available
  • Memory is now better reclaimed on Android when the OS requests it
  • Notifications on Linux and BSD now show the application icon
  • Change listeners for preferences no longer run when setting the same value
  • The file dialog now shows extensions in the list view for better readability
  • Many optimisations and widget performance enhancements
  • Updated various dependencies to their latest versions

There are also many more fixes that improve the stability of our toolkit. Let us know what you think and how we can improve further :).


Get In Touch!


We're excited to hear from anyone interested in the project. Whether it's to find out more, provide suggestions or to get involved - drop us a line!

If you would like to join the community for a chat you'll find us in the #fyne channel on gophers Slack or on our Discord server. If you are not already a member of the communities you can use a Slack invite or Discord invite.

#fyne

(Slack sign up)
(Discord sign up)