Merge branch 'master' of git.kde.org:/kde-workspace
This commit is contained in:
commit
362357deae
5 changed files with 36 additions and 4 deletions
|
@ -49,6 +49,7 @@ TabstripConfig::TabstripConfig( KConfig *c, QWidget *parent )
|
||||||
connect( ui->center, SIGNAL(clicked()), SIGNAL(changed()) );
|
connect( ui->center, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||||
connect( ui->right, SIGNAL(clicked()), SIGNAL(changed()) );
|
connect( ui->right, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||||
connect( ui->showIcon, SIGNAL(clicked()), SIGNAL(changed()) );
|
connect( ui->showIcon, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||||
|
connect( ui->outlineColor, SIGNAL(clicked()), SIGNAL(changed()) );
|
||||||
load( cg );
|
load( cg );
|
||||||
ui->show();
|
ui->show();
|
||||||
}
|
}
|
||||||
|
@ -67,6 +68,7 @@ void TabstripConfig::load( KConfigGroup &c )
|
||||||
ui->center->setChecked( align == "Center" );
|
ui->center->setChecked( align == "Center" );
|
||||||
ui->right->setChecked( align == "Right" );
|
ui->right->setChecked( align == "Right" );
|
||||||
ui->showIcon->setChecked( c.readEntry( "ShowIcon", true ) );
|
ui->showIcon->setChecked( c.readEntry( "ShowIcon", true ) );
|
||||||
|
ui->outlineColor->setColor( c.readEntry( "OutlineColor", QColor( Qt::white ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabstripConfig::save( KConfigGroup &c )
|
void TabstripConfig::save( KConfigGroup &c )
|
||||||
|
@ -79,6 +81,7 @@ void TabstripConfig::save( KConfigGroup &c )
|
||||||
else
|
else
|
||||||
c.writeEntry( "TitleAlignment", "Right" );
|
c.writeEntry( "TitleAlignment", "Right" );
|
||||||
c.writeEntry( "ShowIcon", ui->showIcon->isChecked() );
|
c.writeEntry( "ShowIcon", ui->showIcon->isChecked() );
|
||||||
|
c.writeEntry( "OutlineColor", ui->outlineColor->color() );
|
||||||
config->sync();
|
config->sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,5 +91,6 @@ void TabstripConfig::defaults()
|
||||||
ui->center->setChecked( true );
|
ui->center->setChecked( true );
|
||||||
ui->right->setChecked( false );
|
ui->right->setChecked( false );
|
||||||
ui->showIcon->setChecked( true );
|
ui->showIcon->setChecked( true );
|
||||||
|
ui->outlineColor->setColor( Qt::white );
|
||||||
emit changed();
|
emit changed();
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,26 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="outlineColorLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="outline">
|
||||||
|
<property name="text">
|
||||||
|
<string>O&utline Color:</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>outlineColor</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="KColorButton" name="outlineColor"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|
|
@ -81,7 +81,7 @@ void TabstripDecoration::paintTab( QPainter &painter, const QRect &geom, ClientG
|
||||||
// Draw border around the tab
|
// Draw border around the tab
|
||||||
painter.setPen( Qt::black );
|
painter.setPen( Qt::black );
|
||||||
painter.drawRect( geom.adjusted( 0, 0, -1, -1 ));
|
painter.drawRect( geom.adjusted( 0, 0, -1, -1 ));
|
||||||
painter.setPen( Qt::white );
|
painter.setPen( TabstripFactory::outlineColor() );
|
||||||
painter.drawRect( geom.adjusted( 1, 1, -2, -2 ));
|
painter.drawRect( geom.adjusted( 1, 1, -2, -2 ));
|
||||||
|
|
||||||
// Background
|
// Background
|
||||||
|
@ -132,7 +132,7 @@ void TabstripDecoration::paintEvent( QPaintEvent * )
|
||||||
// Draw black/white border around the main window
|
// Draw black/white border around the main window
|
||||||
painter.setPen( Qt::black );
|
painter.setPen( Qt::black );
|
||||||
painter.drawRect( 0, titlebar.height() - 1, frame.width() - 1, frame.height() - titlebar.height() );
|
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 );
|
painter.drawRect( 1, titlebar.height(), frame.width() - 3, frame.height() - titlebar.height() - 2 );
|
||||||
|
|
||||||
QList< ClientGroupItem > tabList = clientGroupItems();
|
QList< ClientGroupItem > tabList = clientGroupItems();
|
||||||
|
@ -176,7 +176,7 @@ void TabstripDecoration::paintEvent( QPaintEvent * )
|
||||||
painter.setPen( Qt::black );
|
painter.setPen( Qt::black );
|
||||||
painter.drawRect( 0, 0, allTabGeom.left(), allTabGeom.height() - 1 );
|
painter.drawRect( 0, 0, allTabGeom.left(), allTabGeom.height() - 1 );
|
||||||
painter.drawRect( allTabGeom.right() - 1, 0, frame.width() - allTabGeom.right(), 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( 1, 1, allTabGeom.left() - 2, allTabGeom.height() - 3 );
|
||||||
painter.drawRect( allTabGeom.right(), 1, frame.width() - allTabGeom.right() - 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
|
// Draw border around the titlebar
|
||||||
painter.setPen( Qt::black );
|
painter.setPen( Qt::black );
|
||||||
painter.drawRect( titlebar.adjusted( 0, 0, -1, -1 ));
|
painter.drawRect( titlebar.adjusted( 0, 0, -1, -1 ));
|
||||||
painter.setPen( Qt::white );
|
painter.setPen( TabstripFactory::outlineColor() );
|
||||||
painter.drawRect( titlebar.adjusted( 1, 1, -2, -2 ));
|
painter.drawRect( titlebar.adjusted( 1, 1, -2, -2 ));
|
||||||
|
|
||||||
// Background
|
// Background
|
||||||
|
|
|
@ -36,6 +36,7 @@ extern "C"
|
||||||
|
|
||||||
Qt::AlignmentFlag TabstripFactory::titlealign = Qt::AlignCenter;
|
Qt::AlignmentFlag TabstripFactory::titlealign = Qt::AlignCenter;
|
||||||
bool TabstripFactory::show_icon = true;
|
bool TabstripFactory::show_icon = true;
|
||||||
|
QColor TabstripFactory::outline_color = Qt::white;
|
||||||
|
|
||||||
TabstripFactory::TabstripFactory()
|
TabstripFactory::TabstripFactory()
|
||||||
{
|
{
|
||||||
|
@ -88,6 +89,7 @@ bool TabstripFactory::readConfig()
|
||||||
else if( align == "Right" )
|
else if( align == "Right" )
|
||||||
titlealign = Qt::AlignRight;
|
titlealign = Qt::AlignRight;
|
||||||
show_icon = cg.readEntry( "ShowIcon", true );
|
show_icon = cg.readEntry( "ShowIcon", true );
|
||||||
|
outline_color = cg.readEntry( "OutlineColor", QColor( Qt::white ) );
|
||||||
return ( titlealign != oldalign );
|
return ( titlealign != oldalign );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,11 +37,13 @@ class TabstripFactory : public KDecorationFactoryUnstable
|
||||||
QList< KDecorationDefines::BorderSize > borderSizes() const;
|
QList< KDecorationDefines::BorderSize > borderSizes() const;
|
||||||
static Qt::AlignmentFlag titleAlign();
|
static Qt::AlignmentFlag titleAlign();
|
||||||
static bool showIcon();
|
static bool showIcon();
|
||||||
|
static QColor &outlineColor();
|
||||||
private:
|
private:
|
||||||
bool readConfig();
|
bool readConfig();
|
||||||
bool initialized;
|
bool initialized;
|
||||||
static Qt::AlignmentFlag titlealign;
|
static Qt::AlignmentFlag titlealign;
|
||||||
static bool show_icon;
|
static bool show_icon;
|
||||||
|
static QColor outline_color;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline Qt::AlignmentFlag TabstripFactory::titleAlign()
|
inline Qt::AlignmentFlag TabstripFactory::titleAlign()
|
||||||
|
@ -53,5 +55,9 @@ inline bool TabstripFactory::showIcon()
|
||||||
{
|
{
|
||||||
return show_icon;
|
return show_icon;
|
||||||
}
|
}
|
||||||
|
inline QColor &TabstripFactory::outlineColor()
|
||||||
|
{
|
||||||
|
return outline_color;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue