forked from github_mirror/framelesshelper
Minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
4cba3a4dd4
commit
d4a5239d26
|
@ -32,6 +32,8 @@
|
|||
/*
|
||||
* Copied from https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/effects/qpixmapfilter.cpp
|
||||
* With minor modifications, most of them are format changes.
|
||||
* They are exported functions of Qt, we can make use of them directly, but they are in the QtWidgets
|
||||
* module, I don't want our library have such a dependency.
|
||||
*/
|
||||
|
||||
#ifndef AVG
|
||||
|
@ -328,6 +330,8 @@ void Utilities::blurImage(QImage &blurImage, const qreal radius, const bool qual
|
|||
/*
|
||||
* Copied from https://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/styles/qstyle.cpp
|
||||
* With minor modifications, most of them are format changes.
|
||||
* They are exported functions of Qt, we can make use of them directly, but they are in the QtWidgets
|
||||
* module, I don't want our library have such a dependency.
|
||||
*/
|
||||
|
||||
static inline Qt::Alignment visualAlignment(const Qt::LayoutDirection direction, const Qt::Alignment alignment)
|
||||
|
|
|
@ -809,7 +809,9 @@ void Utilities::updateQtFrameMargins(QWindow *window, const bool enable)
|
|||
return;
|
||||
}
|
||||
const int tbh = enable ? Utilities::getSystemMetric(window, Utilities::SystemMetric::TitleBarHeight, true, true) : 0;
|
||||
const QMargins margins = {0, -tbh, 0, 0};
|
||||
const int bw = enable ? Utilities::getSystemMetric(window, Utilities::SystemMetric::BorderWidth, true, true) : 0;
|
||||
const int bh = enable ? Utilities::getSystemMetric(window, Utilities::SystemMetric::BorderHeight, true, true) : 0;
|
||||
const QMargins margins = {-bw, -tbh, -bw, -bh}; // left, top, right, bottom
|
||||
const QVariant marginsVar = QVariant::fromValue(margins);
|
||||
window->setProperty("_q_windowsCustomMargins", marginsVar);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
|
|
Loading…
Reference in New Issue