[Digikam-devel] extragear/graphics/digikam/utilities/imageeditor/editor

Gilles Caulier caulier.gilles at gmail.com
Fri Apr 13 20:03:45 BST 2007


SVN commit 653597 by cgilles:

digiKam from trunk : new action to set zoom factor to 100% with Image Editor and Showfoto.
CCMAIL: digikam-devel at kde.org

 M  +2 -1      digikamimagewindowui.rc  
 M  +16 -0     editorwindow.cpp  
 M  +1 -0      editorwindow.h  
 M  +2 -0      editorwindowprivate.h  


--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/digikamimagewindowui.rc #653596:653597
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<gui version="15" name="digikamimagewindow" >
+<gui version="16" name="digikamimagewindow" >
 
 <MenuBar>
 
@@ -34,6 +34,7 @@
         <Separator/>
         <Action name="editorwindow_zoomplus" /> 
         <Action name="editorwindow_zoomminus" /> 
+        <Action name="editorwindow_zoomto100percents" />
         <Action name="editorwindow_zoomfit2window" />
         <Action name="editorwindow_zoomfit2select" />
         <Separator/>
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.cpp #653596:653597
@@ -325,6 +325,11 @@
     d->zoomMinusAction = KStdAction::zoomOut(m_canvas, SLOT(slotDecreaseZoom()),
                                              actionCollection(), "editorwindow_zoomminus");
 
+    d->zoomTo100percents = new KAction(i18n("Zoom to 1:1"), "viewmag1",
+                                   CTRL+SHIFT+Key_Z, this, SLOT(slotZoomTo100Percents()),
+                                   actionCollection(), "editorwindow_zoomto100percents");
+
+
     d->zoomFitToWindowAction = new KToggleAction(i18n("Fit to &Window"), "view_fit_window",
                                          CTRL+SHIFT+Key_A, this, SLOT(slotToggleFitToWindow()),
                                          actionCollection(), "editorwindow_zoomfit2window");
@@ -675,6 +680,17 @@
     m_canvas->fitToSelect();
 }
 
+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);
+    m_canvas->setZoomFactor(1.0);
+}
+
 void EditorWindow::slotZoomTextChanged(const QString &txt)
 {
     double zoom = KGlobal::locale()->readNumber(txt) / 100.0;
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.h #653596:653597
@@ -203,6 +203,7 @@
     void slotSavingFinished(const QString &filename, bool success);
     void slotDonateMoney();
     void slotToggleSlideShow();
+    void slotZoomTo100Percents();
     void slotZoomSelected();
     void slotZoomTextChanged(const QString &);
     void slotZoomChanged(double zoom);
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindowprivate.h #653596:653597
@@ -75,6 +75,7 @@
         zoomFitToSelectAction  = 0;
         zoomPlusAction         = 0;
         zoomMinusAction        = 0;
+        zoomTo100percents      = 0;
         zoomCombo              = 0;
         zoomComboAction        = 0;
     }
@@ -103,6 +104,7 @@
     KAction                   *cropAction;
     KAction                   *zoomPlusAction;
     KAction                   *zoomMinusAction;
+    KAction                   *zoomTo100percents;
     KAction                   *zoomFitToSelectAction;
     KAction                   *rotateLeftAction;
     KAction                   *rotateRightAction;



More information about the Digikam-devel mailing list