Add room context menu with Leave/Decline invite
This commit is contained in:
5
src/qml/Base/HMenu.qml
Normal file
5
src/qml/Base/HMenu.qml
Normal file
@@ -0,0 +1,5 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
Menu {
|
||||
}
|
5
src/qml/Base/HMenuItem.qml
Normal file
5
src/qml/Base/HMenuItem.qml
Normal file
@@ -0,0 +1,5 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
MenuItem {
|
||||
}
|
@@ -20,6 +20,8 @@ HButton {
|
||||
readonly property alias rightInfo: rightInfo
|
||||
readonly property alias subtitle: subtitle
|
||||
|
||||
property HMenu contextMenu: HMenu {}
|
||||
|
||||
property Item image
|
||||
|
||||
property Item details: HColumnLayout {
|
||||
@@ -75,14 +77,6 @@ HButton {
|
||||
|
||||
onActivated: view.currentIndex = model.index
|
||||
|
||||
onClicked: {
|
||||
view.highlightRangeMode = ListView.NoHighlightRange
|
||||
view.highlightMoveDuration = 0
|
||||
activated()
|
||||
view.highlightRangeMode = ListView.ApplyRange
|
||||
view.highlightMoveDuration = theme.animationDuration
|
||||
}
|
||||
|
||||
|
||||
Timer {
|
||||
interval: 100
|
||||
@@ -91,4 +85,25 @@ HButton {
|
||||
// Component.onCompleted won't work for this
|
||||
onTriggered: if (shouldBeCurrent) view.currentIndex = model.index
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onTapped: {
|
||||
view.highlightRangeMode = ListView.NoHighlightRange
|
||||
view.highlightMoveDuration = 0
|
||||
activated()
|
||||
view.highlightRangeMode = ListView.ApplyRange
|
||||
view.highlightMoveDuration = theme.animationDuration
|
||||
}
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.RightButton
|
||||
onTapped: if (contextMenu.count > 0) contextMenu.popup()
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onLongPressed: if (contextMenu.count > 0) contextMenu.popup()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user