Reformat code.

This commit is contained in:
Black Hat 2018-09-04 21:13:14 +08:00
parent 412b5201bf
commit aa29f5252d
17 changed files with 139 additions and 90 deletions

View File

@ -57,17 +57,19 @@ Page {
Pane { Pane {
width: parent.width / 2 width: parent.width / 2
height: parent.height height: parent.height
padding: 64 padding: 64
ColumnLayout { ColumnLayout {
id: mainCol
width: parent.width width: parent.width
TextField { id: mainCol
id: serverField
TextField {
Layout.fillWidth: true Layout.fillWidth: true
id: serverField
leftPadding: 16 leftPadding: 16
topPadding: 0 topPadding: 0
bottomPadding: 0 bottomPadding: 0
@ -85,10 +87,10 @@ Page {
} }
TextField { TextField {
id: usernameField
Layout.fillWidth: true Layout.fillWidth: true
id: usernameField
leftPadding: 16 leftPadding: 16
topPadding: 0 topPadding: 0
bottomPadding: 0 bottomPadding: 0
@ -105,10 +107,10 @@ Page {
} }
TextField { TextField {
id: passwordField
Layout.fillWidth: true Layout.fillWidth: true
id: passwordField
leftPadding: 16 leftPadding: 16
topPadding: 0 topPadding: 0
bottomPadding: 0 bottomPadding: 0
@ -126,10 +128,10 @@ Page {
} }
Button { Button {
id: loginButton
Layout.fillWidth: true Layout.fillWidth: true
id: loginButton
text: "LOGIN" text: "LOGIN"
highlighted: true highlighted: true

View File

@ -29,28 +29,29 @@ Page {
spacing: 0 spacing: 0
RoomListForm { RoomListForm {
id: roomListForm
Layout.fillHeight: true Layout.fillHeight: true
Layout.preferredWidth: MSettings.miniMode ? 64 : page.width * 0.35 Layout.preferredWidth: MSettings.miniMode ? 64 : page.width * 0.35
Layout.minimumWidth: 64 Layout.minimumWidth: 64
Layout.maximumWidth: 360 Layout.maximumWidth: 360
id: roomListForm
listModel: roomListModel listModel: roomListModel
} }
Rectangle { Rectangle {
Layout.preferredWidth: 1 Layout.preferredWidth: 1
Layout.fillHeight: true Layout.fillHeight: true
color: MSettings.darkTheme ? "#363636" : "#ececec" color: MSettings.darkTheme ? "#363636" : "#ececec"
} }
RoomForm { RoomForm {
id: roomForm
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
id: roomForm
currentRoom: roomListForm.enteredRoom currentRoom: roomListForm.enteredRoom
} }
} }

View File

@ -58,23 +58,28 @@ Page {
Page { Page {
id: generalForm id: generalForm
parent: null parent: null
Column { Column {
Switch { Switch {
text: "Lazy load at initial sync" text: "Lazy load at initial sync"
checked: MSettings.lazyLoad checked: MSettings.lazyLoad
onCheckedChanged: MSettings.lazyLoad = checked onCheckedChanged: MSettings.lazyLoad = checked
} }
Switch { Switch {
text: "Use RichText instead of StyledText" text: "Use RichText instead of StyledText"
checked: MSettings.richText checked: MSettings.richText
onCheckedChanged: MSettings.richText = checked onCheckedChanged: MSettings.richText = checked
} }
Switch { Switch {
text: "Use press and hold instead of right click" text: "Use press and hold instead of right click"
checked: MSettings.pressAndHold checked: MSettings.pressAndHold
onCheckedChanged: MSettings.pressAndHold = checked onCheckedChanged: MSettings.pressAndHold = checked
} }
} }
@ -82,23 +87,28 @@ Page {
Page { Page {
id: appearanceForm id: appearanceForm
parent: null parent: null
Column { Column {
Switch { Switch {
text: "Dark theme" text: "Dark theme"
checked: MSettings.darkTheme checked: MSettings.darkTheme
onCheckedChanged: MSettings.darkTheme = checked onCheckedChanged: MSettings.darkTheme = checked
} }
Switch { Switch {
text: "Mini Room List" text: "Mini Room List"
checked: MSettings.miniMode checked: MSettings.miniMode
onCheckedChanged: MSettings.miniMode = checked onCheckedChanged: MSettings.miniMode = checked
} }
Switch { Switch {
text: "Rearrange rooms by activity" text: "Rearrange rooms by activity"
checked: MSettings.rearrangeByActivity checked: MSettings.rearrangeByActivity
onCheckedChanged: MSettings.rearrangeByActivity = checked onCheckedChanged: MSettings.rearrangeByActivity = checked
} }
} }
@ -118,12 +128,8 @@ Page {
source: "qrc:/asset/img/icon.png" source: "qrc:/asset/img/icon.png"
} }
Label { Label { text: "Matrique, an IM client for the Matrix protocol." }
text: "Matrique, an IM client for the Matrix protocol." Label { text: "Released under GNU General Public License, version 3." }
}
Label {
text: "Released under GNU General Public License, version 3."
}
} }
} }

View File

@ -6,22 +6,22 @@ Item {
property alias sourceSize: baseImage.sourceSize.width property alias sourceSize: baseImage.sourceSize.width
readonly property bool loading: baseImage.status == Image.Loading readonly property bool loading: baseImage.status == Image.Loading
signal clicked()
id: rekt signal clicked()
width: loading ? 128 : baseImage.implicitWidth width: loading ? 128 : baseImage.implicitWidth
height: loading ? progressBar.height : baseImage.implicitHeight height: loading ? progressBar.height : baseImage.implicitHeight
Image { id: rekt
id: baseImage
} Image { id: baseImage }
ProgressBar { ProgressBar {
id: progressBar
width: parent.width width: parent.width
visible: loading visible: loading
id: progressBar
indeterminate: true indeterminate: true
} }

View File

@ -11,5 +11,6 @@ Label {
wrapMode: Label.Wrap wrapMode: Label.Wrap
linkColor: coloredBackground ? "white" : Material.accent linkColor: coloredBackground ? "white" : Material.accent
textFormat: MSettings.richText ? Text.RichText : Text.StyledText textFormat: MSettings.richText ? Text.RichText : Text.StyledText
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
} }

View File

@ -6,6 +6,7 @@ MouseArea {
signal secondaryClicked() signal secondaryClicked()
acceptedButtons: MSettings.pressAndHold ? Qt.LeftButton : (Qt.LeftButton | Qt.RightButton) acceptedButtons: MSettings.pressAndHold ? Qt.LeftButton : (Qt.LeftButton | Qt.RightButton)
onClicked: mouse.button == Qt.RightButton ? secondaryClicked() : primaryClicked() onClicked: mouse.button == Qt.RightButton ? secondaryClicked() : primaryClicked()
onPressAndHold: MSettings.pressAndHold ? secondaryClicked() : {} onPressAndHold: MSettings.pressAndHold ? secondaryClicked() : {}
} }

View File

@ -11,20 +11,18 @@ Item {
z: -2 z: -2
height: parent.height height: parent.height
width: progressInfo.active && !progressInfo.completed ? progressInfo.progress / progressInfo.total * parent.width : 0 width: progressInfo.active && !progressInfo.completed ? progressInfo.progress / progressInfo.total * parent.width : 0
color: Material.accent color: Material.accent
opacity: 0.4 opacity: 0.4
} }
onDownloadedChanged: downloaded && openOnFinished ? openSavedFile() : {} onDownloadedChanged: if (downloaded && openOnFinished) openSavedFile()
function saveFileAs() { function saveFileAs() { currentRoom.saveFileAs(eventId) }
currentRoom.saveFileAs(eventId)
}
function downloadAndOpen() function downloadAndOpen()
{ {
if (downloaded) if (downloaded) openSavedFile()
openSavedFile()
else else
{ {
openOnFinished = true openOnFinished = true
@ -34,10 +32,7 @@ Item {
function openSavedFile() function openSavedFile()
{ {
if (Qt.openUrlExternally(progressInfo.localPath)) if (Qt.openUrlExternally(progressInfo.localPath)) return;
return; if (Qt.openUrlExternally(progressInfo.localDir)) return;
if (Qt.openUrlExternally(progressInfo.localDir))
return;
} }
} }

View File

@ -52,6 +52,7 @@ Popup {
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 2 Layout.preferredHeight: 2
color: Material.accent color: Material.accent
} }

View File

@ -12,13 +12,11 @@ Control {
padding: 12 padding: 12
background: Rectangle {
color: colored ? Material.accent : highlighted ? Material.primary : backgroundColor
}
AutoMouseArea { AutoMouseArea {
anchors.fill: parent anchors.fill: parent
onSecondaryClicked: Qt.createComponent("qrc:/qml/menu/MessageContextMenu.qml").createObject(this) onSecondaryClicked: Qt.createComponent("qrc:/qml/menu/MessageContextMenu.qml").createObject(this)
} }
background: Rectangle { color: colored ? Material.accent : highlighted ? Material.primary : backgroundColor }
} }

View File

@ -13,9 +13,11 @@ Item {
id: item id: item
Image { Image {
id: avatar
width: item.width width: item.width
height: item.width height: item.width
id: avatar
visible: showImage visible: showImage
source: item.source source: item.source
@ -40,6 +42,7 @@ Item {
Label { Label {
anchors.fill: parent anchors.fill: parent
color: "white" color: "white"
visible: showInitial visible: showInitial
text: showInitial ? getInitials(displayText)[0] : "" text: showInitial ? getInitials(displayText)[0] : ""

View File

@ -10,8 +10,9 @@ Item {
id: item id: item
Text { Text {
id: iconText
anchors.fill: parent anchors.fill: parent
id: iconText
font.pointSize: 16 font.pointSize: 16
font.family: materialFont.name font.family: materialFont.name
color: item.color color: item.color

View File

@ -14,10 +14,10 @@ RowLayout {
signal saveFileAs() signal saveFileAs()
signal openExternally() signal openExternally()
id: messageRow
z: -5 z: -5
id: messageRow
Layout.alignment: sentByMe ? Qt.AlignRight : Qt.AlignLeft Layout.alignment: sentByMe ? Qt.AlignRight : Qt.AlignLeft
spacing: 6 spacing: 6
@ -100,14 +100,16 @@ RowLayout {
id: imageComponent id: imageComponent
DownloadableContent { DownloadableContent {
id: downloadable
width: messageImage.width width: messageImage.width
height: messageImage.height height: messageImage.height
id: downloadable
AutoImage { AutoImage {
id: messageImage
z: -4 z: -4
id: messageImage
sourceSize: 128 sourceSize: 128
source: "image://mxc/" + (content.thumbnail_url ? content.thumbnail_url : content.url) source: "image://mxc/" + (content.thumbnail_url ? content.thumbnail_url : content.url)

View File

@ -22,11 +22,11 @@ Item {
} }
Drawer { Drawer {
id: roomDrawer
width: Math.min(item.width * 0.7, 480) width: Math.min(item.width * 0.7, 480)
height: item.height height: item.height
id: roomDrawer
edge: Qt.RightEdge edge: Qt.RightEdge
interactive: false interactive: false
@ -51,12 +51,14 @@ Item {
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: currentRoom && currentRoom.id ? currentRoom.id : "" text: currentRoom && currentRoom.id ? currentRoom.id : ""
} }
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: currentRoom && currentRoom.canonicalAlias ? currentRoom.canonicalAlias : "No Canonical Alias" text: currentRoom && currentRoom.canonicalAlias ? currentRoom.canonicalAlias : "No Canonical Alias"
} }
@ -65,8 +67,9 @@ Item {
Layout.fillWidth: true Layout.fillWidth: true
TextField { TextField {
id: roomNameField
Layout.fillWidth: true Layout.fillWidth: true
id: roomNameField
text: currentRoom && currentRoom.name ? currentRoom.name : "" text: currentRoom && currentRoom.name ? currentRoom.name : ""
} }
@ -84,9 +87,10 @@ Item {
Layout.fillWidth: true Layout.fillWidth: true
TextField { TextField {
Layout.fillWidth: true
id: roomTopicField id: roomTopicField
Layout.fillWidth: true
text: currentRoom && currentRoom.topic ? currentRoom.topic : "" text: currentRoom && currentRoom.topic ? currentRoom.topic : ""
} }
@ -176,6 +180,7 @@ Item {
ImageStatus { ImageStatus {
Layout.preferredWidth: height Layout.preferredWidth: height
Layout.fillHeight: true Layout.fillHeight: true
source: currentRoom && currentRoom.avatarUrl != "" ? "image://mxc/" + currentRoom.avatarUrl : null source: currentRoom && currentRoom.avatarUrl != "" ? "image://mxc/" + currentRoom.avatarUrl : null
displayText: currentRoom ? currentRoom.displayName : "" displayText: currentRoom ? currentRoom.displayName : ""
} }
@ -222,10 +227,11 @@ Item {
spacing: 0 spacing: 0
ListView { ListView {
id: messageListView
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
id: messageListView
clip: true clip: true
displayMarginBeginning: 40 displayMarginBeginning: 40
displayMarginEnd: 40 displayMarginEnd: 40
@ -243,13 +249,12 @@ Item {
delegate: ColumnLayout { delegate: ColumnLayout {
readonly property bool hidden: marks === EventStatus.Redacted || marks === EventStatus.Hidden readonly property bool hidden: marks === EventStatus.Redacted || marks === EventStatus.Hidden
id: delegateColumn
width: parent.width width: parent.width
height: hidden ? -8 : undefined height: hidden ? -8 : undefined
clip: true id: delegateColumn
clip: true
spacing: 8 spacing: 8
Label { Label {
@ -283,9 +288,7 @@ Item {
topPadding: 4 topPadding: 4
bottomPadding: 4 bottomPadding: 4
background: Rectangle { background: Rectangle { color: MSettings.darkTheme ? "#484848" : "grey" }
color: MSettings.darkTheme ? "#484848" : "grey"
}
} }
MessageDelegate { MessageDelegate {
@ -294,6 +297,7 @@ Item {
StateDelegate { StateDelegate {
Layout.maximumWidth: messageListView.width * 0.8 Layout.maximumWidth: messageListView.width * 0.8
visible: eventType === "emote" || eventType === "state" visible: eventType === "emote" || eventType === "state"
} }
} }
@ -304,9 +308,11 @@ Item {
onAtYEndChanged: atYEnd && currentRoom ? currentRoom.markAllMessagesAsRead() : {} onAtYEndChanged: atYEnd && currentRoom ? currentRoom.markAllMessagesAsRead() : {}
RoundButton { RoundButton {
id: goTopFab
width: 64 width: 64
height: 64 height: 64
id: goTopFab
visible: !parent.atYEnd visible: !parent.atYEnd
anchors.right: parent.right anchors.right: parent.right
@ -328,10 +334,10 @@ Item {
} }
ScrollBar { ScrollBar {
id: messageListViewScrollBar
Layout.preferredWidth: 16 Layout.preferredWidth: 16
Layout.fillHeight: true Layout.fillHeight: true
id: messageListViewScrollBar
} }
} }
@ -354,9 +360,11 @@ Item {
TextField { TextField {
property real progress: 0 property real progress: 0
id: inputField
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 48 Layout.preferredHeight: 48
id: inputField
placeholderText: "Send a Message" placeholderText: "Send a Message"
leftPadding: 16 leftPadding: 16
topPadding: 0 topPadding: 0
@ -455,11 +463,11 @@ Item {
} }
ItemDelegate { ItemDelegate {
id: emojiButton
Layout.preferredWidth: 48 Layout.preferredWidth: 48
Layout.preferredHeight: 48 Layout.preferredHeight: 48
id: emojiButton
contentItem: MaterialIcon { icon: "\ue24e" } contentItem: MaterialIcon { icon: "\ue24e" }
background: Rectangle { color: MSettings.darkTheme ? "#282828" : "#eaeaea" } background: Rectangle { color: MSettings.darkTheme ? "#282828" : "#eaeaea" }
@ -467,16 +475,16 @@ Item {
onClicked: emojiPicker.visible ? emojiPicker.close() : emojiPicker.open() onClicked: emojiPicker.visible ? emojiPicker.close() : emojiPicker.open()
EmojiPicker { EmojiPicker {
id: emojiPicker
parent: ApplicationWindow.overlay
x: window.width - 370 x: window.width - 370
y: window.height - 440 y: window.height - 440
width: 360 width: 360
height: 360 height: 360
id: emojiPicker
parent: ApplicationWindow.overlay
textArea: inputField textArea: inputField
} }
} }

View File

@ -16,6 +16,7 @@ Item {
Label { Label {
z: 10 z: 10
text: MSettings.miniMode ? "Empty" : "Here? No, not here." text: MSettings.miniMode ? "Empty" : "Here? No, not here."
anchors.centerIn: parent anchors.centerIn: parent
visible: listView.count === 0 visible: listView.count === 0
@ -26,18 +27,18 @@ Item {
spacing: 0 spacing: 0
TextField { TextField {
id: searchField
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 40 Layout.preferredHeight: 40
Layout.margins: 12 Layout.margins: 12
id: searchField
leftPadding: MSettings.miniMode ? 4 : 32 leftPadding: MSettings.miniMode ? 4 : 32
topPadding: 0 topPadding: 0
bottomPadding: 0 bottomPadding: 0
placeholderText: "Search..." placeholderText: "Search..."
background: Rectangle { background: Rectangle { color: MSettings.darkTheme ? "#282828" : "#fafafa" }
color: MSettings.darkTheme ? "#282828" : "#fafafa"
}
Shortcut { Shortcut {
sequence: StandardKey.Find sequence: StandardKey.Find
@ -47,6 +48,7 @@ Item {
SortFilterProxyModel { SortFilterProxyModel {
id: roomListProxyModel id: roomListProxyModel
filters: RegExpFilter { filters: RegExpFilter {
roleName: "name" roleName: "name"
pattern: searchField.text pattern: searchField.text
@ -120,6 +122,7 @@ Item {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
visible: highlighted visible: highlighted
color: Material.accent color: Material.accent
opacity: 0.1 opacity: 0.1
@ -128,6 +131,7 @@ Item {
Rectangle { Rectangle {
width: 4 width: 4
height: parent.height height: parent.height
color: Material.accent color: Material.accent
visible: unreadCount > 0 || highlighted visible: unreadCount > 0 || highlighted
} }
@ -135,6 +139,7 @@ Item {
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
anchors.margins: 12 anchors.margins: 12
spacing: 12 spacing: 12
ImageStatus { ImageStatus {
@ -179,6 +184,7 @@ Item {
section.delegate: Label { section.delegate: Label {
width: parent.width width: parent.width
height: 24 height: 24
text: section text: section
color: "grey" color: "grey"
leftPadding: MSettings.miniMode ? undefined : 16 leftPadding: MSettings.miniMode ? undefined : 16

View File

@ -13,12 +13,14 @@ import "form"
ApplicationWindow { ApplicationWindow {
readonly property var connection: matriqueController.connection readonly property var connection: matriqueController.connection
id: window
visible: true
width: 960 width: 960
height: 640 height: 640
minimumWidth: 800 minimumWidth: 800
minimumHeight: 480 minimumHeight: 480
id: window
visible: true
title: qsTr("Matrique") title: qsTr("Matrique")
Material.theme: MSettings.darkTheme ? Material.Dark : Material.Light Material.theme: MSettings.darkTheme ? Material.Dark : Material.Light
@ -40,10 +42,11 @@ ApplicationWindow {
Popup { Popup {
property bool busy: matriqueController.busy property bool busy: matriqueController.busy
id: busyPopup
x: (window.width - width) / 2 x: (window.width - width) / 2
y: (window.height - height) / 2 y: (window.height - height) / 2
id: busyPopup
modal: true modal: true
focus: true focus: true
@ -81,9 +84,11 @@ ApplicationWindow {
spacing: 0 spacing: 0
Rectangle { Rectangle {
id: sideNav
Layout.preferredWidth: 64 Layout.preferredWidth: 64
Layout.fillHeight: true Layout.fillHeight: true
id: sideNav
color: Material.primary color: Material.primary
ColumnLayout { ColumnLayout {
@ -106,8 +111,9 @@ ApplicationWindow {
} }
Rectangle { Rectangle {
color: "transparent"
Layout.fillHeight: true Layout.fillHeight: true
color: "transparent"
} }
SideNavButton { SideNavButton {
@ -125,6 +131,7 @@ ApplicationWindow {
Menu { Menu {
id: addRoomMenu id: addRoomMenu
MenuItem { MenuItem {
text:"New Room" text:"New Room"
onTriggered: addRoomDialog.open() onTriggered: addRoomDialog.open()
@ -143,14 +150,17 @@ ApplicationWindow {
contentItem: Column { contentItem: Column {
TextField { TextField {
id: addRoomDialogNameTextField
width: parent.width width: parent.width
id: addRoomDialogNameTextField
placeholderText: "Name" placeholderText: "Name"
} }
TextField { TextField {
id: addRoomDialogTopicTextField
width: parent.width width: parent.width
id: addRoomDialogTopicTextField
placeholderText: "Topic" placeholderText: "Topic"
} }
} }
@ -160,16 +170,18 @@ ApplicationWindow {
} }
MenuItem { MenuItem {
text: "Join Room" text: "Join Room"
onTriggered: joinRoomDialog.open() onTriggered: joinRoomDialog.open()
Dialog { Dialog {
id: joinRoomDialog
parent: ApplicationWindow.overlay
x: (window.width - width) / 2 x: (window.width - width) / 2
y: (window.height - height) / 2 y: (window.height - height) / 2
width: 360 width: 360
id: joinRoomDialog
parent: ApplicationWindow.overlay
title: "Input Room Alias or ID" title: "Input Room Alias or ID"
modal: true modal: true
standardButtons: Dialog.Ok | Dialog.Cancel standardButtons: Dialog.Ok | Dialog.Cancel
@ -185,16 +197,18 @@ ApplicationWindow {
MenuItem { MenuItem {
text: "Direct Chat" text: "Direct Chat"
onTriggered: directChatDialog.open() onTriggered: directChatDialog.open()
Dialog { Dialog {
id: directChatDialog
parent: ApplicationWindow.overlay
x: (window.width - width) / 2 x: (window.width - width) / 2
y: (window.height - height) / 2 y: (window.height - height) / 2
width: 360 width: 360
id: directChatDialog
parent: ApplicationWindow.overlay
title: "Input User ID" title: "Input User ID"
modal: true modal: true
standardButtons: Dialog.Ok | Dialog.Cancel standardButtons: Dialog.Ok | Dialog.Cancel
@ -240,11 +254,12 @@ ApplicationWindow {
} }
StackView { StackView {
id: stackView
initialItem: roomPage
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
id: stackView
initialItem: roomPage
} }
} }

View File

@ -8,28 +8,33 @@ Menu {
MenuItem { MenuItem {
text: "Copy" text: "Copy"
onTriggered: matriqueController.copyToClipboard(plainText) onTriggered: matriqueController.copyToClipboard(plainText)
} }
MenuItem { MenuItem {
text: "Copy Source" text: "Copy Source"
onTriggered: matriqueController.copyToClipboard(toolTip) onTriggered: matriqueController.copyToClipboard(toolTip)
} }
MenuItem { MenuItem {
visible: isFile visible: isFile
height: visible ? undefined : 0 height: visible ? undefined : 0
text: "Open Externally" text: "Open Externally"
onTriggered: messageRow.openExternally() onTriggered: messageRow.openExternally()
} }
MenuItem { MenuItem {
visible: isFile visible: isFile
height: visible ? undefined : 0 height: visible ? undefined : 0
text: "Save As" text: "Save As"
onTriggered: messageRow.saveFileAs() onTriggered: messageRow.saveFileAs()
} }
MenuItem { MenuItem {
visible: sentByMe visible: sentByMe
height: visible ? undefined : 0 height: visible ? undefined : 0
text: "Redact" text: "Redact"
onTriggered: currentRoom.redactEvent(eventId) onTriggered: currentRoom.redactEvent(eventId)
} }

View File

@ -8,21 +8,25 @@ Menu {
text: "Favourite" text: "Favourite"
checkable: true checkable: true
checked: currentRoom && currentRoom.isFavourite checked: currentRoom && currentRoom.isFavourite
onTriggered: currentRoom.isFavourite ? currentRoom.removeTag("m.favourite") : currentRoom.addTag("m.favourite", "1") onTriggered: currentRoom.isFavourite ? currentRoom.removeTag("m.favourite") : currentRoom.addTag("m.favourite", "1")
} }
MenuItem { MenuItem {
text: "Deprioritize" text: "Deprioritize"
checkable: true checkable: true
checked: currentRoom && currentRoom.isLowPriority checked: currentRoom && currentRoom.isLowPriority
onTriggered: currentRoom.isLowPriority ? currentRoom.removeTag("m.lowpriority") : currentRoom.addTag("m.lowpriority", "1") onTriggered: currentRoom.isLowPriority ? currentRoom.removeTag("m.lowpriority") : currentRoom.addTag("m.lowpriority", "1")
} }
MenuSeparator {} MenuSeparator {}
MenuItem { MenuItem {
text: "Mark as Read" text: "Mark as Read"
onTriggered: currentRoom.markAllMessagesAsRead() onTriggered: currentRoom.markAllMessagesAsRead()
} }
MenuItem { MenuItem {
text: "Leave Room" text: "Leave Room"
onTriggered: currentRoom.forget() onTriggered: currentRoom.forget()
} }