Skip to content

Viewport quality-of-life improvements#92

Merged
meowgorithm merged 3 commits intomasterfrom
viewport
Jan 11, 2022
Merged

Viewport quality-of-life improvements#92
meowgorithm merged 3 commits intomasterfrom
viewport

Conversation

@meowgorithm
Copy link
Copy Markdown
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