diff --git a/clients/tabstrip/config/tabstripconfig.cpp b/clients/tabstrip/config/tabstripconfig.cpp index 4174cba7b9..4ddd8fdf56 100644 --- a/clients/tabstrip/config/tabstripconfig.cpp +++ b/clients/tabstrip/config/tabstripconfig.cpp @@ -49,6 +49,7 @@ TabstripConfig::TabstripConfig( KConfig *c, QWidget *parent ) connect( ui->center, SIGNAL(clicked()), SIGNAL(changed()) ); connect( ui->right, SIGNAL(clicked()), SIGNAL(changed()) ); connect( ui->showIcon, SIGNAL(clicked()), SIGNAL(changed()) ); + connect( ui->outlineColor, SIGNAL(clicked()), SIGNAL(changed()) ); load( cg ); ui->show(); } @@ -67,6 +68,7 @@ void TabstripConfig::load( KConfigGroup &c ) ui->center->setChecked( align == "Center" ); ui->right->setChecked( align == "Right" ); ui->showIcon->setChecked( c.readEntry( "ShowIcon", true ) ); + ui->outlineColor->setColor( c.readEntry( "OutlineColor", QColor( Qt::white ) ) ); } void TabstripConfig::save( KConfigGroup &c ) @@ -79,6 +81,7 @@ void TabstripConfig::save( KConfigGroup &c ) else c.writeEntry( "TitleAlignment", "Right" ); c.writeEntry( "ShowIcon", ui->showIcon->isChecked() ); + c.writeEntry( "OutlineColor", ui->outlineColor->color() ); config->sync(); } @@ -88,5 +91,6 @@ void TabstripConfig::defaults() ui->center->setChecked( true ); ui->right->setChecked( false ); ui->showIcon->setChecked( true ); + ui->outlineColor->setColor( Qt::white ); emit changed(); } diff --git a/clients/tabstrip/config/tabstripconfig.ui b/clients/tabstrip/config/tabstripconfig.ui index 1a21e05b3c..8927f9dec9 100644 --- a/clients/tabstrip/config/tabstripconfig.ui +++ b/clients/tabstrip/config/tabstripconfig.ui @@ -51,6 +51,26 @@ + + + + + + O&utline Color: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + outlineColor + + + + + + + + diff --git a/clients/tabstrip/tabstripdecoration.cpp b/clients/tabstrip/tabstripdecoration.cpp index ae468728ab..a159a96e4c 100644 --- a/clients/tabstrip/tabstripdecoration.cpp +++ b/clients/tabstrip/tabstripdecoration.cpp @@ -81,7 +81,7 @@ void TabstripDecoration::paintTab( QPainter &painter, const QRect &geom, ClientG // Draw border around the tab painter.setPen( Qt::black ); painter.drawRect( geom.adjusted( 0, 0, -1, -1 )); - painter.setPen( Qt::white ); + painter.setPen( TabstripFactory::outlineColor() ); painter.drawRect( geom.adjusted( 1, 1, -2, -2 )); // Background @@ -132,7 +132,7 @@ void TabstripDecoration::paintEvent( QPaintEvent * ) // Draw black/white border around the main window painter.setPen( Qt::black ); painter.drawRect( 0, titlebar.height() - 1, frame.width() - 1, frame.height() - titlebar.height() ); - painter.setPen( Qt::white ); + painter.setPen( TabstripFactory::outlineColor() ); painter.drawRect( 1, titlebar.height(), frame.width() - 3, frame.height() - titlebar.height() - 2 ); QList< ClientGroupItem > tabList = clientGroupItems(); @@ -176,7 +176,7 @@ void TabstripDecoration::paintEvent( QPaintEvent * ) painter.setPen( Qt::black ); painter.drawRect( 0, 0, allTabGeom.left(), allTabGeom.height() - 1 ); painter.drawRect( allTabGeom.right() - 1, 0, frame.width() - allTabGeom.right(), allTabGeom.height() - 1 ); - painter.setPen( Qt::white ); + painter.setPen( TabstripFactory::outlineColor() ); painter.drawRect( 1, 1, allTabGeom.left() - 2, allTabGeom.height() - 3 ); painter.drawRect( allTabGeom.right(), 1, frame.width() - allTabGeom.right() - 2, allTabGeom.height() - 3 ); @@ -189,7 +189,7 @@ void TabstripDecoration::paintEvent( QPaintEvent * ) // Draw border around the titlebar painter.setPen( Qt::black ); painter.drawRect( titlebar.adjusted( 0, 0, -1, -1 )); - painter.setPen( Qt::white ); + painter.setPen( TabstripFactory::outlineColor() ); painter.drawRect( titlebar.adjusted( 1, 1, -2, -2 )); // Background diff --git a/clients/tabstrip/tabstripfactory.cpp b/clients/tabstrip/tabstripfactory.cpp index 591a148c04..6b34c01562 100644 --- a/clients/tabstrip/tabstripfactory.cpp +++ b/clients/tabstrip/tabstripfactory.cpp @@ -36,6 +36,7 @@ extern "C" Qt::AlignmentFlag TabstripFactory::titlealign = Qt::AlignCenter; bool TabstripFactory::show_icon = true; +QColor TabstripFactory::outline_color = Qt::white; TabstripFactory::TabstripFactory() { @@ -88,6 +89,7 @@ bool TabstripFactory::readConfig() else if( align == "Right" ) titlealign = Qt::AlignRight; show_icon = cg.readEntry( "ShowIcon", true ); + outline_color = cg.readEntry( "OutlineColor", QColor( Qt::white ) ); return ( titlealign != oldalign ); } diff --git a/clients/tabstrip/tabstripfactory.h b/clients/tabstrip/tabstripfactory.h index 2b667f039d..0b610c21d3 100644 --- a/clients/tabstrip/tabstripfactory.h +++ b/clients/tabstrip/tabstripfactory.h @@ -37,11 +37,13 @@ class TabstripFactory : public KDecorationFactoryUnstable QList< KDecorationDefines::BorderSize > borderSizes() const; static Qt::AlignmentFlag titleAlign(); static bool showIcon(); + static QColor &outlineColor(); private: bool readConfig(); bool initialized; static Qt::AlignmentFlag titlealign; static bool show_icon; + static QColor outline_color; }; inline Qt::AlignmentFlag TabstripFactory::titleAlign() @@ -53,5 +55,9 @@ inline bool TabstripFactory::showIcon() { return show_icon; } +inline QColor &TabstripFactory::outlineColor() + { + return outline_color; + } #endif