diff options
author | Jani Hautakangas <ext-jani.hautakangas@nokia.com> | 2010-01-22 12:00:11 (GMT) |
---|---|---|
committer | Jani Hautakangas <ext-jani.hautakangas@nokia.com> | 2010-01-22 12:00:11 (GMT) |
commit | 8e87feefc0a92fbbeb1846f2471cdded9ef901ff (patch) | |
tree | 75bded8a8d3c2288739451d65a843899a7ff18dd /src/gui | |
parent | b22b06debf9d7e964244a0a613354be0ea9e07b7 (diff) | |
download | Qt-8e87feefc0a92fbbeb1846f2471cdded9ef901ff.zip Qt-8e87feefc0a92fbbeb1846f2471cdded9ef901ff.tar.gz Qt-8e87feefc0a92fbbeb1846f2471cdded9ef901ff.tar.bz2 |
Move avkon component transparency check to app initialization.
Reviewed-by: Sami Merila
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/qdialog.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 19 | ||||
-rw-r--r-- | src/gui/kernel/qt_s60_p.h | 32 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 2 |
4 files changed, 23 insertions, 34 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index 9e11ebf..9ff2ad8 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -267,7 +267,7 @@ QDialog::QDialog(QWidget *parent, Qt::WindowFlags f) #endif #ifdef Q_WS_S60 - if (S60->avkonComponentsSupportTransparency()) { + if (S60->avkonComponentsSupportTransparency) { bool noSystemBackground = testAttribute(Qt::WA_NoSystemBackground); setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute @@ -304,7 +304,7 @@ QDialog::QDialog(QDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f) #endif #ifdef Q_WS_S60 - if (S60->avkonComponentsSupportTransparency()) { + if (S60->avkonComponentsSupportTransparency) { bool noSystemBackground = testAttribute(Qt::WA_NoSystemBackground); setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 361d231..6caac9f 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -71,6 +71,7 @@ # include <private/qcoefepinputcontext_p.h> # endif # include <private/qs60mainapplication_p.h> +# include <centralrepository.h> #endif #include "private/qstylesheetstyle_p.h" @@ -1204,6 +1205,24 @@ void qt_init(QApplicationPrivate * /* priv */, int) S60->virtualMouseRequired = false; } + S60->avkonComponentsSupportTransparency = false; + +#ifdef Q_WS_S60 + TUid KCRUidAvkon = { 0x101F876E }; + TUint32 KAknAvkonTransparencyEnabled = 0x0000000D; + + CRepository* repository = 0; + TRAP(err, repository = CRepository::NewL(KCRUidAvkon)); + + if(err == KErrNone) { + TInt value = 0; + err = repository->Get(KAknAvkonTransparencyEnabled, value); + if(err == KErrNone) { + S60->avkonComponentsSupportTransparency = (value==1) ? true : false; + } + } +#endif + if (touch) { QApplicationPrivate::navigationMode = Qt::NavigationModeNone; } else { diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 2c733b9..1163055 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -74,7 +74,6 @@ #include <akncontext.h> // CAknContextPane #include <eikspane.h> // CEikStatusPane #include <aknpopupfader.h> // MAknFadedComponent and TAknPopupFader -#include <centralrepository.h> #endif QT_BEGIN_NAMESPACE @@ -122,6 +121,7 @@ public: int virtualMouseRequired : 1; int qtOwnsS60Environment : 1; int supportsPremultipliedAlpha : 1; + int avkonComponentsSupportTransparency : 1; QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type static inline void updateScreenSize(); static inline RWsSession& wsSession(); @@ -134,14 +134,8 @@ 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 }; @@ -312,30 +306,6 @@ 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 542da5e..ede87de 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -2028,7 +2028,7 @@ void QWidgetPrivate::updateIsOpaque() #ifdef Q_WS_S60 if (q->windowType() == Qt::Dialog && q->testAttribute(Qt::WA_TranslucentBackground) - && S60->avkonComponentsSupportTransparency()) { + && S60->avkonComponentsSupportTransparency) { setOpaque(false); return; } |