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 { ...@@ -31,6 +31,7 @@ Page {
anchors.fill: parent anchors.fill: parent
model: rooms model: rooms
currentIndex: -1
ScrollDecorator { ScrollDecorator {
flickable: roomView flickable: roomView
...@@ -87,44 +88,25 @@ Page { ...@@ -87,44 +88,25 @@ Page {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: Theme.paddingMedium
spacing: Theme.paddingSmall spacing: Theme.paddingSmall
width: roomItem.width width: roomItem.width
Item { Item {
width: gi.width / 2 Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
height: gi.height height: 2 * Theme.fontSizeMedium
width: height
GlassItem {
id: gi
anchors.right: parent.right Image {
width: Theme.itemSizeSmall anchors.fill: parent
height: Theme.itemSizeSmall sourceSize.width: height
color: Theme.highlightColor sourceSize.height: height
opacity: unreadNotifications > 0 ? 1 : 0 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 { ColumnLayout {
Label { Label {
id: roomName id: roomName
...@@ -149,18 +131,38 @@ Page { ...@@ -149,18 +131,38 @@ Page {
} }
Image { Label {
id: roomImage 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