[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdegraphics/libkscan
From:       Martin Koller <m.koller () surfeu ! at>
Date:       2008-01-31 21:37:44
Message-ID: 1201815464.562243.27144.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 769220 by mkoller:

Forwardport of dialog layout beautification


 M  +17 -10    previewer.cpp  
 M  +14 -5     scanparams.cpp  


--- trunk/KDE/kdegraphics/libkscan/previewer.cpp #769219:769220
@@ -115,13 +115,20 @@
 {
     d = new PreviewerPrivate();
 
-    QVBoxLayout *top = new QVBoxLayout( this );
-    top->setSpacing( 10 );
+    // beautification to look like the left scanparams widget in the dialog
+    QHBoxLayout *htop = new QHBoxLayout( this );
+    QFrame *frame = new QFrame( this );
+    frame->setFrameStyle( QFrame::Panel | QFrame::Raised );
+    frame->setLineWidth( 1 );
+    htop->addWidget( frame );
+
+    QVBoxLayout *top = new QVBoxLayout( frame );
+    top->setSpacing( KDialog::spacingHint() );
     layout = new QHBoxLayout();
-    layout->setSpacing( 2 );
+    layout->setSpacing( KDialog::spacingHint() );
     top->addLayout( layout, 9 );
     QVBoxLayout *left = new QVBoxLayout();
-    left->setSpacing( 3 );
+    left->setSpacing( KDialog::spacingHint() );
     layout->addLayout( left, 2 );
 
     /* Load autoselection values from Config file */
@@ -136,7 +143,7 @@
     overallWidth = 210;
     kDebug(29000) << "Previewer: got Overallsize: " <<
         overallWidth << " x " << overallHeight << endl;
-    img_canvas  = new ImageCanvas( this );
+    img_canvas  = new ImageCanvas( frame );
 
     img_canvas->setDefaultScaleKind( ImageCanvas::DYNAMIC );
     img_canvas->enableContextMenu(true);
@@ -165,13 +172,13 @@
     connect( img_canvas, SIGNAL(newRect(QRect)), this, SLOT(slNewDimen(QRect)));
 
     /* Stuff for the preview-Notification */
-    left->addWidget( new QLabel( i18n("<B>Preview</B>"), this ), 1);
+    left->addWidget( new QLabel( i18n("<B>Preview</B>"), frame ), 1);
 
     // Create a button group to contain buttons for Portrait/Landscape
-    bgroup = new Q3VButtonGroup( i18n("Scan Size"), this );
+    bgroup = new Q3VButtonGroup( i18n("Scan Size"), frame );
 
     // -----
-    pre_format_combo = new QComboBox( this );
+    pre_format_combo = new QComboBox( frame );
     pre_format_combo->setObjectName("PREVIEWFORMATCOMBO");
     pre_format_combo->insertItem( ID_CUSTOM, i18n( "Custom" ));
     pre_format_combo->insertItem( ID_A4, i18n( "DIN A4" ));
@@ -207,7 +214,7 @@
 
 
     /** Autoselection Box **/
-    d->m_autoSelGroup = new Q3GroupBox( 1, Qt::Horizontal, i18n("Auto-Selection"), \
this); +    d->m_autoSelGroup = new Q3GroupBox( 1, Qt::Horizontal, \
i18n("Auto-Selection"), frame );  
     KHBox *hbox       = new KHBox(d->m_autoSelGroup);
     d->m_cbAutoSel    = new QCheckBox( i18n("Active on"), hbox );
@@ -256,7 +263,7 @@
     left->addWidget(d->m_autoSelGroup);
 
     /* Labels for the dimension */
-    Q3GroupBox *gbox = new Q3GroupBox( 1, Qt::Horizontal, i18n("Selection"), this, \
"GROUPBOX" ); +    Q3GroupBox *gbox = new Q3GroupBox( 1, Qt::Horizontal, \
i18n("Selection"), frame, "GROUPBOX" );  
     QLabel *l2 = new QLabel( i18n("width - mm" ), gbox );
     QLabel *l3 = new QLabel( i18n("height - mm" ), gbox );
--- trunk/KDE/kdegraphics/libkscan/scanparams.cpp #769219:769220
@@ -45,6 +45,7 @@
 #include <kiconloader.h>
 #include <kled.h>
 #include <kseparator.h>
+#include <kpushbutton.h>
 
 #include "scanparams.h"
 #include <scansourcedialog.h>
@@ -119,8 +120,8 @@
    // QVBoxLayout *top = new QVBoxLayout(this);
    //top->setSpacing(6);
    KHBox *hb = new KHBox( this );
-   hb->layout()->setSpacing( KDialog::spacingHint() );
-   QString cap = i18n("<b>Scanner Settings</b>");
+   hb->setSpacing( KDialog::spacingHint() );
+   QString cap = i18n("<b>Scanner Settings</b>") + " : ";
    cap += sane_device->getScannerName();
    (void ) new QLabel( cap, hb );
    m_led = new KLed( hb );
@@ -161,7 +162,8 @@
    /* Create a Start-Scan-Button */
    (void) new KSeparator( Qt::Horizontal, this);
    KDialogButtonBox *kbb = new KDialogButtonBox( this );
-   QPushButton* pb = kbb->addButton( i18nc( "@action:button", "Final S&can" ), \
QDialogButtonBox::ActionRole); +   QPushButton* pb = kbb->addButton( KGuiItem( i18nc( \
"@action:button", "Final S&can" ), "scanner" ), +                                     \
QDialogButtonBox::ActionRole );  connect( pb, SIGNAL(clicked()), this, \
SLOT(slStartScan()) );  pb = kbb->addButton( i18nc( "@action:button", "&Preview Scan" \
), QDialogButtonBox::ActionRole);  connect( pb, SIGNAL(clicked()), this, \
SLOT(slAcquirePreview()) ); @@ -232,10 +234,9 @@
    sv->setHScrollBarMode( Q3ScrollView::AlwaysOff );
    sv->setResizePolicy( Q3ScrollView::AutoOneFit );
    KVBox *pbox = new KVBox( sv->viewport());
+   pbox->setSpacing( KDialog::spacingHint() );
    sv->setFrameStyle( QFrame::NoFrame );
 
-   sv->addChild( pbox );
-
    KHBox *hb = new KHBox(pbox);
 
    /* Mode setting */
@@ -505,6 +506,14 @@
      cb_gray_preview = (QCheckBox*) so->widget();
      cb_gray_preview->setToolTip( i18nc( "@info:tooltip", "Acquire a gray preview \
even in color mode (faster)") );  }
+
+   QWidget *spacer = new QWidget( pbox );
+   spacer->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+   pbox->setMinimumWidth( pbox->sizeHint().width() );
+   sv->setMinimumWidth( pbox->minimumWidth() );
+   sv->addChild( pbox );
+
    return( sv );
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic