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.y: item_control.height / 2
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{
id:item_mouse
anchors.fill: parent
@ -433,29 +458,7 @@ Item {
loader_item_menu.item.popup();
}
}else{
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
}
}
}
item_control.clicked()
}
}
}

View File

@ -3,64 +3,22 @@ import QtQuick.Controls 2.15
import FluentUI 1.0
Item {
property color color: FluTheme.dark ? "#FFFFFF" : "#999999"
//DropShadow
property color color: FluTheme.dark ? "#999999" : "#999999"
property int elevation: 5
property int radius: 4
id:control
anchors.fill: parent
anchors.margins: -4
Rectangle{
width: control.width
height: control.height
anchors.centerIn: parent
color: "#00000000"
opacity: 0.02
border.width: 1
radius: control.radius
border.color: control.color
Repeater{
model: elevation
Rectangle{
anchors.fill: parent
color: "#00000000"
opacity: 0.02 * (elevation-index+1)
anchors.margins: -index+1
radius: control.radius
border.width: index
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.y: item_control.height / 2
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{
id:item_mouse
anchors.fill: parent
@ -434,29 +459,7 @@ Item {
loader_item_menu.item.popup();
}
}else{
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
}
}
}
item_control.clicked()
}
}
}

View File

@ -3,64 +3,22 @@ import QtQuick.Controls
import FluentUI
Item {
property color color: FluTheme.dark ? "#FFFFFF" : "#999999"
//DropShadow
property color color: FluTheme.dark ? "#999999" : "#999999"
property int elevation: 5
property int radius: 4
id:control
anchors.fill: parent
anchors.margins: -4
Rectangle{
width: control.width
height: control.height
anchors.centerIn: parent
color: "#00000000"
opacity: 0.02
border.width: 1
radius: control.radius
border.color: control.color
Repeater{
model: elevation
Rectangle{
anchors.fill: parent
color: "#00000000"
opacity: 0.02 * (elevation-index+1)
anchors.margins: -index+1
radius: control.radius
border.width: index
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
}
}