mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-02-24 03:44:50 +08:00
update
This commit is contained in:
parent
6b6dbf27a1
commit
863c88411b
@ -83,7 +83,6 @@ FluScrollablePage{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onClicked: {
|
||||
FluApp.useSystemAppBar = !FluApp.useSystemAppBar
|
||||
dialog_restart.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,6 @@ FluScrollablePage{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onClicked: {
|
||||
FluApp.useSystemAppBar = !FluApp.useSystemAppBar
|
||||
dialog_restart.open()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -124,7 +124,6 @@ endif()
|
||||
#去掉mingw生成的动态库libxxx前缀lib,不去掉前缀会导致 module "FluentUI" plugin "fluentuiplugin" not found
|
||||
if(MINGW)
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX ".debug")
|
||||
endif()
|
||||
|
||||
#MSVC Debug 添加后缀d,与Qt插件风格保持一致
|
||||
|
@ -15,39 +15,14 @@
|
||||
#include <winuser.h>
|
||||
#include <dwmapi.h>
|
||||
#include <codecvt>
|
||||
|
||||
#include <cmath>
|
||||
static inline QByteArray qtNativeEventType()
|
||||
{
|
||||
static const auto result = "windows_generic_MSG";
|
||||
return result;
|
||||
}
|
||||
|
||||
int getSystemMetrics2(const WId windowId, const int index, const bool scaled){
|
||||
Q_ASSERT(windowId);
|
||||
if (!windowId) {
|
||||
return 0;
|
||||
}
|
||||
const UINT realDpi = GetDpiForWindow(reinterpret_cast<HWND>(windowId));
|
||||
{
|
||||
const UINT dpi = (scaled ? realDpi : USER_DEFAULT_SCREEN_DPI);
|
||||
if (const int result = GetSystemMetricsForDpi(index, dpi); result > 0) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
const qreal dpr = (scaled ? qreal(1) : (qreal(realDpi) / qreal(USER_DEFAULT_SCREEN_DPI)));
|
||||
return std::round(qreal(::GetSystemMetrics(index)) / dpr);
|
||||
}
|
||||
|
||||
quint32 getResizeBorderThickness(const WId windowId, const bool scaled){
|
||||
if (!windowId) {
|
||||
return 0;
|
||||
}
|
||||
return getSystemMetrics2(windowId, SM_CXSIZEFRAME, scaled) + getSystemMetrics2(windowId, SM_CXPADDEDBORDER, scaled);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
FramelessEventFilter::FramelessEventFilter(QQuickWindow* window){
|
||||
_window = window;
|
||||
_current = window->winId();
|
||||
@ -73,7 +48,7 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
|
||||
return false;
|
||||
}
|
||||
const LPARAM lParam = msg->lParam;
|
||||
const int borderPadding = getResizeBorderThickness(_window->winId(), true);
|
||||
const int borderPadding = 8;
|
||||
if (uMsg == WM_NCCALCSIZE) {
|
||||
if (_window->visibility() == QWindow::FullScreen) {
|
||||
NCCALCSIZE_PARAMS* sz = reinterpret_cast<NCCALCSIZE_PARAMS*>(lParam);
|
||||
@ -256,9 +231,9 @@ void FluFrameless::componentComplete(){
|
||||
if(!_window.isNull()){
|
||||
_nativeEvent =new FramelessEventFilter(_window);
|
||||
qApp->installNativeEventFilter(_nativeEvent);
|
||||
MARGINS margins[2]{{0, 0, 0, 0}, {0, 0, 1, 0}};
|
||||
HWND hWnd = reinterpret_cast<HWND>(_window->winId());
|
||||
DwmExtendFrameIntoClientArea(hWnd, &margins[false]);
|
||||
// MARGINS margins[2]{{0, 0, 0, 0}, {0, 0, 1, 0}};
|
||||
// HWND hWnd = reinterpret_cast<HWND>(_window->winId());
|
||||
// DwmExtendFrameIntoClientArea(hWnd, &margins[false]);
|
||||
refresLayout();
|
||||
connect(_window,&QWindow::visibilityChanged,this,[=](QWindow::Visibility visibility){ refresLayout(); });
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ Window {
|
||||
property bool showMinimize: true
|
||||
property bool showMaximize: true
|
||||
property bool showStayTop: true
|
||||
flags: Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint
|
||||
flags: Qt.Window | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint
|
||||
property bool autoMaximize: false
|
||||
property var closeListener: function(event){
|
||||
if(closeDestory){
|
||||
|
Loading…
x
Reference in New Issue
Block a user