[Digikam-devel] extragear/graphics/digikam

Gilles Caulier caulier.gilles at free.fr
Sun Mar 12 16:52:42 GMT 2006


SVN commit 517933 by cgilles:

digikam from trunk : image editor and showfoto bugfix : catch and show properly right sidebar when gui is toogle in fullscreen or when slideshow tool used.

CCMAIL: digikam-devel at kde.org

 M  +0 -1      TODO  
 M  +23 -4     libs/widgets/common/sidebar.cpp  
 M  +12 -2     libs/widgets/common/sidebar.h  
 M  +2 -18     showfoto/showfoto.cpp  
 M  +0 -1      showfoto/showfoto.h  
 M  +7 -8      utilities/imageeditor/editor/imagewindow.cpp  
 M  +1 -0      utilities/imageeditor/editor/imagewindow.h  


--- trunk/extragear/graphics/digikam/TODO #517932:517933
@@ -17,7 +17,6 @@
 
    - Added signal/slots control between IE and main interface about "comments & tags" tab.
      Comments & tags set from main must be updated in IE and vise-versa.
-   - Fix in IE/Showfoto Image Properties side bar restoration after fullscreen mode.
      
 * Improving metadata support:
    - removed libkexif depency        ==> under progress ! (Gilles)
--- trunk/extragear/graphics/digikam/libs/widgets/common/sidebar.cpp #517932:517933
@@ -54,6 +54,7 @@
 
     bool          minimizedDefault;
     bool          minimized;
+    bool          isMinimized;         
 
     int           tabs;
     int           activeTab;
@@ -68,7 +69,7 @@
 };
 
 Sidebar::Sidebar(QWidget *parent, const char *name, Side side, bool minimizedDefault)
-    : KMultiTabBar(KMultiTabBar::Vertical, parent, name)
+       : KMultiTabBar(KMultiTabBar::Vertical, parent, name)
 {
     d = new SidebarPriv;
     d->minimizedDefault = minimizedDefault;
@@ -106,7 +107,7 @@
     config->setGroup(QString("%1").arg(name()));
    
     tab = config->readNumEntry("ActiveTab", 0);
-    minimized = config->readNumEntry("Minimized", d->minimizedDefault);
+    minimized = config->readBoolEntry("Minimized", d->minimizedDefault);
         
     if(minimized)
     {
@@ -128,12 +129,30 @@
     config->setGroup(QString("%1").arg(name()));
     
     config->writeEntry("ActiveTab", d->activeTab);
-    config->writeEntry("Minimized", (int)d->minimized);
+    config->writeEntry("Minimized", d->minimized);
 }
 
+void Sidebar::backup()
+{
+    d->isMinimized = d->minimized;
+
+    if (!d->isMinimized) 
+        shrink();
+
+    KMultiTabBar::hide();
+}
+
+void Sidebar::restore()
+{
+    if (!d->isMinimized) 
+        expand();
+
+    KMultiTabBar::show();
+}
+
 void Sidebar::appendTab(QWidget *w, const QPixmap &pic, const QString &title)
 {
-    w->reparent(d->stack, QPoint(0,0));
+    w->reparent(d->stack, QPoint(0, 0));
     KMultiTabBar::appendTab(pic, d->tabs, title);
     d->stack->addWidget(w, d->tabs);
 
--- trunk/extragear/graphics/digikam/libs/widgets/common/sidebar.h #517932:517933
@@ -108,12 +108,22 @@
      * redisplays the whole sidebar
      */
     void expand();
-                
+
     /**
      * load the last view state from disk
      */
     void loadViewState();
-    
+
+    /**
+     * hide sidebar and backup minimized state.
+     */ 
+    void backup();
+
+    /**
+     * show sidebar and restore minimized state.
+     */ 
+    void restore();
+
 private:
     
     
--- trunk/extragear/graphics/digikam/showfoto/showfoto.cpp #517932:517933
@@ -440,8 +440,7 @@
 {
     if (m_fullScreen)
     {
-        m_rightSidebar->show();
-        m_rightSidebar->expand();
+        m_rightSidebar->restore();
 
         // If Hide Thumbbar option is checked, restore it.
         if (!m_showBarAction->isChecked())
@@ -449,8 +448,7 @@
     }
     else
     {
-        m_rightSidebar->shrink();
-        m_rightSidebar->hide();
+        m_rightSidebar->backup();
 
         // If Hide Thumbbar option is checked, catch it if necessary.
         if (!m_showBarAction->isChecked())
@@ -553,20 +551,6 @@
     m_openFilesInFolderAction->setEnabled(val);
 }
 
-void ShowFoto::toggleGUI2SlideShow()
-{
-    if (m_slideShowAction->isChecked())
-    {
-        m_rightSidebar->shrink();
-        m_rightSidebar->hide();
-    }
-    else
-    {
-        m_rightSidebar->show();
-        m_rightSidebar->expand();
-    }
-}
-
 void ShowFoto::slotFilePrint()
 {
     printImage(m_currentItem->url());
--- trunk/extragear/graphics/digikam/showfoto/showfoto.h #517932:517933
@@ -108,7 +108,6 @@
     void toggleActions(bool val);
     void toggleActions2SlideShow(bool val);
     
-    void toggleGUI2SlideShow();
     void toggleGUI2FullScreen();
    
     void toggleNavigation(int index);
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/imagewindow.cpp #517932:517933
@@ -538,17 +538,16 @@
 void ImageWindow::toggleGUI2FullScreen()
 {
     if (m_fullScreen)
-    {
-        m_rightSidebar->show();
-        m_rightSidebar->expand();
-    }
+        m_rightSidebar->restore();
     else
-    {
-        m_rightSidebar->shrink();
-        m_rightSidebar->hide();
-    }
+        m_rightSidebar->backup();
 }
 
+void ImageWindow::toggleActions2SlideShow(bool val)
+{
+    toggleActions(val);
+}
+
 void ImageWindow::saveIsComplete()
 {
     // With save(), we do not reload the image but just continue using the data.
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/imagewindow.h #517932:517933
@@ -93,6 +93,7 @@
     void setupConnections();
     void setupUserArea();
     void toggleGUI2FullScreen();
+    void toggleActions2SlideShow(bool val);
 
     bool save();
     bool saveAs();



More information about the Digikam-devel mailing list