Diffstat (limited to 'core/settings/launcher/tabdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index a90ba7d..d20412a 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp @@ -40,4 +40,5 @@ #include <qpushbutton.h> #include <qwhatsthis.h> +#include <qcheckbox.h> #include <opie/ofontselector.h> @@ -268,5 +269,5 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig setCaption ( tr( "Edit Tab" )); - QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); + QVBoxLayout *lay = new QVBoxLayout ( this, 3, 3 ); OTabWidget *tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); @@ -298,5 +299,7 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig m_bgimage = tc. m_bg_image; bgTypeClicked ( tc. m_bg_type ); + m_fontuse-> setChecked ( tc. m_font_use ); m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); + m_fontselect-> setEnabled ( m_fontuse-> isChecked ( )); fontClicked ( m_fontselect-> selectedFont ( )); @@ -311,16 +314,24 @@ TabDialog::~TabDialog ( ) QWidget *TabDialog::createFontTab ( QWidget *parent ) { - m_fontselect = new OFontSelector ( false, parent, "FontTab" ); + QWidget *tab = new QWidget ( parent, "FontTab" ); + QVBoxLayout *vertLayout = new QVBoxLayout ( tab, 3, 3 ); + m_fontuse = new QCheckBox ( tr( "Use a custom font" ), tab ); + vertLayout-> addWidget ( m_fontuse ); + + m_fontselect = new OFontSelector ( false, tab, "fontsel" ); + vertLayout-> addWidget ( m_fontselect ); + + connect ( m_fontuse, SIGNAL( toggled ( bool )), m_fontselect, SLOT( setEnabled ( bool ))); connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), this, SLOT( fontClicked ( const QFont & ))); - return m_fontselect; + return tab; } QWidget *TabDialog::createBgTab ( QWidget *parent ) { - QWidget *tab = new QWidget( parent, "AdvancedTab" ); - QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 ); + QWidget *tab = new QWidget( parent, "BgTab" ); + QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); QGridLayout* gridLayout = new QGridLayout ( vertLayout ); @@ -339,5 +350,5 @@ QWidget *TabDialog::createBgTab ( QWidget *parent ) QHBoxLayout *hb = new QHBoxLayout ( ); - hb-> setSpacing ( 4 ); + hb-> setSpacing ( 3 ); rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); @@ -354,5 +365,5 @@ QWidget *TabDialog::createBgTab ( QWidget *parent ) hb = new QHBoxLayout ( ); - hb-> setSpacing ( 4 ); + hb-> setSpacing ( 3 ); rb = new QRadioButton( tr( "Image" ), tab, "image" ); @@ -381,6 +392,6 @@ QWidget *TabDialog::createBgTab ( QWidget *parent ) QWidget *TabDialog::createIconTab ( QWidget *parent ) { - QWidget *tab = new QWidget( parent, "AdvancedTab" ); - QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 ); + QWidget *tab = new QWidget( parent, "IconTab" ); + QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); QGridLayout* gridLayout = new QGridLayout ( vertLayout ); @@ -491,4 +502,7 @@ void TabDialog::accept ( ) m_tc. m_text_color = m_iconcolor-> color ( ). name ( ); + m_tc. m_font_use = m_fontuse-> isChecked ( ); + + if ( m_tc. m_font_use ) { QFont f = m_fontselect-> selectedFont ( ); @@ -497,4 +511,5 @@ void TabDialog::accept ( ) m_tc. m_font_weight = f. weight ( ); m_tc. m_font_italic = f. italic ( ); + } QDialog::accept ( ); |