matrixion/resources/qml/dialogs/IgnoredUsers.qml

87 lines
2.3 KiB
QML
Raw 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
2023-10-26 02:51:45 +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
2023-10-31 05:11:03 +03:00
color: palette.window
2023-07-28 04:04:34 +03:00
flags: Qt.WindowCloseButtonHint | Qt.WindowTitleHint
height: 650
minimumHeight: 420
2023-10-31 05:11:03 +03:00
title: qsTr("Ignored users")
width: 420
2023-07-28 04:04:34 +03:00
ListView {
id: view
2023-10-31 05:11:03 +03:00
2023-08-04 09:30:45 +03:00
anchors.fill: parent
2023-10-26 01:38:04 +03:00
footerPositioning: ListView.OverlayFooter
2023-09-08 00:10:04 +03:00
model: TimelineManager.ignoredUsers
2023-10-31 05:11:03 +03:00
spacing: Nheko.paddingMedium
2023-08-04 09:30:45 +03:00
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 {
displayName: profile.displayName
2023-10-31 05:11:03 +03:00
enabled: false
url: profile.avatarUrl.replace("mxc://", "image://MxcImage/")
2023-10-31 05:11:03 +03:00
userid: profile.userid
}
2023-07-28 04:04:34 +03:00
Text {
Layout.alignment: Qt.AlignLeft
2023-10-31 05:11:03 +03:00
Layout.fillWidth: true
2023-07-28 04:04:34 +03:00
color: palette.text
2023-10-31 05:11:03 +03:00
elide: Text.ElideRight
2023-07-28 04:04:34 +03:00
text: modelData
}
ImageButton {
Layout.preferredHeight: 24
Layout.preferredWidth: 24
ToolTip.text: qsTr("Stop Ignoring.")
2023-10-31 05:11:03 +03:00
ToolTip.visible: hovered
hoverEnabled: true
image: ":/icons/icons/ui/dismiss.svg"
onClicked: profile.ignored = false
2023-07-28 04:04:34 +03:00
}
}
2023-10-26 01:38:04 +03:00
footer: DialogButtonBox {
alignment: Qt.AlignRight
standardButtons: DialogButtonBox.Ok
2023-10-31 05:11:03 +03:00
width: view.width
z: 2
2023-10-26 01:38:04 +03:00
background: Rectangle {
anchors.fill: parent
color: palette.window
}
2023-10-31 05:11:03 +03:00
onAccepted: ignoredUsers.close()
}
header: ColumnLayout {
Text {
Layout.fillWidth: true
Layout.maximumWidth: view.width
color: palette.text
text: qsTr("Ignoring a user hides their messages (they can still see yours!).")
wrapMode: Text.Wrap
}
Item {
Layout.preferredHeight: Nheko.paddingLarge
}
2023-10-26 01:38:04 +03:00
}
2023-07-28 04:04:34 +03:00
}
}