Compare commits
No commits in common. "2f1689acd0313a38ce9e5ef396e4464384b37954" and "62aead3855dc38f922d3e526c5d7f5709d13b8a9" have entirely different histories.
2f1689acd0
...
62aead3855
|
@ -14,7 +14,6 @@ FluWindow {
|
||||||
fixSize: true
|
fixSize: true
|
||||||
showMinimize: false
|
showMinimize: false
|
||||||
showStayTop: false
|
showStayTop: false
|
||||||
stayTop:true
|
|
||||||
|
|
||||||
property string crashFilePath
|
property string crashFilePath
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ FluWindow {
|
||||||
fixSize: true
|
fixSize: true
|
||||||
showMinimize: false
|
showMinimize: false
|
||||||
showStayTop: false
|
showStayTop: false
|
||||||
stayTop:true
|
|
||||||
|
|
||||||
property string crashFilePath
|
property string crashFilePath
|
||||||
|
|
||||||
|
|
|
@ -112,18 +112,16 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
*result = 0;
|
*result = 0;
|
||||||
POINT nativeGlobalPos{GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
|
short x = LOWORD(msg->lParam);
|
||||||
POINT nativeLocalPos = nativeGlobalPos;
|
short y = HIWORD(msg->lParam);
|
||||||
::ScreenToClient(hwnd, &nativeLocalPos);
|
|
||||||
RECT clientRect{0, 0, 0, 0};
|
|
||||||
::GetClientRect(hwnd, &clientRect);
|
|
||||||
auto clientWidth = clientRect.right-clientRect.left;
|
|
||||||
auto clientHeight = clientRect.bottom-clientRect.top;
|
|
||||||
int margins = _helper->getMargins();
|
int margins = _helper->getMargins();
|
||||||
bool left = nativeLocalPos.x < margins;
|
QPointer<QQuickWindow> win = _helper->window;
|
||||||
bool right = nativeLocalPos.x > clientWidth - margins;
|
qreal dp = _helper->window->devicePixelRatio();
|
||||||
bool top = nativeLocalPos.y < margins;
|
QPoint pos = win->mapFromGlobal(QPoint(x/dp, y/dp));
|
||||||
bool bottom = nativeLocalPos.y > clientHeight - margins;
|
bool left = pos.x() < margins;
|
||||||
|
bool right = pos.x() > win->width() - margins;
|
||||||
|
bool top = pos.y() < margins;
|
||||||
|
bool bottom = pos.y() > win->height() - margins;
|
||||||
*result = 0;
|
*result = 0;
|
||||||
if (_helper->resizeable() && !_helper->fullScreen() && !_helper->maximized()) {
|
if (_helper->resizeable() && !_helper->fullScreen() && !_helper->maximized()) {
|
||||||
if (left && top) {
|
if (left && top) {
|
||||||
|
@ -148,9 +146,17 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
QVariant appBar = _helper->getAppBar();
|
QVariant appBar = _helper->getAppBar();
|
||||||
if(!appBar.isNull()&& _helper->hoverAppBar()){
|
if(!appBar.isNull()){
|
||||||
*result = HTCAPTION;
|
auto item = appBar.value<QQuickItem*>();
|
||||||
return true;
|
if(item->contains(pos)){
|
||||||
|
QPoint appBarTopLeft = item->mapToItem(_helper->window->contentItem(),QPoint(0, 0)).toPoint();
|
||||||
|
QRect rcAppBar = QRect(appBarTopLeft, QSize(item->width(), item->height()));
|
||||||
|
if (rcAppBar.contains(pos) && _helper->hoverAppBar())
|
||||||
|
{
|
||||||
|
*result = HTCAPTION;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*result = HTCLIENT;
|
*result = HTCLIENT;
|
||||||
return true;
|
return true;
|
||||||
|
@ -174,7 +180,7 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
|
||||||
*result = DefWindowProcW(hwnd, WM_NCACTIVATE, wParam, -1);
|
*result = DefWindowProcW(hwnd, WM_NCACTIVATE, wParam, -1);
|
||||||
return true;
|
return true;
|
||||||
}else if(uMsg == WM_GETMINMAXINFO){
|
}else if(uMsg == WM_GETMINMAXINFO){
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6,2,4)
|
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||||
MINMAXINFO* minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
|
MINMAXINFO* minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
|
||||||
auto pixelRatio = _helper->window->devicePixelRatio();
|
auto pixelRatio = _helper->window->devicePixelRatio();
|
||||||
auto geometry = _helper->window->screen()->availableGeometry();
|
auto geometry = _helper->window->screen()->availableGeometry();
|
||||||
|
|
|
@ -94,14 +94,6 @@ Rectangle{
|
||||||
}
|
}
|
||||||
property bool isRestore: win && Window.Maximized === win.visibility
|
property bool isRestore: win && Window.Maximized === win.visibility
|
||||||
property bool resizable: win && !(win.height === win.maximumHeight && win.height === win.minimumHeight && win.width === win.maximumWidth && win.width === win.minimumWidth)
|
property bool resizable: win && !(win.height === win.maximumHeight && win.height === win.minimumHeight && win.width === win.maximumWidth && win.width === win.minimumWidth)
|
||||||
function containsPointToItem(point,item){
|
|
||||||
var pos = item.mapToGlobal(0,0)
|
|
||||||
var rect = Qt.rect(pos.x,pos.y,item.width,item.height)
|
|
||||||
if(point.x>rect.x && point.x<(rect.x+rect.width) && point.y>rect.y && point.y<(rect.y+rect.height)){
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:mouse_app_bar
|
id:mouse_app_bar
|
||||||
|
@ -291,28 +283,30 @@ Rectangle{
|
||||||
}
|
}
|
||||||
function _maximizeButtonHover(){
|
function _maximizeButtonHover(){
|
||||||
var hover = false
|
var hover = false
|
||||||
|
var pos = btn_maximize.mapToGlobal(0,0)
|
||||||
if(btn_maximize.visible){
|
if(btn_maximize.visible){
|
||||||
if(d.containsPointToItem(FluTools.cursorPos(),btn_maximize)){
|
var rect = Qt.rect(pos.x,pos.y,btn_maximize.width,btn_maximize.height)
|
||||||
hover = true
|
pos = FluTools.cursorPos()
|
||||||
|
if(pos.x>rect.x && pos.x<(rect.x+rect.width) && pos.y>rect.y && pos.y<(rect.y+rect.height)){
|
||||||
|
hover = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d.hoverMaxBtn = hover
|
d.hoverMaxBtn = hover
|
||||||
return hover;
|
return hover;
|
||||||
}
|
}
|
||||||
function _appBarHover(){
|
function _appBarHover(){
|
||||||
var cursorPos = FluTools.cursorPos()
|
|
||||||
for(var i =0 ;i< d.hitTestList.length; i++){
|
for(var i =0 ;i< d.hitTestList.length; i++){
|
||||||
var item = d.hitTestList[i]
|
var item = d.hitTestList[i]
|
||||||
|
var pos = item.mapToGlobal(0,0)
|
||||||
if(item.visible){
|
if(item.visible){
|
||||||
if(d.containsPointToItem(cursorPos,item)){
|
var rect = Qt.rect(pos.x,pos.y,item.width,item.height)
|
||||||
|
pos = FluTools.cursorPos()
|
||||||
|
if(pos.x>rect.x && pos.x<(rect.x+rect.width) && pos.y>rect.y && pos.y<(rect.y+rect.height)){
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(d.containsPointToItem(cursorPos,control)){
|
return true
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
function setHitTestVisible(id){
|
function setHitTestVisible(id){
|
||||||
d.hitTestList.push(id)
|
d.hitTestList.push(id)
|
||||||
|
|
|
@ -66,7 +66,7 @@ Rectangle{
|
||||||
return true
|
return true
|
||||||
return count!==0
|
return count!==0
|
||||||
}
|
}
|
||||||
FluText{
|
Text{
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: Qt.rgba(1,1,1,1)
|
color: Qt.rgba(1,1,1,1)
|
||||||
visible: !isDot
|
visible: !isDot
|
||||||
|
|
|
@ -94,14 +94,6 @@ Rectangle{
|
||||||
}
|
}
|
||||||
property bool isRestore: win && Window.Maximized === win.visibility
|
property bool isRestore: win && Window.Maximized === win.visibility
|
||||||
property bool resizable: win && !(win.height === win.maximumHeight && win.height === win.minimumHeight && win.width === win.maximumWidth && win.width === win.minimumWidth)
|
property bool resizable: win && !(win.height === win.maximumHeight && win.height === win.minimumHeight && win.width === win.maximumWidth && win.width === win.minimumWidth)
|
||||||
function containsPointToItem(point,item){
|
|
||||||
var pos = item.mapToGlobal(0,0)
|
|
||||||
var rect = Qt.rect(pos.x,pos.y,item.width,item.height)
|
|
||||||
if(point.x>rect.x && point.x<(rect.x+rect.width) && point.y>rect.y && point.y<(rect.y+rect.height)){
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
id:mouse_app_bar
|
id:mouse_app_bar
|
||||||
|
@ -291,28 +283,30 @@ Rectangle{
|
||||||
}
|
}
|
||||||
function _maximizeButtonHover(){
|
function _maximizeButtonHover(){
|
||||||
var hover = false
|
var hover = false
|
||||||
|
var pos = btn_maximize.mapToGlobal(0,0)
|
||||||
if(btn_maximize.visible){
|
if(btn_maximize.visible){
|
||||||
if(d.containsPointToItem(FluTools.cursorPos(),btn_maximize)){
|
var rect = Qt.rect(pos.x,pos.y,btn_maximize.width,btn_maximize.height)
|
||||||
hover = true
|
pos = FluTools.cursorPos()
|
||||||
|
if(pos.x>rect.x && pos.x<(rect.x+rect.width) && pos.y>rect.y && pos.y<(rect.y+rect.height)){
|
||||||
|
hover = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d.hoverMaxBtn = hover
|
d.hoverMaxBtn = hover
|
||||||
return hover;
|
return hover;
|
||||||
}
|
}
|
||||||
function _appBarHover(){
|
function _appBarHover(){
|
||||||
var cursorPos = FluTools.cursorPos()
|
|
||||||
for(var i =0 ;i< d.hitTestList.length; i++){
|
for(var i =0 ;i< d.hitTestList.length; i++){
|
||||||
var item = d.hitTestList[i]
|
var item = d.hitTestList[i]
|
||||||
|
var pos = item.mapToGlobal(0,0)
|
||||||
if(item.visible){
|
if(item.visible){
|
||||||
if(d.containsPointToItem(cursorPos,item)){
|
var rect = Qt.rect(pos.x,pos.y,item.width,item.height)
|
||||||
|
pos = FluTools.cursorPos()
|
||||||
|
if(pos.x>rect.x && pos.x<(rect.x+rect.width) && pos.y>rect.y && pos.y<(rect.y+rect.height)){
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(d.containsPointToItem(cursorPos,control)){
|
return true
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
function setHitTestVisible(id){
|
function setHitTestVisible(id){
|
||||||
d.hitTestList.push(id)
|
d.hitTestList.push(id)
|
||||||
|
|
|
@ -66,7 +66,7 @@ Rectangle{
|
||||||
return true
|
return true
|
||||||
return count!==0
|
return count!==0
|
||||||
}
|
}
|
||||||
FluText{
|
Text{
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: Qt.rgba(1,1,1,1)
|
color: Qt.rgba(1,1,1,1)
|
||||||
visible: !isDot
|
visible: !isDot
|
||||||
|
|
Loading…
Reference in New Issue