Compare commits
No commits in common. "5e384934033b6e28e4c5891be365ca9aad1f7497" and "d34751248603529ed2934403f19ebddc5f17e6f2" have entirely different histories.
5e38493403
...
d347512486
|
@ -20,6 +20,7 @@ FluWindow {
|
|||
launchMode: FluWindowType.SingleTask
|
||||
fitsAppBarWindows: true
|
||||
appBar: FluAppBar {
|
||||
width: window.width
|
||||
height: 30
|
||||
darkText: Lang.dark_mode
|
||||
showDark: true
|
||||
|
|
|
@ -23,6 +23,7 @@ FluWindow {
|
|||
launchMode: FluWindowType.SingleTask
|
||||
fitsAppBarWindows: true
|
||||
appBar: FluAppBar {
|
||||
width: window.width
|
||||
height: 30
|
||||
darkText: Lang.dark_mode
|
||||
showDark: true
|
||||
|
|
|
@ -46,10 +46,12 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
|
|||
}
|
||||
return false;
|
||||
}else if(uMsg == WM_NCCALCSIZE){
|
||||
NCCALCSIZE_PARAMS* sz = reinterpret_cast<NCCALCSIZE_PARAMS*>(msg->lParam);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||
NCCALCSIZE_PARAMS& sz = *reinterpret_cast<NCCALCSIZE_PARAMS*>(msg->lParam);
|
||||
*result = WVR_REDRAW;
|
||||
sz->rgrc[0].top -= 1;
|
||||
sz.rgrc[0].top -= 1;
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
|
@ -159,16 +161,10 @@ void FluFrameless::componentComplete(){
|
|||
#ifdef Q_OS_WIN
|
||||
_nativeEvent =new FramelessEventFilter(_window);
|
||||
qApp->installNativeEventFilter(_nativeEvent);
|
||||
HWND hwnd = reinterpret_cast<HWND>(_window->winId());
|
||||
ULONG_PTR cNewStyle = GetClassLongPtr(hwnd, GCL_STYLE) | CS_DROPSHADOW;
|
||||
SetClassLongPtr(hwnd, GCL_STYLE, cNewStyle);
|
||||
DWORD style = ::GetWindowLong(hwnd, GWL_STYLE);
|
||||
SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE |SWP_FRAMECHANGED);
|
||||
SetWindowLong(hwnd, GWL_STYLE, style | WS_THICKFRAME | WS_CAPTION);
|
||||
connect(this,&FluFrameless::stayTopChanged,this,[this,hwnd](){
|
||||
DWORD style = ::GetWindowLong(hwnd, GWL_STYLE);
|
||||
SetWindowLong(hwnd, GWL_STYLE, style | WS_THICKFRAME | WS_CAPTION);
|
||||
});
|
||||
HWND hWnd = reinterpret_cast<HWND>(_window->winId());
|
||||
ULONG_PTR cNewStyle = GetClassLongPtr(hWnd, GCL_STYLE) | CS_DROPSHADOW;
|
||||
SetClassLongPtr(hWnd, GCL_STYLE, cNewStyle);
|
||||
SetWindowPos(hWnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE |SWP_FRAMECHANGED);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ public:
|
|||
class FluFrameless : public QObject, public QQmlParserStatus
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY_AUTO(bool,stayTop)
|
||||
QML_NAMED_ELEMENT(FluFrameless)
|
||||
public:
|
||||
explicit FluFrameless(QObject *parent = nullptr);
|
||||
|
|
|
@ -16,6 +16,7 @@ Window {
|
|||
property bool fitsAppBarWindows: false
|
||||
property Item appBar: FluAppBar {
|
||||
title: window.title
|
||||
width: window.width
|
||||
height: 30
|
||||
showDark: window.showDark
|
||||
showClose: window.showClose
|
||||
|
@ -86,6 +87,14 @@ Window {
|
|||
}
|
||||
lifecycle.onVisible(visible)
|
||||
}
|
||||
Component{
|
||||
id:com_frameless
|
||||
FluFrameless{
|
||||
}
|
||||
}
|
||||
FluLoader{
|
||||
id:loader_frameless
|
||||
}
|
||||
QtObject{
|
||||
id:d
|
||||
property bool isFirstVisible: true
|
||||
|
@ -110,24 +119,53 @@ Window {
|
|||
target: window
|
||||
function onClosing(event){closeListener(event)}
|
||||
}
|
||||
Component{
|
||||
id:com_frameless
|
||||
FluFrameless{
|
||||
stayTop: window.stayTop
|
||||
}
|
||||
}
|
||||
Component{
|
||||
id:com_background
|
||||
Rectangle{
|
||||
color: window.backgroundColor
|
||||
}
|
||||
}
|
||||
FluLoader{
|
||||
anchors.fill: parent
|
||||
sourceComponent: background
|
||||
}
|
||||
FluLoader{
|
||||
id:loader_app_bar
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
height: {
|
||||
if(window.useSystemAppBar){
|
||||
return 0
|
||||
}
|
||||
return window.fitsAppBarWindows ? 0 : window.appBar.height
|
||||
}
|
||||
sourceComponent: window.useSystemAppBar ? undefined : com_app_bar
|
||||
}
|
||||
Component{
|
||||
id:com_app_bar
|
||||
Item{
|
||||
data: window.appBar
|
||||
}
|
||||
}
|
||||
Item{
|
||||
id:container
|
||||
anchors{
|
||||
top: loader_app_bar.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
clip: true
|
||||
}
|
||||
FluLoader{
|
||||
property string loadingText: "加载中..."
|
||||
property bool cancel: false
|
||||
id:loader_loading
|
||||
anchors.fill: container
|
||||
}
|
||||
Component{
|
||||
id:com_loading
|
||||
Popup{
|
||||
|
@ -190,56 +228,6 @@ Window {
|
|||
}
|
||||
}
|
||||
}
|
||||
FluLoader{
|
||||
anchors.fill: parent
|
||||
sourceComponent: background
|
||||
}
|
||||
FluLoader{
|
||||
id:loader_frameless
|
||||
}
|
||||
Item{
|
||||
id:layout_content
|
||||
anchors.fill: parent
|
||||
anchors.margins: {
|
||||
if(FluTools.isWin() && !window.useSystemAppBar){
|
||||
return window.visibility === Window.Maximized ? 8 : 0
|
||||
}
|
||||
return 0
|
||||
}
|
||||
onWidthChanged: {
|
||||
window.appBar.width = width
|
||||
}
|
||||
FluLoader{
|
||||
id:loader_app_bar
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
height: {
|
||||
if(window.useSystemAppBar){
|
||||
return 0
|
||||
}
|
||||
return window.fitsAppBarWindows ? 0 : window.appBar.height
|
||||
}
|
||||
sourceComponent: window.useSystemAppBar ? undefined : com_app_bar
|
||||
}
|
||||
Item{
|
||||
id:container
|
||||
anchors{
|
||||
top: loader_app_bar.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
clip: true
|
||||
}
|
||||
FluLoader{
|
||||
property string loadingText: "加载中..."
|
||||
property bool cancel: false
|
||||
id:loader_loading
|
||||
anchors.fill: container
|
||||
}
|
||||
FluInfoBar{
|
||||
id:infoBar
|
||||
root: window
|
||||
|
@ -249,8 +237,8 @@ Window {
|
|||
}
|
||||
Rectangle{
|
||||
anchors.fill: parent
|
||||
color:"transparent"
|
||||
anchors.topMargin: FluTools.isWin() ? 1/Screen.devicePixelRatio : 0
|
||||
color:"transparent"
|
||||
border.width: window.resizeBorderWidth
|
||||
border.color: window.resizeBorderColor
|
||||
visible: {
|
||||
|
@ -263,7 +251,6 @@ Window {
|
|||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
function destoryOnClose(){
|
||||
lifecycle.onDestoryOnClose()
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ Window {
|
|||
property bool fitsAppBarWindows: false
|
||||
property Item appBar: FluAppBar {
|
||||
title: window.title
|
||||
width: window.width
|
||||
height: 30
|
||||
showDark: window.showDark
|
||||
showClose: window.showClose
|
||||
|
@ -85,6 +86,14 @@ Window {
|
|||
}
|
||||
lifecycle.onVisible(visible)
|
||||
}
|
||||
Component{
|
||||
id:com_frameless
|
||||
FluFrameless{
|
||||
}
|
||||
}
|
||||
FluLoader{
|
||||
id:loader_frameless
|
||||
}
|
||||
QtObject{
|
||||
id:d
|
||||
property bool isFirstVisible: true
|
||||
|
@ -109,24 +118,53 @@ Window {
|
|||
target: window
|
||||
function onClosing(event){closeListener(event)}
|
||||
}
|
||||
Component{
|
||||
id:com_frameless
|
||||
FluFrameless{
|
||||
stayTop: window.stayTop
|
||||
}
|
||||
}
|
||||
Component{
|
||||
id:com_background
|
||||
Rectangle{
|
||||
color: window.backgroundColor
|
||||
}
|
||||
}
|
||||
FluLoader{
|
||||
anchors.fill: parent
|
||||
sourceComponent: background
|
||||
}
|
||||
FluLoader{
|
||||
id:loader_app_bar
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
height: {
|
||||
if(window.useSystemAppBar){
|
||||
return 0
|
||||
}
|
||||
return window.fitsAppBarWindows ? 0 : window.appBar.height
|
||||
}
|
||||
sourceComponent: window.useSystemAppBar ? undefined : com_app_bar
|
||||
}
|
||||
Component{
|
||||
id:com_app_bar
|
||||
Item{
|
||||
data: window.appBar
|
||||
}
|
||||
}
|
||||
Item{
|
||||
id:container
|
||||
anchors{
|
||||
top: loader_app_bar.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
clip: true
|
||||
}
|
||||
FluLoader{
|
||||
property string loadingText: "加载中..."
|
||||
property bool cancel: false
|
||||
id:loader_loading
|
||||
anchors.fill: container
|
||||
}
|
||||
Component{
|
||||
id:com_loading
|
||||
Popup{
|
||||
|
@ -189,56 +227,6 @@ Window {
|
|||
}
|
||||
}
|
||||
}
|
||||
FluLoader{
|
||||
anchors.fill: parent
|
||||
sourceComponent: background
|
||||
}
|
||||
FluLoader{
|
||||
id:loader_frameless
|
||||
}
|
||||
Item{
|
||||
id:layout_content
|
||||
anchors.fill: parent
|
||||
anchors.margins: {
|
||||
if(FluTools.isWin() && !window.useSystemAppBar){
|
||||
return window.visibility === Window.Maximized ? 8 : 0
|
||||
}
|
||||
return 0
|
||||
}
|
||||
onWidthChanged: {
|
||||
window.appBar.width = width
|
||||
}
|
||||
FluLoader{
|
||||
id:loader_app_bar
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
height: {
|
||||
if(window.useSystemAppBar){
|
||||
return 0
|
||||
}
|
||||
return window.fitsAppBarWindows ? 0 : window.appBar.height
|
||||
}
|
||||
sourceComponent: window.useSystemAppBar ? undefined : com_app_bar
|
||||
}
|
||||
Item{
|
||||
id:container
|
||||
anchors{
|
||||
top: loader_app_bar.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
clip: true
|
||||
}
|
||||
FluLoader{
|
||||
property string loadingText: "加载中..."
|
||||
property bool cancel: false
|
||||
id:loader_loading
|
||||
anchors.fill: container
|
||||
}
|
||||
FluInfoBar{
|
||||
id:infoBar
|
||||
root: window
|
||||
|
@ -261,7 +249,6 @@ Window {
|
|||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
function destoryOnClose(){
|
||||
lifecycle.onDestoryOnClose()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue