[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/3.5/kdegraphics/libkscan
From: Martin Koller <m.koller () surfeu ! at>
Date: 2008-01-31 21:05:30
Message-ID: 1201813530.311275.25744.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 769210 by mkoller:
Beautify the layout of the scan dialog
M +16 -10 previewer.cpp
M +12 -5 scanparams.cpp
--- branches/KDE/3.5/kdegraphics/libkscan/previewer.cpp #769209:769210
@@ -106,16 +106,22 @@
QMemArray<long> m_widthSum;
};
-
Previewer::Previewer(QWidget *parent, const char *name )
: QWidget(parent,name)
{
d = new PreviewerPrivate();
- QVBoxLayout *top = new QVBoxLayout( this, 10 );
- layout = new QHBoxLayout( 2 );
+ // 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, KDialog::marginHint(), KDialog::spacingHint() );
+ layout = new QHBoxLayout( KDialog::spacingHint() );
top->addLayout( layout, 9 );
- QVBoxLayout *left = new QVBoxLayout( 3 );
+ QVBoxLayout *left = new QVBoxLayout( KDialog::spacingHint() );
layout->addLayout( left, 2 );
/* Load autoselection values from Config file */
@@ -131,7 +137,7 @@
overallWidth = 210;
kdDebug(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);
@@ -153,13 +159,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 QVButtonGroup( i18n("Scan Size"), this );
+ bgroup = new QVButtonGroup( i18n("Scan Size"), frame );
// -----
- pre_format_combo = new QComboBox( this, "PREVIEWFORMATCOMBO" );
+ pre_format_combo = new QComboBox( frame, "PREVIEWFORMATCOMBO" );
pre_format_combo->insertItem( i18n( "Custom" ), ID_CUSTOM);
pre_format_combo->insertItem( i18n( "DIN A4" ), ID_A4);
pre_format_combo->insertItem( i18n( "DIN A5" ), ID_A5);
@@ -194,7 +200,7 @@
/** Autoselection Box **/
- d->m_autoSelGroup = new QGroupBox( 1, Horizontal, i18n("Auto-Selection"), this);
+ d->m_autoSelGroup = new QGroupBox( 1, Horizontal, i18n("Auto-Selection"), frame);
QHBox *hbox = new QHBox(d->m_autoSelGroup);
d->m_cbAutoSel = new QCheckBox( i18n("Active on"), hbox );
@@ -240,7 +246,7 @@
left->addWidget(d->m_autoSelGroup);
/* Labels for the dimension */
- QGroupBox *gbox = new QGroupBox( 1, Horizontal, i18n("Selection"), this, "GROUPBOX" );
+ QGroupBox *gbox = new QGroupBox( 1, Horizontal, i18n("Selection"), frame, "GROUPBOX" );
QLabel *l2 = new QLabel( i18n("width - mm" ), gbox );
QLabel *l3 = new QLabel( i18n("height - mm" ), gbox );
--- branches/KDE/3.5/kdegraphics/libkscan/scanparams.cpp #769209:769210
@@ -114,8 +114,8 @@
/* A top layout box */
// QVBoxLayout *top = new QVBoxLayout(this, 6);
QHBox *hb = new QHBox( 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 );
@@ -156,7 +156,7 @@
/* Create a Start-Scan-Button */
(void) new KSeparator( KSeparator::HLine, this);
KButtonBox *kbb = new KButtonBox( this );
- QPushButton* pb = kbb->addButton( i18n( "Final S&can" ));
+ QPushButton* pb = kbb->addButton( KGuiItem( i18n( "Final S&can" ), "scanner" ) );
connect( pb, SIGNAL(clicked()), this, SLOT(slStartScan()) );
pb = kbb->addButton( i18n( "&Preview Scan" ));
connect( pb, SIGNAL(clicked()), this, SLOT(slAcquirePreview()) );
@@ -227,10 +227,9 @@
sv->setHScrollBarMode( QScrollView::AlwaysOff );
sv->setResizePolicy( QScrollView::AutoOneFit );
QVBox *pbox = new QVBox( sv->viewport());
+ pbox->setSpacing( KDialog::spacingHint() );
sv->setFrameStyle( QFrame::NoFrame );
- sv->addChild( pbox );
-
QHBox *hb = new QHBox(pbox);
/* Mode setting */
@@ -500,6 +499,14 @@
cb_gray_preview = (QCheckBox*) so->widget();
QToolTip::add( cb_gray_preview, i18n("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