This commit is contained in:
zhuzichu 2023-09-08 19:14:45 +08:00
parent 752fe8cfba
commit 4b01fcf2b4
4 changed files with 80 additions and 158 deletions

View File

@ -409,6 +409,31 @@ Item {
Drag.hotSpot.x: item_control.width / 2 Drag.hotSpot.x: item_control.width / 2
Drag.hotSpot.y: item_control.height / 2 Drag.hotSpot.y: item_control.height / 2
Drag.dragType: Drag.Automatic Drag.dragType: Drag.Automatic
onClicked: {
if(type === 0){
if(model.onTapListener){
model.onTapListener()
}else{
nav_list.currentIndex = _idx
layout_footer.currentIndex = -1
model.tap()
if(d.isMinimal || d.isCompact){
d.enableNavigationPanel = false
}
}
}else{
if(model.onTapListener){
model.onTapListener()
}else{
nav_list.currentIndex = nav_list.count-layout_footer.count+_idx
layout_footer.currentIndex = _idx
model.tap()
if(d.isMinimal || d.isCompact){
d.enableNavigationPanel = false
}
}
}
}
MouseArea{ MouseArea{
id:item_mouse id:item_mouse
anchors.fill: parent anchors.fill: parent
@ -433,29 +458,7 @@ Item {
loader_item_menu.item.popup(); loader_item_menu.item.popup();
} }
}else{ }else{
if(type === 0){ item_control.clicked()
if(model.onTapListener){
model.onTapListener()
}else{
nav_list.currentIndex = _idx
layout_footer.currentIndex = -1
model.tap()
if(d.isMinimal || d.isCompact){
d.enableNavigationPanel = false
}
}
}else{
if(model.onTapListener){
model.onTapListener()
}else{
nav_list.currentIndex = nav_list.count-layout_footer.count+_idx
layout_footer.currentIndex = _idx
model.tap()
if(d.isMinimal || d.isCompact){
d.enableNavigationPanel = false
}
}
}
} }
} }
} }

View File

@ -3,64 +3,22 @@ import QtQuick.Controls 2.15
import FluentUI 1.0 import FluentUI 1.0
Item { Item {
//DropShadow
property color color: FluTheme.dark ? "#FFFFFF" : "#999999" property color color: FluTheme.dark ? "#999999" : "#999999"
property int elevation: 5
property int radius: 4 property int radius: 4
id:control id:control
anchors.fill: parent anchors.fill: parent
anchors.margins: -4 Repeater{
Rectangle{ model: elevation
width: control.width Rectangle{
height: control.height anchors.fill: parent
anchors.centerIn: parent color: "#00000000"
color: "#00000000" opacity: 0.02 * (elevation-index+1)
opacity: 0.02 anchors.margins: -index+1
border.width: 1 radius: control.radius
radius: control.radius border.width: index
border.color: control.color border.color: control.color
}
} }
Rectangle{
width: control.width - 2
height: control.height - 2
anchors.centerIn: parent
color: "#00000000"
opacity: 0.04
border.width: 1
radius: control.radius
border.color: control.color
}
Rectangle{
width: control.width - 4
height: control.height - 4
anchors.centerIn: parent
color: "#00000000"
opacity: 0.06
border.width: 1
radius: control.radius
border.color: control.color
}
Rectangle{
width: control.width - 6
height: control.height - 6
anchors.centerIn: parent
color: "#00000000"
opacity: 0.08
border.width: 1
radius: control.radius
border.color: control.color
}
Rectangle{
width: control.width - 8
height: control.height - 8
anchors.centerIn: parent
opacity: 0.1
radius: control.radius
color: "#00000000"
border.width: 1
border.color: control.color
}
} }

View File

@ -410,6 +410,31 @@ Item {
Drag.hotSpot.x: item_control.width / 2 Drag.hotSpot.x: item_control.width / 2
Drag.hotSpot.y: item_control.height / 2 Drag.hotSpot.y: item_control.height / 2
Drag.dragType: Drag.Automatic Drag.dragType: Drag.Automatic
onClicked:{
if(type === 0){
if(model.onTapListener){
model.onTapListener()
}else{
nav_list.currentIndex = _idx
layout_footer.currentIndex = -1
model.tap()
if(d.isMinimal || d.isCompact){
d.enableNavigationPanel = false
}
}
}else{
if(model.onTapListener){
model.onTapListener()
}else{
nav_list.currentIndex = nav_list.count-layout_footer.count+_idx
layout_footer.currentIndex = _idx
model.tap()
if(d.isMinimal || d.isCompact){
d.enableNavigationPanel = false
}
}
}
}
MouseArea{ MouseArea{
id:item_mouse id:item_mouse
anchors.fill: parent anchors.fill: parent
@ -434,29 +459,7 @@ Item {
loader_item_menu.item.popup(); loader_item_menu.item.popup();
} }
}else{ }else{
if(type === 0){ item_control.clicked()
if(model.onTapListener){
model.onTapListener()
}else{
nav_list.currentIndex = _idx
layout_footer.currentIndex = -1
model.tap()
if(d.isMinimal || d.isCompact){
d.enableNavigationPanel = false
}
}
}else{
if(model.onTapListener){
model.onTapListener()
}else{
nav_list.currentIndex = nav_list.count-layout_footer.count+_idx
layout_footer.currentIndex = _idx
model.tap()
if(d.isMinimal || d.isCompact){
d.enableNavigationPanel = false
}
}
}
} }
} }
} }

View File

@ -3,64 +3,22 @@ import QtQuick.Controls
import FluentUI import FluentUI
Item { Item {
//DropShadow
property color color: FluTheme.dark ? "#FFFFFF" : "#999999" property color color: FluTheme.dark ? "#999999" : "#999999"
property int elevation: 5
property int radius: 4 property int radius: 4
id:control id:control
anchors.fill: parent anchors.fill: parent
anchors.margins: -4 Repeater{
Rectangle{ model: elevation
width: control.width Rectangle{
height: control.height anchors.fill: parent
anchors.centerIn: parent color: "#00000000"
color: "#00000000" opacity: 0.02 * (elevation-index+1)
opacity: 0.02 anchors.margins: -index+1
border.width: 1 radius: control.radius
radius: control.radius border.width: index
border.color: control.color border.color: control.color
}
} }
Rectangle{
width: control.width - 2
height: control.height - 2
anchors.centerIn: parent
color: "#00000000"
opacity: 0.04
border.width: 1
radius: control.radius
border.color: control.color
}
Rectangle{
width: control.width - 4
height: control.height - 4
anchors.centerIn: parent
color: "#00000000"
opacity: 0.06
border.width: 1
radius: control.radius
border.color: control.color
}
Rectangle{
width: control.width - 6
height: control.height - 6
anchors.centerIn: parent
color: "#00000000"
opacity: 0.08
border.width: 1
radius: control.radius
border.color: control.color
}
Rectangle{
width: control.width - 8
height: control.height - 8
anchors.centerIn: parent
opacity: 0.1
radius: control.radius
color: "#00000000"
border.width: 1
border.color: control.color
}
} }