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();
|
positionPreviews();
|
||||||
deco[Inactive]->widget()->show();
|
//deco[Inactive]->widget()->show();
|
||||||
deco[Active]->widget()->show();
|
//deco[Active]->widget()->show();
|
||||||
|
|
||||||
|
//deco[Inactive]->widget()->render( this, deco[Inactive]->widget()->mapToParent( QPoint(0,0) ) );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,6 +106,13 @@ void KDecorationPreview::disablePreview()
|
||||||
no_preview->show();
|
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 )
|
void KDecorationPreview::resizeEvent( QResizeEvent* e )
|
||||||
{
|
{
|
||||||
QWidget::resizeEvent( e );
|
QWidget::resizeEvent( e );
|
||||||
|
|
|
@ -55,6 +55,7 @@ class KDecorationPreview
|
||||||
void setTempBorderSize(KDecorationPlugins* plugin, KDecorationDefines::BorderSize size);
|
void setTempBorderSize(KDecorationPlugins* plugin, KDecorationDefines::BorderSize size);
|
||||||
void setTempButtons(KDecorationPlugins* plugin, bool customEnabled, const QString &left, const QString &right);
|
void setTempButtons(KDecorationPlugins* plugin, bool customEnabled, const QString &left, const QString &right);
|
||||||
protected:
|
protected:
|
||||||
|
virtual void paintEvent( QPaintEvent* );
|
||||||
virtual void resizeEvent( QResizeEvent* );
|
virtual void resizeEvent( QResizeEvent* );
|
||||||
private:
|
private:
|
||||||
void positionPreviews();
|
void positionPreviews();
|
||||||
|
|
Loading…
Reference in a new issue