Diffstat (limited to 'core/settings/launcher/tabdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index 7b01cc7..ca48e66 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp @@ -215,67 +215,67 @@ public: } private: QColor m_textcolor; QColor m_bgcolor; QPixmap m_bgpix; TabConfig::BackgroundType m_bgtype; }; TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &tc, QWidget *parent, const char *name, bool modal, WFlags fl ) - : QDialog ( parent, name, modal, fl ) + : QDialog ( parent, name, modal, fl ), m_tc ( tc ) { setCaption ( tr( "Edit Tab" )); QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); OTabWidget *tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); QWidget *bgtab; tw-> addTab ( bgtab = createBgTab ( tw ), "appearance/backgroundtabicon.png", tr( "Background" )); tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" )); tw-> addTab ( createIconTab ( tw ), "appearance/colorstabicon.png", tr( "Icons" ) ); tw-> setCurrentTab ( bgtab ); QWidget *sample = new QVBox ( this ); QTabBar *tb = new QTabBar ( sample ); QString name ( tr( "Previewing %1" ). arg ( tabname )); tb-> addTab ( tabicon ? new QTab ( *tabicon, name ) : new QTab ( name )); m_sample = new SampleView ( sample ); lay-> addWidget ( tw, 10 ); lay-> addWidget ( sample, 1 ); + + m_iconsize-> setButton ( tc. m_view ); + iconSizeClicked ( tc. m_view ); + m_bgtype-> setButton ( tc. m_bg_type ); + m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); + bgTypeClicked ( tc. m_bg_type ); + m_fontselect-> setSelectedFont ( tc. m_font_family, tc. m_font_style, tc. m_font_size ); + fontClicked ( m_fontselect-> selectedFont ( )); } TabDialog::~TabDialog ( ) { } QWidget *TabDialog::createFontTab ( QWidget *parent ) { - Config config ( "qpe" ); - config. setGroup ( "Appearance" ); - - QString familyStr = config.readEntry( "FontFamily", "Helvetica" ); - QString styleStr = config.readEntry( "FontStyle", "Regular" ); - int size = config.readNumEntry( "FontSize", 10 ); - m_fontselect = new OFontSelector ( parent, "FontTab" ); - m_fontselect-> setSelectedFont ( familyStr, styleStr, size ); connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), this, SLOT( fontClicked ( const QFont & ))); return m_fontselect; } QWidget *TabDialog::createBgTab ( QWidget *parent ) { QWidget *tab = new QWidget( parent, "AdvancedTab" ); QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 ); @@ -290,37 +290,37 @@ QWidget *TabDialog::createBgTab ( QWidget *parent ) QRadioButton *rb; rb = new QRadioButton( tr( "Ruled" ), tab, "ruled" ); m_bgtype-> insert ( rb, TabConfig::Ruled ); gridLayout-> addWidget( rb, 0, 1 ); QHBoxLayout *hb = new QHBoxLayout ( ); hb-> setSpacing ( 4 ); rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); m_bgtype-> insert ( rb, TabConfig::SolidColor ); hb-> addWidget ( rb ); + hb-> addSpacing ( 10 ); m_solidcolor = new OColorButton ( tab ); connect ( m_solidcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( colorClicked ( const QColor & ))); hb-> addWidget ( m_solidcolor ); - hb-> addStretch ( 10 ); gridLayout-> addLayout ( hb, 1, 1 ); rb = new QRadioButton( tr( "Image" ), tab, "image" ); m_bgtype-> insert ( rb, TabConfig::Image ); gridLayout-> addWidget( rb, 3, 1 ); - QPushButton *p; +// QPushButton *p; connect ( m_bgtype, SIGNAL( clicked ( int )), this, SLOT( bgTypeClicked ( int ))); vertLayout-> addStretch ( 10 ); return tab; } QWidget *TabDialog::createIconTab ( QWidget *parent ) { QWidget *tab = new QWidget( parent, "AdvancedTab" ); QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 ); @@ -370,12 +370,24 @@ void TabDialog::bgTypeClicked ( int t ) // m_imagedefault-> setEnabled ( t == TabConfig::Image ); if ( t == TabConfig::SolidColor ) s = m_solidcolor-> color ( ). name ( ); m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); } void TabDialog::colorClicked ( const QColor &col ) { m_sample-> setBackgroundType ( TabConfig::SolidColor, col. name ( )); } + +void TabDialog::accept ( ) +{ + m_tc. m_view = (TabConfig::ViewMode) m_iconsize-> id ( m_iconsize-> selected ( )); + m_tc. m_bg_type = (TabConfig::BackgroundType) m_bgtype-> id ( m_bgtype-> selected ( )); + m_tc. m_bg_color = m_solidcolor-> color ( ). name ( ); + m_tc. m_font_family = m_fontselect-> fontFamily ( ); + m_tc. m_font_size = m_fontselect-> fontSize ( ); + m_tc. m_font_style = m_fontselect-> fontStyle ( ); + + QDialog::accept ( ); +} |