Skip to content

Conversation

meowgorithm
Copy link
Member

@meowgorithm meowgorithm commented Jan 10, 2022

This update contains a number of improvements to the viewport Bubble to make it more pleasant to work with. Keep in mind that as of this update viewport models are strongly encouraged to be initialized with the new New(width, height int) Model function, however it's currently optional to reduce friction when upgrading.

const width, height = 40, 80
vp := viewport.New(width, height)
  • Viewport models now have a Style lipgloss.Style property for setting borders, margins, and padding. No more magic numbers, random constants, and awkward arithmetic!
  • Keybindings are now defined via the key Bubble and can now be easily remapped.
  • The mouse wheel-based scroll speed can now be customized via the model's MouseWheelDelta int property
  • The mouse wheel can now be disabled via the model's MouseWheelEnabled bool property

@meowgorithm meowgorithm merged commit 9401ebb into master Jan 11, 2022
@meowgorithm meowgorithm deleted the viewport branch January 11, 2022 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant