moved all button painting to client.

This commit is contained in:
Hugo Pereira Da Costa 2011-09-19 15:16:43 +02:00
parent 984f6d6305
commit 01da5bb015
3 changed files with 27 additions and 3 deletions

View file

@ -187,6 +187,8 @@ namespace Oxygen
if( _client.compositingActive() )
{
return;
QPainter painter( this );
painter.setRenderHints(QPainter::Antialiasing);
painter.setClipRegion( event->region() );

View file

@ -90,6 +90,13 @@ namespace Oxygen
//@}
//! render buttn to provided painter
void paint(QPainter& );
// parent update
void parentUpdate( void )
{ parentWidget()->update( geometry().adjusted( -1, -1, 1, 1 ) ); }
protected:
//! press event
@ -110,9 +117,6 @@ namespace Oxygen
//! paint
void paintEvent( QPaintEvent* );
//! render buttn to provided painter
void paint(QPainter& );
//! draw icon
void drawIcon( QPainter* );

View file

@ -1394,6 +1394,24 @@ namespace Oxygen
painter.setClipRegion( event->region() );
paint( painter );
// update buttons
if( compositingActive() )
{
QList<Button*> buttons( widget()->findChildren<Button*>() );
foreach( Button* button, buttons )
{
if( event->rect().intersects( button->geometry() ) )
{
painter.save();
painter.setViewport( button->geometry() );
painter.setWindow( button->rect() );
button->paint( painter );
painter.restore();
}
}
}
} else {
{