[Digikam-devel] [Bug 140131] No zoom in image preview

Gilles Caulier caulier.gilles at gmail.com
Thu Apr 12 15:47:54 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=140131         




------- Additional Comments From caulier.gilles gmail com  2007-04-12 16:47 -------
SVN commit 653028 by cgilles:

digiKam from trunk : new option to reset zoom factor to fit preview on window size.
CCBUGS: 140131

 M  +5 -0      digikam/albumwidgetstack.cpp  
 M  +1 -0      digikam/albumwidgetstack.h  
 M  +13 -4     digikam/digikamapp.cpp  
 M  +6 -4      digikam/digikamappprivate.h  
 M  +1 -0      digikam/digikamui.rc  
 M  +8 -0      digikam/digikamview.cpp  
 M  +1 -0      digikam/digikamview.h  
 M  +9 -2      libs/widgets/common/previewwidget.cpp  
 M  +3 -2      libs/widgets/common/previewwidget.h  


--- trunk/extragear/graphics/digikam/digikam/albumwidgetstack.cpp #653027:653028
 @ -217,6 +217,11  @
     d->imagePreviewView->slotDecreaseZoom();
 }
 
+void AlbumWidgetStack::fitToWindow()
+{
+    d->imagePreviewView->fitToWindow();
+}
+
 bool AlbumWidgetStack::maxZoom()
 {
     return d->imagePreviewView->maxZoom();
--- trunk/extragear/graphics/digikam/digikam/albumwidgetstack.h #653027:653028
 @ -71,6 +71,7  @
     
     void   increaseZoom();
     void   decreaseZoom();
+    void   fitToWindow();
     bool   maxZoom();
     bool   minZoom();
     void   setZoomFactor(double z);
--- trunk/extragear/graphics/digikam/digikam/digikamapp.cpp #653027:653028
 @ -784,7 +784,7  @
 
     // -----------------------------------------------------------
 
-    d->thumbSizePlusAction = new KAction(i18n("Zoom in"),
+    d->zoomPlusAction = new KAction(i18n("Zoom in"),
                                    "viewmag+",
                                    CTRL+Key_Plus,
                                    d->view,
 @ -792,7 +792,7  @
                                    actionCollection(),
                                    "album_zoomin");
 
-    d->thumbSizeMinusAction = new KAction(i18n("Zoom out"),
+    d->zoomMinusAction = new KAction(i18n("Zoom out"),
                                    "viewmag-",
                                    CTRL+Key_Minus,
                                    d->view,
 @ -800,6 +800,14  @
                                    actionCollection(),
                                    "album_zoomout");
 
+    d->zoomFitToWindowAction = new KAction(i18n("Fit to &Window"), 
+                                   "view_fit_window",
+                                   CTRL+SHIFT+Key_A, 
+                                   d->view, 
+                                   SLOT(slotFitToWindow()),
+                                   actionCollection(), 
+                                   "album_zoomfit2window");
+
 #if KDE_IS_VERSION(3,2,0)
     d->fullScreenAction = KStdAction::fullScreen(this, SLOT(slotToggleFullScreen()),
                                                  actionCollection(), this, "full_screen");
 @ -950,13 +958,13  @
 
 void DigikamApp::enableZoomPlusAction(bool val)
 {
-    d->thumbSizePlusAction->setEnabled(val);
+    d->zoomPlusAction->setEnabled(val);
     d->zoomPlusButton->setEnabled(val);
 }
 
 void DigikamApp::enableZoomMinusAction(bool val)
 {
-    d->thumbSizeMinusAction->setEnabled(val);
+    d->zoomMinusAction->setEnabled(val);
     d->zoomMinusButton->setEnabled(val);
 }
 
 @ -1865,6 +1873,7  @
     // View menu     
     d->albumSortAction->setEnabled(!t);
     d->imageSortAction->setEnabled(!t);
+    d->zoomFitToWindowAction->setEnabled(t);
 }
 
 }  // namespace Digikam
--- trunk/extragear/graphics/digikam/digikam/digikamappprivate.h #653027:653028
 @ -100,8 +100,6  @
         selectAllAction                      = 0;
         selectNoneAction                     = 0;
         selectInvertAction                   = 0;
-        thumbSizePlusAction                  = 0;
-        thumbSizeMinusAction                 = 0;
         fullScreenAction                     = 0;
         slideShowAction                      = 0;
         slideShowAllAction                   = 0;
 @ -134,6 +132,9  @
         zoomTracker                          = 0;
         zoomMinusButton                      = 0;
         zoomPlusButton                       = 0;
+        zoomFitToWindowAction                = 0;
+        zoomPlusAction                       = 0;
+        zoomMinusAction                      = 0;
     }
 
     bool                   fullScreen;
 @ -209,10 +210,11  @
     KAction               *slideShowAllAction;
     KAction               *slideShowSelectionAction;
     KAction               *slideShowRecursiveAction;
-    KAction               *thumbSizePlusAction;
-    KAction               *thumbSizeMinusAction;
     KSelectAction         *imageSortAction;
     KSelectAction         *albumSortAction;
+    KAction               *zoomPlusAction;
+    KAction               *zoomMinusAction;
+    KAction               *zoomFitToWindowAction;
 
     KAction               *rating0Star;
     KAction               *rating1Star;
--- trunk/extragear/graphics/digikam/digikam/digikamui.rc #653027:653028
 @ -64,6 +64,7  @
      <Separator/>
      <Action name="album_zoomin" />
      <Action name="album_zoomout" />
+     <Action name="album_zoomfit2window" />
      <Separator />
      <Action name="album_sort" />
      <Action name="image_sort" />
--- trunk/extragear/graphics/digikam/digikam/digikamview.cpp #653027:653028
 @ -817,6 +817,14  @
     }
 }
 
+void DigikamView::slotFitToWindow()
+{
+    if (d->albumWidgetStack->previewMode() == AlbumWidgetStack::PreviewImageMode)
+    {
+        d->albumWidgetStack->fitToWindow();
+    }
+}
+
 void DigikamView::slotZoomFactorChanged(double zoom)
 {
     toogleZoomActions();
--- trunk/extragear/graphics/digikam/digikam/digikamview.h #653027:653028
 @ -81,6 +81,7  @
     // View Action slots
     void slotZoomIn();
     void slotZoomOut();
+    void slotFitToWindow();
     void slotSlideShowAll();
     void slotSlideShowSelection();
     void slotSlideShowRecursive();
--- trunk/extragear/graphics/digikam/libs/widgets/common/previewwidget.cpp #653027:653028
 @ -479,13 +479,20  @
     return d->zoom; 
 }
 
-bool PreviewWidget::fitToWindow()
+bool PreviewWidget::isFitToWindow()
 {
     return d->autoZoom;
 }
 
-void PreviewWidget::toggleFitToWindow()
+void PreviewWidget::fitToWindow()
 {
+    updateAutoZoom();
+    updateContentsSize();
+    viewport()->update();
+}
+
+void PreviewWidget::lockFitToWindow()
+{
     d->autoZoom = !d->autoZoom;
 
     if (d->autoZoom)
--- trunk/extragear/graphics/digikam/libs/widgets/common/previewwidget.h #653027:653028
 @ -50,8 +50,9  @
     void setImage(const QImage& image);
     void setZoomFactor(double z);
     void setBackgroundColor(const QColor& color);
-    bool fitToWindow();
-    void toggleFitToWindow();
+    void fitToWindow();
+    bool isFitToWindow();
+    void lockFitToWindow();
 
     bool maxZoom();
     bool minZoom();



More information about the Digikam-devel mailing list