feat(StatusPopupMenu): make menu items invisible when disabled
Closes #135
This commit is contained in:
parent
666908d93a
commit
7d96ad02ca
|
@ -102,6 +102,7 @@ Rectangle {
|
|||
StatusMenuItem {
|
||||
text: qsTr("Edit Community")
|
||||
icon.name: "edit"
|
||||
enabled: false
|
||||
}
|
||||
|
||||
StatusMenuSeparator {}
|
||||
|
|
|
@ -27,7 +27,7 @@ Menu {
|
|||
delegate: MenuItem {
|
||||
id: statusPopupMenuItem
|
||||
|
||||
implicitHeight: 38
|
||||
implicitHeight: action.enabled ? 38 : 0
|
||||
|
||||
property int subMenuIndex
|
||||
|
||||
|
@ -71,8 +71,9 @@ Menu {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 8
|
||||
active: parent.subMenu && !!statusPopupMenu.subMenuItemIcons[parent.subMenuIndex] ||
|
||||
!!statusPopupMenuItem.action.icon.name
|
||||
active: (parent.subMenu && !!statusPopupMenu.subMenuItemIcons[parent.subMenuIndex] ||
|
||||
!!statusPopupMenuItem.action.icon.name) &&
|
||||
statusPopupMenuItem.action.enabled
|
||||
}
|
||||
|
||||
contentItem: StatusBaseText {
|
||||
|
@ -94,6 +95,7 @@ Menu {
|
|||
}
|
||||
font.pixelSize: 13
|
||||
elide: Text.ElideRight
|
||||
visible: statusPopupMenuItem.action.enabled
|
||||
}
|
||||
|
||||
arrow: StatusIcon {
|
||||
|
@ -120,7 +122,7 @@ Menu {
|
|||
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
hoverEnabled: statusPopupMenuItem.action.enabled
|
||||
onPressed: mouse.accepted = false
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue