From 85f1ae0adb2e58d2dc0bab5cd02f16454cbd9a2c Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Wed, 29 Feb 2012 16:54:52 +0100 Subject: [PATCH 1/4] removed unneeded check. --- clients/oxygen/oxygenclient.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index cd94eb48bf..dfe713ada4 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -1435,19 +1435,16 @@ namespace Oxygen paint( painter ); // update buttons - if( compositingActive() ) + QList buttons( widget()->findChildren() ); + foreach( Button* button, buttons ) { - QList buttons( widget()->findChildren() ); - foreach( Button* button, buttons ) + if( button->isVisible() && event->rect().intersects( button->geometry() ) ) { - if( button->isVisible() && event->rect().intersects( button->geometry() ) ) - { - painter.save(); - painter.setViewport( button->geometry() ); - painter.setWindow( button->rect() ); - button->paint( painter ); - painter.restore(); - } + painter.save(); + painter.setViewport( button->geometry() ); + painter.setWindow( button->rect() ); + button->paint( painter ); + painter.restore(); } } From 5988ed21619923eefdacc92419c7d6b9ae66f048 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Wed, 29 Feb 2012 17:10:23 +0100 Subject: [PATCH 2/4] Fixed warning when rendering text on invalid rectangle; Fixed painting of buttons in preview. (thanks Martin :) ) --- clients/oxygen/oxygenclient.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index dfe713ada4..156023a19e 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -976,6 +976,8 @@ namespace Oxygen { QPixmap out( rect.size() ); + if( !rect.isValid() ) return QPixmap(); + out.fill( Qt::transparent ); if( caption.isEmpty() || !color.isValid() ) return out; @@ -1438,13 +1440,15 @@ namespace Oxygen QList buttons( widget()->findChildren() ); foreach( Button* button, buttons ) { - if( button->isVisible() && event->rect().intersects( button->geometry() ) ) + if( ( button->isVisible() || isPreview() ) && event->rect().intersects( button->geometry() ) ) { + painter.save(); painter.setViewport( button->geometry() ); painter.setWindow( button->rect() ); button->paint( painter ); painter.restore(); + } } From 8728fb3a7be9386573b81eaf2748cdb5a0b37c12 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Wed, 29 Feb 2012 17:17:25 +0100 Subject: [PATCH 3/4] cosmetics. --- clients/oxygen/oxygenclient.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index 156023a19e..799b9e7829 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -975,9 +975,9 @@ namespace Oxygen QPixmap Client::renderTitleText( const QRect& rect, const QString& caption, const QColor& color, bool elide ) const { - QPixmap out( rect.size() ); if( !rect.isValid() ) return QPixmap(); + QPixmap out( rect.size() ); out.fill( Qt::transparent ); if( caption.isEmpty() || !color.isValid() ) return out; @@ -1687,7 +1687,6 @@ namespace Oxygen } else if( !( isActive() && configuration().drawTitleOutline() ) ) { - geometry.adjust( buttonsLeftWidth() + layoutMetric( LM_TitleEdgeLeft ) , 0, -( buttonsRightWidth() + layoutMetric( LM_TitleEdgeRight )), 0 ); From b91e8e788b7c64ff70fbe9b9aebcdbf19fe4cd4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 1 Mar 2012 13:12:15 +0100 Subject: [PATCH 4/4] Ensure that update script does not overwrite settings The upgrade script changed to thumbnails layout in case that there has not been any settings for BoxSwitch effect stored in the config file. REVIEW: 104129 --- data/update_tabbox_qml_settings.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/update_tabbox_qml_settings.cpp b/data/update_tabbox_qml_settings.cpp index 618b36f1e9..7297ffff7a 100644 --- a/data/update_tabbox_qml_settings.cpp +++ b/data/update_tabbox_qml_settings.cpp @@ -46,9 +46,11 @@ int main( int argc, char* argv[] ) KComponentData inst( &about ); Q_UNUSED( KGlobal::locale() ); // jump-start locales to get to translated descriptions KConfig config("kwinrc"); + KConfigGroup plugins = config.group("Plugins"); + const bool boxSwitchEnabled = plugins.readEntry("kwin4_effect_boxswitchEnabled", true); KConfigGroup boxswitch = config.group("Effect-BoxSwitch"); - const bool boxSwitchPrimary = boxswitch.readEntry("TabBox", true); - const bool boxSwitchAlternative = boxswitch.readEntry("TabBoxAlternative", false); + const bool boxSwitchPrimary = boxSwitchEnabled && boxswitch.hasKey("TabBox") && boxswitch.readEntry("TabBox", true); + const bool boxSwitchAlternative = boxSwitchEnabled && boxswitch.hasKey("TabBoxAlternative") && boxswitch.readEntry("TabBoxAlternative", false); boxswitch.writeEntry("TabBox", false); boxswitch.writeEntry("TabBoxAlternative", false); boxswitch.sync();