2020-11-19 14:59:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtGraphicalEffects 1.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-20 10:03:09 +00:00
|
|
|
|
|
|
|
import StatusQ.Controls 0.1
|
2021-10-21 23:34:35 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Core 0.1
|
2021-10-20 10:03:09 +00:00
|
|
|
|
2020-11-19 14:59:31 +00:00
|
|
|
import "../../../../shared"
|
2021-10-14 11:33:34 +00:00
|
|
|
import "../../../../shared/popups"
|
2021-10-14 13:09:35 +00:00
|
|
|
import "../../../../shared/panels"
|
2020-11-19 14:59:31 +00:00
|
|
|
|
2021-10-14 11:33:34 +00:00
|
|
|
// TODO: replace with StatusModal
|
2020-11-19 14:59:31 +00:00
|
|
|
ModalPopup {
|
|
|
|
id: root
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Muted chats"
|
|
|
|
title: qsTrId("muted-chats")
|
2020-11-19 14:59:31 +00:00
|
|
|
property bool showMutedContacts: false
|
2021-07-20 16:01:22 +00:00
|
|
|
property string noContentText: ""
|
2020-11-19 14:59:31 +00:00
|
|
|
|
|
|
|
onClosed: {
|
|
|
|
root.destroy()
|
|
|
|
}
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: mutedChatsList
|
|
|
|
anchors.top: parent.top
|
|
|
|
visible: true
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2021-06-22 15:38:45 +00:00
|
|
|
model: root.showMutedContacts ? profileModel.mutedChats.contacts : profileModel.mutedChats.chats
|
2020-11-19 14:59:31 +00:00
|
|
|
delegate: Rectangle {
|
2021-03-19 10:25:29 +00:00
|
|
|
id: channelItem
|
|
|
|
property bool isHovered: false
|
2020-11-19 14:59:31 +00:00
|
|
|
height: contactImage.height + Style.current.smallPadding * 2
|
2021-01-21 18:07:01 +00:00
|
|
|
width: parent.width
|
2021-03-19 10:25:29 +00:00
|
|
|
radius: Style.current.radius
|
|
|
|
color: isHovered ? Style.current.backgroundHover : Style.current.transparent
|
2020-11-19 14:59:31 +00:00
|
|
|
|
2021-10-21 23:34:35 +00:00
|
|
|
StatusSmartIdenticon {
|
2020-11-19 14:59:31 +00:00
|
|
|
id: contactImage
|
|
|
|
anchors.left: parent.left
|
2021-03-19 10:25:29 +00:00
|
|
|
anchors.leftMargin: Style.current.smallPadding
|
2020-11-19 14:59:31 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2021-10-21 23:34:35 +00:00
|
|
|
image: StatusImageSettings {
|
|
|
|
width: 40
|
|
|
|
height: 40
|
|
|
|
source: model.identicon
|
|
|
|
isIdenticon: true
|
|
|
|
}
|
|
|
|
icon: StatusIconSettings {
|
|
|
|
width: 40
|
|
|
|
height: 40
|
|
|
|
letterSize: 15
|
|
|
|
color: Theme.palette.miscColor5
|
|
|
|
}
|
|
|
|
name: model.name
|
2020-11-19 14:59:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: contactInfo
|
|
|
|
text: model.chatType !== Constants.chatTypePublic ?
|
|
|
|
Emoji.parse(Utils.removeStatusEns(Utils.filterXSS(model.name)), "26x26") :
|
|
|
|
"#" + Utils.filterXSS(model.name)
|
|
|
|
anchors.right: unmuteButton.left
|
|
|
|
anchors.rightMargin: Style.current.smallPadding
|
|
|
|
elide: Text.ElideRight
|
2021-03-19 10:25:29 +00:00
|
|
|
font.pixelSize: 15
|
2020-11-19 14:59:31 +00:00
|
|
|
anchors.left: contactImage.right
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
}
|
|
|
|
|
2021-03-19 10:25:29 +00:00
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
hoverEnabled: true
|
|
|
|
onEntered: channelItem.isHovered = true
|
|
|
|
onExited: channelItem.isHovered = false
|
|
|
|
}
|
|
|
|
|
2021-10-20 10:03:09 +00:00
|
|
|
StatusFlatButton {
|
2020-11-19 14:59:31 +00:00
|
|
|
id: unmuteButton
|
|
|
|
anchors.right: parent.right
|
2021-03-19 10:25:29 +00:00
|
|
|
anchors.rightMargin: Style.current.smallPadding
|
2020-11-19 14:59:31 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Unmute"
|
|
|
|
text: qsTrId("unmute")
|
2021-07-13 09:11:08 +00:00
|
|
|
|
2021-03-19 10:25:29 +00:00
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
hoverEnabled: true
|
|
|
|
onEntered: {
|
|
|
|
channelItem.isHovered = true
|
|
|
|
}
|
2021-07-13 09:11:08 +00:00
|
|
|
onClicked: {
|
|
|
|
chatsModel.channelView.unmuteChatItem(model.id)
|
|
|
|
}
|
2021-03-19 10:25:29 +00:00
|
|
|
}
|
2020-11-19 14:59:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-07-20 16:01:22 +00:00
|
|
|
|
|
|
|
StyledText {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
visible: (mutedChatsList.count === 0)
|
|
|
|
text: root.noContentText
|
|
|
|
}
|
2020-11-19 14:59:31 +00:00
|
|
|
}
|