diff options
author | Samuel Nevala <samuel.nevala@intopalo.com> | 2015-08-17 14:57:46 +0300 |
---|---|---|
committer | Andrew Knight <andrew.knight@intopalo.com> | 2015-08-20 05:41:26 +0000 |
commit | b349289fa0003da58adb5cee51e5c2e093a6dd6f (patch) | |
tree | e79971cf4e6d1dc3c5cd9cbd316fa0da3b41278b | |
parent | 5bf5fe964bc495f4390462d3287575bb99aab18e (diff) |
winrt: Hide status bar on windows phone.
Task-Id: QTBUG-47789
Change-Id: I9ca5f336ba9ee7524d4a4bbff3bbf4fbbb56fd54
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtscreen.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index 89ad33657b..2a7cbaa159 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -414,6 +414,9 @@ public: ComPtr<Xaml::IDependencyObject> canvas; ComPtr<IApplicationView> view; ComPtr<IDisplayInformation> displayInformation; +#ifdef Q_OS_WINPHONE + ComPtr<IStatusBar> statusBar; +#endif // Q_OS_WINPHONE QScopedPointer<QWinRTCursor> cursor; @@ -535,6 +538,15 @@ QWinRTScreen::QWinRTScreen(Xaml::IWindow *xamlWindow) Q_ASSERT_SUCCEEDED(hr); d->cursor.reset(new QWinRTCursor); + +#ifdef Q_OS_WINPHONE + ComPtr<IStatusBarStatics> statusBarStatics; + hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_ViewManagement_StatusBar).Get(), + IID_PPV_ARGS(&statusBarStatics)); + Q_ASSERT_SUCCEEDED(hr); + hr = statusBarStatics->GetForCurrentView(&d->statusBar); + Q_ASSERT_SUCCEEDED(hr); +#endif // Q_OS_WINPHONE } QWinRTScreen::~QWinRTScreen() @@ -660,6 +672,19 @@ void QWinRTScreen::addWindow(QWindow *window) Q_D(QWinRTScreen); if (window == topWindow()) return; + +#ifdef Q_OS_WINPHONE + if (d->statusBar && (window->flags() & Qt::WindowType_Mask) == Qt::Window) { + QEventDispatcherWinRT::runOnXamlThread([this, d]() { + HRESULT hr; + ComPtr<IAsyncAction> op; + hr = d->statusBar->HideAsync(&op); + Q_ASSERT_SUCCEEDED(hr); + return S_OK; + }); + } +#endif // Q_OS_WINPHONE + d->visibleWindows.prepend(window); QWindowSystemInterface::handleWindowActivated(window, Qt::OtherFocusReason); handleExpose(); |