diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-04-24 09:58:44 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-04-28 14:42:22 (GMT) |
commit | 6143217a8594c40d693e4ffceb914bc927f43b05 (patch) | |
tree | db8f11c76e0921330f86da264886adf1d16e2d65 /src/gui/kernel/qwidget_s60.cpp | |
parent | c4e2008731cd7c9df922921c52294f84205fccb9 (diff) | |
download | Qt-6143217a8594c40d693e4ffceb914bc927f43b05.zip Qt-6143217a8594c40d693e4ffceb914bc927f43b05.tar.gz Qt-6143217a8594c40d693e4ffceb914bc927f43b05.tar.bz2 |
More work on translucent windows.
One step closer to semi-transparent windows, but not there yet. This
gets the transparent contents into the window, but the previous
contents are not cleared so it keeps drawing the backing store on top
of itself each time a Draw() is done. SetBackgroundColor() indicates
to WSERV that our window is semi-transparent. We also make sure not to
use 'EDrawModeWriteAlpha' when the widget is non-opaque since this
actually changes the alpha channel on the frame buffer (not the
window) so the gives undesired results. It's a faster draw mode though
so we should use it where we can.
Diffstat (limited to 'src/gui/kernel/qwidget_s60.cpp')
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 20325c2..f78b5be 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -206,7 +206,8 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO if (q->testAttribute(Qt::WA_TranslucentBackground)) { RWindow *rwindow = static_cast<RWindow*>(topExtra->rwindow); TDisplayMode gotDM = (TDisplayMode)rwindow->SetRequiredDisplayMode(EColor16MA); - int erro = rwindow->SetTransparencyAlphaChannel(); + if (rwindow->SetTransparencyAlphaChannel() == KErrNone) + rwindow->SetBackgroundColor(~0); } } @@ -451,7 +452,8 @@ void QWidgetPrivate::s60UpdateIsOpaque() QTLWExtra *topExtra = topData(); RWindow *rwindow = static_cast<RWindow*>(topExtra->rwindow); TDisplayMode gotDM = (TDisplayMode)rwindow->SetRequiredDisplayMode(EColor16MA); - int erro = rwindow->SetTransparencyAlphaChannel(); + if (rwindow->SetTransparencyAlphaChannel() == KErrNone) + rwindow->SetBackgroundColor(~0); } else { QTLWExtra *topExtra = topData(); RWindow *rwindow = static_cast<RWindow*>(topExtra->rwindow); |