fyne v2.0 Release Notes

Release Date: 2021-01-22 // over 3 years ago
  • ๐Ÿ”„ Changes that are not backward compatible

    These changes may break some apps, please read the โฌ†๏ธ upgrading doc for more info โšก๏ธ The import path is now fyne.io/fyne/v2 when you are ready to make the update.

    • Coordinate system to float32

      • Size and Position units were changed from int to float32
      • Text.TextSize moved to float32 and fyne.MeasureText now takes a float32 size parameter
      • Removed Size.Union (use Size.Max instead)
      • Added fyne.Delta for difference-based X, Y float32 representation
      • DraggedEvent.DraggedX and DraggedY (int, int) to DraggedEvent.Dragged (Delta)
      • ScrollEvent.DeltaX and DeltaY (int, int) moved to ScrollEvent.Scrolled (Delta)
    • โšก๏ธ Theme API update

      • fyne.Theme moved to fyne.LegacyTheme and can be load to a new theme using theme.FromLegacy
      • A new, more flexible, Theme interface has been created that we encourage developers to use
    • ๐Ÿšš The second parameter of theme.NewThemedResource was removed, it was previously ignored

    • The desktop.Cursor definition was renamed desktop.StandardCursor to make way for custom cursors

    • ๐Ÿ’… Button Style and HideShadow were removed, use Importance

    • โฌ†๏ธ iOS apps preferences will be lost in this upgrade as we move to more advanced storage

    • ๐Ÿ”Š Dialogs no longer show when created, unless using the ShowXxx convenience methods

    • Entry widget now contains scrolling so should no longer be wrapped in a scroll container

    • โœ‚ Removed deprecated types including:

      • dialog.FileIcon (now widget.FileIcon)
      • widget.Radio (now widget.RadioGroup)
      • widget.AccordionContainer (now widget.Accordion)
      • layout.NewFixedGridLayout() (now layout.NewGridWrapLayout())
      • widget.ScrollContainer (now container.Scroll)
      • widget.SplitContainer (now container.Spilt)
      • widget.Group (replaced by widget.Card)
      • widget.Box (now container.NewH/VBox, with Children field moved to Objects)
      • widget.TabContainer and widget.AppTabs (now container.AppTabs)
    • ๐Ÿšš Many deprecated fields have been removed, replacements listed in API docs 1.4

    โž• Added

    • ๐Ÿ”€ Data binding API to connect data sources to widgets and sync data
      • Add preferences data binding and Preferences.AddChangeListener
      • Add bind support to Check, Entry, Label, List, ProgressBar and Slider widgets
    • Animation API for handling smooth element transitions
      • Add animations to buttons, tabs and entry cursor
    • Storage repository API for connecting custom file sources
      • Add storage functions Copy, Delete and Move for URI
      • Add CanRead, CanWrite and CanList to storage APIs
    • ๐Ÿ†• New Theme API for easier customisation of apps
      • Add ability for custom themes to support light/dark preference
      • Support for custom icons in theme definition
      • New theme.FromLegacy helper to use old theme API definitions
    • โž• Add fyne.Vector for managing x/y float32 coordinates
    • โž• Add MouseButtonTertiary for middle mouse button events on desktop
    • โž• Add canvas.ImageScaleFastest for faster, less precise, scaling
    • โž• Add new dialog.Form that will phase out dialog.Entry
    • โž• Add keyboard control for main menu
    • โž• Add Scroll.OnScrolled event for seeing changes in scroll container
    • โž• Add TextStyle and OnSubmitted to Entry widget
    • โž• Add support for HintText and showing validation errors in Form widget
    • โž• Added basic support for tab character in Entry, Label and TextGrid

    ๐Ÿ”„ Changed

    • ๐Ÿ‘€ Coordinate system is now float32 - see breaking changes above
    • ๐Ÿšš ScrollEvent and DragEvent moved to Delta from (int, int)
    • ๐Ÿ”„ Change bundled resources to use more efficient string storage
    • ๐Ÿšš Left and Right mouse buttons on Desktop are being moved to MouseButtonPrimary and MouseButtonSecondary
    • ๐ŸŽ Many optimisations and widget performance enhancements

    • Moving to new container.New() and container.NewWithoutLayout() constructors (replacing fyne.NewContainer and fyne.NewContainerWithoutLayout)

    • Moving storage APIs OpenFileFromURI, SaveFileToURI and ListerForURI to Reader, Writer and List functions

    ๐Ÿ›  Fixed

    • Validating a widget in widget.Form before renderer was created could cause a panic
    • โž• Added file and folder support for mobile simulation support (#1470)
    • Appending options to a disabled widget.RadioGroup shows them as enabled (#1697)
    • Toggling toolbar icons does not refresh (#1809)
    • Black screen when slide up application on iPhone (#1610)
    • Properly align Label in FormItem (#1531)
    • Mobile dropdowns are too low (#1771)
    • Cursor does not go down to next line with wrapping (#1737)
    • Entry: while adding text beyond visible reagion there is no auto-scroll (#912)