-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add option to disable mouse dragging on scroll area. #2163
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This reverts commit 4990e61.
@@ -608,7 +629,7 @@ impl Prepared { | |||
|
|||
if content_is_too_large[0] || content_is_too_large[1] { | |||
// Drag contents to scroll (for touch screens mostly): | |||
let sense = if self.scrolling_enabled { | |||
let sense = if self.drag_to_scroll_enabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it check both flags ?
let sense = if self.scrolling_enabled && self.drag_to_scroll_enabled {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should
I can really, really need that. Thanks. |
@@ -90,6 +90,8 @@ pub struct ScrollArea { | |||
offset_y: Option<f32>, | |||
/// If false, we ignore scroll events. | |||
scrolling_enabled: bool, | |||
/// If false we ignore mouse drag events. | |||
drag_to_scroll_enabled: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would you want to turn this off for just one ScrollArea an not another?
Wouldn't it make more sense to put this as global setting in Style
instead?
@@ -521,6 +541,7 @@ impl Prepared { | |||
content_ui, | |||
viewport: _, | |||
scrolling_enabled, | |||
drag_to_scroll_enabled: mouse_dragging_enabled, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drag_to_scroll_enabled: mouse_dragging_enabled, | |
drag_to_scroll_enabled, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try out the cursor in any other application and try to follow that behavior.
- While typing, there shouldn't be blinking
- When stopping to type, there should be a short delay before the blinking starts
- The on-period and off-period should be equally long
A badly implemented cursor blinking is more annoying than useful
Adds an option in scrollarea to disable dragging with the mouse seperatley from the option to disable scrolling entirely.
There is not much more to this commit and i am unsure if it is a trivial change.