This commit is contained in:
zhuzichu 2023-11-21 18:12:11 +08:00
parent b981ecca7d
commit 542ea0a7b9
9 changed files with 15 additions and 45 deletions

View File

@ -45,7 +45,6 @@ FluWindow {
tour.open()
checkUpdate(true)
FluEventBus.registerEvent(event_checkupdate)
setHitTestVisible(layout_back_buttons)
}
Component.onDestruction: {

View File

@ -48,7 +48,6 @@ FluWindow {
tour.open()
checkUpdate(true)
FluEventBus.registerEvent(event_checkupdate)
setHitTestVisible(layout_back_buttons)
}
Component.onDestruction: {

@ -1 +1 @@
Subproject commit 2613dd72fd9bf37758caaafb43531e858a337639
Subproject commit 694967e930d2dd9f15c5429674005cc0a4217060

View File

@ -72,10 +72,10 @@ Rectangle{
return false
}
property bool isRestore: win && Window.Maximized === win.visibility
property bool resizable: win && !(win.minimumHeight === win.maximumHeight && win.maximumWidth === win.minimumWidth)
property bool resizable: win && !(win.height === win.maximumHeight && win.height === win.minimumHeight && win.width === win.maximumWidth && win.width === win.minimumWidth)
}
TapHandler {
onTapped: if (tapCount === 2) btn_maximize.clicked()
onTapped: if (tapCount === 2 && d.resizable) btn_maximize.clicked()
gesturePolicy: TapHandler.DragThreshold
}
DragHandler {

View File

@ -86,11 +86,6 @@ Item {
return FluNavigationViewType.Open
}
})
if(Window.window instanceof FluWindow){
Window.window.setHitTestVisible(backButton())
Window.window.setHitTestVisible(navButton())
Window.window.setHitTestVisible(logoButton())
}
timer_anim_delay.restart()
}
Timer{

View File

@ -38,7 +38,7 @@ Window {
property bool showMinimize: true
property bool showMaximize: true
property bool showStayTop: true
readonly property bool useSystemAppBar: false
property bool useSystemAppBar: false
property var closeListener: function(event){
if(closeDestory){
destoryOnClose()
@ -49,6 +49,10 @@ Window {
}
signal initArgument(var argument)
id:window
maximumWidth: useSystemAppBar&&fixSize ? width : 16777215
maximumHeight: useSystemAppBar&&fixSize ? height : 16777215
minimumWidth: useSystemAppBar&&fixSize ? width : 0
minimumHeight: useSystemAppBar&&fixSize ? height : 0
color:"transparent"
onStayTopChanged: {
d.changedStayTop()
@ -214,15 +218,8 @@ Window {
flags = flags | Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint
if(appBar){
var appbar = window.appBar
setTitleBarItem(appbar)
window.moveWindowToDesktopCenter()
setHitTestVisible(appbar.minimizeButton())
setHitTestVisible(appbar.maximizeButton())
setHitTestVisible(appbar.closeButton())
setHitTestVisible(appbar.stayTopButton())
setHitTestVisible(appbar.darkButton())
setWindowFixedSize(fixSize)
appbar.maximizeButton.visible = !fixSize
if (blurBehindWindowEnabled)
window.background = undefined
}
@ -259,9 +256,6 @@ Window {
}
}
}
function setHitTestVisible(item){
framless_helper.setHitTestVisible(item)
}
function destoryOnClose(){
lifecycle.onDestoryOnClose()
}

View File

@ -72,10 +72,10 @@ Rectangle{
return false
}
property bool isRestore: win && Window.Maximized === win.visibility
property bool resizable: win && !(win.minimumHeight === win.maximumHeight && win.maximumWidth === win.minimumWidth)
property bool resizable: win && !(win.height === win.maximumHeight && win.height === win.minimumHeight && win.width === win.maximumWidth && win.width === win.minimumWidth)
}
TapHandler {
onTapped: if (tapCount === 2) btn_maximize.clicked()
onTapped: if (tapCount === 2 && d.resizable) btn_maximize.clicked()
gesturePolicy: TapHandler.DragThreshold
}
DragHandler {

View File

@ -87,11 +87,6 @@ Item {
return FluNavigationViewType.Open
}
})
if(Window.window instanceof FluWindow){
Window.window.setHitTestVisible(backButton())
Window.window.setHitTestVisible(navButton())
Window.window.setHitTestVisible(logoButton())
}
timer_anim_delay.restart()
}
Timer{

View File

@ -37,7 +37,7 @@ Window {
property bool showMinimize: true
property bool showMaximize: true
property bool showStayTop: true
readonly property bool useSystemAppBar: false
property bool useSystemAppBar: false
property var closeListener: function(event){
if(closeDestory){
destoryOnClose()
@ -48,6 +48,10 @@ Window {
}
signal initArgument(var argument)
id:window
maximumWidth: useSystemAppBar&&fixSize ? width : 16777215
maximumHeight: useSystemAppBar&&fixSize ? height : 16777215
minimumWidth: useSystemAppBar&&fixSize ? width : 0
minimumHeight: useSystemAppBar&&fixSize ? height : 0
color:"transparent"
onStayTopChanged: {
d.changedStayTop()
@ -57,12 +61,6 @@ Window {
initArgument(argument)
d.changedStayTop()
if(useSystemAppBar){
if(fixSize){
maximumHeight = height
minimumHeight = height
maximumWidth = width
minimumWidth = width
}
window.moveWindowToDesktopCenter()
window.visible = true
}
@ -219,15 +217,8 @@ Window {
flags = flags | Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint
if(appBar){
var appbar = window.appBar
setTitleBarItem(appbar)
window.moveWindowToDesktopCenter()
setHitTestVisible(appbar.minimizeButton())
setHitTestVisible(appbar.maximizeButton())
setHitTestVisible(appbar.closeButton())
setHitTestVisible(appbar.stayTopButton())
setHitTestVisible(appbar.darkButton())
setWindowFixedSize(fixSize)
appbar.maximizeButton.visible = !fixSize
if (blurBehindWindowEnabled)
window.background = undefined
}
@ -264,9 +255,6 @@ Window {
}
}
}
function setHitTestVisible(item){
framless_helper.setHitTestVisible(item)
}
function destoryOnClose(){
lifecycle.onDestoryOnClose()
}