Version: 0.9.2 beta2 (using KDE KDE 3.5.6) Installed from: Compiled From Sources Compiler: 4.1.2 OS: Linux At the moment when I have selected to fit the photo into the imageeditors window I cannot zoom in or out. Neither by selecting a zoom factor nor by pressing CTRL and using the middle mouse wheel. Both functions are disabled in this case. I think it would be helpful if the "fit into window" function would automatically be disabled if it is "on" and I try to zoom in/out eg. by using CTRL+middle mouse wheel. At the moment I first have to deactivate "fit into window". But I do not see any reason why I should have to explicitly disable this function if I want to zoom in or out. This could be done automatically.
SVN commit 666890 by cgilles: digikam from trunk : Image Editor : to be able to use the zoom +/- functions if "Fit To Window" option is enabled. BUG: 145170 M +1 -1 canvas/canvas.cpp M +36 -24 editor/editorwindow.cpp M +2 -0 editor/editorwindow.h --- trunk/extragear/graphics/digikam/utilities/imageeditor/canvas/canvas.cpp #666889:666890 @@ -928,7 +928,7 @@ void Canvas::setZoomFactor(double zoom) { if (d->autoZoom) - return; + d->autoZoom = false; // Zoom using center of canvas and given zoom factor. --- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.cpp #666889:666890 @@ -321,11 +321,10 @@ // -- Standard 'View' menu actions --------------------------------------------- - d->zoomPlusAction = KStdAction::zoomIn(m_canvas, SLOT(slotIncreaseZoom()), + d->zoomPlusAction = KStdAction::zoomIn(this, SLOT(slotIncreaseZoom()), actionCollection(), "editorwindow_zoomplus"); - - d->zoomMinusAction = KStdAction::zoomOut(m_canvas, SLOT(slotDecreaseZoom()), + d->zoomMinusAction = KStdAction::zoomOut(this, SLOT(slotDecreaseZoom()), actionCollection(), "editorwindow_zoomminus"); d->zoomTo100percents = new KAction(i18n("Zoom to 1:1"), "viewmag1", @@ -494,12 +493,12 @@ d->accelerators->insert("Zoom Plus Key_Plus", i18n("Zoom In"), i18n("Zoom in on Image"), - Key_Plus, m_canvas, SLOT(slotIncreaseZoom()), + Key_Plus, this, SLOT(slotIncreaseZoom()), false, true); d->accelerators->insert("Zoom Plus Key_Minus", i18n("Zoom Out"), i18n("Zoom out of Image"), - Key_Minus, m_canvas, SLOT(slotDecreaseZoom()), + Key_Minus, this, SLOT(slotDecreaseZoom()), false, true); } @@ -661,14 +660,27 @@ applyMainWindowSettings(KGlobal::config(), "ImageViewer Settings"); } -void EditorWindow::slotToggleFitToWindow() +void EditorWindow::slotIncreaseZoom() { - bool checked = d->zoomFitToWindowAction->isChecked(); + d->zoomFitToWindowAction->blockSignals(true); + d->zoomFitToWindowAction->setChecked(false); + d->zoomFitToWindowAction->blockSignals(false); + m_canvas->slotIncreaseZoom(); +} - d->zoomPlusAction->setEnabled(!checked); - d->zoomComboAction->setEnabled(!checked); - d->zoomMinusAction->setEnabled(!checked); +void EditorWindow::slotDecreaseZoom() +{ + d->zoomFitToWindowAction->blockSignals(true); + d->zoomFitToWindowAction->setChecked(false); + d->zoomFitToWindowAction->blockSignals(false); + m_canvas->slotDecreaseZoom(); +} +void EditorWindow::slotToggleFitToWindow() +{ + d->zoomPlusAction->setEnabled(true); + d->zoomComboAction->setEnabled(true); + d->zoomMinusAction->setEnabled(true); m_canvas->toggleFitToWindow(); } @@ -694,25 +706,30 @@ m_canvas->setZoomFactor(1.0); } +void EditorWindow::slotZoomSelected() +{ + QString txt = d->zoomCombo->currentText(); + txt = txt.left(txt.find('%')); + slotZoomTextChanged(txt); +} + void EditorWindow::slotZoomTextChanged(const QString &txt) { 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::slotZoomSelected() -{ - QString txt = d->zoomCombo->currentText(); - txt = txt.left(txt.find('%')); - slotZoomTextChanged(txt); -} - void EditorWindow::slotZoomChanged(double zoom) { - d->zoomPlusAction->setEnabled(!m_canvas->maxZoom() && !m_canvas->fitToWindow()); - d->zoomMinusAction->setEnabled(!m_canvas->minZoom() && !m_canvas->fitToWindow()); + d->zoomPlusAction->setEnabled(!m_canvas->maxZoom()); + d->zoomMinusAction->setEnabled(!m_canvas->minZoom()); d->zoomCombo->blockSignals(true); d->zoomCombo->setCurrentText(QString::number(lround(zoom*100.0)) + QString("%")); @@ -792,13 +809,8 @@ // Restore Auto zoom action ? bool autoZoom = config->readBoolEntry("AutoZoom", true); - if (autoZoom) - { d->zoomFitToWindowAction->activate(); - d->zoomPlusAction->setEnabled(false); - d->zoomMinusAction->setEnabled(false); - } } void EditorWindow::applyStandardSettings() --- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.h #666889:666890 @@ -213,6 +213,8 @@ void slotSelectionChanged(const QRect& sel); void slotToggleFitToWindow(); void slotFitToSelect(); + void slotIncreaseZoom(); + void slotDecreaseZoom(); private:
Great - thanks a lot - this is a big useability improvement!
Am Montag, 21. Mai 2007 09:58:08 schrieb Gilles Caulier: [bugs.kde.org quoted mail] Thanks for the fix. However there seems to be a small bug left. When I first select "fit to screen" and then scroll in or out of the photo the icon for "fit to screen" stays selected which is confusing. Clicking on it now still works and fits the photo to the screen again but then the icon is deselected :-) Thanks Rainer
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();