[Digikam-devel] extragear/graphics/digikam

Andi Clemens andi.clemens at gmx.net
Sat Jan 9 21:02:21 GMT 2010


SVN commit 1072287 by aclemens:

Add helper class "ButtonIconDisabler". This class can take a QAbstractButton as
a child and disable the icon if the button is not toggled / checked.
This makes the state of the indicator much more visible...

It will look like the button is disabled, but with the difference that it still
can be pressed. This will be used in the status bar of the image editor for the
indicator buttons.

I found a weird bug though: When using the actions via shortcuts, the icons are
drawn correct. BUT if you select the "View" menu for the first time and the
indicators were grayed out, they will be redrawn and displayed as if the
buttons have been checked.
I checked with GDB, but the ButtonIconDisabler class is not triggered. I don't
understand what is causing this, because it only happens when you click on the
menu the first time. After that this behavior is not visible.

Any idea why this is happening? If we can't find a solution, I guess we need to
remove the ButtonIconDisabler class again.

CCMAIL:digikam-devel at kde.org

 M  +1 -0      CMakeLists.txt  
 A             libs/widgets/common/buttonicondisabler.cpp   [License: GPL (v2+)]
 A             libs/widgets/common/buttonicondisabler.h   [License: GPL (v2+)]
 M  +6 -2      utilities/imageeditor/editor/editorwindow.cpp  


--- trunk/extragear/graphics/digikam/CMakeLists.txt #1072286:1072287
@@ -616,6 +616,7 @@
        )
 
     SET(libcommonwidgets_SRCS
+        ${CMAKE_CURRENT_SOURCE_DIR}/libs/widgets/common/buttonicondisabler.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/libs/widgets/common/colorgradientwidget.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/libs/widgets/common/comboboxutilities.cpp
         ${CMAKE_CURRENT_SOURCE_DIR}/libs/widgets/common/curveswidget.cpp
--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/editorwindow.cpp #1072286:1072287
@@ -104,6 +104,7 @@
 
 // Local includes
 
+#include "buttonicondisabler.h"
 #include "canvas.h"
 #include "colorcorrectiondlg.h"
 #include "dimginterface.h"
@@ -633,23 +634,26 @@
 
     d->underExposureIndicator = new QToolButton(buttonsBox);
     d->underExposureIndicator->setDefaultAction(d->viewUnderExpoAction);
+    new ButtonIconDisabler(d->underExposureIndicator);
 
     d->overExposureIndicator  = new QToolButton(buttonsBox);
     d->overExposureIndicator->setDefaultAction(d->viewOverExpoAction);
+    new ButtonIconDisabler(d->overExposureIndicator);
 
     d->cmViewIndicator        = new QToolButton(buttonsBox);
     d->cmViewIndicator->setDefaultAction(d->viewCMViewAction);
+    new ButtonIconDisabler(d->cmViewIndicator);
 
     buttonsGrp->addButton(d->underExposureIndicator);
     buttonsGrp->addButton(d->overExposureIndicator);
     buttonsGrp->addButton(d->cmViewIndicator);
-    
+
     hlay->setSpacing(0);
     hlay->setMargin(0);
     hlay->addWidget(d->underExposureIndicator);
     hlay->addWidget(d->overExposureIndicator);
     hlay->addWidget(d->cmViewIndicator);
-    
+
     statusBar()->addPermanentWidget(buttonsBox);
 }
 



More information about the Digikam-devel mailing list