mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Merge pull request #841 from LorenDB/qolImprovements
Quality-of-life improvements
This commit is contained in:
commit
2ffd476e8f
4 changed files with 76 additions and 39 deletions
|
@ -236,21 +236,21 @@ Page {
|
||||||
enabled: false
|
enabled: false
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
height: fontMetrics.averageCharacterWidth * 3
|
height: fontMetrics.averageCharacterWidth * 3
|
||||||
width: height
|
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
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
id: collapsedBubbleText
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width * 0.8
|
|
||||||
height: parent.height * 0.8
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
fontSizeMode: Text.Fit
|
fontSizeMode: Text.Fit
|
||||||
font.bold: true
|
font.bold: true
|
||||||
font.pixelSize: fontMetrics.font.pixelSize * 0.8
|
font.pixelSize: fontMetrics.font.pixelSize * 0.8
|
||||||
color: hasLoudNotification ? "white" : roomItem.bubbleText
|
color: hasLoudNotification ? "white" : roomItem.bubbleText
|
||||||
text: notificationCount > 99 ? "99+" : notificationCount
|
text: notificationCount > 9999 ? "9999+" : notificationCount
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -320,22 +320,29 @@ Page {
|
||||||
|
|
||||||
visible: notificationCount > 0
|
visible: notificationCount > 0
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
height: fontMetrics.averageCharacterWidth * 3
|
height: notificationBubbleText.height + Nheko.paddingMedium
|
||||||
width: height
|
Layout.preferredWidth: Math.max(notificationBubbleText.width + Nheko.paddingMedium, height)
|
||||||
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: notificationBubbleHover.hovered && (notificationCount > 9999)
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
id: notificationBubbleText
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width * 0.8
|
|
||||||
height: parent.height * 0.8
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
fontSizeMode: Text.Fit
|
fontSizeMode: Text.Fit
|
||||||
font.bold: true
|
font.bold: true
|
||||||
font.pixelSize: fontMetrics.font.pixelSize * 0.8
|
font.pixelSize: fontMetrics.font.pixelSize * 0.8
|
||||||
color: hasLoudNotification ? "white" : roomItem.bubbleText
|
color: hasLoudNotification ? "white" : roomItem.bubbleText
|
||||||
text: notificationCount > 99 ? "99+" : notificationCount
|
text: notificationCount > 9999 ? "9999+" : notificationCount
|
||||||
|
|
||||||
|
HoverHandler {
|
||||||
|
id: notificationBubbleHover
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,16 +4,38 @@
|
||||||
|
|
||||||
import ".."
|
import ".."
|
||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
import QtQuick.Controls 2.1
|
import QtQuick.Controls 2.15
|
||||||
|
import QtQuick.Layouts 1.15
|
||||||
import im.nheko 1.0
|
import im.nheko 1.0
|
||||||
|
|
||||||
Column {
|
Rectangle {
|
||||||
id: r
|
id: r
|
||||||
|
|
||||||
required property int encryptionError
|
required property int encryptionError
|
||||||
required property string eventId
|
required property string eventId
|
||||||
|
|
||||||
|
radius: fontMetrics.lineSpacing / 2 + Nheko.paddingMedium
|
||||||
width: parent ? parent.width : undefined
|
width: parent ? parent.width : undefined
|
||||||
|
height: contents.implicitHeight + Nheko.paddingMedium * 2
|
||||||
|
color: Nheko.colors.alternateBase
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: contents
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: Nheko.paddingMedium
|
||||||
|
spacing: Nheko.paddingMedium
|
||||||
|
|
||||||
|
Image {
|
||||||
|
source: "image://colorimage/:/icons/icons/ui/shield-filled-cross.svg?" + Nheko.theme.error
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
width: 24
|
||||||
|
height: width
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
spacing: Nheko.paddingSmall
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
MatrixText {
|
MatrixText {
|
||||||
text: {
|
text: {
|
||||||
|
@ -34,8 +56,8 @@ Column {
|
||||||
return qsTr("Unknown decryption error");
|
return qsTr("Unknown decryption error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
color: Nheko.colors.buttonText
|
color: Nheko.colors.text
|
||||||
width: r ? r.width : undefined
|
width: parent ? parent.width : undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
@ -46,3 +68,7 @@ Column {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -104,11 +104,11 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
MatrixText {
|
MatrixText {
|
||||||
text: qsTr("%1 member(s)").arg(roomSettings.memberCount)
|
text: qsTr("%n member(s)", "", roomSettings.memberCount)
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
onTapped: TimelineManager.openRoomMembers(roomSettings.roomId)
|
onSingleTapped: TimelineManager.openRoomMembers(Rooms.getRoomById(roomSettings.roomId))
|
||||||
}
|
}
|
||||||
|
|
||||||
CursorShape {
|
CursorShape {
|
||||||
|
|
|
@ -170,6 +170,10 @@ public slots:
|
||||||
RoomPreview currentRoomPreview() const { return roomlistmodel->currentRoomPreview(); }
|
RoomPreview currentRoomPreview() const { return roomlistmodel->currentRoomPreview(); }
|
||||||
void setCurrentRoom(QString roomid) { roomlistmodel->setCurrentRoom(std::move(roomid)); }
|
void setCurrentRoom(QString roomid) { roomlistmodel->setCurrentRoom(std::move(roomid)); }
|
||||||
void resetCurrentRoom() { roomlistmodel->resetCurrentRoom(); }
|
void resetCurrentRoom() { roomlistmodel->resetCurrentRoom(); }
|
||||||
|
TimelineModel *getRoomById(const QString &id) const
|
||||||
|
{
|
||||||
|
return roomlistmodel->getRoomById(id).data();
|
||||||
|
}
|
||||||
|
|
||||||
void nextRoomWithActivity();
|
void nextRoomWithActivity();
|
||||||
void nextRoom();
|
void nextRoom();
|
||||||
|
|
Loading…
Reference in a new issue