matrixion/resources/qml/dialogs/IgnoredUsers.qml

85 lines
2.3 KiB
QML
Raw Permalink Normal View History

2023-07-28 04:04:34 +03:00
// SPDX-FileCopyrightText: Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
2023-09-08 01:44:10 +03:00
import QtQml
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Window
import im.nheko
import "../"
2023-07-28 04:04:34 +03:00
Window {
id: ignoredUsers
title: qsTr("Ignored users")
flags: Qt.WindowCloseButtonHint | Qt.WindowTitleHint
height: 650
width: 420
minimumHeight: 420
color: palette.window
ListView {
id: view
2023-08-04 09:30:45 +03:00
anchors.fill: parent
2023-07-28 04:04:34 +03:00
spacing: Nheko.paddingMedium
2023-10-26 01:38:04 +03:00
footerPositioning: ListView.OverlayFooter
2023-07-28 04:04:34 +03:00
2023-09-08 00:10:04 +03:00
model: TimelineManager.ignoredUsers
2023-08-04 09:30:45 +03:00
header: ColumnLayout {
Text {
Layout.fillWidth: true
Layout.maximumWidth: view.width
wrapMode: Text.Wrap
color: palette.text
text: qsTr("Ignoring a user hides their messages (they can still see yours!).")
}
Item { Layout.preferredHeight: Nheko.paddingLarge }
}
2023-07-28 04:04:34 +03:00
delegate: RowLayout {
property var profile: TimelineManager.getGlobalUserProfile(modelData)
2023-07-28 04:04:34 +03:00
width: view.width
Avatar {
enabled: false
displayName: profile.displayName
userid: profile.userid
url: profile.avatarUrl.replace("mxc://", "image://MxcImage/")
}
2023-07-28 04:04:34 +03:00
Text {
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
elide: Text.ElideRight
color: palette.text
text: modelData
}
ImageButton {
Layout.preferredHeight: 24
Layout.preferredWidth: 24
2023-10-26 01:38:04 +03:00
image: ":/icons/icons/ui/dismiss.svg"
2023-07-28 04:04:34 +03:00
hoverEnabled: true
ToolTip.visible: hovered
ToolTip.text: qsTr("Stop Ignoring.")
onClicked: profile.ignored = false
2023-07-28 04:04:34 +03:00
}
}
2023-10-26 01:38:04 +03:00
footer: DialogButtonBox {
z: 2
width: view.width
alignment: Qt.AlignRight
standardButtons: DialogButtonBox.Ok
onAccepted: ignoredUsers.close()
background: Rectangle {
anchors.fill: parent
color: palette.window
}
}
2023-07-28 04:04:34 +03:00
}
}