diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_p.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 12 | ||||
-rw-r--r-- | src/gui/kernel/qsoftkeymanager.cpp | 8 | ||||
-rw-r--r-- | src/gui/kernel/qt_s60_p.h | 23 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 4 |
5 files changed, 41 insertions, 8 deletions
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 8df4d08..992e4be 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..5578a72 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -357,6 +357,9 @@ QSymbianControl::~QSymbianControl() setFocusSafely(false); S60->appUi()->RemoveFromStack(this); delete m_longTapDetector; + + if(m_previousEventLongTap) + QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons & ~Qt::RightButton; } void QSymbianControl::setWidget(QWidget *w) @@ -866,6 +869,11 @@ void QSymbianControl::SizeChanged() tlwExtra->inTopLevelResize = false; } } + + // CCoeControl::SetExtent calls SizeChanged, but does not call + // PositionChanged, so we call it here to ensure that the widget's + // position is updated. + PositionChanged(); } void QSymbianControl::PositionChanged() @@ -1255,7 +1263,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 +1278,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/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 21795b4..a914220 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -197,8 +197,7 @@ bool QSoftKeyManager::event(QEvent *e) } while (source); QSoftKeyManagerPrivate::softKeySource = source; - if (source) - QSoftKeyManagerPrivate::updateSoftKeys_sys(softKeys); + QSoftKeyManagerPrivate::updateSoftKeys_sys(softKeys); return true; } return false; @@ -247,7 +246,10 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &softkeys) } } - Qt::WindowType sourceWindowType = QSoftKeyManagerPrivate::softKeySource->window()->windowType(); + const Qt::WindowType sourceWindowType = QSoftKeyManagerPrivate::softKeySource + ? QSoftKeyManagerPrivate::softKeySource->window()->windowType() + : Qt::Widget; + if (needsExitButton && sourceWindowType != Qt::Dialog && sourceWindowType != Qt::Popup) QT_TRAP_THROWING(nativeContainer->SetCommandL(2, EAknSoftkeyExit, qt_QString2TPtrC(QSoftKeyManager::tr("Exit")))); 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() diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index a6d8ed7..88cd63d 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -434,8 +434,10 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de drawableWindow->PointerFilter(EPointerFilterEnterExit | EPointerFilterMove | EPointerFilterDrag, 0); - if (q->isVisible() && q->testAttribute(Qt::WA_Mapped)) + if (q->isVisible() && q->testAttribute(Qt::WA_Mapped)) { activateSymbianWindow(control.data()); + control->MakeVisible(true); + } // We wait until the control is fully constructed before calling setWinId, because // this generates a WinIdChanged event. |