This commit is contained in:
朱子楚\zhuzi
2024-04-17 15:11:14 +08:00
parent c9c737f2fc
commit 1a0f2afee0
6 changed files with 72 additions and 63 deletions

View File

@ -67,6 +67,8 @@ void FluFrameless::componentComplete() {
if (_disabled) {
return;
}
int w = window()->width();
int h = window()->height();
_current = window()->winId();
window()->setFlags((window()->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint | Qt::FramelessWindowHint);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
@ -107,6 +109,12 @@ void FluFrameless::componentComplete() {
::RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
});
#endif
h = h + _appbar->height();
if(_fixSize){
window()->setMaximumSize(QSize(w,h));
window()->setMinimumSize(QSize(w,h));
}
window()->resize(QSize(w,h));
connect(this, &FluFrameless::topmostChanged, this, [this] {
_setWindowTopmost(topmost());
});

View File

@ -3,6 +3,7 @@
#include <QObject>
#include <QQuickItem>
#include <QAbstractNativeEventFilter>
#include <QQmlProperty>
#include "stdafx.h"
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))