summary refs log tree commit diff
path: root/resources/qml/RoomList.qml
diff options
context:
space:
mode:
Diffstat (limited to 'resources/qml/RoomList.qml')
-rw-r--r--resources/qml/RoomList.qml82
1 files changed, 40 insertions, 42 deletions
diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml

index 12ecc6e8..db255bd3 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml
@@ -114,10 +114,10 @@ Page { } - delegate: Rectangle { + delegate: ItemDelegate { id: roomItem - property color background: Nheko.colors.window + property color backgroundColor: Nheko.colors.window property color importantText: Nheko.colors.text property color unimportantText: Nheko.colors.buttonText property color bubbleBackground: Nheko.colors.highlight @@ -136,20 +136,31 @@ Page { required property bool isDirect required property string directChatOtherUserId - color: background height: avatarSize + 2 * Nheko.paddingMedium width: ListView.view.width state: "normal" - ToolTip.visible: hovered.hovered && collapsed + ToolTip.visible: hovered && collapsed ToolTip.text: roomName + onClicked: { + console.log("tapped " + roomId); + if (!Rooms.currentRoom || Rooms.currentRoom.roomId !== roomId) + Rooms.setCurrentRoom(roomId); + else + Rooms.resetCurrentRoom(); + } + onPressAndHold: { + if (!isInvite) + roomContextMenu.show(roomId, tags); + + } states: [ State { name: "highlight" - when: hovered.hovered && !((Rooms.currentRoom && roomId == Rooms.currentRoom.roomId) || Rooms.currentRoomPreview.roomid == roomId) + when: roomItem.hovered && !((Rooms.currentRoom && roomId == Rooms.currentRoom.roomId) || Rooms.currentRoomPreview.roomid == roomId) PropertyChanges { target: roomItem - background: Nheko.colors.dark + backgroundColor: Nheko.colors.dark importantText: Nheko.colors.brightText unimportantText: Nheko.colors.brightText bubbleBackground: Nheko.colors.highlight @@ -163,7 +174,7 @@ Page { PropertyChanges { target: roomItem - background: Nheko.colors.highlight + backgroundColor: Nheko.colors.highlight importantText: Nheko.colors.highlightedText unimportantText: Nheko.colors.highlightedText bubbleBackground: Nheko.colors.highlightedText @@ -189,28 +200,6 @@ Page { acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad } - TapHandler { - margin: -Nheko.paddingSmall - onSingleTapped: { - console.log("tapped "+roomId); - if (!Rooms.currentRoom || Rooms.currentRoom.roomId !== roomId) - Rooms.setCurrentRoom(roomId); - else - Rooms.resetCurrentRoom(); - } - onLongPressed: { - if (!isInvite) - roomContextMenu.show(roomId, tags); - - } - } - - HoverHandler { - id: hovered - - acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad - } - } RowLayout { @@ -362,6 +351,10 @@ Page { visible: hasUnreadMessages } + background: Rectangle { + color: backgroundColor + } + } } @@ -505,35 +498,40 @@ Page { Rectangle { id: unverifiedStuffBubble - color: Qt.lighter(Nheko.theme.orange, verifyButtonHovered.hovered ? 1.2 : 1.0) + + color: Qt.lighter(Nheko.theme.orange, verifyButtonHovered.hovered ? 1.2 : 1) Layout.fillWidth: true implicitHeight: explanation.height + Nheko.paddingMedium * 2 visible: SelfVerificationStatus.status != SelfVerificationStatus.AllVerified RowLayout { id: unverifiedStuffBubbleContainer + width: parent.width height: explanation.height + Nheko.paddingMedium * 2 spacing: 0 Label { id: explanation + Layout.margins: Nheko.paddingMedium Layout.rightMargin: Nheko.paddingSmall color: Nheko.colors.buttonText Layout.fillWidth: true - text: switch(SelfVerificationStatus.status) { + text: { + switch (SelfVerificationStatus.status) { case SelfVerificationStatus.NoMasterKey: - //: Cross-signing setup has not run yet. - return qsTr("Encryption not set up"); + //: Cross-signing setup has not run yet. + return qsTr("Encryption not set up"); case SelfVerificationStatus.UnverifiedMasterKey: - //: The user just signed in with this device and hasn't verified their master key. - return qsTr("Unverified login"); + //: The user just signed in with this device and hasn't verified their master key. + return qsTr("Unverified login"); case SelfVerificationStatus.UnverifiedDevices: - //: There are unverified devices signed in to this account. - return qsTr("Please verify your other devices"); + //: There are unverified devices signed in to this account. + return qsTr("Please verify your other devices"); default: - return "" + return ""; + } } textFormat: Text.PlainText wrapMode: Text.Wrap @@ -558,8 +556,8 @@ Page { HoverHandler { id: verifyButtonHovered - enabled: !closeUnverifiedBubble.hovered + enabled: !closeUnverifiedBubble.hovered acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad } @@ -567,13 +565,13 @@ Page { enabled: !closeUnverifiedBubble.hovered acceptedButtons: Qt.LeftButton onSingleTapped: { - if (SelfVerificationStatus.status == SelfVerificationStatus.UnverifiedDevices) { + if (SelfVerificationStatus.status == SelfVerificationStatus.UnverifiedDevices) SelfVerificationStatus.verifyUnverifiedDevices(); - } else { + else SelfVerificationStatus.statusChanged(); - } } } + } Rectangle {