summaryrefslogtreecommitdiff
path: root/core/settings/launcher/tabdialog.cpp
Unidiff
Diffstat (limited to 'core/settings/launcher/tabdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/tabdialog.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp
index cef92d9..abe310f 100644
--- a/core/settings/launcher/tabdialog.cpp
+++ b/core/settings/launcher/tabdialog.cpp
@@ -48,12 +48,13 @@
48#include <qlabel.h> 48#include <qlabel.h>
49#include <qfileinfo.h> 49#include <qfileinfo.h>
50#include <qradiobutton.h> 50#include <qradiobutton.h>
51#include <qbuttongroup.h> 51#include <qbuttongroup.h>
52#include <qwhatsthis.h> 52#include <qwhatsthis.h>
53#include <qcheckbox.h> 53#include <qcheckbox.h>
54#include <qspinbox.h>
54 55
55 56
56using namespace Opie::Ui; 57using namespace Opie::Ui;
57class SampleItem : public QIconViewItem { 58class SampleItem : public QIconViewItem {
58public: 59public:
59 SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) 60 SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text )
@@ -77,12 +78,14 @@ public:
77 } 78 }
78 79
79private: 80private:
80 QPixmap m_large, m_small; 81 QPixmap m_large, m_small;
81}; 82};
82 83
84//FIXME: Why not derive SampleView from LauncherView ???
85
83class SampleView : public QIconView { 86class SampleView : public QIconView {
84public: 87public:
85 SampleView ( QWidget *parent = 0, const char *name = 0 ) : QIconView ( parent, name ) 88 SampleView ( QWidget *parent = 0, const char *name = 0 ) : QIconView ( parent, name )
86 { 89 {
87 setItemsMovable ( false ); 90 setItemsMovable ( false );
88 setAutoArrange ( true ); 91 setAutoArrange ( true );
@@ -191,12 +194,13 @@ public:
191 void setItemTextPos ( ItemTextPos pos ) 194 void setItemTextPos ( ItemTextPos pos )
192 { 195 {
193 calculateGrid ( pos ); 196 calculateGrid ( pos );
194 QIconView::setItemTextPos( pos ); 197 QIconView::setItemTextPos( pos );
195 } 198 }
196 199
200 //FIXME: Add per-tab column handling from launcherview.cpp
197 void calculateGrid ( ItemTextPos pos ) 201 void calculateGrid ( ItemTextPos pos )
198 { 202 {
199 int dw = QApplication::desktop ( )-> width ( ); 203 int dw = QApplication::desktop ( )-> width ( );
200 int viewerWidth = dw - style ( ).scrollBarExtent ( ). width ( ); 204 int viewerWidth = dw - style ( ).scrollBarExtent ( ). width ( );
201 if ( pos == Bottom ) { 205 if ( pos == Bottom ) {
202 int cols = 3; 206 int cols = 3;
@@ -413,24 +417,29 @@ QWidget *TabDialog::createIconTab ( QWidget *parent )
413 m_iconsize-> insert ( rb, TabConfig::List ); 417 m_iconsize-> insert ( rb, TabConfig::List );
414 gridLayout-> addWidget( rb, 0, 1 ); 418 gridLayout-> addWidget( rb, 0, 1 );
415 419
416 rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" ); 420 rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" );
417 m_iconsize-> insert ( rb, TabConfig::Icon ); 421 m_iconsize-> insert ( rb, TabConfig::Icon );
418 gridLayout-> addWidget( rb, 1, 1 ); 422 gridLayout-> addWidget( rb, 1, 1 );
419
420 connect ( m_iconsize, SIGNAL( clicked(int)), this, SLOT( iconSizeClicked(int))); 423 connect ( m_iconsize, SIGNAL( clicked(int)), this, SLOT( iconSizeClicked(int)));
421
422 gridLayout-> addRowSpacing ( 2, 8 ); 424 gridLayout-> addRowSpacing ( 2, 8 );
423 425
424 label = new QLabel ( tr( "Color:" ), tab ); 426 label = new QLabel ( tr( "Color:" ), tab );
425 gridLayout-> addWidget ( label, 3, 0 ); 427 gridLayout-> addWidget ( label, 3, 0 );
428 gridLayout-> addRowSpacing ( 3, 8 );
426 429
427 m_iconcolor = new Opie::OColorButton ( tab, QColor ( m_tc. m_text_color ) ); 430 m_iconcolor = new Opie::OColorButton ( tab, QColor ( m_tc. m_text_color ) );
428 connect ( m_iconcolor, SIGNAL( colorSelected(const QColor&)), this, SLOT( iconColorClicked(const QColor&))); 431 connect ( m_iconcolor, SIGNAL( colorSelected(const QColor&)), this, SLOT( iconColorClicked(const QColor&)));
429 gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft ); 432 gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft );
430 433
434 label = new QLabel( tr( "Columns:" ), tab );
435 gridLayout->addWidget( label, 4, 0 );
436 m_iconcolumns = new QSpinBox( 0, 10, 1, tab, "iconspinbox" );
437 m_iconcolumns->setSpecialValueText( tr( "Automatic" ) );
438 gridLayout->addWidget( m_iconcolumns, 4, 1, AlignLeft );
439
431 vertLayout-> addStretch ( 10 ); 440 vertLayout-> addStretch ( 10 );
432 441
433 if ( m_tc.m_last_directory == QString::null ) { 442 if ( m_tc.m_last_directory == QString::null ) {
434 m_tc.m_last_directory = QPEApplication::documentDir(); 443 m_tc.m_last_directory = QPEApplication::documentDir();
435 } 444 }
436 445
@@ -503,12 +512,13 @@ void TabDialog::bgDefaultClicked ( )
503 512
504void TabDialog::accept ( ) 513void TabDialog::accept ( )
505{ 514{
506 m_tc. m_view = (TabConfig::ViewMode) m_iconsize-> id ( m_iconsize-> selected ( )); 515 m_tc. m_view = (TabConfig::ViewMode) m_iconsize-> id ( m_iconsize-> selected ( ));
507 m_tc. m_bg_type = (TabConfig::BackgroundType) m_bgtype-> id ( m_bgtype-> selected ( )); 516 m_tc. m_bg_type = (TabConfig::BackgroundType) m_bgtype-> id ( m_bgtype-> selected ( ));
508 m_tc. m_bg_color = m_solidcolor-> color ( ). name ( ); 517 m_tc. m_bg_color = m_solidcolor-> color ( ). name ( );
518 m_tc. m_iconcolumns = m_iconcolumns-> value( );
509 m_tc. m_bg_image = m_bgimage; 519 m_tc. m_bg_image = m_bgimage;
510 m_tc. m_text_color = m_iconcolor-> color ( ). name ( ); 520 m_tc. m_text_color = m_iconcolor-> color ( ). name ( );
511 521
512 m_tc. m_font_use = m_fontuse-> isChecked ( ); 522 m_tc. m_font_use = m_fontuse-> isChecked ( );
513 523
514 if ( m_tc. m_font_use ) { 524 if ( m_tc. m_font_use ) {