moved all button painting to client.
This commit is contained in:
parent
984f6d6305
commit
01da5bb015
3 changed files with 27 additions and 3 deletions
|
@ -187,6 +187,8 @@ namespace Oxygen
|
|||
|
||||
if( _client.compositingActive() )
|
||||
{
|
||||
return;
|
||||
|
||||
QPainter painter( this );
|
||||
painter.setRenderHints(QPainter::Antialiasing);
|
||||
painter.setClipRegion( event->region() );
|
||||
|
|
|
@ -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* );
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue