[Digikam-devel] [Bug 145170] Always allow zooming in/out in imageeditor
Gilles Caulier
caulier.gilles at gmail.com
Mon May 21 10:37:02 BST 2007
------- 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=145170
------- Additional Comments From caulier.gilles gmail com 2007-05-21 11:37 -------
SVN commit 666924 by cgilles:
digiKam from trunk: Image Editor disable Fit To Window option properlly in all cases (Reported by Rainer Krienke).
CCBUGS: 145170
M +4 -0 canvas/canvas.cpp
M +1 -0 canvas/canvas.h
M +10 -17 editor/editorwindow.cpp
M +1 -0 editor/editorwindow.h
--- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/canvas.cpp #666923:666924
@ -928,7 +928,10 @
void Canvas::setZoomFactor(double zoom)
{
if (d->autoZoom)
+ {
d->autoZoom = false;
+ emit signalToggleOffFitToWindow();
+ }
// Zoom using center of canvas and given zoom factor.
@ -972,6 +975,7 @
d->zoom = QMIN(dstWidth/srcWidth, dstHeight/srcHeight);
d->autoZoom = false;
+ emit signalToggleOffFitToWindow();
d->im->zoom(d->zoom);
updateContentsSize(true);
--- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/canvas.h #666923:666924
@ -134,6 +134,7 @
void signalSavingFinished(const QString &filename, bool success);
void signalSavingProgress(const QString& filePath, float progress);
void signalSelectionChanged(const QRect&);
+ void signalToggleOffFitToWindow();
public slots:
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.cpp #666923:666924
@ -170,6 +170,9 @
{
// -- Canvas connections ------------------------------------------------
+ connect(m_canvas, SIGNAL(signalToggleOffFitToWindow()),
+ this, SLOT(slotToggleOffFitToWindow()));
+
connect(m_canvas, SIGNAL(signalShowNextImage()),
this, SLOT(slotForward()));
@ -672,17 +675,11 @
void EditorWindow::slotIncreaseZoom()
{
- d->zoomFitToWindowAction->blockSignals(true);
- d->zoomFitToWindowAction->setChecked(false);
- d->zoomFitToWindowAction->blockSignals(false);
m_canvas->slotIncreaseZoom();
}
void EditorWindow::slotDecreaseZoom()
{
- d->zoomFitToWindowAction->blockSignals(true);
- d->zoomFitToWindowAction->setChecked(false);
- d->zoomFitToWindowAction->blockSignals(false);
m_canvas->slotDecreaseZoom();
}
@ -696,9 +693,6 @
void EditorWindow::slotFitToSelect()
{
- d->zoomFitToWindowAction->blockSignals(true);
- d->zoomFitToWindowAction->setChecked(false);
- d->zoomFitToWindowAction->blockSignals(false);
d->zoomPlusAction->setEnabled(true);
d->zoomComboAction->setEnabled(true);
d->zoomMinusAction->setEnabled(true);
@ -707,9 +701,6 @
void EditorWindow::slotZoomTo100Percents()
{
- d->zoomFitToWindowAction->blockSignals(true);
- d->zoomFitToWindowAction->setChecked(false);
- d->zoomFitToWindowAction->blockSignals(false);
d->zoomPlusAction->setEnabled(true);
d->zoomComboAction->setEnabled(true);
d->zoomMinusAction->setEnabled(true);
@ -728,12 +719,7 @
bool r = false;
double zoom = KGlobal::locale()->readNumber(txt, &r) / 100.0;
if (r && zoom > 0.0)
- {
- d->zoomFitToWindowAction->blockSignals(true);
- d->zoomFitToWindowAction->setChecked(false);
- d->zoomFitToWindowAction->blockSignals(false);
m_canvas->setZoomFactor(zoom);
- }
}
void EditorWindow::slotZoomChanged(double zoom)
@ -746,6 +732,13 @
d->zoomCombo->blockSignals(false);
}
+void EditorWindow::slotToggleOffFitToWindow()
+{
+ d->zoomFitToWindowAction->blockSignals(true);
+ d->zoomFitToWindowAction->setChecked(false);
+ d->zoomFitToWindowAction->blockSignals(false);
+}
+
void EditorWindow::slotEscapePressed()
{
if (m_fullScreen)
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.h #666923:666924
@ -212,6 +212,7 @
void slotZoomChanged(double zoom);
void slotSelectionChanged(const QRect& sel);
void slotToggleFitToWindow();
+ void slotToggleOffFitToWindow();
void slotFitToSelect();
void slotIncreaseZoom();
void slotDecreaseZoom();
More information about the Digikam-devel
mailing list