Bug 408074 - Arrow keys move 'priority' slider in wrong direction
Summary: Arrow keys move 'priority' slider in wrong direction
Status: RESOLVED FIXED
Alias: None
Product: ksysguard
Classification: Applications
Component: ksysguard (show other bugs)
Version: 5.15.90
Platform: Archlinux Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2019-05-29 15:59 UTC by Kishore Gopalakrishnan
Modified: 2019-06-16 15:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.17.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kishore Gopalakrishnan 2019-05-29 15:59:16 UTC
SUMMARY
Using the arrow keys to move the 'priority' slider in the 'Set Priority' window (that can be opened from the right-click menu of a process) results in the slider moving in the wrong direction.

STEPS TO REPRODUCE
1. Open Ksysguard.
2. Go to the tab that lists processes.
3. Right click on a process and select 'Set Priority'.
4. Click on the slider that sets the CPU priority.
5. Press the left and right arrow keys on the keyboard.

OBSERVED RESULT
The slider moves in the direction opposite to that indicated by the arrow key pressed.

EXPECTED RESULT
Slider should move in the direction indicated by the arrow key pressed.

SOFTWARE/OS VERSIONS
Linux distro: Arch Linux
KDE Plasma Version: 5.15.90
KDE Frameworks Version: 5.58.0
Qt Version: 5.13.0
Comment 1 Christoph Feck 2019-06-14 11:22:51 UTC
The UI sets QAbstractSlider::invertedAppearance() because of inverted numbers for UNIX priorities. A low value means a high priority.

It should also set invertedControls().

https://doc.qt.io/qt-5/qabstractslider.html#invertedControls-prop
https://cgit.kde.org/libksysguard.git/tree/processui/ReniceDlgUi.ui
Comment 2 Kishore Gopalakrishnan 2019-06-15 10:05:23 UTC
I've submitted a patch here: https://phabricator.kde.org/D21828
Comment 3 Nate Graham 2019-06-16 15:53:04 UTC
Git commit cf1791d752b05f898aef73a8d91c57f9de45305a by Nate Graham, on behalf of Kishore Gopalakrishnan.
Committed on 16/06/2019 at 15:52.
Pushed by ngraham into branch 'master'.

Invert controls direction for process priority slider

Summary:
Since low 'nice' values correspond to high priority, the slider labels are inverted so that 'higher' corresponds to a lower nice number. However, this was not done for the slider control, resulting in the arrow keys moving the slider in the direction opposite to that expected by the user. This patch fixes this by setting invertedControls to 'true' for the priority slider.

Test Plan:
1. Open Ksysguard.
2. Go to the tab that lists processes.
3. Right click on a process and select 'Set Priority'.
4. Click on the slider that sets the CPU priority.
5. Press the left and right arrow keys on the keyboard and check if they move the slider in the appropriate direction.

Reviewers: cfeck

Reviewed By: cfeck

Subscribers: cfeck, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D21828

M  +6    -0    processui/ReniceDlgUi.ui

https://commits.kde.org/libksysguard/cf1791d752b05f898aef73a8d91c57f9de45305a