[Digikam-devel] extragear/graphics/digikam/imageplugins/freerotation

Andi Clemens andi.clemens at gmx.net
Fri May 15 17:35:59 BST 2009


SVN commit 968414 by aclemens:

Use DExpanderBox in freerotation tool, too.
Makes it much more space saving on smaller screens.

Gilles, Marcel and others,
we should consider to use this in every plugin... what do you think?
It is much more readable then those ugly vertical tabs (toolbox widget)
we use in some places.

Andi

CCMAIL:digikam-devel at kde.org

 M  +22 -9     freerotationtool.cpp  
 M  +16 -14    freerotationtool.h  


--- trunk/extragear/graphics/digikam/imageplugins/freerotation/freerotationtool.cpp #968413:968414
@@ -35,7 +35,6 @@
 
 #include <QCheckBox>
 #include <QGridLayout>
-#include <QGroupBox>
 #include <QImage>
 #include <QLabel>
 #include <QLayout>
@@ -64,6 +63,7 @@
 
 // Local includes
 
+#include "clicklabel.h"
 #include "daboutdata.h"
 #include "dimg.h"
 #include "editortoolsettings.h"
@@ -106,6 +106,7 @@
                                             EditorToolSettings::Cancel,
                                             EditorToolSettings::ColorGuide);
 
+
     QLabel *label1  = new QLabel(i18n("New width:"));
     m_newWidthLabel = new QLabel(temp.setNum( iface.originalWidth()) + i18n(" px"));
     m_newWidthLabel->setAlignment( Qt::AlignBottom | Qt::AlignRight );
@@ -184,7 +185,8 @@
 
     // -------------------------------------------------------------
 
-    m_manualAdjustContainer      = new QGroupBox(i18n("Manual Adjustment"));
+//    m_manualAdjustContainer      = new QGroupBox(i18n("Manual Adjustment"));
+    m_manualAdjustContainer      = new QWidget;
     QGridLayout *containerLayout = new QGridLayout;
     containerLayout->addWidget(label3,              0, 0, 1, 1);
     containerLayout->addWidget(m_angleInput,        1, 0, 1, 1);
@@ -195,7 +197,8 @@
 
     // -------------------------------------------------------------
 
-    m_autoAdjustContainer         = new QGroupBox(i18n("Automatic Correction"));
+//    m_autoAdjustContainer         = new QGroupBox(i18n("Automatic Correction"));
+    m_autoAdjustContainer         = new QWidget;
     QGridLayout *containerLayout2 = new QGridLayout;
     QLabel *autoDescr             = new QLabel;
     autoDescr->setText(i18n("<p>Correct the rotation of your images automatically by assigning two points in the "
@@ -213,7 +216,21 @@
 
     // -------------------------------------------------------------
 
+    QWidget* settingsContainer = new QWidget;
+    QGridLayout* containerLayout3 = new QGridLayout;
+    containerLayout3->addWidget(m_antialiasInput, 0, 0, 1,-1);
+    containerLayout3->addWidget(label5,           1, 0, 1, 1);
+    containerLayout3->addWidget(m_autoCropCB,     1, 1, 1, 1);
+    settingsContainer->setLayout(containerLayout3);
+
+    // -------------------------------------------------------------
+
     KSeparator *line  = new KSeparator(Qt::Horizontal);
+    m_expanderBox = new DExpanderBox;
+    m_expanderBox->addItem(m_autoAdjustContainer,   SmallIcon("freerotation"), i18n("Automatic Correction"));
+    m_expanderBox->addItem(m_manualAdjustContainer, SmallIcon("freerotation"), i18n("Manual Adjustment"));
+    m_expanderBox->addItem(settingsContainer,       SmallIcon("freerotation"), i18n("Additional Settings"));
+    m_expanderBox->addStretch();
 
     // -------------------------------------------------------------
 
@@ -223,12 +240,8 @@
     mainLayout->addWidget(label2,                  1, 0, 1, 1);
     mainLayout->addWidget(m_newHeightLabel,        1, 1, 1, 1);
     mainLayout->addWidget(line,                    2, 0, 1,-1);
-    mainLayout->addWidget(m_autoAdjustContainer,   3, 0, 1,-1);
-    mainLayout->addWidget(m_manualAdjustContainer, 4, 0, 1,-1);
-    mainLayout->addWidget(m_antialiasInput,        5, 0, 1,-1);
-    mainLayout->addWidget(label5,                  6, 0, 1, 1);
-    mainLayout->addWidget(m_autoCropCB,            6, 1, 1, 1);
-    mainLayout->setRowStretch(10, 10);
+    mainLayout->addWidget(m_expanderBox,           3, 0, 1,-1);
+    mainLayout->setRowStretch(3, 10);
     mainLayout->setMargin(m_gboxSettings->spacingHint());
     mainLayout->setSpacing(m_gboxSettings->spacingHint());
     m_gboxSettings->plainPage()->setLayout(mainLayout);
--- trunk/extragear/graphics/digikam/imageplugins/freerotation/freerotationtool.h #968413:968414
@@ -31,7 +31,6 @@
 #include "editortool.h"
 
 class QCheckBox;
-class QGroupBox;
 class QLabel;
 class QPixmap;
 class QPoint;
@@ -46,6 +45,7 @@
 
 namespace Digikam
 {
+class DExpanderBox;
 class EditorToolSettings;
 class ImageWidget;
 }
@@ -93,30 +93,32 @@
 
 private:
 
-    QLabel                       *m_newWidthLabel;
-    QLabel                       *m_newHeightLabel;
+    QLabel*                       m_newWidthLabel;
+    QLabel*                       m_newHeightLabel;
 
-    QCheckBox                    *m_antialiasInput;
+    QCheckBox*                    m_antialiasInput;
 
-    QPushButton                  *m_autoAdjustBtn;
-    QPushButton                  *m_autoAdjustPoint1Btn;
-    QPushButton                  *m_autoAdjustPoint2Btn;
+    QPushButton*                  m_autoAdjustBtn;
+    QPushButton*                  m_autoAdjustPoint1Btn;
+    QPushButton*                  m_autoAdjustPoint2Btn;
 
     QPoint                        m_autoAdjustPoint1;
     QPoint                        m_autoAdjustPoint2;
 
-    QGroupBox                    *m_autoAdjustContainer;
-    QGroupBox                    *m_manualAdjustContainer;
+    QWidget*                      m_autoAdjustContainer;
+    QWidget*                      m_manualAdjustContainer;
 
-    KDcrawIface::RComboBox       *m_autoCropCB;
+    KDcrawIface::RComboBox*       m_autoCropCB;
 
-    KDcrawIface::RIntNumInput    *m_angleInput;
+    KDcrawIface::RIntNumInput*    m_angleInput;
 
-    KDcrawIface::RDoubleNumInput *m_fineAngleInput;
+    KDcrawIface::RDoubleNumInput* m_fineAngleInput;
 
-    Digikam::ImageWidget         *m_previewWidget;
+    Digikam::ImageWidget*         m_previewWidget;
 
-    Digikam::EditorToolSettings  *m_gboxSettings;
+    Digikam::DExpanderBox*        m_expanderBox;
+
+    Digikam::EditorToolSettings*  m_gboxSettings;
 };
 
 }  // namespace DigikamFreeRotationImagesPlugin



More information about the Digikam-devel mailing list