From b8a767e3cfc74bed621d83f01451d808924a57a0 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Mon, 19 Sep 2011 15:20:07 +0200 Subject: [PATCH] properly update parent when button state is changed. --- clients/oxygen/oxygenbutton.cpp | 20 +++++--------------- clients/oxygen/oxygenbutton.h | 2 +- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/clients/oxygen/oxygenbutton.cpp b/clients/oxygen/oxygenbutton.cpp index ab0b5fc622..5b4d53b81c 100644 --- a/clients/oxygen/oxygenbutton.cpp +++ b/clients/oxygen/oxygenbutton.cpp @@ -122,7 +122,7 @@ namespace Oxygen _glowAnimation->setDirection( Animation::Forward ); if( !isAnimated() ) _glowAnimation->start(); - } else update(); + } else parentUpdate(); } @@ -139,7 +139,7 @@ namespace Oxygen } _status = Oxygen::Normal; - update(); + parentUpdate(); } @@ -150,7 +150,7 @@ namespace Oxygen if( _type == ButtonMax || event->button() == Qt::LeftButton ) { _status = Oxygen::Pressed; - update(); + parentUpdate(); } KCommonDecorationButton::mousePressEvent( event ); @@ -161,7 +161,7 @@ namespace Oxygen { _status = ( rect().contains( event->pos() ) ) ? Oxygen::Hovered:Oxygen::Normal; - update(); + parentUpdate(); KCommonDecorationButton::mouseReleaseEvent( event ); } @@ -184,17 +184,8 @@ namespace Oxygen { if( _client.hideTitleBar() ) return; - - if( _client.compositingActive() ) + if( !_client.compositingActive() ) { - return; - - QPainter painter( this ); - painter.setRenderHints(QPainter::Antialiasing); - painter.setClipRegion( event->region() ); - paint( painter ); - - } else { { @@ -260,7 +251,6 @@ namespace Oxygen { // shadow color - QColor shadow; if( isAnimated() ) shadow = _helper.alphaColor( glow, glowIntensity() ); else if( _status == Oxygen::Hovered ) shadow = glow; diff --git a/clients/oxygen/oxygenbutton.h b/clients/oxygen/oxygenbutton.h index 92ba1b6ecd..9828f5fd0e 100644 --- a/clients/oxygen/oxygenbutton.h +++ b/clients/oxygen/oxygenbutton.h @@ -82,7 +82,7 @@ namespace Oxygen { if( _glowIntensity == value ) return; _glowIntensity = value; - update(); + parentUpdate(); } qreal glowIntensity( void ) const