Backport r987415:
Changed painting of preview decorations, to use widget->render() instead of widget->show(). This allows to have oxygen decorations painted properly (with visible shadows), to handle window resize properly, and does not affect other decorations. svn path=/branches/KDE/4.3/kdebase/workspace/; revision=987419
This commit is contained in:
parent
9d6aa6abed
commit
31bdb777a9
2 changed files with 12 additions and 2 deletions
|
@ -85,9 +85,11 @@ bool KDecorationPreview::recreateDecoration( KDecorationPlugins* plugins )
|
|||
}
|
||||
|
||||
positionPreviews();
|
||||
deco[Inactive]->widget()->show();
|
||||
deco[Active]->widget()->show();
|
||||
//deco[Inactive]->widget()->show();
|
||||
//deco[Active]->widget()->show();
|
||||
|
||||
//deco[Inactive]->widget()->render( this, deco[Inactive]->widget()->mapToParent( QPoint(0,0) ) );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -104,6 +106,13 @@ void KDecorationPreview::disablePreview()
|
|||
no_preview->show();
|
||||
}
|
||||
|
||||
void KDecorationPreview::paintEvent( QPaintEvent* e )
|
||||
{
|
||||
QWidget::paintEvent(e);
|
||||
if( deco[Inactive] ) deco[Inactive]->widget()->render( this, deco[Inactive]->widget()->mapToParent( QPoint(0,0) ) );
|
||||
if( deco[Active] ) deco[Active]->widget()->render( this, deco[Active]->widget()->mapToParent( QPoint(0,0) ) );
|
||||
}
|
||||
|
||||
void KDecorationPreview::resizeEvent( QResizeEvent* e )
|
||||
{
|
||||
QWidget::resizeEvent( e );
|
||||
|
|
|
@ -55,6 +55,7 @@ class KDecorationPreview
|
|||
void setTempBorderSize(KDecorationPlugins* plugin, KDecorationDefines::BorderSize size);
|
||||
void setTempButtons(KDecorationPlugins* plugin, bool customEnabled, const QString &left, const QString &right);
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent* );
|
||||
virtual void resizeEvent( QResizeEvent* );
|
||||
private:
|
||||
void positionPreviews();
|
||||
|
|
Loading…
Reference in a new issue