Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85629449
D338.1786163293.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D338.1786163293.diff
View Options
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,7 +21,7 @@
endif()
set(QT_MAJOR_VERSION ${kazv_KF_QT_MAJOR_VERSION})
set(KF_MAJOR_VERSION ${kazv_KF_QT_MAJOR_VERSION})
-set(QT_MIN_VERSION 6.5.0)
+set(QT_MIN_VERSION 6.9.0)
set(KF_MIN_VERSION 6.0.0)
option(kazv_LINK_BREEZE_ICONS "Link to Breeze icons library" OFF)
diff --git a/src/contents/ui/RoomListView.qml b/src/contents/ui/RoomListView.qml
--- a/src/contents/ui/RoomListView.qml
+++ b/src/contents/ui/RoomListView.qml
@@ -30,6 +30,7 @@
delegate: Kazv.RoomListViewItemDelegate {
required property var index
+ width: ListView.view.width
item: roomList.at(index)
iconSize: roomListView.iconSize
}
diff --git a/src/contents/ui/RoomListViewItemDelegate.qml b/src/contents/ui/RoomListViewItemDelegate.qml
--- a/src/contents/ui/RoomListViewItemDelegate.qml
+++ b/src/contents/ui/RoomListViewItemDelegate.qml
@@ -6,7 +6,7 @@
import QtQuick 2.2
import QtQuick.Layouts 1.15
-import QtQuick.Controls 2.15
+import QtQuick.Controls
import org.kde.kirigami 2.13 as Kirigami
import moe.kazv.mxc.kazv 0.0 as MK
@@ -16,7 +16,7 @@
import '.' as Kazv
-Kirigami.SwipeListItem {
+ItemDelegate {
id: upper
property var item
property var iconSize: 1
@@ -36,15 +36,12 @@
checkable: true
checked: sdkVars.currentRoomId == item.roomId
autoExclusive: true
+ highlighted: checked
Kirigami.Theme.colorSet: !checked ? Kirigami.Theme.View : Kirigami.Theme.Selection
Kirigami.Theme.inherit: false
focusPolicy: Qt.StrongFocus
Accessible.focusable: true
Accessible.name: roomDisplayName
- background: Rectangle {
- anchors.fill: parent
- color: (upper.hovered || upper.visualFocus) ? Kirigami.Theme.hoverColor : Kirigami.Theme.backgroundColor
- }
contentItem: RowLayout {
Kazv.AvatarAdapter {
@@ -52,6 +49,14 @@
name: Helpers.roomAvatarPlaceholderName(item)
}
+ Kirigami.Icon {
+ objectName: 'favIndicator'
+ source: /* iconName: */ 'starred-symbolic'
+ visible: upper.isFavourite
+ Accessible.role: Accessible.Indicator
+ Accessible.name: l10n.get('room-list-view-room-item-fav-indicator')
+ }
+
Label {
objectName: 'tombstoneIndicator'
visible: item.tombstoned === true
@@ -124,20 +129,20 @@
Accessible.name: l10n.get('room-list-view-room-item-unread-indicator')
}
}
- actions: [
+ ContextMenu.menu: Menu {
Kirigami.Action {
text: l10n.get("room-list-view-room-item-fav-action")
checkable: true
checked: isFavourite
icon.name: isFavourite ? 'starred-symbolic' : 'non-starred-symbolic'
onTriggered: toggleFavourite()
- },
+ }
Kirigami.Action {
text: l10n.get('room-list-view-room-item-more-action')
icon.name: 'view-more-horizontal-symbolic'
onTriggered: activateRoomSettingsPage(item)
}
- ]
+ }
function toggleFavourite() {
favouriteToggler.toggleTag('m.favourite');
diff --git a/src/tests/quick-tests/tst_RoomListViewItemDelegate.qml b/src/tests/quick-tests/tst_RoomListViewItemDelegate.qml
--- a/src/tests/quick-tests/tst_RoomListViewItemDelegate.qml
+++ b/src/tests/quick-tests/tst_RoomListViewItemDelegate.qml
@@ -43,6 +43,12 @@
unreadNotificationCount: 0,
})
+ property var roomFav: JsHelpers.factory.room({
+ membership: MK.MatrixRoom.Join,
+ unreadNotificationCount: 0,
+ tagIds: ['m.favourite'],
+ })
+
property var timelineUnread: QtObject {
property var count: 5
function at(i) {
@@ -213,6 +219,11 @@
id: delegateTombstone
item: roomTombstone
}
+
+ Kazv.RoomListViewItemDelegate {
+ id: delegateFav
+ item: roomFav
+ }
}
TestCase {
@@ -257,6 +268,19 @@
verify(leaveIndicator.visible);
}
+ function test_favIndicator() {
+ {
+ const indicator = findChild(delegateJoin, 'favIndicator');
+ verify(indicator);
+ verify(!indicator.visible);
+ }
+ {
+ const indicator = findChild(delegateFav, 'favIndicator');
+ verify(indicator);
+ verify(indicator.visible);
+ }
+ }
+
function test_lastUnreadMessage() {
const room = {};
compare(delegateJoin.getLastUnreadMessage(timelineUnread, timelineUnread.count, room).eventId, '$event2');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Aug 7, 9:28 PM (19 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1723986
Default Alt Text
D338.1786163293.diff (4 KB)
Attached To
Mode
D338: Refactor room list to use ItemDelegate
Attached
Detach File
Event Timeline
Log In to Comment