Compare commits

..

No commits in common. "af6e39d8c0662524ab0ba45d5c10e889835a1ca6" and "2bd0a831e7fdfd1b1ba91866a3df17385bed6df9" have entirely different histories.

7 changed files with 18 additions and 20 deletions

View File

@ -30,7 +30,6 @@ SolidCompression=yes
WizardStyle=modern
UninstallDisplayIcon={app}\{#MyAppExeName}
SetupIconFile=.\..\favicon.ico
MinVersion = 6.0
[Languages]
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"

View File

@ -6,6 +6,7 @@ project(example VERSION 1.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#exmapleQMLimport example
set(QML_IMPORT_PATH ${CMAKE_BINARY_DIR}/example CACHE STRING "Qt Creator extra QML import paths" FORCE)

View File

@ -10,6 +10,7 @@ endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (FLUENTUI_BUILD_STATIC_LIB)
add_definitions(-DFLUENTUI_BUILD_STATIC_LIB)
endif()

View File

@ -73,11 +73,16 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
}
return false;
}else if(uMsg == WM_NCACTIVATE){
if(!isCompositionEnabled()){
*result = 1;
return true;
if(isCompositionEnabled()){
*result = DefWindowProc(hwnd, uMsg, wParam, -1);
}else{
if (wParam == FALSE) {
*result = TRUE;
} else {
*result = FALSE;
}
return false;
}
return true;
}
return false;
#endif
@ -192,8 +197,6 @@ void FluFrameless::componentComplete(){
DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
SetWindowLongPtr(hwnd,GWL_STYLE,style &~ WS_SYSMENU);
SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE |SWP_FRAMECHANGED);
_stayTop = QQmlProperty(_window,"stayTop");
_stayTop.connectNotifySignal(this,SLOT(_stayTopChange()));
#else
_window->setFlag(Qt::FramelessWindowHint,true);
#endif
@ -201,14 +204,6 @@ void FluFrameless::componentComplete(){
}
}
void FluFrameless::_stayTopChange(){
#ifdef Q_OS_WIN
HWND hwnd = reinterpret_cast<HWND>(_window->winId());
DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
SetWindowLongPtr(hwnd,GWL_STYLE,style &~ WS_SYSMENU);
#endif
}
FluFrameless::~FluFrameless(){
if (!_window.isNull()) {
_window->removeEventFilter(this);

View File

@ -5,7 +5,6 @@
#include <QQuickWindow>
#include <QtQml/qqml.h>
#include <QAbstractNativeEventFilter>
#include <QQmlProperty>
#include "stdafx.h"
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
@ -29,6 +28,7 @@ public:
class FluFrameless : public QObject, public QQmlParserStatus
{
Q_OBJECT
Q_PROPERTY_AUTO(bool,stayTop)
QML_NAMED_ELEMENT(FluFrameless)
public:
explicit FluFrameless(QObject *parent = nullptr);
@ -39,11 +39,9 @@ protected:
bool eventFilter(QObject *obj, QEvent *event) override;
private:
void updateCursor(int edges);
Q_SLOT void _stayTopChange();
private:
QPointer<QQuickWindow> _window = nullptr;
FramelessEventFilter* _nativeEvent = nullptr;
QQmlProperty _stayTop;
};
#endif // FLUFRAMELESS_H

View File

@ -112,7 +112,9 @@ Window {
}
Component{
id:com_frameless
FluFrameless{}
FluFrameless{
stayTop: window.stayTop
}
}
Component{
id:com_background

View File

@ -111,7 +111,9 @@ Window {
}
Component{
id:com_frameless
FluFrameless{}
FluFrameless{
stayTop: window.stayTop
}
}
Component{
id:com_background