Fix a small alignment issue of text in notification bubbles

This commit is contained in:
Nicolas Werner 2021-12-16 21:30:58 +01:00
parent 2ffd476e8f
commit 999ac95658
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -236,7 +236,7 @@ Page {
enabled: false
Layout.alignment: Qt.AlignRight
height: fontMetrics.averageCharacterWidth * 3
width: Math.min(Math.max(collapsedBubbleText.width + Nheko.paddingMedium, height), parent.width)
width: Math.max(collapsedBubbleText.width, height)
radius: height / 2
color: hasLoudNotification ? Nheko.theme.red : roomItem.bubbleBackground
@ -246,7 +246,7 @@ Page {
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
fontSizeMode: Text.Fit
width: Math.max(implicitWidth + Nheko.paddingMedium, parent.height)
font.bold: true
font.pixelSize: fontMetrics.font.pixelSize * 0.8
color: hasLoudNotification ? "white" : roomItem.bubbleText
@ -321,7 +321,7 @@ Page {
visible: notificationCount > 0
Layout.alignment: Qt.AlignRight
height: notificationBubbleText.height + Nheko.paddingMedium
Layout.preferredWidth: Math.max(notificationBubbleText.width + Nheko.paddingMedium, height)
Layout.preferredWidth: Math.max(notificationBubbleText.width, height)
radius: height / 2
color: hasLoudNotification ? Nheko.theme.red : roomItem.bubbleBackground
ToolTip.text: notificationCount
@ -333,7 +333,7 @@ Page {
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
fontSizeMode: Text.Fit
width: Math.max(implicitWidth + Nheko.paddingMedium, parent.height)
font.bold: true
font.pixelSize: fontMetrics.font.pixelSize * 0.8
color: hasLoudNotification ? "white" : roomItem.bubbleText