Sine Striker
2023-12-22 555a8181fff96271812476f2169f2713d7734f4b
Add conditional compile options to Quick
3个文件已修改
12 ■■■■■ 已修改文件
CMakeLists.txt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/quick/quickwindowagent_win.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/widgets/widgetwindowagent_win.cpp 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CMakeLists.txt
@@ -14,7 +14,7 @@
option(QWINDOWKIT_ENABLE_QT_WINDOW_CONTEXT "Enable Qt Window Context anyway" OFF)
option(QWINDOWKIT_ENABLE_STYLE_AGENT "Enable building style agent" ON)
option(QWINDOWKIT_ENABLE_WINDOWS_SYSTEM_BORDER "Disable system border on Windows" ON)
option(QWINDOWKIT_ENABLE_WINDOWS_SYSTEM_BORDER "Enable system border on Windows" ON)
# ----------------------------------
# CMake Settings
src/quick/quickwindowagent_win.cpp
@@ -3,10 +3,13 @@
#include <QtQuick/QQuickPaintedItem>
#include <QtQuick/private/qquickitem_p.h>
#include <QWKCore/qwindowkit_windows.h>
#include <QWKCore/qwkconfig.h>
#include <QWKCore/private/nativeeventfilter_p.h>
namespace QWK {
#if QWINDOWKIT_CONFIG(ENABLE_WINDOWS_SYSTEM_BORDER)
    class BorderItem : public QQuickPaintedItem, public NativeEventFilter {
    public:
        explicit BorderItem(QQuickItem *parent, AbstractWindowContext *context);
@@ -109,13 +112,16 @@
    void BorderItem::_q_windowActivityChanged() {
        update();
    }
#endif
    void QuickWindowAgentPrivate::setupWindows10BorderWorkaround() {
#if QWINDOWKIT_CONFIG(ENABLE_WINDOWS_SYSTEM_BORDER)
        // Install painting hook
        auto ctx = context.get();
        if (ctx->property("needBorderPainter").toBool()) {
            std::ignore = new BorderItem(hostWindow->contentItem(), ctx);
        }
#endif
    }
}
src/widgets/widgetwindowagent_win.cpp
@@ -1,11 +1,9 @@
#include "widgetwindowagent_p.h"
#include <QWKCore/qwkconfig.h>
#include <QWKCore/qwkglobal.h>
#include <QtGui/QPainter>
#include <QWKCore/qwindowkit_windows.h>
#include <QWKCore/qwkconfig.h>
#include <QWKCore/private/nativeeventfilter_p.h>
namespace QWK {