Details
-
Suggestion
-
Resolution: Fixed
-
P2: Important
-
6.5.0
-
Windows 10/11
-
-
8dbc48248 (dev), 3a54d3109 (6.6), aa7a0cd4b (6.5)
Description
With recent updates to the Microsoft App SDK it is now easier to customize a window title bar for win32 apps on Windows 10 and 11.
One feature that we would like support for in Qt is extending the content view into the titlebar which is provided by the app sdk method ExtendsContentIntoTitleBar().
We've tried hacking this into a QML app using the following to see how Qt will react:
#include <winrt/Windows.Foundation.h> #include <winrt/Windows.UI.h> #include <winrt/Microsoft.UI.h> #include <winrt/Microsoft.UI.Windowing.h> #include <winrt/Microsoft.UI.Interop.h> namespace winrt { using namespace Windows::Foundation; using namespace Microsoft::UI::Windowing; using namespace Microsoft::UI; } ... HWND hWnd = reinterpret_cast<HWND>(winId()); winrt::WindowId windowId = winrt::GetWindowIdFromWindow(hWnd); winrt::AppWindow appWindow = winrt::AppWindow::GetFromWindowId(windowId); auto titleBar = appWindow.TitleBar(); if (titleBar.IsCustomizationSupported()) { titleBar.ExtendsContentIntoTitleBar(true); titleBar.ButtonBackgroundColor(winrt::ColorHelper::FromArgb(255, color().red(), color().green(), color().blue())); }
And the attached screenshot shows the result. The main content for the qml window is not extended up into the title bar and mouse events are offset by the title bar.
Do you have any tips for how we could possibly get this working temporarily so the QML content is correctly positioned in the window?