diff options
author | Janne Heikkilä <janne.heikkila@symbio.com> | 2010-12-15 12:00:52 +0200 |
---|---|---|
committer | Stanislav Ionascu <stanislav.ionascu@nokia.com> | 2010-12-29 12:10:57 +0200 |
commit | 9d7a2fb2ebc2b1cae019a12abbc0563f5c7f9814 (patch) | |
tree | c34b5a4c1be5697af361f97fbba740373f7cc72c | |
parent | d04e9b4867a518bc27d7b3dab47c43ca4380c230 (diff) |
Fixes: NB#210256 - Background goes blank on changing orientation
RevBy: Stanislav Ionascu
Details: Combine the opacity defined in style with the opacity value coming from the controller.
Controller opacity is controlled by the animations making the combined opacity varying in
the range of [0.0, style()->opacity()].
ModifiedBy: Stanislav Ionascu
Details: Reset the painter opacity after drawing the dimming rectangle.
Use effectiveOpacity property of the controller to correctly apply style opacity of the dimming background.
-rw-r--r-- | src/views/mscenelayereffectdimview.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/views/mscenelayereffectdimview.cpp b/src/views/mscenelayereffectdimview.cpp index abad48b0..25052045 100644 --- a/src/views/mscenelayereffectdimview.cpp +++ b/src/views/mscenelayereffectdimview.cpp @@ -49,7 +49,11 @@ void MSceneLayerEffectDimView::paint(QPainter *painter, const QStyleOptionGraphi Q_UNUSED(widget); Q_UNUSED(option); + qreal oldOpacity = painter->opacity(); + qreal opacity = d_ptr->controller->effectiveOpacity() * style()->opacity(); + painter->setOpacity(opacity); painter->fillRect(boundingRect(), QColor(0, 0, 0)); + painter->setOpacity(oldOpacity); } QRectF MSceneLayerEffectDimView::boundingRect() const @@ -60,11 +64,7 @@ QRectF MSceneLayerEffectDimView::boundingRect() const void MSceneLayerEffectDimView::applyStyle() { - Q_D(MSceneLayerEffectDimView); - MSceneWindowView::applyStyle(); - - d->controller->setOpacity(style()->opacity()); } M_REGISTER_VIEW_NEW(MSceneLayerEffectDimView, MSceneLayerEffect) |