fix(communities): Right click inside the community pane does not open context menu
Fixes: #2547
This commit is contained in:
parent
4c0371144b
commit
562373fdfc
|
@ -41,6 +41,56 @@ Rectangle {
|
|||
TransferOwnershipPopup {}
|
||||
}
|
||||
|
||||
CommunityProfilePopup {
|
||||
id: communityProfilePopup
|
||||
communityId: chatsModel.communities.activeCommunity.id
|
||||
name: chatsModel.communities.activeCommunity.name
|
||||
description: chatsModel.communities.activeCommunity.description
|
||||
access: chatsModel.communities.activeCommunity.access
|
||||
nbMembers: chatsModel.communities.activeCommunity.nbMembers
|
||||
isAdmin: chatsModel.communities.activeCommunity.admin
|
||||
source: chatsModel.communities.activeCommunity.thumbnailImage
|
||||
communityColor: chatsModel.communities.activeCommunity.communityColor
|
||||
}
|
||||
|
||||
PopupMenu {
|
||||
id: optionsMenu
|
||||
|
||||
Action {
|
||||
enabled: chatsModel.communities.activeCommunity.admin
|
||||
//% "Create channel"
|
||||
text: qsTrId("create-channel")
|
||||
icon.source: "../../img/hash.svg"
|
||||
icon.width: 20
|
||||
icon.height: 20
|
||||
onTriggered: openPopup(createChannelPopup, {communityId: chatsModel.communities.activeCommunity.id})
|
||||
}
|
||||
|
||||
Action {
|
||||
enabled: chatsModel.communities.activeCommunity.admin
|
||||
text: qsTr("Create category")
|
||||
icon.source: "../../img/create-category.svg"
|
||||
icon.width: 20
|
||||
icon.height: 20
|
||||
onTriggered: openPopup(createCategoryPopup, {communityId: chatsModel.communities.activeCommunity.id})
|
||||
}
|
||||
|
||||
Separator {}
|
||||
|
||||
Action {
|
||||
text: qsTr("Invite People")
|
||||
enabled: chatsModel.communities.activeCommunity.canManageUsers
|
||||
icon.source: "../../img/export.svg"
|
||||
icon.width: 20
|
||||
icon.height: 20
|
||||
onTriggered: openPopup(inviteFriendsToCommunityPopup, {communityId: chatsModel.communities.activeCommunity.id})
|
||||
}
|
||||
|
||||
onAboutToHide: {
|
||||
optionsBtn.state = "default"
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: communityHeader
|
||||
width: parent.width
|
||||
|
@ -74,48 +124,13 @@ Rectangle {
|
|||
|
||||
onClicked: {
|
||||
optionsBtn.state = "pressed"
|
||||
|
||||
let x = optionsBtn.iconX + optionsBtn.icon.width / 2 - optionsMenu.width / 2
|
||||
optionsMenu.popup(x, optionsBtn.icon.height + 14)
|
||||
}
|
||||
let y = optionsBtn.height + 4
|
||||
|
||||
PopupMenu {
|
||||
id: optionsMenu
|
||||
x: optionsBtn.x + optionsBtn.width / 2 - optionsMenu.width / 2
|
||||
y: optionsBtn.height
|
||||
let point = optionsBtn.mapToItem(root, x, y)
|
||||
|
||||
Action {
|
||||
enabled: chatsModel.communities.activeCommunity.admin
|
||||
//% "Create channel"
|
||||
text: qsTrId("create-channel")
|
||||
icon.source: "../../img/hash.svg"
|
||||
icon.width: 20
|
||||
icon.height: 20
|
||||
onTriggered: openPopup(createChannelPopup, {communityId: chatsModel.communities.activeCommunity.id})
|
||||
}
|
||||
|
||||
Action {
|
||||
enabled: chatsModel.communities.activeCommunity.admin
|
||||
text: qsTr("Create category")
|
||||
icon.source: "../../img/create-category.svg"
|
||||
icon.width: 20
|
||||
icon.height: 20
|
||||
onTriggered: openPopup(createCategoryPopup, {communityId: chatsModel.communities.activeCommunity.id})
|
||||
}
|
||||
|
||||
Separator {}
|
||||
|
||||
Action {
|
||||
text: qsTr("Invite People")
|
||||
enabled: chatsModel.communities.activeCommunity.canManageUsers
|
||||
icon.source: "../../img/export.svg"
|
||||
icon.width: 20
|
||||
icon.height: 20
|
||||
onTriggered: openPopup(inviteFriendsToCommunityPopup, {communityId: chatsModel.communities.activeCommunity.id})
|
||||
}
|
||||
|
||||
onAboutToHide: {
|
||||
optionsBtn.state = "default"
|
||||
}
|
||||
optionsMenu.popup(point.x, point.y)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -174,9 +189,31 @@ Rectangle {
|
|||
leftPadding: Style.current.halfPadding
|
||||
rightPadding: Style.current.halfPadding
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
contentHeight: categoryList.height + channelList.height + emptyViewAndSuggestionsLoader.height + backUpBannerLoader.height + 2 * Style.current.padding
|
||||
contentHeight: categoryList.height
|
||||
+ channelList.height
|
||||
+ emptyViewAndSuggestionsLoader.height
|
||||
+ backUpBannerLoader.height
|
||||
+ 2 * Style.current.padding
|
||||
clip: true
|
||||
|
||||
background: Item {
|
||||
anchors.fill: parent
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
|
||||
onClicked: {
|
||||
let x = mouse.x + 4
|
||||
let y = mouse.y + 4
|
||||
|
||||
let point = chatGroupsContainer.mapToItem(root, x, y)
|
||||
|
||||
optionsMenu.popup(point.x, point.y)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ChannelList {
|
||||
id: channelList
|
||||
searchStr: ""
|
||||
|
@ -212,18 +249,6 @@ Rectangle {
|
|||
BackUpCommuntyBanner {}
|
||||
}
|
||||
}
|
||||
|
||||
CommunityProfilePopup {
|
||||
id: communityProfilePopup
|
||||
communityId: chatsModel.communities.activeCommunity.id
|
||||
name: chatsModel.communities.activeCommunity.name
|
||||
description: chatsModel.communities.activeCommunity.description
|
||||
access: chatsModel.communities.activeCommunity.access
|
||||
nbMembers: chatsModel.communities.activeCommunity.nbMembers
|
||||
isAdmin: chatsModel.communities.activeCommunity.admin
|
||||
source: chatsModel.communities.activeCommunity.thumbnailImage
|
||||
communityColor: chatsModel.communities.activeCommunity.communityColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,16 @@ Rectangle {
|
|||
radius: 16
|
||||
color: Style.current.transparent
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
onClicked: {
|
||||
/* Prevents sending events to the component beneath
|
||||
if Right Mouse Button is clicked. */
|
||||
mouse.accepted = false;
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 66
|
||||
height: 4
|
||||
|
|
|
@ -37,6 +37,16 @@ Column {
|
|||
height: 40
|
||||
width: categoryListContent.width
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
onClicked: {
|
||||
/* Prevents sending events to the component beneath
|
||||
if Right Mouse Button is clicked. */
|
||||
mouse.accepted = false;
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: model.name
|
||||
elide: Text.ElideRight
|
||||
|
|
|
@ -17,6 +17,16 @@ Rectangle {
|
|||
radius: 16
|
||||
color: Style.current.transparent
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
onClicked: {
|
||||
/* Prevents sending events to the component beneath
|
||||
if Right Mouse Button is clicked. */
|
||||
mouse.accepted = false;
|
||||
}
|
||||
}
|
||||
|
||||
SVGImage {
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: -6
|
||||
|
|
Loading…
Reference in New Issue