Add scan-area sliders and a combo-box that contains predefined page sizes, but only the ones that fit in the maximum scan area of the scanner. The combo-box also contains landscape versions of the sizes that fit.
Details
- Reviewers
antonarnold ngraham - Group Reviewers
VDG KDE Applications - Commits
- R382:7f983585f062: Add scan-area sliders and predefined page sizes combobox
The sliders and combo-box interact with the normal selection and does not break it.
Diff Detail
- Repository
- R382 KSane Library
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
I'm not 100% happy with having the size sliders there directly after the color options.
One option could be a separator line and a second to move the size options to a separate tab.
A third option could be to have a colapsable widget to hide the width,height,... options by default.
Any thoughts?
Are the sliders actually needed at all if the primary way to manipulate the scan area box is directly, by clicking and dragging on the preview?
The sliders provide the size of the scanned area in numeric form and there is the possibility to fine-tune the scan area without having to be too steady on the hand when doing the selection. So I do see a value in having the sliders in some form...
What I mean is that the spinboxes provide fine control, numeric input, and feedback. But the sliders provide gross control, which is already provided by the preview.
Ah OK :). The spinbox+slider is a reused widget that is used for all numeric properties in libksane :)
What do you think about having the size options in a separate tab?
@sars That's a really elegant solution. For me the gui is fine. Simple enough and functional. If hiding is necessary something like a collapsable accordeon view might be modern, but I'm no ui design expert.
I found one bug when I switch from a scan source with a big page size to a smaller scan source the combo box is updated and a valid item is selected but the width/height is not set correctly.
Actually I just found out that changing the scan source always resets x,y,w,h to 0,0,max,max
@antonarnold Good bug catch! All the scan sources I have here, have the same size so I did never reach that code path...
As I always reset the size to full scan area the default size selection should be "Custom"
In a later PR, we could leave the size as it is, if it fits.
For another PR it could also be possible to go through the sizes in the combobox when the scan size is manually changed and set the size that matches, but I'm not sure it is worth the hassle ;)
The update works as intended. in my opinion it's good enough if all the elements are consistent.
I found another minor bug that changes the size of the x+y offset sliders when the value of the w+h sliders are increased.
But this also ain't a dealbreaker for me.
@antonarnold I'm not exactly sure what is wrong in those ;)
I wonder if you mean that the size of the spin-box changes? The reason for that is that the maximum for the spin-box changes when the size changes. This is done to prevent the selection from being outside the possible scan area.
We could add a minimum width for the spin-box so that the size would not change al the time if that is the problem.
@sars ah you are right I thought it is supposed to be a fixed size layout but it is not as it can be seen in the before picture already.
There are a lot of unit conversions in the diff so I tried to run 'LC_ALL=en_US.en_US ./skanlite'
That doesn't look valid
This change has unfortunately broken the build on FreeBSD - see https://build.kde.org/view/Failing/job/Applications/job/libksane/job/kf5-qt5%20FreeBSDQt5.13/lastFailedBuild/console