From 824b0746c137ef7ee63f9689a81e6223565fcee1 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Mon, 21 Feb 2022 11:05:00 +0800 Subject: [PATCH] Win32: remove unnecessary code Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- utilities_win32.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/utilities_win32.cpp b/utilities_win32.cpp index b4ba954..aa3b7e4 100644 --- a/utilities_win32.cpp +++ b/utilities_win32.cpp @@ -302,12 +302,9 @@ void Utilities::updateQtFrameMargins(QWindow *window, const bool enable) if (!window) { return; } - const bool useCustomFrameMargin = (enable && (window->windowState() != Qt::WindowMaximized) - && (window->windowState() != Qt::WindowFullScreen)); - const int resizeBorderThickness = useCustomFrameMargin ? - Utilities::getSystemMetric(window, SystemMetric::ResizeBorderThickness, true, true) : 0; + const int resizeBorderThickness = enable ? Utilities::getSystemMetric(window, SystemMetric::ResizeBorderThickness, true, true) : 0; const int titleBarHeight = enable ? Utilities::getSystemMetric(window, SystemMetric::TitleBarHeight, true, true) : 0; - const QMargins margins = {-resizeBorderThickness, -titleBarHeight, -resizeBorderThickness, -resizeBorderThickness}; // left, top, right, bottom + const QMargins margins = {-resizeBorderThickness, -titleBarHeight, -resizeBorderThickness, -resizeBorderThickness}; const QVariant marginsVar = QVariant::fromValue(margins); window->setProperty("_q_windowsCustomMargins", marginsVar); #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))