You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, I love what I see with egui! Thanks for making the tool!
Problem
Bit of a nitpick, but I was a little bothered by the fact that when I click on a widget and drag the mouse, the window moved. This happened when I accidentally moved the mouse slightly while attempting to click on a button. I don't usually see that in applications. I would expect the window to stay put and the button to still be clicked, so long as my mouse was still over the button upon release.
Experience:
Solution
I see that the sense used for Button is Sense::click()here. I also see that Label uses Sense::click() when touchscreen is enabled and Sense::click_and_drag() when touchscreen is disabled here. When I apply the same logic to the button, I get a result much closer to expected.
Desired:
I think this effect should be applied to the following widgets:
Button
Checkbox
RadioButton
SelectableLabel
ComboBox
ColorPicker
Considerations
Using Sense::click_and_drag() seems like the wrong approach to solve the problem (even though it works) because the widgets in the list above are not really "draggable". Possibly creating another Sense bitflag is the solution, but before discussing implementation details, I wanted some thoughts on the feature in general. Thanks!
The text was updated successfully, but these errors were encountered:
joshua-holmes
changed the title
Prevent dragging window while holding click on widget and moving mouse
Feature: Prevent dragging window while holding click on widget and moving mouse
Jan 21, 2025
First, I love what I see with egui! Thanks for making the tool!
Problem
Bit of a nitpick, but I was a little bothered by the fact that when I click on a widget and drag the mouse, the window moved. This happened when I accidentally moved the mouse slightly while attempting to click on a button. I don't usually see that in applications. I would expect the window to stay put and the button to still be clicked, so long as my mouse was still over the button upon release.
Experience:
Solution
I see that the sense used for
Button
isSense::click()
here. I also see thatLabel
usesSense::click()
when touchscreen is enabled andSense::click_and_drag()
when touchscreen is disabled here. When I apply the same logic to the button, I get a result much closer to expected.Desired:
I think this effect should be applied to the following widgets:
Considerations
Using
Sense::click_and_drag()
seems like the wrong approach to solve the problem (even though it works) because the widgets in the list above are not really "draggable". Possibly creating anotherSense
bitflag is the solution, but before discussing implementation details, I wanted some thoughts on the feature in general. Thanks!The text was updated successfully, but these errors were encountered: