Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2578094
RoomListView.qml
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
RoomListView.qml
View Options
/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2020-2021 Tusooa Zhu <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import
QtQuick
2.2
import
QtQuick
.
Layouts
1.15
import
QtQuick
.
Controls
2.15
import
org
.
kde
.
kirigami
2.13
as
Kirigami
import
'matrix-helpers.js'
as
Helpers
ListView
{
id: roomListView
property
var
roomList
property
var
roomIds:
roomList
.
roomIds
property
var
iconSize:
Kirigami
.
Units
.
iconSizes
.
large
//matrixSdk.currentRoomId
Layout.fillHeight:
true
model:
roomList
.
count
Layout.minimumHeight:
childrenRect
.
height
currentIndex:
roomIds
.
indexOf
(
sdkVars
.
currentRoomId
)
/* onModelChanged: currentIndex = Qt.binding(function() { */
/* print("current room id is: `%1`".arg(matrixSdk.currentRoomId)) */
/* print("index is: ", roomIds.indexOf(matrixSdk.currentRoomId)) */
/* return roomIds.indexOf(matrixSdk.currentRoomId) */
/* }) */
/* onCurrentIndexChanged: { */
/* root.roomPage.roomId = roomList.roomIdAt(currentIndex) */
/* } */
delegate:
Kirigami
.
SwipeListItem
{
property
var
item:
roomList
.
at
(
index
)
onClicked:
{
root
.
sdkVars
.
currentRoomId
=
item
.
roomId
}
checkable:
true
checked:
sdkVars
.
currentRoomId
==
item
.
roomId
autoExclusive:
true
RowLayout
{
Kirigami
.
Avatar
{
sourceSize.width:
iconSize
sourceSize.height:
iconSize
source:
item
.
avatarMxcUri
?
matrixSdk
.
mxcUriToHttp
(
item
.
avatarMxcUri
)
:
''
name:
Helpers
.
roomAvatarPlaceholderName
(
item
)
}
Label
{
text:
Helpers
.
roomNameOrHeroes
(
item
,
l10n
)
Layout.fillWidth:
true
}
}
actions:
[
Kirigami
.
Action
{
text:
l10n
.
get
(
"room-list-view-room-item-fav-action"
)
iconName:
"non-starred-symbolic"
onTriggered:
showPassiveNotification
(
l10n
.
get
(
'room-list-view-room-item-fav-action-notification'
,
{
name:
item
.
name
}))
}
]
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jun 24, 8:30 PM (21 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
92088
Default Alt Text
RoomListView.qml (1 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment