v0.10.0 #96
meowgorithm
started this conversation in
General
v0.10.0
#96
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Timer, stopwatch, bugfixes and quality-of-life improvements
🎊 Happy New Year! This is a big release with a couple new components a bunch of bug fixes and quality-of-life improvements across the board. Read on for highlights and details.
tl;dr
New
New()
constructor at the package level Viewport quality-of-life improvements #92key
package Viewport quality-of-life improvements #92MouseWheelDelta
property Viewport quality-of-life improvements #92MouseWheelEnabled
property Viewport quality-of-life improvements #92Changed
NewModel()
constructors are now deprecated in favor ofNew()
Deprecate NewModel() constructors; use New() instead #93list.FilterMachesMsg
(thanks @jon4hz) expose list.FilterMachesMsg #77key.Matches
to accept multiple binding arguments Allowkey.Matches
to accept multiple binding arguments #84Fixed
InsertItem
onlist
Update keybindings after calling InsertItem on the list model #94textinput
infinite loop and panic (thanks @IllusionMan1212) fix textinput infinite loop and panic #89Highlights
New: Timer
@caarlos0 added a simple timer Bubble for counting down.
See the example code and docs for details.
New: Stopwatch
To match the timer, @caarlos0 also added a simple stopwatch Bubble for counting up.
See the example code and docs for details.
Constructors
Prior to this update the convention was to create new models via a
NewModel
. We've changed that convention toNew()
for brevity and readability.NewModel()
will continue to work in a deprecated fashion to ease the update process.Viewport improvements
As of this update you're strongly encouraged to initialize viewport models with the new
New(width, height int) Model
function, however it's currently optional to reduce friction when upgrading.Viewport models also now have a
Style lipgloss.Style
property you can use to apply a borders, margins, and padding directly to a viewport. Not more magic numbers, random constants, and fussy arithmetic.Keybindings are now defined via the
key
Bubble and can now be easily remapped.For details see the available bindings. Note that you can also just match on keys in the parent
Update
and call viewport methods like LineUp programmatically.And, lastly, you can now disable the mouse wheel on a viewport with
MouseWheelEnabled bool
as well as change the mouse wheel scroll speed with theMouseWheelDelta int
property.See the viewport docs for details.
Spinner improvements
Now spinners only respond to their own spin messages so you don't need any more fancy logic when you want to control multiple spinners at once. To start a specific spinner you now call
Tick()
on the model instead of the package:For posterity, you can still use the package-level
Tick
method in a deprecated fashion, however note that it will affect all spinners that process the resultingTickMsg
as it did prior to the release.For details see the spinner docs.
Key bindings
key.Binding
currently allows you to bind against multiple keys:However, sometimes you may also want to match on multiple bindings:
This update expands
key.Matches
to accept multiple arguments so you can condense the abovecase
statement to:For more on how keybindings work see the key docs.
New Contributors
Full Changelog: v0.9.0...v0.10.0
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Slack.
This discussion was created from the release v0.10.0.
Beta Was this translation helpful? Give feedback.
All reactions