From d14a0e62d95410980e37884e89b12300399b9b7c Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Tue, 29 Nov 2022 19:51:33 +0800 Subject: [PATCH] bump version Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- CMakeLists.txt | 2 +- qmake/inc/core/framelesshelper.version | 4 ++-- src/core/framelesshelper_win.cpp | 11 +++++------ src/core/micamaterial.cpp | 2 ++ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fdb104..56e1a1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ cmake_minimum_required(VERSION 3.20) project(FramelessHelper - VERSION 2.3.4.0 + VERSION 2.3.5.0 DESCRIPTION "Cross-platform window customization framework for Qt Widgets and Qt Quick." HOMEPAGE_URL "https://github.com/wangwenx190/framelesshelper/" LANGUAGES CXX diff --git a/qmake/inc/core/framelesshelper.version b/qmake/inc/core/framelesshelper.version index 005e900..88e0a19 100644 --- a/qmake/inc/core/framelesshelper.version +++ b/qmake/inc/core/framelesshelper.version @@ -35,9 +35,9 @@ [[maybe_unused]] inline constexpr const int FRAMELESSHELPER_VERSION_MAJOR = 2; [[maybe_unused]] inline constexpr const int FRAMELESSHELPER_VERSION_MINOR = 3; -[[maybe_unused]] inline constexpr const int FRAMELESSHELPER_VERSION_PATCH = 4; +[[maybe_unused]] inline constexpr const int FRAMELESSHELPER_VERSION_PATCH = 5; [[maybe_unused]] inline constexpr const int FRAMELESSHELPER_VERSION_TWEAK = 0; -[[maybe_unused]] inline constexpr const char FRAMELESSHELPER_VERSION_STR[] = "2.3.4.0\0"; +[[maybe_unused]] inline constexpr const char FRAMELESSHELPER_VERSION_STR[] = "2.3.5.0\0"; [[maybe_unused]] inline constexpr const char FRAMELESSHELPER_COMMIT_STR[] = "UNKNOWN\0"; [[maybe_unused]] inline constexpr const char FRAMELESSHELPER_COMPILE_DATETIME_STR[] = "UNKNOWN\0"; diff --git a/src/core/framelesshelper_win.cpp b/src/core/framelesshelper_win.cpp index 2d66d59..38c6ffe 100644 --- a/src/core/framelesshelper_win.cpp +++ b/src/core/framelesshelper_win.cpp @@ -1138,14 +1138,12 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me return true; // Jump over Qt's wrong handling logic. } const QSizeF oldSize = {qreal(clientRect.right - clientRect.left), qreal(clientRect.bottom - clientRect.top)}; - const UINT oldDpi = data.dpi.x; static constexpr const auto defaultDpi = qreal(USER_DEFAULT_SCREEN_DPI); // We need to round the scale factor according to Qt's rounding policy. - const qreal oldDpr = Utils::roundScaleFactor(qreal(oldDpi) / defaultDpi); - const QSizeF unscaledSize = (oldSize / oldDpr); + const qreal oldDpr = Utils::roundScaleFactor(qreal(data.dpi.x) / defaultDpi); const auto newDpi = UINT(wParam); const qreal newDpr = Utils::roundScaleFactor(qreal(newDpi) / defaultDpi); - const QSizeF newSize = (unscaledSize * newDpr); + const QSizeF newSize = (oldSize / oldDpr * newDpr); const auto suggestedSize = reinterpret_cast(lParam); suggestedSize->cx = qRound(newSize.width()); suggestedSize->cy = qRound(newSize.height()); @@ -1157,8 +1155,9 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me if (frameBorderVisible) { const int frameSizeX = Utils::getResizeBorderThicknessForDpi(true, newDpi); const int frameSizeY = Utils::getResizeBorderThicknessForDpi(false, newDpi); - suggestedSize->cx += (frameSizeX * 2); - suggestedSize->cy += frameSizeY; + suggestedSize->cx += (frameSizeX * 2); // The size of the two resize borders on the left and right edge. + suggestedSize->cy += frameSizeY; // Only add the bottom resize border. We don't have anything on the top edge. + // Both the top resize border and the title bar are in the client area. } *result = TRUE; // We have set our preferred window size, don't use the default linear DPI scaling. return true; // Jump over Qt's wrong handling logic. diff --git a/src/core/micamaterial.cpp b/src/core/micamaterial.cpp index f3145b4..aa5475b 100644 --- a/src/core/micamaterial.cpp +++ b/src/core/micamaterial.cpp @@ -72,7 +72,9 @@ static constexpr const qreal kDefaultBlurRadius = 128.0; static Q_CONSTEXPR2 const QColor kDefaultSystemLightColor2 = {243, 243, 243}; // #F3F3F3 +#ifndef FRAMELESSHELPER_CORE_NO_BUNDLE_RESOURCE FRAMELESSHELPER_STRING_CONSTANT2(NoiseImageFilePath, ":/org.wangwenx190.FramelessHelper/resources/images/noise.png") +#endif // FRAMELESSHELPER_CORE_NO_BUNDLE_RESOURCE struct MicaMaterialData {