Simplify menu code and tweak UI.

This commit is contained in:
Black Hat
2018-09-12 08:27:34 +08:00
parent ebe69fd4c0
commit 2d2d35fcf5
7 changed files with 30 additions and 33 deletions

View File

@@ -89,7 +89,7 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true
text: currentRoom ? currentRoom.topic : ""
text: currentRoom ? (currentRoom.topic).replace(/(\r\n\t|\n|\r\t)/gm,"") : ""
color: "white"
elide: Text.ElideRight
wrapMode: Text.NoWrap

View File

@@ -116,7 +116,7 @@ Item {
hoverEnabled: MSettings.miniMode
onSecondaryClicked: {
roomContextMenu.room = currentRoom
roomContextMenu.model = model
roomContextMenu.popup()
}
onPrimaryClicked: {
@@ -141,11 +141,14 @@ Item {
}
Rectangle {
width: 4
width: unreadCount > 0 || highlighted ? 4 : 0
height: parent.height
color: Material.accent
visible: unreadCount > 0 || highlighted
Behavior on width {
PropertyAnimation { easing.type: Easing.InOutCubic; duration: 200 }
}
}
RowLayout {
@@ -187,7 +190,7 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true
text: (lastEvent == "" ? topic : lastEvent).replace(/(\r\n\t|\n|\r\t)/gm,"");
text: (lastEvent == "" ? topic : lastEvent).replace(/(\r\n\t|\n|\r\t)/gm,"")
elide: Text.ElideRight
wrapMode: Text.NoWrap
}