From caf3bededa3a7672cfe4bb01cc2e51cadcce896f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 9 Jun 2008 14:50:57 +0000 Subject: [PATCH] Sync r818156 from oxygen. svn path=/trunk/KDE/kdebase/workspace/; revision=818762 --- clients/ozone/config/config.cpp | 4 ++++ clients/ozone/config/oxygenconfig.ui | 10 ++++++++++ clients/ozone/oxygen.cpp | 6 +++++- clients/ozone/oxygen.h | 5 +++++ clients/ozone/oxygenclient.cpp | 4 ++-- 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/clients/ozone/config/config.cpp b/clients/ozone/config/config.cpp index 76ba916191..4efe6e7d92 100644 --- a/clients/ozone/config/config.cpp +++ b/clients/ozone/config/config.cpp @@ -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(); diff --git a/clients/ozone/config/oxygenconfig.ui b/clients/ozone/config/oxygenconfig.ui index c1aced3425..4b15983010 100644 --- a/clients/ozone/config/oxygenconfig.ui +++ b/clients/ozone/config/oxygenconfig.ui @@ -26,6 +26,16 @@ + + + + When enabled, this option increases the visibility of the window titlebar by showing stripes + + + Show stripes next to the title + + + diff --git a/clients/ozone/oxygen.cpp b/clients/ozone/oxygen.cpp index 421273f2a4..efedefd675 100644 --- a/clients/ozone/oxygen.cpp +++ b/clients/ozone/oxygen.cpp @@ -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; diff --git a/clients/ozone/oxygen.h b/clients/ozone/oxygen.h index e60acb818b..0e43f6317e 100644 --- a/clients/ozone/oxygen.h +++ b/clients/ozone/oxygen.h @@ -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 diff --git a/clients/ozone/oxygenclient.cpp b/clients/ozone/oxygenclient.cpp index cce52c577c..bb511ee2e7 100644 --- a/clients/ozone/oxygenclient.cpp +++ b/clients/ozone/oxygenclient.cpp @@ -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) {