mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-03-15 00:19:42 +08:00
Compare commits
No commits in common. "155307fe6a6a1006a59022fd547fb75eec853d3e" and "68462706e23a358c4193d2d30227698d0172f0ce" have entirely different histories.
155307fe6a
...
68462706e2
@ -73,7 +73,11 @@ if (WIN32)
|
|||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
list(APPEND sources_files ${PROJECT_NAME}.qrc)
|
#加快qrc编译
|
||||||
|
qt_add_big_resources(QRC_RESOURCES ${PROJECT_NAME}.qrc)
|
||||||
|
list(APPEND QRC_RESOURCES ${PROJECT_NAME}.qrc)
|
||||||
|
set_property(SOURCE ${PROJECT_NAME}.qrc PROPERTY SKIP_AUTORCC ON)
|
||||||
|
list(APPEND sources_files ${QRC_RESOURCES})
|
||||||
|
|
||||||
#添加可执行文件
|
#添加可执行文件
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
@ -32,9 +32,13 @@ add_custom_target(Script-UpdateTranslations
|
|||||||
SOURCES ${TS_FILE_PATHS}
|
SOURCES ${TS_FILE_PATHS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
qt_add_big_resources(QRC_RESOURCES qml.qrc)
|
||||||
|
list(APPEND QRC_RESOURCES qml.qrc)
|
||||||
|
set_property(SOURCE qml.qrc PROPERTY SKIP_AUTORCC ON)
|
||||||
|
|
||||||
set(PROJECT_SOURCES
|
set(PROJECT_SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
qml.qrc
|
${QRC_RESOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
||||||
|
@ -86,7 +86,7 @@ void FluFrameless::componentComplete() {
|
|||||||
int w = window()->width();
|
int w = window()->width();
|
||||||
int h = window()->height();
|
int h = window()->height();
|
||||||
_current = window()->winId();
|
_current = window()->winId();
|
||||||
window()->setFlags((window()->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint);
|
window()->setFlags((window()->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint | Qt::FramelessWindowHint);
|
||||||
if (!_fixSize) {
|
if (!_fixSize) {
|
||||||
window()->setFlag(Qt::WindowMaximizeButtonHint);
|
window()->setFlag(Qt::WindowMaximizeButtonHint);
|
||||||
}
|
}
|
||||||
@ -102,9 +102,6 @@ void FluFrameless::componentComplete() {
|
|||||||
setHitTestVisible(_closeButton);
|
setHitTestVisible(_closeButton);
|
||||||
}
|
}
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3))
|
|
||||||
qWarning()<<"Qt's own frameless bug, currently only exist in 6.5.3, please use other versions";
|
|
||||||
#endif
|
|
||||||
HWND hwnd = reinterpret_cast<HWND>(window()->winId());
|
HWND hwnd = reinterpret_cast<HWND>(window()->winId());
|
||||||
DWORD style = ::GetWindowLongPtr(hwnd, GWL_STYLE);
|
DWORD style = ::GetWindowLongPtr(hwnd, GWL_STYLE);
|
||||||
if (_fixSize) {
|
if (_fixSize) {
|
||||||
@ -178,21 +175,10 @@ void FluFrameless::componentComplete() {
|
|||||||
*result = hitTestResult;
|
*result = hitTestResult;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool isMaximum = ::IsZoomed(hwnd);
|
clientRect->top = originalTop;
|
||||||
if (isMaximum) {
|
clientRect->bottom = originalBottom;
|
||||||
auto geometry = window()->screen()->geometry();
|
clientRect->left = originalLeft;
|
||||||
auto offsetX = qAbs(geometry.left() - originalLeft);
|
clientRect->right = originalRight;
|
||||||
auto offsetY = qAbs(geometry.top() - originalTop);
|
|
||||||
clientRect->top = originalTop + offsetY;
|
|
||||||
clientRect->bottom = originalBottom - offsetY;
|
|
||||||
clientRect->left = originalLeft + offsetX;
|
|
||||||
clientRect->right = originalRight - offsetX;
|
|
||||||
} else {
|
|
||||||
clientRect->top = originalTop;
|
|
||||||
clientRect->bottom = originalBottom;
|
|
||||||
clientRect->left = originalLeft;
|
|
||||||
clientRect->right = originalRight;
|
|
||||||
}
|
|
||||||
_setMaximizeHovered(false);
|
_setMaximizeHovered(false);
|
||||||
*result = WVR_REDRAW;
|
*result = WVR_REDRAW;
|
||||||
return true;
|
return true;
|
||||||
@ -255,6 +241,17 @@ void FluFrameless::componentComplete() {
|
|||||||
} else if (uMsg == WM_NCACTIVATE) {
|
} else if (uMsg == WM_NCACTIVATE) {
|
||||||
*result = TRUE;
|
*result = TRUE;
|
||||||
return true;
|
return true;
|
||||||
|
} else if (uMsg == WM_GETMINMAXINFO) {
|
||||||
|
auto *minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
|
||||||
|
auto pixelRatio = window()->devicePixelRatio();
|
||||||
|
auto geometry = window()->screen()->availableGeometry();
|
||||||
|
RECT rect;
|
||||||
|
SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, 0);
|
||||||
|
minmaxInfo->ptMaxPosition.x = rect.left;
|
||||||
|
minmaxInfo->ptMaxPosition.y = rect.top;
|
||||||
|
minmaxInfo->ptMaxSize.x = qRound(geometry.width() * pixelRatio);
|
||||||
|
minmaxInfo->ptMaxSize.y = qRound(geometry.height() * pixelRatio);
|
||||||
|
return false;
|
||||||
} else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN)) {
|
} else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN)) {
|
||||||
if (_hitMaximizeButton()) {
|
if (_hitMaximizeButton()) {
|
||||||
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user