[Digikam-devel] [Bug 157314] Zoom-slider has no steps
Arnd Baecker
arnd.baecker at web.de
Fri Apr 18 17:09:33 BST 2008
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=157314
------- Additional Comments From arnd.baecker web de 2008-04-18 18:09 -------
Created an attachment (id=24391)
--> (http://bugs.kde.org/attachment.cgi?id=24391&action=view)
make zoom values snap to specific values, v0
The patch works for the + and - buttons at the slider,
CTRL+mousewheel and changes of the slider itself.
For dealing with changes of the slider itself,
modifying PreviewWidget::setZoomFactor a la
//If we are near 100% zoom, then we force 100% zoom
if (fabs(zoom-1.0)<0.05)
{
zoom = 1.0;
}
(as done in the previous patch on the ML) is not a good idea.
Reason: this routine is used at various places throughout the code.
In particular, when a fit-to-window would be 96% then this should not
be set to 100% automatically, just because of 100% snapping .... ;-)
Also, if the user changed the ZoomText
(e.g.: EditorWindow::slotZoomTextChanged)
this must not be changed afterwards ;-)
To deal with the slider, the places to be adapted are:
#void DigikamView::setThumbSize(int size)
void ImagePannelWidget::slotZoomSliderChanged(int size)
void LightTableView::slotLeftZoomSliderChanged(int size)
void LightTableView::slotRightZoomSliderChanged(int size)
All these call setZoomFactor(z) in the end.
Therefore, instead a setZoomFactorSnapped(z) is
introduced, which does the proper handling of "snapping"
to 50%, 100% and fit-to-window.
Of course, this needs testing - feedback welcome!
(Once everything is considered fine, I will clean up the few DWarning()
statements left in for debugging)
Best, Arnd
More information about the Digikam-devel
mailing list