mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-10-30 15:57:37 +08:00
update
This commit is contained in:
parent
eb4ec242b1
commit
c2b845658d
@ -3,6 +3,7 @@
|
||||
#include <QQuickWindow>
|
||||
#include <QGuiApplication>
|
||||
#include <QScreen>
|
||||
#include <QDateTime>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#pragma comment (lib,"user32.lib")
|
||||
@ -62,9 +63,6 @@ void FluFrameless::componentComplete(){
|
||||
}
|
||||
window()->installEventFilter(this);
|
||||
qApp->installNativeEventFilter(this);
|
||||
if(_appbar){
|
||||
_appbar->installEventFilter(this);
|
||||
}
|
||||
if(_maximizeButton){
|
||||
setHitTestVisible(_maximizeButton);
|
||||
}
|
||||
@ -425,7 +423,18 @@ bool FluFrameless::eventFilter(QObject *obj, QEvent *ev){
|
||||
}
|
||||
}else{
|
||||
if(_hitAppBar()){
|
||||
window()->startSystemMove();
|
||||
qint64 clickTimer = QDateTime::currentMSecsSinceEpoch();
|
||||
qint64 offset = clickTimer - this->_clickTimer;
|
||||
this->_clickTimer = clickTimer;
|
||||
if(offset<300){
|
||||
if(_isMaximized()){
|
||||
showNormal();
|
||||
}else{
|
||||
showMaximized();
|
||||
}
|
||||
}else{
|
||||
window()->startSystemMove();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -54,6 +54,7 @@ private:
|
||||
qint64 _current;
|
||||
int _edges = 0;
|
||||
int _margins = 8;
|
||||
qint64 _clickTimer = 0;
|
||||
QList<QPointer<QQuickItem>> _hitTestList;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user