mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-01-23 04:14:35 +08:00
update
This commit is contained in:
parent
db89d2485c
commit
ea69589c0a
@ -155,18 +155,16 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
|
||||
*result = HTCLIENT;
|
||||
return true;
|
||||
}else if(uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN){
|
||||
if(FluTools::getInstance()->isWindows11OrGreater() && _helper->hoverMaxBtn() && _helper->resizeable()){
|
||||
if(_helper->hoverMaxBtn()){
|
||||
QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
||||
QGuiApplication::sendEvent(_helper->maximizeButton(),&event);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}else if(uMsg == WM_NCLBUTTONUP || uMsg == WM_NCRBUTTONUP){
|
||||
if(FluTools::getInstance()->isWindows11OrGreater() && _helper->hoverMaxBtn() && _helper->resizeable()){
|
||||
if(_helper->hoverMaxBtn()){
|
||||
QMouseEvent event = QMouseEvent(QEvent::MouseButtonRelease, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
||||
QGuiApplication::sendEvent(_helper->maximizeButton(),&event);
|
||||
}
|
||||
return false;
|
||||
}else if(uMsg == WM_NCPAINT){
|
||||
*result = FALSE;
|
||||
return true;
|
||||
|
@ -253,7 +253,7 @@ Rectangle{
|
||||
Layout.preferredHeight: 30
|
||||
iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
|
||||
color: {
|
||||
if(pressed){
|
||||
if(down){
|
||||
return maximizePressColor
|
||||
}
|
||||
if(FluTools.isWindows11OrGreater()){
|
||||
@ -291,9 +291,13 @@ Rectangle{
|
||||
}
|
||||
function _maximizeButtonHover(){
|
||||
var hover = false
|
||||
if(btn_maximize.visible){
|
||||
if(btn_maximize.visible && FluTools.isWindows11OrGreater() && d.resizable){
|
||||
if(d.containsPointToItem(FluTools.cursorPos(),btn_maximize)){
|
||||
hover = true
|
||||
}else{
|
||||
if(btn_maximize.down){
|
||||
btn_maximize.down = false
|
||||
}
|
||||
}
|
||||
}
|
||||
d.hoverMaxBtn = hover
|
||||
|
@ -253,7 +253,7 @@ Rectangle{
|
||||
Layout.preferredHeight: 30
|
||||
iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
|
||||
color: {
|
||||
if(pressed){
|
||||
if(down){
|
||||
return maximizePressColor
|
||||
}
|
||||
if(FluTools.isWindows11OrGreater()){
|
||||
@ -291,9 +291,13 @@ Rectangle{
|
||||
}
|
||||
function _maximizeButtonHover(){
|
||||
var hover = false
|
||||
if(btn_maximize.visible){
|
||||
if(btn_maximize.visible && FluTools.isWindows11OrGreater() && d.resizable){
|
||||
if(d.containsPointToItem(FluTools.cursorPos(),btn_maximize)){
|
||||
hover = true
|
||||
}else{
|
||||
if(btn_maximize.down){
|
||||
btn_maximize.down = false
|
||||
}
|
||||
}
|
||||
}
|
||||
d.hoverMaxBtn = hover
|
||||
|
Loading…
Reference in New Issue
Block a user