Sync r818156 from oxygen.

svn path=/trunk/KDE/kdebase/workspace/; revision=818762
This commit is contained in:
Luboš Luňák 2008-06-09 14:50:57 +00:00
parent c410c673e1
commit caf3bededa
5 changed files with 26 additions and 3 deletions

View file

@ -49,6 +49,7 @@ OxygenConfig::OxygenConfig( KConfig*, QWidget* parent )
c = new KConfig( "oxygenrc" );
KConfigGroup cg(c, "Windeco");
ui = new OxygenConfigUI( parent );
connect( ui->showStripes, SIGNAL(clicked()), SIGNAL(changed()) );
connect( ui->blendTitlebarColors, SIGNAL(clicked()), SIGNAL(changed()) );
load( cg );
@ -68,6 +69,7 @@ OxygenConfig::~OxygenConfig()
void OxygenConfig::load( const KConfigGroup& )
{
KConfigGroup cg(c, "Windeco");
ui->showStripes->setChecked( cg.readEntry("ShowStripes", true) );
ui->blendTitlebarColors->setChecked( cg.readEntry("BlendTitlebarColors", true) );
}
@ -76,6 +78,7 @@ void OxygenConfig::load( const KConfigGroup& )
void OxygenConfig::save( KConfigGroup& )
{
KConfigGroup cg(c, "Windeco");
cg.writeEntry( "ShowStripes", ui->showStripes->isChecked() );
cg.writeEntry( "BlendTitlebarColors", ui->blendTitlebarColors->isChecked() );
c->sync();
}
@ -84,6 +87,7 @@ void OxygenConfig::save( KConfigGroup& )
// Sets UI widget defaults which must correspond to style defaults
void OxygenConfig::defaults()
{
ui->showStripes->setChecked( true );
ui->blendTitlebarColors->setChecked( true );
emit changed();

View file

@ -26,6 +26,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showStripes" >
<property name="whatsThis" >
<string>When enabled, this option increases the visibility of the window titlebar by showing stripes</string>
</property>
<property name="text" >
<string>Show stripes next to the title</string>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />

View file

@ -47,6 +47,7 @@ namespace Oxygen
bool OxygenFactory::initialized_ = false;
Qt::Alignment OxygenFactory::titlealign_ = Qt::AlignLeft;
bool OxygenFactory::showStripes_ = true;
bool OxygenFactory::blendTitlebarColors_ = true;
//////////////////////////////////////////////////////////////////////////////
@ -117,10 +118,13 @@ bool OxygenFactory::readConfig()
else if (value == "AlignHCenter") titlealign_ = Qt::AlignHCenter;
else if (value == "AlignRight") titlealign_ = Qt::AlignRight;
bool oldstripes = showStripes;
showStripes_ = group.readEntry( "ShowStripes", true );
bool oldblend = blendTitlebarColors;
blendTitlebarColors_ = group.readEntry( "BlendTitlebarColors", true );
if (oldalign == titlealign_ && oldblend == blendTitlebarColors_)
if (oldalign == titlealign_ && oldstripes == showStripes_ && oldblend == blendTitlebarColors_)
return false;
else
return true;

View file

@ -65,6 +65,7 @@ public:
static bool initialized();
static Qt::Alignment titleAlign();
static bool showStripes();
static bool blendTitlebarColors();
private:
@ -73,6 +74,7 @@ private:
private:
static bool initialized_;
static Qt::Alignment titlealign_;
static bool showStripes_;
static bool blendTitlebarColors_;
};
@ -85,6 +87,9 @@ inline Qt::Alignment OxygenFactory::titleAlign()
inline bool OxygenFactory::blendTitlebarColors()
{ return blendTitlebarColors_; }
inline bool OxygenFactory::showStripes()
{ return showStripes_; }
} //namespace Oxygen
} //namespace Ozone

View file

@ -350,8 +350,8 @@ void OxygenClient::paintEvent(QPaintEvent *e)
QPointF(x+w, titleTop+titleHeight-0.5));
}
// draw "scratches" as indicator for active windows
if (isActive()) {
// draw stripes as indicator for active windows
if (isActive() && OxygenFactory::showStripes()) {
Qt::Alignment align = OxygenFactory::titleAlign();
if (widget()->layoutDirection() == Qt::RightToLeft)
{