diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-11-04 13:21:37 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-11-04 13:57:08 (GMT) |
commit | be6357bfa96cdaffa5797fef99e95cac7121e5b3 (patch) | |
tree | f6bc6b53cc301bd749b98545ea887f376a655b6b /src | |
parent | 968eabf3ff6b686867d964f2a3437a228be0ea6b (diff) | |
download | Qt-be6357bfa96cdaffa5797fef99e95cac7121e5b3.zip Qt-be6357bfa96cdaffa5797fef99e95cac7121e5b3.tar.gz Qt-be6357bfa96cdaffa5797fef99e95cac7121e5b3.tar.bz2 |
Fixed modal dialog fading support in Symbian.
Switched to use S60 API instead of Symbian one, the rationale is given
below as an copy/paste from S60 docs:
"Cross-application fading support
Symbian OS provides some support for fading, but this only covers
fading within an application. The S60 UI can have more than one
application on the screen at once (in fact, since the system parts
of the Status pane are inside EikServer, it always has more than one
application on the screen). The S60 UI introduced the fading and
drawing system to manage the fading state for the whole system.
Application and UI control code for S60 should not attempt to set fade
for a popup window directly. Instead, the popup window should implement
the MAknFadedComponent interface, and should use the TAknPopupFader
support class to set the fade.
The application UI base classes interact with the fading and drawing
system by informing it when the foreground status of the application
changes. They also use it to implement system wide fading."
There is also task QTBUG-5393 to implement fading support in future
without S60 dependency.
Task-number: QTBUG-5181
Reviewed-by: Sami Merila
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qapplication_p.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qt_s60_p.h | 23 |
3 files changed, 25 insertions, 4 deletions
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 0fa7269..ec308c0 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -72,7 +72,7 @@ #include <private/qgraphicssystem_qws_p.h> #endif #ifdef Q_OS_SYMBIAN -#include <w32std.h> +#include <w32std.h> #endif QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 1b0659a..5fe9536 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1255,7 +1255,7 @@ bool QApplicationPrivate::modalState() void QApplicationPrivate::enterModal_sys(QWidget *widget) { if (widget) { - widget->effectiveWinId()->DrawableWindow()->FadeBehind(ETrue); + static_cast<QSymbianControl *>(widget->effectiveWinId())->FadeBehindPopup(ETrue); // Modal partial screen dialogs (like queries) capture pointer events. // ### FixMe: Add specialized behaviour for fullscreen modal dialogs widget->effectiveWinId()->SetGloballyCapturing(ETrue); @@ -1270,7 +1270,7 @@ void QApplicationPrivate::enterModal_sys(QWidget *widget) void QApplicationPrivate::leaveModal_sys(QWidget *widget) { if (widget) { - widget->effectiveWinId()->DrawableWindow()->FadeBehind(EFalse); + static_cast<QSymbianControl *>(widget->effectiveWinId())->FadeBehindPopup(EFalse); // ### FixMe: Add specialized behaviour for fullscreen modal dialogs widget->effectiveWinId()->SetGloballyCapturing(EFalse); widget->effectiveWinId()->SetPointerCapture(EFalse); diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 789d89e..3405bcf 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -73,6 +73,7 @@ #include <akntitle.h> // CAknTitlePane #include <akncontext.h> // CAknContextPane #include <eikspane.h> // CEikStatusPane +#include <aknpopupfader.h> // MAknFadedComponent and TAknPopupFader #endif QT_BEGIN_NAMESPACE @@ -114,7 +115,7 @@ public: int supportsPremultipliedAlpha : 1; QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type static inline void updateScreenSize(); - static inline RWsSession& wsSession(); + static inline RWsSession& wsSession(); static inline RWindowGroup& windowGroup(); static inline CWsScreenDevice* screenDevice(); static inline CCoeAppUi* appUi(); @@ -140,7 +141,11 @@ public: }; class QLongTapTimer; + class QSymbianControl : public CCoeControl, public QAbstractLongTapObserver +#ifdef Q_WS_S60 +, public MAknFadedComponent +#endif { public: DECLARE_TYPE_ID(0x51740000) // Fun fact: the two first values are "Qt" in ASCII. @@ -165,6 +170,17 @@ public: void setFocusSafely(bool focus); +#ifdef Q_WS_S60 + void FadeBehindPopup(bool fade){ popupFader.FadeBehindPopup( this, this, fade); } + +protected: // from MAknFadedComponent + TInt CountFadedComponents() {return 1;} + CCoeControl* FadedComponent(TInt aIndex) {return this;} +#else + #warning No fallback implementation for QSymbianControl::FadeBehindPopup + void FadeBehindPopup(bool /*fade*/){ } +#endif + protected: void Draw(const TRect& aRect) const; void SizeChanged(); @@ -189,6 +205,11 @@ private: bool m_ignoreFocusChanged; QLongTapTimer* m_longTapDetector; bool m_previousEventLongTap; + +#ifdef Q_WS_S60 + // Fader object used to fade everything except this menu and the CBA. + TAknPopupFader popupFader; +#endif }; inline QS60Data::QS60Data() |