summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorJani Hautakangas <ext-jani.hautakangas@nokia.com>2010-01-22 09:08:08 (GMT)
committerJani Hautakangas <ext-jani.hautakangas@nokia.com>2010-01-22 09:11:00 (GMT)
commitb22b06debf9d7e964244a0a613354be0ea9e07b7 (patch)
tree7feb63a4fc260dc886cfda15b9d26d922a78a6fb /src/gui/kernel
parente575816cd618841e90e8933ff52e40a8581d3328 (diff)
downloadQt-b22b06debf9d7e964244a0a613354be0ea9e07b7.zip
Qt-b22b06debf9d7e964244a0a613354be0ea9e07b7.tar.gz
Qt-b22b06debf9d7e964244a0a613354be0ea9e07b7.tar.bz2
Fix for symbian dialog background transparency.
If Avkon components support transparency then dialog background is transparent enabling rounded corners. Reviewed-by: Sami Merila
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qt_s60_p.h31
-rw-r--r--src/gui/kernel/qwidget.cpp8
2 files changed, 39 insertions, 0 deletions
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index b417065..2c733b9 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -74,6 +74,7 @@
#include <akncontext.h> // CAknContextPane
#include <eikspane.h> // CEikStatusPane
#include <aknpopupfader.h> // MAknFadedComponent and TAknPopupFader
+#include <centralrepository.h>
#endif
QT_BEGIN_NAMESPACE
@@ -133,8 +134,14 @@ public:
static inline CAknTitlePane* titlePane();
static inline CAknContextPane* contextPane();
static inline CEikButtonGroupContainer* buttonGroupContainer();
+ static inline bool avkonComponentsSupportTransparency();
TTrapHandler *s60InstalledTrapHandler;
+
+private:
+
+ bool transparencyChecked;
+ bool transparencyEnabled;
#endif
};
@@ -305,6 +312,30 @@ inline CEikButtonGroupContainer* QS60Data::buttonGroupContainer()
{
return CEikonEnv::Static()->AppUiFactory()->Cba();
}
+
+inline bool QS60Data::avkonComponentsSupportTransparency()
+{
+ if(!S60->transparencyChecked) {
+ S60->transparencyChecked = true;
+ S60->transparencyEnabled = false;
+
+ TUid KCRUidAvkon = { 0x101F876E };
+ TUint32 KAknAvkonTransparencyEnabled = 0x0000000D;
+
+ CRepository* repository = 0;
+ TRAPD(err, repository = CRepository::NewL(KCRUidAvkon));
+
+ if(err == KErrNone) {
+ TInt value = 0;
+ err = repository->Get(KAknAvkonTransparencyEnabled, value);
+ if(err == KErrNone) {
+ S60->transparencyEnabled = (value==1) ? true : false;
+ }
+ }
+ }
+
+ return S60->transparencyEnabled;
+}
#endif // Q_WS_S60
static inline QFont qt_TFontSpec2QFontL(const TFontSpec &fontSpec)
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 81a9a80..542da5e 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -2026,6 +2026,14 @@ void QWidgetPrivate::updateIsOpaque()
}
#endif
+#ifdef Q_WS_S60
+ if (q->windowType() == Qt::Dialog && q->testAttribute(Qt::WA_TranslucentBackground)
+ && S60->avkonComponentsSupportTransparency()) {
+ setOpaque(false);
+ return;
+ }
+#endif
+
if (q->testAttribute(Qt::WA_OpaquePaintEvent) || q->testAttribute(Qt::WA_PaintOnScreen)) {
setOpaque(true);
return;