diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index 34c58e111f..17832ecc9d 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -978,6 +978,8 @@ namespace Oxygen { QPixmap out( rect.size() ); + if( !rect.isValid() ) return QPixmap(); + out.fill( Qt::transparent ); if( caption.isEmpty() || !color.isValid() ) return out; @@ -1439,13 +1441,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(); + } }