From 0586c98f90866e4bc9f0dfe73aefb0a07c56697e Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周二, 12 12月 2023 15:44:14 +0800 Subject: [PATCH] Add win10 border handler --- src/core/contexts/abstractwindowcontext.cpp | 32 +++++++++++++------------------- 1 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/core/contexts/abstractwindowcontext.cpp b/src/core/contexts/abstractwindowcontext.cpp index d3e8c0f..3c902e9 100644 --- a/src/core/contexts/abstractwindowcontext.cpp +++ b/src/core/contexts/abstractwindowcontext.cpp @@ -180,31 +180,25 @@ void AbstractWindowContext::virtual_hook(int id, void *data) { switch (id) { - case NeedsDrawBordersHook: { - auto &result = *static_cast<bool *>(data); - result = false; - return; + case CentralizeHook: { + // TODO: Qt + break; } - case BorderThicknessHook: { - auto args = static_cast<void **>(data); - const bool requireNative = *static_cast<const bool *>(args[0]); - quint32 &thickness = *static_cast<quint32 *>(args[1]); - std::ignore = requireNative; - thickness = 1; - return; + case ShowSystemMenuHook: { + // TODO: Qt + break; } - case BorderColorsHook: { - auto arr = *reinterpret_cast<QList<QColor> *>(data); - arr.clear(); - arr.push_back(kSampleColorSet.activeLight); - arr.push_back(kSampleColorSet.activeDark); - arr.push_back(kSampleColorSet.inactiveLight); - arr.push_back(kSampleColorSet.inactiveDark); + case DefaultColorsHook: { + auto map = *reinterpret_cast<QMap<QString, QColor> *>(data); + map.clear(); + map.insert("activeLight", kSampleColorSet.activeLight); + map.insert("activeDark", kSampleColorSet.activeDark); + map.insert("inactiveLight", kSampleColorSet.inactiveLight); + map.insert("inactiveDark", kSampleColorSet.inactiveDark); return; } - default: break; } -- Gitblit v1.9.1