seantronsen / pvt

GNU General Public License v3.0
0 stars 0 forks source link

Trackbar Issues & Improvements #5

Closed seantrons closed 7 months ago

seantrons commented 7 months ago

While the trackbar implementation fulfills the goal it was designed for, it's not without room for improvement.

My biggest gripe with the current version is that dragging the bar along with the mouse does not use the defined step size. To elaborate, if I specify a step size of 20 and use the mouse to drag the trackbar, it still moves in increments of 1. Specifying step size only works if the user is navigating the control widgets with the keyboard using the tab and arrow keys.

I claim this is an issue for three reasons:

  1. It requires the users to implement more logic to ensure the number received from the trackbar is a valid input. For example, when I need a symmetric kernel the value must be some form of 2k + 1. As such, the value sent by the trackbar must be pre-processed meaning it is no longer the value the user sees in the display.

  2. Dragging with the mouse emits too many events. While Qt does ignore most of them when frequency of submission is large, this still results in the user interface feeling unresponsive for trackbars representing large ranges of values (e.g 1-10,000).

  3. Using a trackbar with a large range of values is just slow.

seantronsen commented 7 months ago

Somewhat related, I'm making step size specification optional in the next commit (will mention after push). It will default to 1 instead of requiring user input each time.

seantronsen commented 7 months ago

Step size made optional by this commit: https://github.com/seantronsen/qtviewer/commit/0656fa531f0f57946a15061fa4b221f47200b9a7

seantronsen commented 7 months ago

Steps for mouse drag have been added in: https://github.com/seantronsen/qtviewer/commit/e3c6a3fb51eb7f4b6d7329c5f5cf0fe66a843b97

seantronsen commented 7 months ago

Emission of too many events will be addressed in https://github.com/seantronsen/qtviewer/issues/14.

Closing.