Skip to content
Snippets Groups Projects
Commit 5366f2bb authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Swap sides in room list and fix sorting stealing focus

parent 17d3dd0f
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,7 @@ Page {
anchors.fill: parent
model: rooms
currentIndex: -1
ScrollDecorator {
flickable: roomView
......@@ -87,44 +88,25 @@ Page {
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: Theme.paddingMedium
spacing: Theme.paddingSmall
width: roomItem.width
Item {
width: gi.width / 2
height: gi.height
GlassItem {
id: gi
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
height: 2 * Theme.fontSizeMedium
width: height
anchors.right: parent.right
width: Theme.itemSizeSmall
height: Theme.itemSizeSmall
color: Theme.highlightColor
opacity: unreadNotifications > 0 ? 1 : 0
Image {
anchors.fill: parent
sourceSize.width: height
sourceSize.height: height
fillMode: Image.PreserveAspectFit
source: model.roomPicture
asynchronous: true
}
}
Label {
id: unreadMessages
color: unreadNotifications > 0 ? Theme.highlightColor : Theme.secondaryColor
width: Theme.fontSizeMedium
Layout.preferredWidth: Theme.paddingMedium
text: {
if (unreadNotifications <= 0)
return "";
else if (unreadNotifications > 100)
return "99+";
else
return unreadNotifications;
}
font.pixelSize: unreadNotifications < 10 ? Theme.fontSizeLarge : Theme.fontSizeSmall
horizontalAlignment: Text.AlignRight
}
ColumnLayout {
Label {
id: roomName
......@@ -149,18 +131,38 @@ Page {
}
Image {
id: roomImage
Label {
id: unreadMessages
color: unreadNotifications > 0 ? Theme.highlightColor : Theme.secondaryColor
width: Theme.fontSizeMedium
Layout.preferredWidth: Theme.paddingMedium
text: {
if (unreadNotifications <= 0)
return "";
else if (unreadNotifications > 100)
return "99+";
else
return unreadNotifications;
}
font.pixelSize: unreadNotifications < 10 ? Theme.fontSizeLarge : Theme.fontSizeSmall
horizontalAlignment: Text.AlignRight
}
Item {
width: gi.width / 4
height: gi.height
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
GlassItem {
id: gi
anchors.horizontalCenter: parent.right
width: Theme.itemSizeSmall
height: Theme.itemSizeSmall
color: Theme.highlightColor
opacity: unreadNotifications > 0 ? 1 : 0
}
height: 2 * Theme.fontSizeMedium
width: height
sourceSize.width: height
sourceSize.height: height
fillMode: Image.PreserveAspectFit
source: model.roomPicture
asynchronous: true
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment