2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtGraphicalEffects 1.15
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2021-10-18 10:34:16 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2024-10-15 19:26:12 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2021-02-11 15:50:59 +00:00
|
|
|
|
|
|
|
Menu {
|
|
|
|
id: root
|
2022-08-26 13:18:30 +00:00
|
|
|
width: 165
|
2021-02-11 15:50:59 +00:00
|
|
|
height: 36
|
|
|
|
|
|
|
|
background: Item {
|
|
|
|
id: menuBackground
|
|
|
|
Rectangle {
|
|
|
|
id: menuBackgroundContent
|
|
|
|
implicitWidth: menuBackground.width
|
|
|
|
implicitHeight: menuBackground.height
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.indirectColor2
|
|
|
|
radius: Theme.radius
|
2021-02-11 15:50:59 +00:00
|
|
|
layer.enabled: true
|
|
|
|
layer.effect: DropShadow{
|
|
|
|
width: menuBackgroundContent.width
|
|
|
|
height: menuBackgroundContent.height
|
|
|
|
x: menuBackgroundContent.x
|
|
|
|
visible: menuBackgroundContent.visible
|
|
|
|
source: menuBackgroundContent
|
|
|
|
horizontalOffset: 0
|
|
|
|
verticalOffset: 4
|
|
|
|
radius: 12
|
|
|
|
samples: 25
|
|
|
|
spread: 0.2
|
|
|
|
color: "#22000000"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: Item {
|
|
|
|
width: root.width
|
|
|
|
height: root.height
|
|
|
|
Row {
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
Repeater {
|
|
|
|
model: root.contentModel
|
|
|
|
}
|
2021-02-11 15:50:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
delegate: MenuItem {
|
|
|
|
id: menuItem
|
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
leftPadding: 0
|
|
|
|
topPadding: 0
|
|
|
|
action: Action {}
|
|
|
|
contentItem: Item {
|
2021-10-18 10:34:16 +00:00
|
|
|
StatusFlatRoundButton {
|
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
icon.width: 24
|
|
|
|
icon.height: 24
|
2021-02-11 15:50:59 +00:00
|
|
|
icon.name: menuItem.action.icon.name
|
2021-03-03 15:38:46 +00:00
|
|
|
highlighted: menuItem.action.checked
|
2021-10-18 10:34:16 +00:00
|
|
|
tooltip.text: menuItem.action.text
|
|
|
|
type: StatusFlatRoundButton.Type.Tertiary
|
|
|
|
onClicked: menuItem.action.actionTriggered()
|
2021-02-11 15:50:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
background: Rectangle {
|
|
|
|
color: "transparent"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|