main
zhuzihcu 2023-06-09 09:29:28 +08:00
parent 49029164ff
commit cf730bc769
2 changed files with 37 additions and 23 deletions

View File

@ -39,15 +39,15 @@ FluWindow {
id:framless_helper id:framless_helper
onReady: { onReady: {
setTitleBarItem(title_bar) setTitleBarItem(title_bar)
framless_helper.moveWindowToDesktopCenter() moveWindowToDesktopCenter()
setHitTestVisible(title_bar.minimizeButton()) setHitTestVisible(title_bar.minimizeButton())
setHitTestVisible(title_bar.maximizeButton()) setHitTestVisible(title_bar.maximizeButton())
setHitTestVisible(title_bar.closeButton()) setHitTestVisible(title_bar.closeButton())
framless_helper.setWindowFixedSize(fixSize) setWindowFixedSize(fixSize)
title_bar.maximizeButton.visible = !fixSize title_bar.maximizeButton.visible = !fixSize
if (blurBehindWindowEnabled) if (blurBehindWindowEnabled)
window.backgroundVisible = false window.backgroundVisible = false
window.visible = true window.show()
} }
} }
Connections{ Connections{

View File

@ -29,18 +29,7 @@ Item {
QtObject{ QtObject{
id:d id:d
property var stackItems: [] property var stackItems: []
property int displayMode: { property int displayMode: FluNavigationView.Open
if(control.displayMode !==FluNavigationView.Auto){
return control.displayMode
}
if(control.width<=700){
return FluNavigationView.Minimal
}else if(control.width<=900){
return FluNavigationView.Compact
}else{
return FluNavigationView.Open
}
}
property bool enableNavigationPanel: false property bool enableNavigationPanel: false
property bool isCompact: d.displayMode === FluNavigationView.Compact property bool isCompact: d.displayMode === FluNavigationView.Compact
property bool isMinimal: d.displayMode === FluNavigationView.Minimal property bool isMinimal: d.displayMode === FluNavigationView.Minimal
@ -50,14 +39,6 @@ Item {
onIsCompactAndNotPanelChanged: { onIsCompactAndNotPanelChanged: {
collapseAll() collapseAll()
} }
onDisplayModeChanged: {
if(d.displayMode === FluNavigationView.Compact){
collapseAll()
}
if(d.displayMode === FluNavigationView.Minimal){
d.enableNavigationPanel = false
}
}
function handleItems(){ function handleItems(){
var idx = 0 var idx = 0
var data = [] var data = []
@ -93,6 +74,31 @@ Item {
return data return data
} }
} }
Component.onCompleted: {
d.displayMode = Qt.binding(function(){
if(control.displayMode !==FluNavigationView.Auto){
return control.displayMode
}
if(control.width<=700){
return FluNavigationView.Minimal
}else if(control.width<=900){
return FluNavigationView.Compact
}else{
return FluNavigationView.Open
}
})
}
Connections{
target: d
function onDisplayModeChanged(){
if(d.displayMode === FluNavigationView.Compact){
collapseAll()
}
if(d.displayMode === FluNavigationView.Minimal){
d.enableNavigationPanel = false
}
}
}
Component{ Component{
id:com_panel_item_empty id:com_panel_item_empty
Item{ Item{
@ -614,7 +620,15 @@ Item {
} }
return "transparent" return "transparent"
} }
clip: true
x: visible ? 0 : -width x: visible ? 0 : -width
Behavior on width {
NumberAnimation{
duration: 167
easing.type: Easing.BezierSpline
easing.bezierCurve: [ 0, 0, 0, 1 ]
}
}
Behavior on x { Behavior on x {
NumberAnimation{ NumberAnimation{
duration: 167 duration: 167