Skip to content

v0.14.0 - 30-Dec-2020

Compare
Choose a tag to compare
@mum4k mum4k released this 30 Dec 07:40
· 131 commits to master since this release
d2b202a

Breaking API changes

  • The widgetapi.Widget.Keyboard and widgetapi.Widget.Mouse methods now
    accepts a second argument which provides widgets with additional metadata.
    All widgets implemented outside of the termdash repository will need to be
    updated similarly to the Barchart example below. Change the original method
    signatures:

    func (*BarChart) Keyboard(k *terminalapi.Keyboard) error { ... }
    
    func (*BarChart) Mouse(m *terminalapi.Mouse) error { ... }

    By adding the new *widgetapi.EventMeta argument as follows:

    func (*BarChart) Keyboard(k *terminalapi.Keyboard, meta *widgetapi.EventMeta) error { ... }
    
    func (*BarChart) Mouse(m *terminalapi.Mouse, meta *widgetapi.EventMeta) error { ... }

Fixed

  • termdash no longer crashes when tcell is used and the terminal window
    downsizes while content is being drawn.

Added

Text input form functionality with keyboard navigation

  • added a new formdemo that demonstrates a text input form with keyboard
    navigation.

Infrastructure changes

  • container now allows users to configure keyboard keys that move focus to
    the next or the previous container.
  • containers can request to be skipped when focus is moved using keyboard keys.
  • containers can register into separate focus groups and specific keyboard keys
    can be configured to move the focus within each focus group.
  • widgets can now request keyboard events exclusively when focused.
  • users can now set a container as focused using the new container.Focused
    option.

Updates to the button widget

  • the button widget allows users to specify multiple trigger keys.
  • the button widget now supports different keys for the global and focused
    scope.
  • the button widget can now be drawn without the shadow or the press
    animation.
  • the button widget can now be drawn without horizontal padding around its
    text.
  • the button widget now allows specifying cell options for each cell of the
    displayed text. Separate cell options can be specified for each of button's
    main states (up, focused and up, down).
  • the button widget allows specifying separate fill color values for each of
    its main states (up, focused and up, down).
  • the button widget now has a method SetCallback that allows updating the
    callback function on an existing button instance.

Updates to the textinput widget

  • the textinput widget can now be configured to request keyboard events
    exclusively when focused.
  • the textinput widget can now be initialized with a default text in the
    input box.