-
-
Notifications
You must be signed in to change notification settings - Fork 521
Make first click select option line but not toggle it, toggle with next click, handle right click #1732
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
Conversation
…xt click, handle right click ... and assorted consistency improvements
@@ -67,16 +65,32 @@ static HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ch) { | |||
break; | |||
case '-': | |||
case KEY_F(7): | |||
case KEY_RIGHTCLICK: |
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.
I object using right click as mentioned in this comment. The right button to use should be KEY_WHEELDOWN
.
if (OptionItem_kind(selected) == OPTION_ITEM_NUMBER) { | ||
NumberItem_decrease((NumberItem*)selected); | ||
result = HANDLED; | ||
} else if (OptionItem_kind(selected) == OPTION_ITEM_CHECK) { | ||
CheckItem_set((CheckItem*)selected, false); | ||
result = HANDLED; | ||
} | ||
break; | ||
case '+': | ||
case KEY_F(8): |
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.
Referencing this comment, a case KEY_WHEELUP:
can be added here.
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.
No, because then you'd scroll through the list of options with the mouse wheel and when getting to a numeric one you'd get "stuck" and it's value would start changing (rapidly) instead. That's awful UX.
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.
@fasterit I saw GIMP and Inkscape have their way of solving this:
Detect the mouse cursor position when rolling mouse wheel. If the mouse cursor is on a numeric field, increment or decrement the value of that. If the mouse cursor is outside the numeric field but still in the panel, scroll thr panel instead.
So the mouse wheel can still be used for value increment and decrement.
Maybe my proposal of case KEY_WHEELUP:
here might not make things work as intended, but it might be worth fixing this in another PR.
@Explorer09 Handling mouse wheel / touchpad scroll events is a different set of changes (even if most of the code for it may overlap. |
... and assorted consistency improvements
Improved version of #1731 as discussed there