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

Support scrolling popup contents using mouse #10053

Merged
merged 4 commits into from
Mar 31, 2024

Conversation

sudormrfbin
Copy link
Member

Hey, long time no see :) This PR adds support for scrolling through the popup with the mouse as an alternative to the already existing C-d and C-u bindings. Scrolling is only done if has_scrollbar is true.

For ignoring mouse events that fall outside the frame of the popup, the rendering area Rect of the popup is stored in the struct. This feels hacky but I couldn't think of any other way to retrieve the area inside handle_event().


The PR has been organized into commits that can be easily reviewed. Some commits are only concerned with moving code around with no new functionality introduced.

@sudormrfbin sudormrfbin changed the title Support scrolling popup content using mouse Support scrolling popup contents using mouse Mar 30, 2024
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me! 96edc84 could be fixed up into 4dfa235 to make the commit history a tiny bit tidier I suppose but it's probably not necessary

@the-mikedavis the-mikedavis added the S-waiting-on-review Status: Awaiting review from a maintainer. label Mar 31, 2024
Copy link
Member

@pascalkuthe pascalkuthe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think storing arena in the popup drung rendering is a bit hacky. I think that should be stored in a more centralized manner (I think the compositor probably needs a bit of a rework anyway) but it's ok as a stopgap

@pascalkuthe pascalkuthe merged commit 957d030 into helix-editor:master Mar 31, 2024
6 checks passed
Desdaemon pushed a commit to Desdaemon/helix that referenced this pull request Apr 3, 2024
* Extract popup scrolling code into named functions

* Scroll popup contents on mouse scroll event

* Ignore mouse events outside the popup

* Remove unneeded return statement
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
* Extract popup scrolling code into named functions

* Scroll popup contents on mouse scroll event

* Ignore mouse events outside the popup

* Remove unneeded return statement
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
* Extract popup scrolling code into named functions

* Scroll popup contents on mouse scroll event

* Ignore mouse events outside the popup

* Remove unneeded return statement
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 4, 2024
* Extract popup scrolling code into named functions

* Scroll popup contents on mouse scroll event

* Ignore mouse events outside the popup

* Remove unneeded return statement
postsolar pushed a commit to postsolar/helix that referenced this pull request Apr 20, 2024
* Extract popup scrolling code into named functions

* Scroll popup contents on mouse scroll event

* Ignore mouse events outside the popup

* Remove unneeded return statement
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
* Extract popup scrolling code into named functions

* Scroll popup contents on mouse scroll event

* Ignore mouse events outside the popup

* Remove unneeded return statement
Vulpesx pushed a commit to Vulpesx/helix that referenced this pull request Jun 7, 2024
* Extract popup scrolling code into named functions

* Scroll popup contents on mouse scroll event

* Ignore mouse events outside the popup

* Remove unneeded return statement
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
* Extract popup scrolling code into named functions

* Scroll popup contents on mouse scroll event

* Ignore mouse events outside the popup

* Remove unneeded return statement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants