Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
朱子楚\zhuzi committed Apr 23, 2024
1 parent c7de653 commit b8ef916
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/FluFrameless.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ void FluFrameless::componentComplete() {
auto geometry = window()->screen()->availableGeometry();
RECT rect;
SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
minmaxInfo->ptMinTrackSize.x = window()->minimumWidth() * pixelRatio + offsetXY.x();
minmaxInfo->ptMinTrackSize.y = window()->minimumHeight() * pixelRatio + offsetXY.y() + _appbar->height() * pixelRatio;
minmaxInfo->ptMaxPosition.x = rect.left - offsetXY.x();
minmaxInfo->ptMaxPosition.y = rect.top - offsetXY.x();
minmaxInfo->ptMaxSize.x = qRound(geometry.width() * pixelRatio) + offsetXY.x() * 2;
Expand Down Expand Up @@ -429,7 +431,6 @@ void FluFrameless::setHitTestVisible(QQuickItem *val) {
}
}


void FluFrameless::_setWindowTopmost(bool topmost) {
#ifdef Q_OS_WIN
HWND hwnd = reinterpret_cast<HWND>(window()->winId());
Expand Down
6 changes: 3 additions & 3 deletions src/Qt5/imports/FluentUI/Controls/FluWindowDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ FluWindow {
}
}
}
function showDialog(){
var x = transientParent.x + (transientParent.width - width)/2
var y = transientParent.y + (transientParent.height - height)/2
function showDialog(offsetX=0,offsetY=0){
var x = transientParent.x + (transientParent.width - width)/2 + offsetX
var y = transientParent.y + (transientParent.height - height)/2 + offsetY
control.stayTop = Qt.binding(function(){return transientParent.stayTop})
control.setGeometry(x,y,width,height)
control.visibility = Window.Windowed
Expand Down
6 changes: 3 additions & 3 deletions src/Qt6/imports/FluentUI/Controls/FluWindowDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ FluWindow {
}
}
}
function showDialog(){
var x = transientParent.x + (transientParent.width - width)/2
var y = transientParent.y + (transientParent.height - height)/2
function showDialog(offsetX=0,offsetY=0){
var x = transientParent.x + (transientParent.width - width)/2 + offsetX
var y = transientParent.y + (transientParent.height - height)/2 + offsetY
control.stayTop = Qt.binding(function(){return transientParent.stayTop})
control.setGeometry(x,y,width,height)
control.visibility = Window.Windowed
Expand Down

0 comments on commit b8ef916

Please sign in to comment.