Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewport quality-of-life improvements #92

Merged
merged 3 commits into from Jan 11, 2022
Merged

Viewport quality-of-life improvements #92

merged 3 commits into from Jan 11, 2022

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.

None yet

1 participant