Updated community popup menu btn style. Fixes #1961# This is a combination of 4 commits.

Updated community popup menu btn style. Fixes #1961

Updated community popup menu btn style. Fixes #1961

Updated community popup menu btn style. Fixes #1961

Updated community popup menu btn style. Fixes #1961
This commit is contained in:
ace-smart 2021-03-04 20:16:22 +04:00 committed by Iuri Matias
parent 250a1801d4
commit 81bb7fcc65

View File

@ -41,39 +41,52 @@ Item {
anchors.topMargin: -4 anchors.topMargin: -4
} }
StatusIconButton { StatusRoundButton {
id: optionsBtn id: optionsBtn
icon.name: "dots-icon" pressedIconRotation: 45
iconColor: Style.current.inputColor icon.name: "plusSign"
size: "medium"
width: 36
height: 36
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: Style.current.bigPadding anchors.rightMargin: Style.current.bigPadding
anchors.verticalCenter: parent.verticalCenter anchors.top: parent.top
onClicked: optionsMenu.open() anchors.topMargin: 8
}
PopupMenu { onClicked: {
id: optionsMenu optionsBtn.state = "pressed"
x: optionsBtn.x + optionsBtn.width / 2 - optionsMenu.width / 2 let x = optionsBtn.iconX + optionsBtn.icon.width / 2 - optionsMenu.width / 2
y: optionsBtn.height optionsMenu.popup(x, optionsBtn.icon.height + 14)
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 { PopupMenu {
//% "Leave community" id: optionsMenu
text: qsTrId("leave-community") x: optionsBtn.x + optionsBtn.width / 2 - optionsMenu.width / 2
icon.source: "../../img/delete.svg" y: optionsBtn.height
icon.color: Style.current.red
icon.width: 20 Action {
icon.height: 20 enabled: chatsModel.communities.activeCommunity.admin
onTriggered: chatsModel.communities.leaveCurrentCommunity() //% "Create channel"
text: qsTrId("create-channel")
icon.source: "../../img/hash.svg"
icon.width: 20
icon.height: 20
onTriggered: openPopup(createChannelPopup, {communityId: chatsModel.activeCommunity.id})
}
Action {
//% "Leave community"
text: qsTrId("leave-community")
icon.source: "../../img/delete.svg"
icon.color: Style.current.red
icon.width: 20
icon.height: 20
onTriggered: chatsModel.leaveCurrentCommunity()
}
onAboutToHide: {
optionsBtn.state = "default"
}
} }
} }
} }