Skip to content

Conversation

fasterit
Copy link
Member

... and assorted consistency improvements

Improved version of #1731 as discussed there

…xt click, handle right click

... and assorted consistency improvements
@BenBE BenBE added the enhancement Extension or improvement to existing feature label Jun 28, 2025
@BenBE BenBE added this to the 3.5.0 milestone Jun 28, 2025
@@ -67,16 +65,32 @@ static HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ch) {
break;
case '-':
case KEY_F(7):
case KEY_RIGHTCLICK:
Copy link
Contributor

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):
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

@BenBE
Copy link
Member

BenBE commented Jun 30, 2025

@Explorer09 Handling mouse wheel / touchpad scroll events is a different set of changes (even if most of the code for it may overlap.

@BenBE BenBE merged commit bcddf99 into htop-dev:main Jun 30, 2025
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Extension or improvement to existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants