Fix a few things

This commit is contained in:
Loren Burkholder 2021-12-13 22:07:59 -05:00
parent 6e7e22b0e7
commit 4a7e6d3f48
2 changed files with 4 additions and 16 deletions

View file

@ -31,7 +31,7 @@ Page {
anchors.right: parent.right anchors.right: parent.right
height: parent.height height: parent.height
model: Rooms model: Rooms
reuseItems: false reuseItems: true
ScrollHelper { ScrollHelper {
flickable: parent flickable: parent
@ -139,7 +139,7 @@ Page {
height: avatarSize + 2 * Nheko.paddingMedium height: avatarSize + 2 * Nheko.paddingMedium
width: ListView.view.width width: ListView.view.width
state: "normal" state: "normal"
ToolTip.visible: hovered && collapsed && !collapsedBubbleHover.hovered && !notificationBubbleHover.hovered ToolTip.visible: hovered && collapsed
ToolTip.text: roomName ToolTip.text: roomName
onClicked: { onClicked: {
console.log("tapped " + roomId); console.log("tapped " + roomId);
@ -239,8 +239,6 @@ Page {
width: Math.min(Math.max(collapsedBubbleText.width + Nheko.paddingMedium, height), parent.width) width: Math.min(Math.max(collapsedBubbleText.width + Nheko.paddingMedium, height), parent.width)
radius: height / 2 radius: height / 2
color: hasLoudNotification ? Nheko.theme.red : roomItem.bubbleBackground color: hasLoudNotification ? Nheko.theme.red : roomItem.bubbleBackground
ToolTip.text: notificationCount
ToolTip.visible: collapsedBubbleHover.hovered && (notificationCount > 9999)
Label { Label {
id: collapsedBubbleText id: collapsedBubbleText
@ -255,10 +253,6 @@ Page {
text: notificationCount > 9999 ? "9999+" : notificationCount text: notificationCount > 9999 ? "9999+" : notificationCount
} }
HoverHandler {
id: collapsedBubbleHover
}
} }
} }
@ -345,12 +339,6 @@ Page {
color: hasLoudNotification ? "white" : roomItem.bubbleText color: hasLoudNotification ? "white" : roomItem.bubbleText
text: notificationCount > 9999 ? "9999+" : notificationCount text: notificationCount > 9999 ? "9999+" : notificationCount
onTextChanged: {
let old = parent.width
parent.width = Math.max(probableWidth + Nheko.paddingMedium, parent.height)
console.log(old + " changed to " + parent.width)
}
HoverHandler { HoverHandler {
id: notificationBubbleHover id: notificationBubbleHover
} }

View file

@ -14,7 +14,7 @@ Rectangle {
required property int encryptionError required property int encryptionError
required property string eventId required property string eventId
radius: fontMetrics.xHeight + Nheko.paddingMedium radius: fontMetrics.lineSpacing / 2 + Nheko.paddingMedium
width: parent ? parent.width : undefined width: parent ? parent.width : undefined
height: contents.implicitHeight + Nheko.paddingMedium * 2 height: contents.implicitHeight + Nheko.paddingMedium * 2
color: Nheko.colors.alternateBase color: Nheko.colors.alternateBase
@ -56,7 +56,7 @@ Rectangle {
return qsTr("Unknown decryption error"); return qsTr("Unknown decryption error");
} }
} }
color: Nheko.colors.buttonText color: Nheko.colors.text
width: parent ? parent.width : undefined width: parent ? parent.width : undefined
} }