adapt to latest qt change

And install some missing files

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2022-07-13 10:40:29 +08:00
parent 5e863ee661
commit 7f9f2c8543
5 changed files with 48 additions and 6 deletions

View File

@ -8,15 +8,21 @@ You can join our [Discord channel](https://discord.gg/grrM4Tmesy) to communicate
## Roadmap ## Roadmap
- Common: Add cross-platform blur behind window feature.
- Common: Add cross-platform customizable system menu for both Qt Widgets and Qt Quick. Also supports both light and dark theme. - Common: Add cross-platform customizable system menu for both Qt Widgets and Qt Quick. Also supports both light and dark theme.
- Common: Migrate to categorized logging output.
- Examples: Add QtWebEngine based demo projects for both Qt Widgets and Qt Quick. The whole user interface will be written in HTML instead of C++/QML. - Examples: Add QtWebEngine based demo projects for both Qt Widgets and Qt Quick. The whole user interface will be written in HTML instead of C++/QML.
- Examples: Add demo projects that emulate the classic appearance of UWP applications. They will have a backward button on the left side of the title bar and a search box in the middle of the title bar. And maybe a side bar on the left side to switch between different pages. - Examples: Add demo projects that emulate the classic appearance of UWP applications. They will have a backward button on the left side of the title bar and a search box in the middle of the title bar. And maybe a side bar on the left side to switch between different pages.
- Examples: Add demo projects that the main window is not resizable. - Examples: Add demo projects that the main window is not resizable.
- Examples: Add demo projects that have transparent background and doesn't have rectangular window frame. - Examples: Add demo projects that have transparent background and doesn't have rectangular window frame.
- Feature requests are welcome! - Feature requests are welcome!
## Highlights v2.2
- Common: Added blur behind window feature for Windows (7~11), Linux and macOS.
- CMake: Implemented CMake package support. It's now possible to use `find_package` to find FramelessHelper.
- Examples: Enabled blur behind window and round window corner by default.
- Common: Migrated to categorized logging output.
- Common: Internal code improvements & bug fixes.
## Highlights v2.1 ## Highlights v2.1
- Windows: Added support for the snap layout feature introduced in Windows 11. - Windows: Added support for the snap layout feature introduced in Windows 11.
@ -97,7 +103,7 @@ cmake --install . --config Release --strip
**IMPORTANT NOTE**: On Linux you need to install the _GTK3_ and _X11_ development packages first. **IMPORTANT NOTE**: On Linux you need to install the _GTK3_ and _X11_ development packages first.
Once the compilation and installation is done, you will be able to use the `find_package(FramelessHelper REQUIRED COMPONENTS Core Widgets Quick)` command to find and link to the FramelessHelper library. But before doing that, please make sure CMake knows where to find FramelessHelper, by passing the `CMAKE_PREFIX_PATH` variable to it. For example: `-DCMAKE_PREFIX_PATH=C:/my-cmake-packages;C:/my-toolchain;etc...`. Build FramelessHelper as a sub-directory of your CMake project is of course also supported. Once the compilation and installation is done, you will be able to use the `find_package(FramelessHelper REQUIRED COMPONENTS Core Widgets Quick)` command to find and link to the FramelessHelper library. But before doing that, please make sure CMake knows where to find FramelessHelper, by passing the `CMAKE_PREFIX_PATH` variable to it. For example: `-DCMAKE_PREFIX_PATH=C:/my-cmake-packages;C:/my-toolchain;etc...`. Build FramelessHelper as a sub-directory of your CMake project is of course also supported. The supported FramelessHelper target names are `FramelessHelper::FramelessHelperCore`, `FramelessHelper::FramelessHelperWidgets` and `FramelessHelper::FramelessHelperQuick`.
## Use ## Use

View File

@ -46,6 +46,14 @@ set(PUBLIC_HEADERS
${INCLUDE_PREFIX}/chromepalette.h ${INCLUDE_PREFIX}/chromepalette.h
) )
set(PUBLIC_HEADERS_ALIAS
${INCLUDE_PREFIX}/Global
${INCLUDE_PREFIX}/FramelessHelper_Qt
${INCLUDE_PREFIX}/FramelessManager
${INCLUDE_PREFIX}/Utils
${INCLUDE_PREFIX}/ChromePalette
)
set(PRIVATE_HEADERS set(PRIVATE_HEADERS
${INCLUDE_PREFIX}/private/framelessmanager_p.h ${INCLUDE_PREFIX}/private/framelessmanager_p.h
${INCLUDE_PREFIX}/private/framelessconfig_p.h ${INCLUDE_PREFIX}/private/framelessconfig_p.h
@ -69,6 +77,10 @@ if(WIN32)
${INCLUDE_PREFIX}/framelesshelper_windows.h ${INCLUDE_PREFIX}/framelesshelper_windows.h
${INCLUDE_PREFIX}/framelesshelper_win.h ${INCLUDE_PREFIX}/framelesshelper_win.h
) )
list(APPEND PUBLIC_HEADERS_ALIAS
${INCLUDE_PREFIX}/FramelessHelper_Windows
${INCLUDE_PREFIX}/FramelessHelper_Win
)
list(APPEND SOURCES list(APPEND SOURCES
utils_win.cpp utils_win.cpp
framelesshelper_win.cpp framelesshelper_win.cpp
@ -130,7 +142,7 @@ if(MSVC)
_WIN32_IE=${_WIN32_WINNT_WIN10} NTDDI_VERSION=${NTDDI_WIN10_CO} _WIN32_IE=${_WIN32_WINNT_WIN10} NTDDI_VERSION=${NTDDI_WIN10_CO}
) )
target_compile_options(${SUB_PROJ_NAME} PRIVATE target_compile_options(${SUB_PROJ_NAME} PRIVATE
/utf-8 /W3 /WX /utf-8 /W3 /WX # Cannot use /W4 here, Qt's own headers are not warning-clean.
) )
else() else()
target_compile_options(${SUB_PROJ_NAME} PRIVATE target_compile_options(${SUB_PROJ_NAME} PRIVATE
@ -184,6 +196,7 @@ export(EXPORT ${SUB_PROJ_NAME}Targets
) )
install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH}) install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH})
install(FILES ${PUBLIC_HEADERS_ALIAS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH})
install(FILES ${PRIVATE_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH}/private) install(FILES ${PRIVATE_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH}/private)
install(EXPORT ${SUB_PROJ_NAME}Targets install(EXPORT ${SUB_PROJ_NAME}Targets

View File

@ -479,7 +479,9 @@ void FramelessHelperWin::addWindow(const SystemParameters &params)
static const bool isWin10RS1OrGreater = Utils::isWindowsVersionOrGreater(WindowsVersion::_10_1607); static const bool isWin10RS1OrGreater = Utils::isWindowsVersionOrGreater(WindowsVersion::_10_1607);
if (isWin10RS1OrGreater) { if (isWin10RS1OrGreater) {
const bool dark = Utils::shouldAppsUseDarkMode(); const bool dark = Utils::shouldAppsUseDarkMode();
#if (QT_VERSION < QT_VERSION_CHECK(6, 4, 0))
Utils::updateWindowFrameBorderColor(windowId, dark); Utils::updateWindowFrameBorderColor(windowId, dark);
#endif
static const bool isWin10RS5OrGreater = Utils::isWindowsVersionOrGreater(WindowsVersion::_10_1809); static const bool isWin10RS5OrGreater = Utils::isWindowsVersionOrGreater(WindowsVersion::_10_1809);
if (isWin10RS5OrGreater) { if (isWin10RS5OrGreater) {
static const bool isQtQuickApplication = (params.getCurrentApplicationType() == ApplicationType::Quick); static const bool isQtQuickApplication = (params.getCurrentApplicationType() == ApplicationType::Quick);
@ -1081,7 +1083,9 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
&& (std::wcscmp(reinterpret_cast<LPCWSTR>(lParam), kThemeSettingChangeEventName) == 0)) { && (std::wcscmp(reinterpret_cast<LPCWSTR>(lParam), kThemeSettingChangeEventName) == 0)) {
systemThemeChanged = true; systemThemeChanged = true;
const bool dark = Utils::shouldAppsUseDarkMode(); const bool dark = Utils::shouldAppsUseDarkMode();
#if (QT_VERSION < QT_VERSION_CHECK(6, 4, 0))
Utils::updateWindowFrameBorderColor(windowId, dark); Utils::updateWindowFrameBorderColor(windowId, dark);
#endif
static const bool isWin10RS5OrGreater = Utils::isWindowsVersionOrGreater(WindowsVersion::_10_1809); static const bool isWin10RS5OrGreater = Utils::isWindowsVersionOrGreater(WindowsVersion::_10_1809);
if (isWin10RS5OrGreater) { if (isWin10RS5OrGreater) {
static const bool isQtQuickApplication = (data.params.getCurrentApplicationType() == ApplicationType::Quick); static const bool isQtQuickApplication = (data.params.getCurrentApplicationType() == ApplicationType::Quick);

View File

@ -39,6 +39,14 @@ set(PUBLIC_HEADERS
${INCLUDE_PREFIX}/quickchromepalette.h ${INCLUDE_PREFIX}/quickchromepalette.h
) )
set(PUBLIC_HEADERS_ALIAS
${INCLUDE_PREFIX}/Global
${INCLUDE_PREFIX}/FramelessQuickModule
${INCLUDE_PREFIX}/FramelessQuickHelper
${INCLUDE_PREFIX}/FramelessQuickUtils
${INCLUDE_PREFIX}/QuickChromePalette
)
set(PRIVATE_HEADERS set(PRIVATE_HEADERS
${INCLUDE_PREFIX}/private/quickstandardsystembutton_p.h ${INCLUDE_PREFIX}/private/quickstandardsystembutton_p.h
${INCLUDE_PREFIX}/private/quickstandardtitlebar_p.h ${INCLUDE_PREFIX}/private/quickstandardtitlebar_p.h
@ -150,7 +158,7 @@ if(MSVC)
_WIN32_IE=${_WIN32_WINNT_WIN10} NTDDI_VERSION=${NTDDI_WIN10_CO} _WIN32_IE=${_WIN32_WINNT_WIN10} NTDDI_VERSION=${NTDDI_WIN10_CO}
) )
target_compile_options(${SUB_PROJ_NAME} PRIVATE target_compile_options(${SUB_PROJ_NAME} PRIVATE
/utf-8 /W3 /WX /utf-8 /W3 /WX # Cannot use /W4 here, Qt's own headers are not warning-clean.
) )
else() else()
target_compile_options(${SUB_PROJ_NAME} PRIVATE target_compile_options(${SUB_PROJ_NAME} PRIVATE
@ -189,6 +197,7 @@ export(EXPORT ${SUB_PROJ_NAME}Targets
) )
install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH}) install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH})
install(FILES ${PUBLIC_HEADERS_ALIAS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH})
install(FILES ${PRIVATE_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH}/private) install(FILES ${PRIVATE_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH}/private)
install(EXPORT ${SUB_PROJ_NAME}Targets install(EXPORT ${SUB_PROJ_NAME}Targets

View File

@ -37,6 +37,15 @@ set(PUBLIC_HEADERS
${INCLUDE_PREFIX}/standardtitlebar.h ${INCLUDE_PREFIX}/standardtitlebar.h
) )
set(PUBLIC_HEADERS_ALIAS
${INCLUDE_PREFIX}/Global
${INCLUDE_PREFIX}/FramelessWidget
${INCLUDE_PREFIX}/FramelessMainWindow
${INCLUDE_PREFIX}/StandardSystemButton
${INCLUDE_PREFIX}/FramelessWidgetsHelper
${INCLUDE_PREFIX}/StandardTitleBar
)
set(PRIVATE_HEADERS set(PRIVATE_HEADERS
${INCLUDE_PREFIX}/private/framelesswidgetshelper_p.h ${INCLUDE_PREFIX}/private/framelesswidgetshelper_p.h
${INCLUDE_PREFIX}/private/standardsystembutton_p.h ${INCLUDE_PREFIX}/private/standardsystembutton_p.h
@ -98,7 +107,7 @@ target_compile_definitions(${SUB_PROJ_NAME} PRIVATE
if(MSVC) if(MSVC)
target_compile_options(${SUB_PROJ_NAME} PRIVATE target_compile_options(${SUB_PROJ_NAME} PRIVATE
/utf-8 /W3 /WX /utf-8 /W3 /WX # Cannot use /W4 here, Qt's own headers are not warning-clean.
) )
else() else()
target_compile_options(${SUB_PROJ_NAME} PRIVATE target_compile_options(${SUB_PROJ_NAME} PRIVATE
@ -135,6 +144,7 @@ export(EXPORT ${SUB_PROJ_NAME}Targets
) )
install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH}) install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH})
install(FILES ${PUBLIC_HEADERS_ALIAS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH})
install(FILES ${PRIVATE_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH}/private) install(FILES ${PRIVATE_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${SUB_PROJ_PATH}/private)
install(EXPORT ${SUB_PROJ_NAME}Targets install(EXPORT ${SUB_PROJ_NAME}Targets