From 8ca1b93abb881a133cd12364d4d9e2426e682990 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Sat, 13 Nov 2021 13:46:29 -0500 Subject: [PATCH 01/22] Switch member dialog to using ItemDelegate --- resources/qml/dialogs/RoomMembers.qml | 111 +++++++++++++++----------- 1 file changed, 64 insertions(+), 47 deletions(-) diff --git a/resources/qml/dialogs/RoomMembers.qml b/resources/qml/dialogs/RoomMembers.qml index 6c8d1383..dd0c1db6 100644 --- a/resources/qml/dialogs/RoomMembers.qml +++ b/resources/qml/dialogs/RoomMembers.qml @@ -85,67 +85,84 @@ ApplicationWindow { enabled: !Settings.mobileMode } - delegate: RowLayout { + delegate: ItemDelegate { id: del + onClicked: Rooms.currentRoom.openUserProfile(model.mxid) + padding: Nheko.paddingMedium width: ListView.view.width - spacing: Nheko.paddingMedium - - Avatar { - id: avatar - - width: Nheko.avatarSize - height: Nheko.avatarSize - userid: model.mxid - url: model.avatarUrl.replace("mxc://", "image://MxcImage/") - displayName: model.displayName - onClicked: Rooms.currentRoom.openUserProfile(model.mxid) + height: memberLayout.implicitHeight + background: Rectangle { + color: roomMembersRoot.color } - ColumnLayout { - spacing: Nheko.paddingSmall + RowLayout { + id: memberLayout - ElidedLabel { - fullText: model.displayName - color: TimelineManager.userColor(model ? model.mxid : "", Nheko.colors.window) - font.pixelSize: fontMetrics.font.pixelSize - elideWidth: del.width - Nheko.paddingMedium * 2 - avatar.width - encryptInd.width + spacing: Nheko.paddingMedium + + Avatar { + id: avatar + + width: Nheko.avatarSize + height: Nheko.avatarSize + userid: model.mxid + url: model.avatarUrl.replace("mxc://", "image://MxcImage/") + displayName: model.displayName + enabled: false } - ElidedLabel { - fullText: model.mxid - color: Nheko.colors.buttonText - font.pixelSize: Math.ceil(fontMetrics.font.pixelSize * 0.9) - elideWidth: del.width - Nheko.paddingMedium * 2 - avatar.width - encryptInd.width + ColumnLayout { + spacing: Nheko.paddingSmall + + ElidedLabel { + fullText: model.displayName + color: TimelineManager.userColor(model ? model.mxid : "", Nheko.colors.window) + font.pixelSize: fontMetrics.font.pixelSize + elideWidth: del.width - Nheko.paddingMedium * 2 - avatar.width - encryptInd.width + } + + ElidedLabel { + fullText: model.mxid + color: Nheko.colors.buttonText + font.pixelSize: Math.ceil(fontMetrics.font.pixelSize * 0.9) + elideWidth: del.width - Nheko.paddingMedium * 2 - avatar.width - encryptInd.width + } + + Item { + Layout.fillHeight: true + Layout.fillWidth: true + } + } - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } + EncryptionIndicator { + id: encryptInd - } + Layout.alignment: Qt.AlignRight + visible: room.isEncrypted + encrypted: room.isEncrypted + trust: encrypted ? model.trustlevel : Crypto.Unverified + ToolTip.text: { + if (!encrypted) + return qsTr("This room is not encrypted!"); - EncryptionIndicator { - id: encryptInd - - Layout.alignment: Qt.AlignRight - visible: room.isEncrypted - encrypted: room.isEncrypted - trust: encrypted ? model.trustlevel : Crypto.Unverified - ToolTip.text: { - if (!encrypted) - return qsTr("This room is not encrypted!"); - - switch (trust) { - case Crypto.Verified: - return qsTr("This user is verified."); - case Crypto.TOFU: - return qsTr("This user isn't verified, but is still using the same master key from the first time you met."); - default: - return qsTr("This user has unverified devices!"); + switch (trust) { + case Crypto.Verified: + return qsTr("This user is verified."); + case Crypto.TOFU: + return qsTr("This user isn't verified, but is still using the same master key from the first time you met."); + default: + return qsTr("This user has unverified devices!"); + } } } + + } + + CursorShape { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor } } From d645c43618fc9e70dda535eeb7f61c6cd3ba6e1b Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Sat, 13 Nov 2021 14:05:27 -0500 Subject: [PATCH 02/22] Add highlight on hover --- resources/qml/dialogs/ReadReceipts.qml | 7 ++++++- resources/qml/dialogs/RoomMembers.qml | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/qml/dialogs/ReadReceipts.qml b/resources/qml/dialogs/ReadReceipts.qml index 1bfdae84..0d35db84 100644 --- a/resources/qml/dialogs/ReadReceipts.qml +++ b/resources/qml/dialogs/ReadReceipts.qml @@ -59,13 +59,18 @@ ApplicationWindow { model: readReceipts delegate: ItemDelegate { + id: del + onClicked: room.openUserProfile(model.mxid) padding: Nheko.paddingMedium - width: receiptLayout.implicitWidth + width: ListView.view.width height: receiptLayout.implicitHeight hoverEnabled: true ToolTip.visible: hovered ToolTip.text: model.mxid + background: Rectangle { + color: del.hovered ? Nheko.colors.dark : readReceiptsRoot.color + } RowLayout { id: receiptLayout diff --git a/resources/qml/dialogs/RoomMembers.qml b/resources/qml/dialogs/RoomMembers.qml index dd0c1db6..c9371839 100644 --- a/resources/qml/dialogs/RoomMembers.qml +++ b/resources/qml/dialogs/RoomMembers.qml @@ -92,8 +92,9 @@ ApplicationWindow { padding: Nheko.paddingMedium width: ListView.view.width height: memberLayout.implicitHeight + hoverEnabled: true background: Rectangle { - color: roomMembersRoot.color + color: del.hovered ? Nheko.colors.dark : roomMembersRoot.color } RowLayout { From 07aa89cca15f5c8bd031ee05e241795d61417c3f Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Sat, 13 Nov 2021 14:22:09 -0500 Subject: [PATCH 03/22] Port invite dialog to use ItemDelegate --- resources/qml/dialogs/InviteDialog.qml | 62 ++++++++++++++++---------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/resources/qml/dialogs/InviteDialog.qml b/resources/qml/dialogs/InviteDialog.qml index 86c176be..2d415a36 100644 --- a/resources/qml/dialogs/InviteDialog.qml +++ b/resources/qml/dialogs/InviteDialog.qml @@ -98,37 +98,53 @@ ApplicationWindow { Layout.fillWidth: true Layout.fillHeight: true model: invitees + spacing: Nheko.paddingMedium - delegate: RowLayout { - spacing: Nheko.paddingMedium + delegate: ItemDelegate { + id: del - Avatar { - width: Nheko.avatarSize - height: Nheko.avatarSize - userid: model.mxid - url: model.avatarUrl.replace("mxc://", "image://MxcImage/") - displayName: model.displayName - onClicked: TimelineManager.openGlobalUserProfile(model.mxid) + hoverEnabled: true + width: ListView.view.width + height: layout.implicitHeight + onClicked: TimelineManager.openGlobalUserProfile(model.mxid) + background: Rectangle { + color: del.hovered ? Nheko.colors.dark : inviteDialogRoot.color } - ColumnLayout { - spacing: Nheko.paddingSmall + RowLayout { + id: layout - Label { - text: model.displayName - color: TimelineManager.userColor(model ? model.mxid : "", Nheko.colors.window) - font.pointSize: fontMetrics.font.pointSize + spacing: Nheko.paddingMedium + + Avatar { + width: Nheko.avatarSize + height: Nheko.avatarSize + userid: model.mxid + url: model.avatarUrl.replace("mxc://", "image://MxcImage/") + displayName: model.displayName + enabled: false } - Label { - text: model.mxid - color: Nheko.colors.buttonText - font.pointSize: fontMetrics.font.pointSize * 0.9 - } + ColumnLayout { + spacing: Nheko.paddingSmall + + Label { + text: model.displayName + color: TimelineManager.userColor(model ? model.mxid : "", Nheko.colors.window) + font.pointSize: fontMetrics.font.pointSize + } + + Label { + text: model.mxid + color: Nheko.colors.buttonText + font.pointSize: fontMetrics.font.pointSize * 0.9 + } + + Item { + Layout.fillHeight: true + Layout.fillWidth: true + } - Item { - Layout.fillHeight: true - Layout.fillWidth: true } } From f095352a2cc6ba60f3460b00b5a61c22fb60c215 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Sat, 13 Nov 2021 14:32:11 -0500 Subject: [PATCH 04/22] Add pointing hand cursor shape --- resources/qml/dialogs/InviteDialog.qml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/qml/dialogs/InviteDialog.qml b/resources/qml/dialogs/InviteDialog.qml index 2d415a36..c9d247d7 100644 --- a/resources/qml/dialogs/InviteDialog.qml +++ b/resources/qml/dialogs/InviteDialog.qml @@ -147,6 +147,11 @@ ApplicationWindow { } + CursorShape { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + } + } } From e09af0b1017726afe41a078230387509f7af5c8f Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Sat, 13 Nov 2021 14:38:22 -0500 Subject: [PATCH 05/22] Nicer padding --- resources/qml/dialogs/InviteDialog.qml | 5 +++-- resources/qml/dialogs/ReadReceipts.qml | 5 +++-- resources/qml/dialogs/RoomMembers.qml | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/resources/qml/dialogs/InviteDialog.qml b/resources/qml/dialogs/InviteDialog.qml index c9d247d7..168819c4 100644 --- a/resources/qml/dialogs/InviteDialog.qml +++ b/resources/qml/dialogs/InviteDialog.qml @@ -98,14 +98,13 @@ ApplicationWindow { Layout.fillWidth: true Layout.fillHeight: true model: invitees - spacing: Nheko.paddingMedium delegate: ItemDelegate { id: del hoverEnabled: true width: ListView.view.width - height: layout.implicitHeight + height: layout.implicitHeight + Nheko.paddingSmall * 2 onClicked: TimelineManager.openGlobalUserProfile(model.mxid) background: Rectangle { color: del.hovered ? Nheko.colors.dark : inviteDialogRoot.color @@ -115,6 +114,8 @@ ApplicationWindow { id: layout spacing: Nheko.paddingMedium + anchors.verticalCenter: parent.verticalCenter + x: parent.x + Nheko.paddingSmall Avatar { width: Nheko.avatarSize diff --git a/resources/qml/dialogs/ReadReceipts.qml b/resources/qml/dialogs/ReadReceipts.qml index 0d35db84..f97706db 100644 --- a/resources/qml/dialogs/ReadReceipts.qml +++ b/resources/qml/dialogs/ReadReceipts.qml @@ -54,7 +54,6 @@ ApplicationWindow { id: readReceiptsList clip: true - spacing: Nheko.paddingMedium boundsBehavior: Flickable.StopAtBounds model: readReceipts @@ -64,7 +63,7 @@ ApplicationWindow { onClicked: room.openUserProfile(model.mxid) padding: Nheko.paddingMedium width: ListView.view.width - height: receiptLayout.implicitHeight + height: receiptLayout.implicitHeight + Nheko.paddingSmall * 2 hoverEnabled: true ToolTip.visible: hovered ToolTip.text: model.mxid @@ -76,6 +75,8 @@ ApplicationWindow { id: receiptLayout spacing: Nheko.paddingMedium + anchors.verticalCenter: parent.verticalCenter + x: parent.x + Nheko.paddingSmall Avatar { width: Nheko.avatarSize diff --git a/resources/qml/dialogs/RoomMembers.qml b/resources/qml/dialogs/RoomMembers.qml index c9371839..6750ed81 100644 --- a/resources/qml/dialogs/RoomMembers.qml +++ b/resources/qml/dialogs/RoomMembers.qml @@ -75,7 +75,6 @@ ApplicationWindow { id: memberList clip: true - spacing: Nheko.paddingMedium boundsBehavior: Flickable.StopAtBounds model: members @@ -91,7 +90,7 @@ ApplicationWindow { onClicked: Rooms.currentRoom.openUserProfile(model.mxid) padding: Nheko.paddingMedium width: ListView.view.width - height: memberLayout.implicitHeight + height: memberLayout.implicitHeight + Nheko.paddingSmall * 2 hoverEnabled: true background: Rectangle { color: del.hovered ? Nheko.colors.dark : roomMembersRoot.color @@ -101,6 +100,8 @@ ApplicationWindow { id: memberLayout spacing: Nheko.paddingMedium + anchors.verticalCenter: parent.verticalCenter + x: parent.x + Nheko.paddingSmall Avatar { id: avatar From b1c1274d96144805bf416571117f9889f2e55600 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Sat, 13 Nov 2021 15:05:26 -0500 Subject: [PATCH 06/22] Allow removing users from the invite dialog --- resources/qml/dialogs/InviteDialog.qml | 17 ++++++++++++++--- src/InviteesModel.cpp | 14 ++++++++++++++ src/InviteesModel.h | 1 + 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/resources/qml/dialogs/InviteDialog.qml b/resources/qml/dialogs/InviteDialog.qml index 168819c4..6ee6fbf5 100644 --- a/resources/qml/dialogs/InviteDialog.qml +++ b/resources/qml/dialogs/InviteDialog.qml @@ -116,6 +116,7 @@ ApplicationWindow { spacing: Nheko.paddingMedium anchors.verticalCenter: parent.verticalCenter x: parent.x + Nheko.paddingSmall + width: del.width - Nheko.paddingSmall * 2 Avatar { width: Nheko.avatarSize @@ -148,11 +149,21 @@ ApplicationWindow { } - CursorShape { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor + Item { + Layout.fillWidth: true + Layout.fillHeight: true } + ImageButton { + image: ":/icons/icons/ui/remove-symbol.png" + onClicked: invitees.removeUser(model.mxid) + } + + } + + CursorShape { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor } } diff --git a/src/InviteesModel.cpp b/src/InviteesModel.cpp index e045581a..707bfd97 100644 --- a/src/InviteesModel.cpp +++ b/src/InviteesModel.cpp @@ -30,6 +30,20 @@ InviteesModel::addUser(QString mxid) emit countChanged(); } +void +InviteesModel::removeUser(QString mxid) +{ + for (int i = 0; i < invitees_.length(); ++i) { + if (invitees_[i]->mxid_ == mxid) { + beginRemoveRows(QModelIndex(), i, i); + invitees_.removeAt(i); + endRemoveRows(); + emit countChanged(); + break; + } + } +} + QHash InviteesModel::roleNames() const { diff --git a/src/InviteesModel.h b/src/InviteesModel.h index fd64116b..65fb78d6 100644 --- a/src/InviteesModel.h +++ b/src/InviteesModel.h @@ -43,6 +43,7 @@ public: InviteesModel(QObject *parent = nullptr); Q_INVOKABLE void addUser(QString mxid); + Q_INVOKABLE void removeUser(QString mxid); QHash roleNames() const override; int rowCount(const QModelIndex & = QModelIndex()) const override From 8830ce25d1e746c9e324e599ecf1a48cddd24f68 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Sat, 13 Nov 2021 15:05:37 -0500 Subject: [PATCH 07/22] Don't add a user twice --- src/InviteesModel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/InviteesModel.cpp b/src/InviteesModel.cpp index 707bfd97..ad99c847 100644 --- a/src/InviteesModel.cpp +++ b/src/InviteesModel.cpp @@ -16,6 +16,10 @@ InviteesModel::InviteesModel(QObject *parent) void InviteesModel::addUser(QString mxid) { + for (const auto &invitee : invitees_) + if (invitee->mxid_ == mxid) + return; + beginInsertRows(QModelIndex(), invitees_.count(), invitees_.count()); auto invitee = new Invitee{mxid, this}; From 36f1bbcc029b64b4caa5306ad6f5a49ceb1033e6 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Mon, 15 Nov 2021 18:57:16 -0500 Subject: [PATCH 08/22] Remove duplicate property --- resources/qml/dialogs/ReadReceipts.qml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/resources/qml/dialogs/ReadReceipts.qml b/resources/qml/dialogs/ReadReceipts.qml index f97706db..ad1c44e0 100644 --- a/resources/qml/dialogs/ReadReceipts.qml +++ b/resources/qml/dialogs/ReadReceipts.qml @@ -116,10 +116,6 @@ ApplicationWindow { cursorShape: Qt.PointingHandCursor } - background: Rectangle { - color: readReceiptsRoot.color - } - } } From f048caee69d15381a365b91a158df7d14b463adb Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Mon, 15 Nov 2021 19:04:33 -0500 Subject: [PATCH 09/22] Simplify code for padding delegates --- resources/qml/dialogs/InviteDialog.qml | 2 +- resources/qml/dialogs/ReadReceipts.qml | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/resources/qml/dialogs/InviteDialog.qml b/resources/qml/dialogs/InviteDialog.qml index 6ee6fbf5..3acaa69d 100644 --- a/resources/qml/dialogs/InviteDialog.qml +++ b/resources/qml/dialogs/InviteDialog.qml @@ -155,7 +155,7 @@ ApplicationWindow { } ImageButton { - image: ":/icons/icons/ui/remove-symbol.png" + image: ":/icons/icons/ui/dismiss.svg" onClicked: invitees.removeUser(model.mxid) } diff --git a/resources/qml/dialogs/ReadReceipts.qml b/resources/qml/dialogs/ReadReceipts.qml index ad1c44e0..1afa4785 100644 --- a/resources/qml/dialogs/ReadReceipts.qml +++ b/resources/qml/dialogs/ReadReceipts.qml @@ -75,8 +75,8 @@ ApplicationWindow { id: receiptLayout spacing: Nheko.paddingMedium - anchors.verticalCenter: parent.verticalCenter - x: parent.x + Nheko.paddingSmall + anchors.fill: parent + anchors.margins: Nheko.paddingSmall Avatar { width: Nheko.avatarSize @@ -103,12 +103,16 @@ ApplicationWindow { } Item { - Layout.fillHeight: true Layout.fillWidth: true } } + Item { + Layout.fillWidth: true + Layout.fillHeight: true + } + } CursorShape { From b5e25a8369f4fc9b2dde6cca3f58204c618f2c0f Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Tue, 16 Nov 2021 20:35:10 -0500 Subject: [PATCH 10/22] Don't add arbitrary padding This breaks the vertical-centeredness on the close button. --- resources/qml/RoomList.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml index 80f162d6..d3cc7aee 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml @@ -543,8 +543,7 @@ Page { id: closeUnverifiedBubble Layout.rightMargin: Nheko.paddingMedium - Layout.topMargin: Nheko.paddingMedium - Layout.alignment: Qt.AlignRight | Qt.AlignCenter + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter hoverEnabled: true width: fontMetrics.font.pixelSize height: fontMetrics.font.pixelSize From 9a5d457a490b40e362b6dd124b32613c7da3ed95 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Tue, 16 Nov 2021 21:06:51 -0500 Subject: [PATCH 11/22] Quality-of-life improvements to InputDialog --- resources/qml/dialogs/InputDialog.qml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resources/qml/dialogs/InputDialog.qml b/resources/qml/dialogs/InputDialog.qml index 12211c60..b040068a 100644 --- a/resources/qml/dialogs/InputDialog.qml +++ b/resources/qml/dialogs/InputDialog.qml @@ -21,6 +21,11 @@ ApplicationWindow { width: 350 height: fontMetrics.lineSpacing * 7 + Shortcut { + sequence: StandardKey.Cancel + onActivated: dbb.rejected() + } + ColumnLayout { spacing: Nheko.paddingMedium anchors.margins: Nheko.paddingMedium @@ -36,11 +41,15 @@ ApplicationWindow { id: statusInput Layout.fillWidth: true + onAccepted: dbb.accepted() + focus: true } } footer: DialogButtonBox { + id: dbb + standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel onAccepted: { if (inputDialog.onAccepted) From deccdef2cb153713778c0c1f21e11b7ba8c67c39 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 17 Nov 2021 00:40:30 +0100 Subject: [PATCH 12/22] Mention fluent icons in readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b5ed4966..615193bd 100644 --- a/README.md +++ b/README.md @@ -370,6 +370,7 @@ Here are some screen shots to get a feel for the UI, but things will probably ch ### Third party [Single Application for Qt](https://github.com/itay-grudev/SingleApplication) +[Fluent Icons](https://github.com/microsoft/fluentui-system-icons) [Matrix]:https://matrix.org [Element]:https://element.io From b8802c99edb8868110465a03659f13dfd77c103c Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 17 Nov 2021 00:48:39 +0100 Subject: [PATCH 13/22] Fix resolution of failed image --- resources/icons/ui/image-failed.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/icons/ui/image-failed.svg b/resources/icons/ui/image-failed.svg index 6d72859f..59fef0c6 100644 --- a/resources/icons/ui/image-failed.svg +++ b/resources/icons/ui/image-failed.svg @@ -1,3 +1,3 @@ - + From 9e4c2d0d3a2220446729df73fa86d66fd1262eba Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 17 Nov 2021 00:49:12 +0100 Subject: [PATCH 14/22] Fix linebreaks in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 615193bd..26167c16 100644 --- a/README.md +++ b/README.md @@ -369,8 +369,8 @@ Here are some screen shots to get a feel for the UI, but things will probably ch ### Third party -[Single Application for Qt](https://github.com/itay-grudev/SingleApplication) -[Fluent Icons](https://github.com/microsoft/fluentui-system-icons) +- [Single Application for Qt](https://github.com/itay-grudev/SingleApplication) +- [Fluent Icons](https://github.com/microsoft/fluentui-system-icons) [Matrix]:https://matrix.org [Element]:https://element.io From 71dce9c64a5eb9e5d20604b2a98bf36d9671b421 Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 16 Nov 2021 21:47:19 -0500 Subject: [PATCH 15/22] Translated using Weblate (Dutch) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 100.0% (606 of 606 strings) Co-authored-by: Jaron Viƫtor Translate-URL: https://weblate.nheko.im/projects/nheko/nheko-master/nl/ Translation: Nheko/nheko --- resources/langs/nheko_nl.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/langs/nheko_nl.ts b/resources/langs/nheko_nl.ts index 00e7c80d..0e97f163 100644 --- a/resources/langs/nheko_nl.ts +++ b/resources/langs/nheko_nl.ts @@ -143,12 +143,12 @@ The cache on your disk is newer than this version of Nheko supports. Please update Nheko or clear your cache. - + De opgeslagen gegevens van Nheko zijn nieuwer dan de versie die je nu draait. Update Nheko of verwijder de gegevens. Failed to open database, logging out! - + Kon database niet openen, je wordt uitgelogd! @@ -1977,7 +1977,7 @@ Als je "verifieer" kiest, moet je het andere apparaat bij de hand hebb Identity key changed. This breaks E2EE, so logging out. - + Identiteitssleutel is veranderd. Dit breekt eind-tot-eind versleuteling, dus je wordt uitgelogd. From d1e1e9363d4fd61e44d1349802ec17f2db4eeb4c Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 17 Nov 2021 06:26:33 +0100 Subject: [PATCH 16/22] Fix qml warnings and missing icons --- resources/qml/dialogs/RoomSettings.qml | 4 ++-- resources/qml/dialogs/UserProfile.qml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/qml/dialogs/RoomSettings.qml b/resources/qml/dialogs/RoomSettings.qml index b1448644..1eeef98b 100644 --- a/resources/qml/dialogs/RoomSettings.qml +++ b/resources/qml/dialogs/RoomSettings.qml @@ -87,7 +87,7 @@ ApplicationWindow { Connections { target: roomSettings - onDisplayError: { + function onDisplayError(errorMessage) { errorText.text = errorMessage; errorText.opacity = 1; hideErrorAnimation.restart(); @@ -229,7 +229,7 @@ ApplicationWindow { title: qsTr("End-to-End Encryption") text: qsTr("Encryption is currently experimental and things might break unexpectedly.
Please take note that it can't be disabled afterwards.") - modality: Qt.Modal + modality: Qt.NonModal onAccepted: { if (roomSettings.isEncryptionEnabled) return ; diff --git a/resources/qml/dialogs/UserProfile.qml b/resources/qml/dialogs/UserProfile.qml index 6c8f9ba2..ba3f3a45 100644 --- a/resources/qml/dialogs/UserProfile.qml +++ b/resources/qml/dialogs/UserProfile.qml @@ -314,9 +314,9 @@ ApplicationWindow { case VerificationStatus.UNVERIFIED: return "image://colorimage/:/icons/icons/ui/shield-filled-exclamation-mark.svg?#d6c020"; case VerificationStatus.SELF: - return "image://colorimage/:/icons/ui/checkmark.svg?green"; + return "image://colorimage/:/icons/icons/ui/checkmark.svg?green"; default: - return "image://colorimage/:/icons/ui/shield-filled-cross.svg?#d6c020"; + return "image://colorimage/:/icons/icons/ui/shield-filled-cross.svg?#d6c020"; } } } From a45d1bbeaaa91b1df4de51500f844c804e047413 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 17 Nov 2021 22:23:50 +0100 Subject: [PATCH 17/22] Update bundled deps --- .gitlab-ci.yml | 14 ++------- CMakeLists.txt | 14 ++++----- io.github.NhekoReborn.Nheko.yaml | 53 ++++++++++++++++++++------------ 3 files changed, 44 insertions(+), 37 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5a917b03..031e140c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,32 +6,24 @@ variables: build-gcc7: stage: build - image: ubuntu:16.04 + image: ubuntu:20.04 tags: [docker] variables: - CXX: g++-7 - CC: gcc-7 QT_PKG: 515 TRAVIS_OS_NAME: linux before_script: - apt-get update - apt-get install -y software-properties-common - add-apt-repository ppa:ubuntu-toolchain-r/test -y - - add-apt-repository ppa:beineri/opt-qt-5.15.2-xenial -y - - apt-get update && apt-get -y install --no-install-recommends g++-7 build-essential ninja-build qt${QT_PKG}{base,declarative,tools,multimedia,script,quickcontrols2,svg} liblmdb-dev libgl1-mesa-dev libssl-dev git ccache + - add-apt-repository ppa:beineri/opt-qt-5.15.2-focal -y + - apt-get update && apt-get -y install --no-install-recommends build-essential ninja-build qt${QT_PKG}{base,declarative,tools,multimedia,script,quickcontrols2,svg} liblmdb-dev libgl1-mesa-dev libssl-dev git ccache pkg-config libsecret-1-dev cmake # need recommended deps for wget - apt-get -y install wget - - wget https://github.com/Kitware/CMake/releases/download/v3.19.0/cmake-3.19.0-Linux-x86_64.sh && sh cmake-3.19.0-Linux-x86_64.sh --skip-license --prefix=/usr/local - /usr/sbin/update-ccache-symlinks - - update-alternatives --install /usr/bin/gcc gcc "/usr/bin/${CC}" 10 - - update-alternatives --install /usr/bin/g++ g++ "/usr/bin/${CXX}" 10 - - update-alternatives --set gcc "/usr/bin/${CC}" - - update-alternatives --set g++ "/usr/bin/${CXX}" - rm -rf ../.hunter && mv .hunter ../.hunter || true script: - export PATH="/usr/lib/ccache:${PATH}" - export CMAKE_BUILD_PARALLEL_LEVEL=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l) - - export PATH="/usr/local/bin/:${PATH}" - . "/opt/qt${QT_PKG}/bin/qt${QT_PKG}-env.sh" || true - cmake -GNinja -H. -Bbuild -DCMAKE_INSTALL_PREFIX=.deps/usr diff --git a/CMakeLists.txt b/CMakeLists.txt index ed8cfc69..42c04cdd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,7 +174,7 @@ if (USE_BUNDLED_QTKEYCHAIN) FetchContent_Declare( qt5keychain GIT_REPOSITORY https://github.com/frankosterfeld/qtkeychain.git - GIT_TAG v0.12.0 + GIT_TAG v0.13.1 ) if (BUILD_SHARED_LIBS) set(QTKEYCHAIN_STATIC OFF CACHE INTERNAL "") @@ -388,7 +388,7 @@ if(USE_BUNDLED_MTXCLIENT) FetchContent_Declare( MatrixClient GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git - GIT_TAG bacb7e524ff0f38591b88b248d8d8409b7fd49a0 + GIT_TAG v0.6.0 ) set(BUILD_LIB_EXAMPLES OFF CACHE INTERNAL "") set(BUILD_LIB_TESTS OFF CACHE INTERNAL "") @@ -401,7 +401,7 @@ if(USE_BUNDLED_OLM) FetchContent_Declare( Olm GIT_REPOSITORY https://gitlab.matrix.org/matrix-org/olm.git - GIT_TAG 3.2.4 + GIT_TAG 3.2.6 ) set(OLM_TESTS OFF CACHE INTERNAL "") FetchContent_MakeAvailable(Olm) @@ -423,14 +423,14 @@ if(USE_BUNDLED_CMARK) FetchContent_Declare( cmark GIT_REPOSITORY https://github.com/commonmark/cmark.git - GIT_TAG 242e277a661ec7e51f34dcaf86c1925d550b1498 #0.29.0 << doesn't work with fetch content yet + GIT_TAG 0.30.2 CMAKE_ARGS "CMARK_STATIC=ON CMARK_SHARED=OFF CMARK_TESTS=OFF CMARK_TESTS=OFF" ) FetchContent_MakeAvailable(cmark) if (MSVC) - add_library(cmark::cmark ALIAS libcmark) + add_library(cmark::cmark ALIAS cmark) else() - add_library(cmark::cmark ALIAS libcmark_static) + add_library(cmark::cmark ALIAS cmark_static) endif() else() find_package(cmark REQUIRED 0.29.0) @@ -691,7 +691,7 @@ if(USE_BUNDLED_COEURL) FetchContent_Declare( coeurl GIT_REPOSITORY https://nheko.im/Nheko-Reborn/coeurl.git - GIT_TAG 3901507db25cf3f9364b58cd8c7880640900c992 + GIT_TAG v0.1.0 ) FetchContent_MakeAvailable(coeurl) target_link_libraries(nheko PUBLIC coeurl::coeurl) diff --git a/io.github.NhekoReborn.Nheko.yaml b/io.github.NhekoReborn.Nheko.yaml index 5f2c6ddc..a252da7a 100644 --- a/io.github.NhekoReborn.Nheko.yaml +++ b/io.github.NhekoReborn.Nheko.yaml @@ -59,9 +59,9 @@ modules: - -DCMAKE_BUILD_TYPE=Release - -DCMARK_TESTS=OFF sources: - - sha256: 2558ace3cbeff85610de3bda32858f722b359acdadf0c4691851865bb84924a6 + - sha256: 6c7d2bcaea1433d977d8fed0b55b71c9d045a7cdf616e3cd2dce9007da753db3 type: archive - url: https://github.com/commonmark/cmark/archive/0.29.0.tar.gz + url: https://github.com/commonmark/cmark/archive/0.30.2.tar.gz - name: spdlog buildsystem: cmake-ninja config-opts: @@ -78,11 +78,23 @@ modules: buildsystem: cmake-ninja name: olm sources: - - commit: 64afab93645957846d936a19b8501dbd3f2cc4a1 + - commit: 8656f1463c4e16366335fb468453a9455a366c78 disable-shallow-clone: true - tag: 3.2.4 + tag: 3.2.6 type: git url: https://gitlab.matrix.org/matrix-org/olm.git + - buildsystem: meson + name: libsecret + config-opts: + - -Dmanpage=false + - -Dvapi=false + - -Dgtk_doc=false + - -Dintrospection=false + sources: + - commit: 3fe635e64efd4b8dbc9ec3548b0bc8034c7665c4 + tag: 0.20.4 + type: git + url: https://gitlab.gnome.org/GNOME/libsecret.git - config-opts: - -DCMAKE_BUILD_TYPE=Release - -DBUILD_TEST_APPLICATION=OFF @@ -90,8 +102,8 @@ modules: buildsystem: cmake-ninja name: QtKeychain sources: - - commit: 815fe610353ff8ad7e2f1121c368a74df8db5eb7 - tag: v0.12.0 + - commit: f59ac26be709fd2d8d7a062fab1cf1e67a93806c + tag: v0.13.1 type: git url: https://github.com/frankosterfeld/qtkeychain.git - config-opts: @@ -99,14 +111,14 @@ modules: buildsystem: cmake name: nlohmann sources: - - sha256: d51a3a8d3efbb1139d7608e28782ea9efea7e7933157e8ff8184901efd8ee760 + - sha256: 1155fd1a83049767360e9a120c43c578145db3204d2b309eba49fbbedd0f4ed3 type: archive - url: https://github.com/nlohmann/json/archive/v3.7.0.tar.gz + url: https://github.com/nlohmann/json/archive/v3.10.4.tar.gz - buildsystem: meson name: gstreamer sources: - - commit: a42fe476d3ee5576921f67a331464065ec33b9a4 - tag: 1.18.3 + - commit: 71c213f99ad5c8fc8f36a26238483f2bdf7d846a + tag: 1.18.5 type: git url: https://gitlab.freedesktop.org/gstreamer/gstreamer.git - config-opts: @@ -115,8 +127,8 @@ modules: buildsystem: meson name: gstreamer-plugins-base sources: - - commit: 2cc319ee13f6b72df3d432b7c75aca81feb260e5 - tag: 1.18.3 + - commit: 57fb883b3f8c6d7a397afc0dfc4a7c2e5af05579 + tag: 1.18.5 type: git url: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base.git - config-opts: @@ -128,8 +140,8 @@ modules: buildsystem: meson name: gstreamer-plugins-good sources: - - commit: e816c6cd73c9e0676828c9e227a049ebad3d019f - tag: 1.18.3 + - commit: 56dec037a80266add6853e4b06e2dc379de757d1 + tag: 1.18.5 type: git url: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good.git - config-opts: @@ -143,8 +155,8 @@ modules: buildsystem: meson name: gstreamer-plugins-bad sources: - - commit: 382e373d9be363f1e21b12990a4d12f1ecb6df41 - tag: 1.18.3 + - commit: d3af58d5b31941caa26c3ded85d7a7b84a91f0cc + tag: 1.18.5 type: git url: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad.git - buildsystem: qmake @@ -154,7 +166,8 @@ modules: - mkdir -p /app/bin/ - cp libqtjdenticon.so /app/bin/ sources: - - commit: 77eb0d62441e03bbbfc2b1d2057c4045ac87fb85 + - commit: e58c14369dfbf008c63f43a4556b2e52232e0265 + tag: v0.1.0 type: git url: https://github.com/Nheko-Reborn/qt-jdenticon.git - buildsystem: meson @@ -162,7 +175,8 @@ modules: - -Ddefault_library=static name: coeurl sources: - - commit: 3901507db25cf3f9364b58cd8c7880640900c992 + - commit: a08f619adaa1ccd34eb6315d6578eddae0d1cc9b + tag: v0.1.0 type: git url: https://nheko.im/nheko-reborn/coeurl.git - config-opts: @@ -173,7 +187,8 @@ modules: buildsystem: cmake-ninja name: mtxclient sources: - - commit: bacb7e524ff0f38591b88b248d8d8409b7fd49a0 + - commit: eecc4e93f2137c658014f17cefd62ad569063769 + tag: v0.6.0 type: git url: https://github.com/Nheko-Reborn/mtxclient.git - config-opts: From 3a3735f67acce5e79e94a73d3c6d4a8738e5adcf Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 18 Nov 2021 02:56:32 +0100 Subject: [PATCH 18/22] Fix hunter messing with pkg-config --- CMakeLists.txt | 64 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 56 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42c04cdd..6340fc3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,23 @@ HunterGate( LOCAL ) +macro(hunter_add_package_safe) + set(pkg_temp_backup_libdir "$ENV{PKG_CONFIG_LIBDIR}") + set(pkg_temp_backup_path "$ENV{PKG_CONFIG_PATH}") + hunter_add_package(${ARGV}) + if("${pkg_temp_backup_path}" STREQUAL "") + unset(ENV{PKG_CONFIG_PATH}) + else() + set(ENV{PKG_CONFIG_PATH} "${pkg_temp_backup_path}") + endif() + if("${pkg_temp_backup_libdir}" STREQUAL "") + unset(ENV{PKG_CONFIG_LIBDIR}) + else() + set(ENV{PKG_CONFIG_LIBDIR} "${pkg_temp_backup_libdir}") + endif() + message("pkg_conf_path: '$ENV{PKG_CONFIG_PATH}', pkg_conf_libdir: '$ENV{PKG_CONFIG_LIBDIR}'") +endmacro() + option(USE_BUNDLED_SPDLOG "Use the bundled version of spdlog." ${HUNTER_ENABLED}) option(USE_BUNDLED_OLM "Use the bundled version of libolm." ${HUNTER_ENABLED}) option(USE_BUNDLED_GTEST "Use the bundled version of Google Test." ${HUNTER_ENABLED}) @@ -120,10 +137,16 @@ endif() # ## Need to repeat all libevent deps?!? if (USE_BUNDLED_LIBEVENT) - hunter_add_package(Libevent) + hunter_add_package_safe(Libevent) find_package(Libevent CONFIG REQUIRED) else() find_package(PkgConfig REQUIRED) +if (HUNTER_ENABLED) + message("pkg_conf_path: '$ENV{PKG_CONFIG_PATH}', pkg_conf_libdir: '$ENV{PKG_CONFIG_LIBDIR}'") + set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_LIBDIR}") + set(ENV{PKG_CONFIG_LIBDIR} "${pkg_temp_backup}") + message("pkg_conf_path: '$ENV{PKG_CONFIG_PATH}', pkg_conf_libdir: '$ENV{PKG_CONFIG_LIBDIR}'") +endif() pkg_check_modules(libevent_core REQUIRED IMPORTED_TARGET libevent_core) if (WIN32) pkg_check_modules(libevent_windows REQUIRED IMPORTED_TARGET libevent_windows) @@ -135,16 +158,22 @@ endif() # curl if (USE_BUNDLED_LIBCURL) - hunter_add_package(CURL) + hunter_add_package_safe(CURL) find_package(CURL CONFIG REQUIRED) else() find_package(PkgConfig REQUIRED) +if (HUNTER_ENABLED) + message("pkg_conf_path: '$ENV{PKG_CONFIG_PATH}', pkg_conf_libdir: '$ENV{PKG_CONFIG_LIBDIR}'") + set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_LIBDIR}") + set(ENV{PKG_CONFIG_LIBDIR} "${pkg_temp_backup}") + message("pkg_conf_path: '$ENV{PKG_CONFIG_PATH}', pkg_conf_libdir: '$ENV{PKG_CONFIG_LIBDIR}'") +endif() pkg_check_modules(libcurl REQUIRED IMPORTED_TARGET libcurl) endif() # spdlog if(USE_BUNDLED_SPDLOG) - hunter_add_package(spdlog) + hunter_add_package_safe(spdlog) endif() find_package(spdlog 1.0.0 CONFIG REQUIRED) @@ -153,7 +182,7 @@ find_package(spdlog 1.0.0 CONFIG REQUIRED) # #include(LMDB) if(USE_BUNDLED_LMDB) - hunter_add_package(lmdb) + hunter_add_package_safe(lmdb) find_package(liblmdb CONFIG REQUIRED) target_include_directories(liblmdb::lmdb INTERFACE @@ -170,6 +199,12 @@ find_package(Qt5QuickCompiler) find_package(Qt5DBus) if (USE_BUNDLED_QTKEYCHAIN) +if (HUNTER_ENABLED) + message("pkg_conf_path: '$ENV{PKG_CONFIG_PATH}', pkg_conf_libdir: '$ENV{PKG_CONFIG_LIBDIR}'") + set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_LIBDIR}") + set(ENV{PKG_CONFIG_LIBDIR} "${pkg_temp_backup}") + message("pkg_conf_path: '$ENV{PKG_CONFIG_PATH}', pkg_conf_libdir: '$ENV{PKG_CONFIG_LIBDIR}'") +endif() include(FetchContent) FetchContent_Declare( qt5keychain @@ -380,7 +415,7 @@ include(FeatureSummary) if(USE_BUNDLED_OPENSSL) - hunter_add_package(OpenSSL) + hunter_add_package_safe(OpenSSL) endif() find_package(OpenSSL 1.1.0 REQUIRED) if(USE_BUNDLED_MTXCLIENT) @@ -414,7 +449,7 @@ else() ) endif() if(USE_BUNDLED_SPDLOG) - hunter_add_package(spdlog) + hunter_add_package_safe(spdlog) endif() find_package(spdlog 1.0.0 CONFIG REQUIRED) @@ -437,7 +472,7 @@ else() endif() if(USE_BUNDLED_JSON) - hunter_add_package(nlohmann_json) + hunter_add_package_safe(nlohmann_json) endif() find_package(nlohmann_json 3.2.0) set_package_properties(nlohmann_json PROPERTIES @@ -474,8 +509,15 @@ else() add_library(lmdbxx::lmdbxx ALIAS lmdbxx) endif() +if (HUNTER_ENABLED) + message("pkg_conf_path: '$ENV{PKG_CONFIG_PATH}', pkg_conf_libdir: '$ENV{PKG_CONFIG_LIBDIR}'") + set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_LIBDIR}") + set(ENV{PKG_CONFIG_LIBDIR} "${pkg_temp_backup}") + unset(ENV{PKG_CONFIG_LIBDIR}) + message("pkg_conf_path: '$ENV{PKG_CONFIG_PATH}', pkg_conf_libdir: '$ENV{PKG_CONFIG_LIBDIR}'") +endif() include(FindPkgConfig) -pkg_check_modules(GSTREAMER IMPORTED_TARGET gstreamer-sdp-1.0>=1.18 gstreamer-webrtc-1.0>=1.18) +pkg_check_modules(GSTREAMER NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH IMPORTED_TARGET gstreamer-sdp-1.0>=1.18 gstreamer-webrtc-1.0>=1.18) if (TARGET PkgConfig::GSTREAMER) add_feature_info(voip ON "GStreamer found. Call support is enabled automatically.") pkg_check_modules(XCB IMPORTED_TARGET xcb xcb-ewmh) @@ -700,6 +742,12 @@ elseif(coeurl_DIR) target_link_libraries(nheko PUBLIC coeurl::coeurl) else() find_package(PkgConfig REQUIRED) +if (HUNTER_ENABLED) + message("pkg_conf_path: '$ENV{PKG_CONFIG_PATH}', pkg_conf_libdir: '$ENV{PKG_CONFIG_LIBDIR}'") + set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_LIBDIR}") + set(ENV{PKG_CONFIG_LIBDIR} "${pkg_temp_backup}") + message("pkg_conf_path: '$ENV{PKG_CONFIG_PATH}', pkg_conf_libdir: '$ENV{PKG_CONFIG_LIBDIR}'") +endif() pkg_check_modules(coeurl REQUIRED IMPORTED_TARGET coeurl) target_link_libraries(nheko PUBLIC PkgConfig::coeurl) endif() From 7f5a92106a023a96328bb5719bcec901c1374fc3 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 18 Nov 2021 03:10:04 +0100 Subject: [PATCH 19/22] Try to fix lmdbxx download --- .gitlab-ci.yml | 2 +- CMakeLists.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 031e140c..590304db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ variables: # prevent configure tzdata hanging apt install commands DEBIAN_FRONTEND: noninteractive -build-gcc7: +build-gcc9: stage: build image: ubuntu:20.04 tags: [docker] diff --git a/CMakeLists.txt b/CMakeLists.txt index 6340fc3c..6424f38f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -487,10 +487,10 @@ if(USE_BUNDLED_LMDBXX) lmdbxx URL "https://raw.githubusercontent.com/hoytech/lmdbxx/1.0.0/lmdb++.h" DOWNLOAD_NO_EXTRACT TRUE + CONFIGURE_COMMAND "" + BUILD_COMMAND "" ) - if(NOT lmdbxx_POPULATED) - FetchContent_Populate(lmdbxx) - endif() + FetchContent_Populate(lmdbxx) add_library(lmdbxx INTERFACE) target_include_directories(lmdbxx INTERFACE ${lmdbxx_SOURCE_DIR}) add_library(lmdbxx::lmdbxx ALIAS lmdbxx) From 17f2c35b3a47e61fa77e0230aadb422dadb2097d Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 18 Nov 2021 03:28:26 +0100 Subject: [PATCH 20/22] Try to fix lmdbxx download --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 590304db..af642112 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,9 +20,10 @@ build-gcc9: # need recommended deps for wget - apt-get -y install wget - /usr/sbin/update-ccache-symlinks + - wget https://github.com/Kitware/CMake/releases/download/v3.19.0/cmake-3.19.0-Linux-x86_64.sh && sh cmake-3.19.0-Linux-x86_64.sh --skip-license --prefix=/usr/local - rm -rf ../.hunter && mv .hunter ../.hunter || true script: - - export PATH="/usr/lib/ccache:${PATH}" + - export PATH="/usr/local/bin/:/usr/lib/ccache:${PATH}" - export CMAKE_BUILD_PARALLEL_LEVEL=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l) - . "/opt/qt${QT_PKG}/bin/qt${QT_PKG}-env.sh" || true - cmake -GNinja -H. -Bbuild @@ -30,7 +31,7 @@ build-gcc9: -DHUNTER_ROOT="../.hunter" -DHUNTER_ENABLED=ON -DBUILD_SHARED_LIBS=OFF -DUSE_BUNDLED_OPENSSL=ON -DUSE_BUNDLED_LMDB=OFF -DCMAKE_BUILD_TYPE=Release -DHUNTER_CONFIGURATION_TYPES=Release - -DCI_BUILD=ON + -DCI_BUILD=ON -DFETCHCONTENT_QUIET=OFF - cmake --build build after_script: - mv ../.hunter .hunter From 7be659af4642d6220ea606b1eb456e470541ee4f Mon Sep 17 00:00:00 2001 From: Joseph Donofry Date: Thu, 18 Nov 2021 12:39:58 -0500 Subject: [PATCH 21/22] Fix video call filename and qtjdenticon for windows --- appveyor.yml | 2 +- resources/qml/voip/PlaceCall.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 51bf949d..06137ada 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -66,7 +66,7 @@ after_build: - echo %BUILD% - mkdir NhekoRelease - copy build\Release\nheko.exe NhekoRelease\nheko.exe - - copy qt-jdenticon\release\qtjdenticon0.dll NhekoRelease\qtjdenticon0.dll + - copy qt-jdenticon\release\qtjdenticon0.dll NhekoRelease\qtjdenticon.dll - copy build\_deps\cmark-build\src\Release\cmark.dll NhekoRelease\cmark.dll - windeployqt --qmldir resources\qml\ NhekoRelease\nheko.exe diff --git a/resources/qml/voip/PlaceCall.qml b/resources/qml/voip/PlaceCall.qml index 0ad546df..4ba68628 100644 --- a/resources/qml/voip/PlaceCall.qml +++ b/resources/qml/voip/PlaceCall.qml @@ -161,7 +161,7 @@ Popup { Image { Layout.preferredWidth: 22 Layout.preferredHeight: 22 - source: "image://colorimage/:/icons/icons/ui/video-call.svg?" + Nheko.colors.windowText + source: "image://colorimage/:/icons/icons/ui/video.svg?" + Nheko.colors.windowText } ComboBox { From 57fb0d79f97f4e0c83f474892876e6898b10cb86 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 18 Nov 2021 22:33:45 +0100 Subject: [PATCH 22/22] Fix colors and alignment in dialogs --- resources/qml/dialogs/InviteDialog.qml | 13 +++---------- resources/qml/dialogs/ReadReceipts.qml | 5 ----- resources/qml/dialogs/RoomMembers.qml | 15 +++++++-------- src/timeline/TimelineViewManager.cpp | 7 ++++--- src/timeline/TimelineViewManager.h | 2 +- 5 files changed, 15 insertions(+), 27 deletions(-) diff --git a/resources/qml/dialogs/InviteDialog.qml b/resources/qml/dialogs/InviteDialog.qml index 3acaa69d..9ddf8ed0 100644 --- a/resources/qml/dialogs/InviteDialog.qml +++ b/resources/qml/dialogs/InviteDialog.qml @@ -114,8 +114,7 @@ ApplicationWindow { id: layout spacing: Nheko.paddingMedium - anchors.verticalCenter: parent.verticalCenter - x: parent.x + Nheko.paddingSmall + anchors.centerIn: parent width: del.width - Nheko.paddingSmall * 2 Avatar { @@ -132,26 +131,20 @@ ApplicationWindow { Label { text: model.displayName - color: TimelineManager.userColor(model ? model.mxid : "", Nheko.colors.window) + color: TimelineManager.userColor(model ? model.mxid : "", del.background.color) font.pointSize: fontMetrics.font.pointSize } Label { text: model.mxid - color: Nheko.colors.buttonText + color: del.hovered ? Nheko.colors.brightText : Nheko.colors.buttonText font.pointSize: fontMetrics.font.pointSize * 0.9 } - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } - } Item { Layout.fillWidth: true - Layout.fillHeight: true } ImageButton { diff --git a/resources/qml/dialogs/ReadReceipts.qml b/resources/qml/dialogs/ReadReceipts.qml index 1afa4785..52e4512b 100644 --- a/resources/qml/dialogs/ReadReceipts.qml +++ b/resources/qml/dialogs/ReadReceipts.qml @@ -102,15 +102,10 @@ ApplicationWindow { font.pointSize: fontMetrics.font.pointSize * 0.9 } - Item { - Layout.fillWidth: true - } - } Item { Layout.fillWidth: true - Layout.fillHeight: true } } diff --git a/resources/qml/dialogs/RoomMembers.qml b/resources/qml/dialogs/RoomMembers.qml index 6750ed81..37ab6a80 100644 --- a/resources/qml/dialogs/RoomMembers.qml +++ b/resources/qml/dialogs/RoomMembers.qml @@ -100,8 +100,8 @@ ApplicationWindow { id: memberLayout spacing: Nheko.paddingMedium - anchors.verticalCenter: parent.verticalCenter - x: parent.x + Nheko.paddingSmall + anchors.centerIn: parent + width: parent.width - Nheko.paddingSmall * 2 Avatar { id: avatar @@ -119,23 +119,22 @@ ApplicationWindow { ElidedLabel { fullText: model.displayName - color: TimelineManager.userColor(model ? model.mxid : "", Nheko.colors.window) + color: TimelineManager.userColor(model ? model.mxid : "", del.background.color) font.pixelSize: fontMetrics.font.pixelSize elideWidth: del.width - Nheko.paddingMedium * 2 - avatar.width - encryptInd.width } ElidedLabel { fullText: model.mxid - color: Nheko.colors.buttonText + color: del.hovered ? Nheko.colors.brightText : Nheko.colors.buttonText font.pixelSize: Math.ceil(fontMetrics.font.pixelSize * 0.9) elideWidth: del.width - Nheko.paddingMedium * 2 - avatar.width - encryptInd.width } - Item { - Layout.fillHeight: true - Layout.fillWidth: true - } + } + Item { + Layout.fillWidth: true } EncryptionIndicator { diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp index 84aa2c90..c5fe6b4b 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp @@ -116,9 +116,10 @@ TimelineViewManager::updateColorPalette() QColor TimelineViewManager::userColor(QString id, QColor background) { - if (!userColors.contains(id)) - userColors.insert(id, QColor(utils::generateContrastingHexColor(id, background))); - return userColors.value(id); + QPair idx{id, background.rgba64()}; + if (!userColors.contains(idx)) + userColors.insert(idx, QColor(utils::generateContrastingHexColor(id, background))); + return userColors.value(idx); } QString diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h index 6696b1c4..3e3952a8 100644 --- a/src/timeline/TimelineViewManager.h +++ b/src/timeline/TimelineViewManager.h @@ -147,7 +147,7 @@ private: CallManager *callManager_ = nullptr; VerificationManager *verificationManager_ = nullptr; - QHash userColors; + QHash, QColor> userColors; }; Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationAccept) Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationCancel)