diff --git a/clients/nitrogen/config/config.cpp b/clients/nitrogen/config/config.cpp index 5c1242c1b3..738f867bf4 100644 --- a/clients/nitrogen/config/config.cpp +++ b/clients/nitrogen/config/config.cpp @@ -65,7 +65,6 @@ namespace Nitrogen connect( user_interface_->blendColor, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) ); connect( user_interface_->sizeGripMode, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) ); - connect( user_interface_->showStripes, SIGNAL(clicked()), SIGNAL(changed()) ); connect( user_interface_->drawSeparator, SIGNAL(clicked()), SIGNAL(changed()) ); connect( user_interface_->titleOutline, SIGNAL(clicked()), SIGNAL(changed()) ); connect( user_interface_->useOxygenShadows, SIGNAL(clicked()), SIGNAL(changed()) ); @@ -137,7 +136,6 @@ namespace Nitrogen NitrogenConfig::SIZE_GRIP_MODE, NitrogenConfiguration::sizeGripModeName( NitrogenConfiguration::sizeGripMode( user_interface_->sizeGripMode->currentText(), true ), false ) ); - configurationGroup.writeEntry( NitrogenConfig::SHOW_STRIPES, user_interface_->showStripes->isChecked() ); configurationGroup.writeEntry( NitrogenConfig::DRAW_SEPARATOR, user_interface_->drawSeparator->isChecked() ); configurationGroup.writeEntry( NitrogenConfig::DRAW_TITLE_OUTLINE, user_interface_->titleOutline->isChecked() ); configurationGroup.writeEntry( NitrogenConfig::USE_OXYGEN_SHADOWS, user_interface_->useOxygenShadows->isChecked() ); @@ -176,7 +174,6 @@ namespace Nitrogen user_interface_->frameBorder->setCurrentIndex( user_interface_->frameBorder->findText( configuration.frameBorderName( true ) ) ); user_interface_->sizeGripMode->setCurrentIndex( user_interface_->sizeGripMode->findText( configuration.sizeGripModeName( true ) ) ); - user_interface_->showStripes->setChecked( configuration.showStripes() ); user_interface_->drawSeparator->setChecked( configuration.drawSeparator() ); user_interface_->titleOutline->setChecked( configuration.drawTitleOutline() ); user_interface_->useOxygenShadows->setChecked( configuration.useOxygenShadows() ); diff --git a/clients/nitrogen/config/nitrogenconfigurationui.cpp b/clients/nitrogen/config/nitrogenconfigurationui.cpp index a325f1fc4a..c4ec2d1657 100644 --- a/clients/nitrogen/config/nitrogenconfigurationui.cpp +++ b/clients/nitrogen/config/nitrogenconfigurationui.cpp @@ -45,8 +45,7 @@ namespace Nitrogen frameBorder(0), blendColor(0), sizeGripMode(0), - drawSeparator(0), - showStripes(0) + drawSeparator(0) { setupUI(); } //_________________________________________________________ @@ -137,14 +136,6 @@ namespace Nitrogen drawSeparator->setWhatsThis(i18n( "When enabled, this option makes an horizontal separator appear between the window title bar and the window contents.")); - // show stripes - vboxLayout->addWidget( showStripes = new QCheckBox( i18n("Show stripes next to the title"), basicWidget) ); - showStripes->setObjectName(QString::fromUtf8("showStripes")); - showStripes->setWhatsThis(i18n( - "When enabled, this option increases the visibility of the window titlebar by showing stripes")); - - showStripes->hide(); - } diff --git a/clients/nitrogen/config/nitrogenconfigurationui.h b/clients/nitrogen/config/nitrogenconfigurationui.h index e56d82be43..2f68cdd536 100644 --- a/clients/nitrogen/config/nitrogenconfigurationui.h +++ b/clients/nitrogen/config/nitrogenconfigurationui.h @@ -68,9 +68,6 @@ namespace Nitrogen //! draw separator QCheckBox *drawSeparator; - //! show stripes - QCheckBox *showStripes; - //! active window title outline QCheckBox *titleOutline; diff --git a/clients/nitrogen/config/nitrogenexceptiondialog.cpp b/clients/nitrogen/config/nitrogenexceptiondialog.cpp index a17e12e340..0eaa156179 100644 --- a/clients/nitrogen/config/nitrogenexceptiondialog.cpp +++ b/clients/nitrogen/config/nitrogenexceptiondialog.cpp @@ -146,15 +146,6 @@ namespace Nitrogen checkboxes_.insert( std::make_pair( NitrogenException::DrawSeparator, checkbox ) ); connect( checkbox, SIGNAL( toggled( bool ) ), drawSeparator, SLOT( setEnabled( bool ) ) ); - // stripes - // temporarily hide the "stripes" settings. Might be permanently removed in the future - //gridLayout->addWidget( checkbox = new QCheckBox( i18n("Show stripes next to the title:" ), box ), 5, 0, 1, 1 ); - gridLayout->addWidget( showStripes = new ComboBox( box ), 5, 1, 1, 1 ); - showStripes->setEnabled( false ); - showStripes->hide(); - //checkboxes_.insert( std::make_pair( NitrogenException::ShowStripes, checkbox ) ); - //connect( checkbox, SIGNAL( toggled( bool ) ), showStripes, SLOT( setEnabled( bool ) ) ); - } //___________________________________________ @@ -181,7 +172,6 @@ namespace Nitrogen // flags drawSeparator->setValue( exception.drawSeparator() ); - showStripes->setValue( exception.showStripes() ); titleOutline->setValue( exception.drawTitleOutline() ); // mask @@ -202,7 +192,6 @@ namespace Nitrogen // flags exception.setDrawSeparator( drawSeparator->isChecked() ); - exception.setShowStripes( showStripes->isChecked() ); exception.setDrawTitleOutline( titleOutline->isChecked() ); // mask diff --git a/clients/nitrogen/config/nitrogenexceptiondialog.h b/clients/nitrogen/config/nitrogenexceptiondialog.h index 7508d13cc9..f39f6b3e04 100644 --- a/clients/nitrogen/config/nitrogenexceptiondialog.h +++ b/clients/nitrogen/config/nitrogenexceptiondialog.h @@ -104,9 +104,6 @@ namespace Nitrogen //! draw separator ComboBox* drawSeparator; - //! stripes - ComboBox* showStripes; - }; } diff --git a/clients/nitrogen/nitrogen.cpp b/clients/nitrogen/nitrogen.cpp index d84ed976ff..1ca868cb36 100644 --- a/clients/nitrogen/nitrogen.cpp +++ b/clients/nitrogen/nitrogen.cpp @@ -225,7 +225,6 @@ namespace Nitrogen if( iter->mask() & NitrogenException::FrameBorder ) configuration.setFrameBorder( iter->frameBorder() ); if( iter->mask() & NitrogenException::BlendColor ) configuration.setBlendColor( iter->blendColor() ); if( iter->mask() & NitrogenException::DrawSeparator ) configuration.setDrawSeparator( iter->drawSeparator() ); - if( iter->mask() & NitrogenException::ShowStripes ) configuration.setShowStripes( iter->showStripes() ); if( iter->mask() & NitrogenException::TitleOutline ) configuration.setDrawTitleOutline( iter->drawTitleOutline() ); if( iter->mask() & NitrogenException::SizeGripMode ) configuration.setSizeGripMode( iter->sizeGripMode() ); diff --git a/clients/nitrogen/nitrogenclient.cpp b/clients/nitrogen/nitrogenclient.cpp index c95877f9d9..a58a72b182 100644 --- a/clients/nitrogen/nitrogenclient.cpp +++ b/clients/nitrogen/nitrogenclient.cpp @@ -554,43 +554,6 @@ namespace Nitrogen } - //________________________________________________________________ - void NitrogenClient::drawStripes(QPainter *p, QPalette &palette, const int start, const int end, const int topMargin) - { - - QColor color( KDecoration::options()->color(ColorTitleBar) ); - - QLinearGradient stripeGradient(QPoint(start,0), QPoint(end,0)); - stripeGradient.setColorAt(0.0, Qt::transparent); - stripeGradient.setColorAt(0.05, KDecoration::options()->color(ColorTitleBar)); - stripeGradient.setColorAt(1.0, Qt::transparent); - QPen pen1(stripeGradient, 0.5); - - QLinearGradient stripeGradient2(QPoint(start,0), QPoint(end,0)); - stripeGradient2.setColorAt(0.0, Qt::transparent); - stripeGradient2.setColorAt(0.05, helper_.calcLightColor(palette.color(QPalette::Window))); - stripeGradient2.setColorAt(1.0, Qt::transparent); - QPen pen2(stripeGradient2, 0.5); - - bool antialiasing = p->testRenderHint(QPainter::Antialiasing); - p->setRenderHint(QPainter::Antialiasing, false); - const int titleHeight = layoutMetric(LM_TitleHeight); - double voffset = 4.0*configuration().buttonSize()/22; - double scale = double(titleHeight-voffset)/4; - double base = titleHeight + topMargin; - for (int i = 0; i < 3; ++i) - { - - // calculate offset for each stripe. - int offset = int(base - voffset) - int(scale)*(i+1); - p->setPen(pen1); - p->drawLine(QPoint(start, offset), QPoint(end, offset)); - p->setPen(pen2); - p->drawLine(QPoint(start, offset+1), QPoint(end, offset+1)); - } - p->setRenderHint(QPainter::Antialiasing, antialiasing); - } - //________________________________________________________________ void NitrogenClient::updateWindowShape() { @@ -785,45 +748,6 @@ namespace Nitrogen if( isActive() && configuration().drawSeparator() && !configuration().drawTitleOutline() ) { helper().drawSeparator(&painter, QRect(x, titleTop+titleHeight-1.5, w, 2), color, Qt::Horizontal); } - // draw stripes as indicator for active windows - if( isActive() && configuration().showStripes() ) - { - - Qt::Alignment align = configuration().titleAlignment(); - if (widget()->layoutDirection() == Qt::RightToLeft) - { - - if (align == Qt::AlignLeft) align = Qt::AlignRight; - else if (align == Qt::AlignRight) align = Qt::AlignLeft; - - } - - if (align & Qt::AlignLeft) { - - int left = titleLeft + QFontMetrics(options()->font(isActive(), false)).width( caption() ) + 4; - int right = titleLeft + titleWidth; - drawStripes(&painter, palette, left, right, titleTop); - - } else if (align & Qt::AlignRight) { - - int left = titleLeft; - int right = titleLeft + titleWidth - QFontMetrics(options()->font(isActive(), false)).width( caption() ) - 4; - drawStripes(&painter, palette, right, left, titleTop); - - } else if (align & Qt::AlignHCenter) { - - int textWidth = QFontMetrics(options()->font(isActive(), false)).width( caption() ); - int left = titleLeft; - int centerLeft = titleLeft + titleWidth/2 - textWidth/2 - 4; - int centerRight = titleLeft + titleWidth/2 + textWidth/2 + 4; - int right = titleLeft + titleWidth; - drawStripes(&painter, palette, centerLeft, left, titleTop); - drawStripes(&painter, palette, centerRight, right, titleTop); - - } - - } - // shadow and resize handles if( configuration().frameBorder() >= NitrogenConfiguration::BorderTiny && !isMaximized() ) { diff --git a/clients/nitrogen/nitrogenclient.h b/clients/nitrogen/nitrogenclient.h index 021cbc6965..9fec12816b 100644 --- a/clients/nitrogen/nitrogenclient.h +++ b/clients/nitrogen/nitrogenclient.h @@ -143,9 +143,6 @@ namespace Nitrogen //! palette background QPalette backgroundPalette( const QWidget*, QPalette ) const; - //! draw - void drawStripes(QPainter*, QPalette&, const int, const int, const int); - //! calculate mask QRegion calcMask( void ) const; diff --git a/clients/nitrogen/nitrogenconfiguration.cpp b/clients/nitrogen/nitrogenconfiguration.cpp index c8bd172dcb..18f82860f7 100644 --- a/clients/nitrogen/nitrogenconfiguration.cpp +++ b/clients/nitrogen/nitrogenconfiguration.cpp @@ -41,7 +41,6 @@ namespace Nitrogen frameBorder_( BorderDefault ), blendColor_( RadialBlending ), sizeGripMode_( SizeGripWhenNeeded ), - showStripes_( true ), drawSeparator_( true ), drawTitleOutline_( false ), useOxygenShadows_( true ) @@ -79,11 +78,6 @@ namespace Nitrogen group.readEntry( NitrogenConfig::SIZE_GRIP_MODE, defaultConfiguration.sizeGripModeName( false ) ), false ) ); - // show stripes - setShowStripes( group.readEntry( - NitrogenConfig::SHOW_STRIPES, - defaultConfiguration.showStripes() ) ); - // draw separator setDrawSeparator( group.readEntry( NitrogenConfig::DRAW_SEPARATOR, @@ -110,7 +104,6 @@ namespace Nitrogen group.writeEntry( NitrogenConfig::FRAME_BORDER, frameBorderName( false ) ); group.writeEntry( NitrogenConfig::SIZE_GRIP_MODE, sizeGripModeName( false ) ); - group.writeEntry( NitrogenConfig::SHOW_STRIPES, showStripes() ); group.writeEntry( NitrogenConfig::DRAW_SEPARATOR, drawSeparator() ); group.writeEntry( NitrogenConfig::DRAW_TITLE_OUTLINE, drawTitleOutline() ); group.writeEntry( NitrogenConfig::USE_OXYGEN_SHADOWS, useOxygenShadows() ); @@ -274,7 +267,6 @@ namespace Nitrogen frameBorder() == other.frameBorder() && blendColor() == other.blendColor() && sizeGripMode() == other.sizeGripMode() && - showStripes() == other.showStripes() && drawSeparator() == other.drawSeparator() && drawTitleOutline() == other.drawTitleOutline() && useOxygenShadows() == other.useOxygenShadows(); diff --git a/clients/nitrogen/nitrogenconfiguration.h b/clients/nitrogen/nitrogenconfiguration.h index c085f93acd..1a6bb08f1f 100644 --- a/clients/nitrogen/nitrogenconfiguration.h +++ b/clients/nitrogen/nitrogenconfiguration.h @@ -33,7 +33,6 @@ namespace NitrogenConfig static const QString TITLE_ALIGNMENT = "TitleAlignment"; static const QString BUTTON_SIZE = "ButtonSize"; - static const QString SHOW_STRIPES = "ShowStripes"; static const QString DRAW_SEPARATOR = "DrawSeparator"; static const QString DRAW_TITLE_OUTLINE = "DrawTitleOutline"; static const QString FRAME_BORDER = "FrameBorder"; @@ -207,15 +206,6 @@ namespace Nitrogen //@} - //! stripes - virtual bool showStripes( void ) const - //{ return showStripes_; } - { return false; } - - //! stripes - virtual void setShowStripes( bool value ) - { showStripes_ = value; } - //! separator virtual bool drawSeparator( void ) const { return drawSeparator_; } @@ -257,9 +247,6 @@ namespace Nitrogen //! size grip mode SizeGripMode sizeGripMode_; - //! stripes - bool showStripes_; - //! separator bool drawSeparator_; diff --git a/clients/nitrogen/nitrogenexception.h b/clients/nitrogen/nitrogenexception.h index 2a4233b3db..9e5d6a2f0c 100644 --- a/clients/nitrogen/nitrogenexception.h +++ b/clients/nitrogen/nitrogenexception.h @@ -62,13 +62,12 @@ namespace Nitrogen { None = 0, TitleAlignment = 1<<0, - ShowStripes = 1<<1, DrawSeparator = 1<<2, TitleOutline = 1<<3, FrameBorder = 1<<4, BlendColor = 1<<5, SizeGripMode = 1<<6, - All = TitleAlignment|ShowStripes|DrawSeparator|TitleOutline|FrameBorder|BlendColor|SizeGripMode + All = TitleAlignment|DrawSeparator|TitleOutline|FrameBorder|BlendColor|SizeGripMode }; //! constructor