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;
|
*result = HTCLIENT;
|
||||||
return true;
|
return true;
|
||||||
}else if(uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN){
|
}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);
|
QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
||||||
QGuiApplication::sendEvent(_helper->maximizeButton(),&event);
|
QGuiApplication::sendEvent(_helper->maximizeButton(),&event);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}else if(uMsg == WM_NCLBUTTONUP || uMsg == WM_NCRBUTTONUP){
|
}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);
|
QMouseEvent event = QMouseEvent(QEvent::MouseButtonRelease, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
||||||
QGuiApplication::sendEvent(_helper->maximizeButton(),&event);
|
QGuiApplication::sendEvent(_helper->maximizeButton(),&event);
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}else if(uMsg == WM_NCPAINT){
|
}else if(uMsg == WM_NCPAINT){
|
||||||
*result = FALSE;
|
*result = FALSE;
|
||||||
return true;
|
return true;
|
||||||
|
@ -253,7 +253,7 @@ Rectangle{
|
|||||||
Layout.preferredHeight: 30
|
Layout.preferredHeight: 30
|
||||||
iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
|
iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
|
||||||
color: {
|
color: {
|
||||||
if(pressed){
|
if(down){
|
||||||
return maximizePressColor
|
return maximizePressColor
|
||||||
}
|
}
|
||||||
if(FluTools.isWindows11OrGreater()){
|
if(FluTools.isWindows11OrGreater()){
|
||||||
@ -291,9 +291,13 @@ Rectangle{
|
|||||||
}
|
}
|
||||||
function _maximizeButtonHover(){
|
function _maximizeButtonHover(){
|
||||||
var hover = false
|
var hover = false
|
||||||
if(btn_maximize.visible){
|
if(btn_maximize.visible && FluTools.isWindows11OrGreater() && d.resizable){
|
||||||
if(d.containsPointToItem(FluTools.cursorPos(),btn_maximize)){
|
if(d.containsPointToItem(FluTools.cursorPos(),btn_maximize)){
|
||||||
hover = true
|
hover = true
|
||||||
|
}else{
|
||||||
|
if(btn_maximize.down){
|
||||||
|
btn_maximize.down = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d.hoverMaxBtn = hover
|
d.hoverMaxBtn = hover
|
||||||
|
@ -253,7 +253,7 @@ Rectangle{
|
|||||||
Layout.preferredHeight: 30
|
Layout.preferredHeight: 30
|
||||||
iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
|
iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
|
||||||
color: {
|
color: {
|
||||||
if(pressed){
|
if(down){
|
||||||
return maximizePressColor
|
return maximizePressColor
|
||||||
}
|
}
|
||||||
if(FluTools.isWindows11OrGreater()){
|
if(FluTools.isWindows11OrGreater()){
|
||||||
@ -291,9 +291,13 @@ Rectangle{
|
|||||||
}
|
}
|
||||||
function _maximizeButtonHover(){
|
function _maximizeButtonHover(){
|
||||||
var hover = false
|
var hover = false
|
||||||
if(btn_maximize.visible){
|
if(btn_maximize.visible && FluTools.isWindows11OrGreater() && d.resizable){
|
||||||
if(d.containsPointToItem(FluTools.cursorPos(),btn_maximize)){
|
if(d.containsPointToItem(FluTools.cursorPos(),btn_maximize)){
|
||||||
hover = true
|
hover = true
|
||||||
|
}else{
|
||||||
|
if(btn_maximize.down){
|
||||||
|
btn_maximize.down = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d.hoverMaxBtn = hover
|
d.hoverMaxBtn = hover
|
||||||
|
Loading…
Reference in New Issue
Block a user