Page MenuHomePhorge

D47.1732488431.diff
No OneTemporary

Size
6 KB
Referenced Files
None
Subscribers
None

D47.1732488431.diff

diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
build
node_modules
TAGS
+/src/contents/ui/AvatarAdapter.qml
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,6 +52,11 @@
Multimedia Test Network QuickTest
)
find_package(KF${KF_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 Config KIO Notifications)
+if(KF_MAJOR_VERSION EQUAL 6)
+ find_package(KF${KF_MAJOR_VERSION}KirigamiAddons REQUIRED)
+else()
+ find_package(KF${KF_MAJOR_VERSION}KirigamiAddons)
+endif()
find_package(Threads REQUIRED)
find_package(nlohmann_json REQUIRED)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -10,6 +10,13 @@
configure_file(kazv-platform.hpp.in kazv-platform.hpp)
configure_file(kazv-defs.hpp.in kazv-defs.hpp)
+set(kazv_avatarAdapterFile ${CMAKE_CURRENT_SOURCE_DIR}/contents/ui/AvatarAdapter_KAC.qml)
+if(NOT KF${KF_MAJOR_VERSION}KirigamiAddons_FOUND)
+ set(kazv_avatarAdapterFile ${CMAKE_CURRENT_SOURCE_DIR}/contents/ui/AvatarAdapter_Kirigami.qml)
+endif()
+
+configure_file(${kazv_avatarAdapterFile} ${CMAKE_CURRENT_SOURCE_DIR}/contents/ui/AvatarAdapter.qml COPYONLY)
+
set(kazvprivlib_SRCS
qt-job-handler.cpp
qt-job.cpp
diff --git a/src/contents/ui/AvatarAdapter_KAC.qml b/src/contents/ui/AvatarAdapter_KAC.qml
new file mode 100644
--- /dev/null
+++ b/src/contents/ui/AvatarAdapter_KAC.qml
@@ -0,0 +1,11 @@
+/*
+ * This file is part of kazv.
+ * SPDX-FileCopyrightText: 2024 tusooa <tusooa@kazv.moe>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import QtQuick 2.15
+import org.kde.kirigamiaddons.components 1.0 as KAC
+
+KAC.Avatar {
+}
diff --git a/src/contents/ui/AvatarAdapter_Kirigami.qml b/src/contents/ui/AvatarAdapter_Kirigami.qml
new file mode 100644
--- /dev/null
+++ b/src/contents/ui/AvatarAdapter_Kirigami.qml
@@ -0,0 +1,11 @@
+/*
+ * This file is part of kazv.
+ * SPDX-FileCopyrightText: 2024 tusooa <tusooa@kazv.moe>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+import QtQuick 2.15
+import org.kde.kirigami 2.20 as Kirigami
+
+Kirigami.Avatar {
+}
diff --git a/src/contents/ui/EventReadIndicator.qml b/src/contents/ui/EventReadIndicator.qml
--- a/src/contents/ui/EventReadIndicator.qml
+++ b/src/contents/ui/EventReadIndicator.qml
@@ -9,7 +9,6 @@
import QtQuick.Controls 2.15
import org.kde.kirigami 2.13 as Kirigami
-
import '.' as Kazv
import 'matrix-helpers.js' as Helpers
@@ -33,7 +32,7 @@
Repeater {
model: readIndicator.actualItems
- Kirigami.Avatar {
+ Kazv.AvatarAdapter {
objectName: `readIndicatorAvatar${index}`
property var member: readIndicator.model.at(index)
property var nameProvider: Kazv.UserNameProvider {
@@ -80,7 +79,7 @@
RowLayout {
id: itemLayout
anchors.fill: parent
- Kirigami.Avatar {
+ Kazv.AvatarAdapter {
objectName: `readIndicatorAvatar${index}`
Layout.preferredWidth: readIndicator.avatarSize
Layout.preferredHeight: readIndicator.avatarSize
diff --git a/src/contents/ui/RoomListViewItemDelegate.qml b/src/contents/ui/RoomListViewItemDelegate.qml
--- a/src/contents/ui/RoomListViewItemDelegate.qml
+++ b/src/contents/ui/RoomListViewItemDelegate.qml
@@ -9,7 +9,6 @@
import QtQuick.Controls 2.15
import org.kde.kirigami 2.13 as Kirigami
-
import moe.kazv.mxc.kazv 0.0 as MK
import 'matrix-helpers.js' as Helpers
@@ -41,7 +40,7 @@
Kirigami.Theme.inherit: false
RowLayout {
- Kirigami.Avatar {
+ Kazv.AvatarAdapter {
sourceSize.width: iconSize
sourceSize.height: iconSize
source: item.roomOrHeroAvatarMxcUri ? matrixSdk.mxcUriToHttp(item.roomOrHeroAvatarMxcUri) : ''
diff --git a/src/contents/ui/RoomMemberListViewItemDelegate.qml b/src/contents/ui/RoomMemberListViewItemDelegate.qml
--- a/src/contents/ui/RoomMemberListViewItemDelegate.qml
+++ b/src/contents/ui/RoomMemberListViewItemDelegate.qml
@@ -22,7 +22,7 @@
property var iconSize
RowLayout {
- Kirigami.Avatar {
+ Kazv.AvatarAdapter {
sourceSize.width: iconSize
sourceSize.height: iconSize
source: member.avatarMxcUri ? matrixSdk.mxcUriToHttp(member.avatarMxcUri) : ''
diff --git a/src/contents/ui/UserPage.qml b/src/contents/ui/UserPage.qml
--- a/src/contents/ui/UserPage.qml
+++ b/src/contents/ui/UserPage.qml
@@ -138,7 +138,7 @@
}
ColumnLayout {
- Kirigami.Avatar {
+ Kazv.AvatarAdapter {
id: avatar
objectName: 'avatar'
Layout.alignment: Qt.AlignHCenter
diff --git a/src/contents/ui/event-types/Simple.qml b/src/contents/ui/event-types/Simple.qml
--- a/src/contents/ui/event-types/Simple.qml
+++ b/src/contents/ui/event-types/Simple.qml
@@ -53,7 +53,7 @@
Layout.topMargin: shouldCollapseSender ? 0 : Kirigami.Units.largeSpacing
Layout.bottomMargin: 0
- Kirigami.Avatar {
+ Kazv.AvatarAdapter {
id: avatar
objectName: 'senderAvatar'
Layout.alignment: Qt.AlignTop
@@ -83,7 +83,7 @@
RowLayout {
visible: !shouldCollapseSender
- Kirigami.Avatar {
+ Kazv.AvatarAdapter {
id: avatarCompact
Layout.preferredWidth: Kirigami.Units.iconSizes.sizeForLabels
Layout.preferredHeight: Kirigami.Units.iconSizes.sizeForLabels
diff --git a/src/contents/ui/settings/ProfileSettings.qml b/src/contents/ui/settings/ProfileSettings.qml
--- a/src/contents/ui/settings/ProfileSettings.qml
+++ b/src/contents/ui/settings/ProfileSettings.qml
@@ -19,7 +19,7 @@
property var getSelfProfilePromise: undefined
property var loaded: false
- Kirigami.Avatar {
+ Kazv.AvatarAdapter {
id: avatar
objectName: 'avatar'
Layout.alignment: Qt.AlignHCenter
diff --git a/src/resources.qrc b/src/resources.qrc
--- a/src/resources.qrc
+++ b/src/resources.qrc
@@ -76,6 +76,7 @@
<file alias="MessageNotification.qml">contents/ui/MessageNotification.qml</file>
<file alias="Notifier.qml">contents/ui/Notifier.qml</file>
<file alias="NotificationAction.qml">contents/ui/NotificationAction.qml</file>
+ <file alias="AvatarAdapter.qml">contents/ui/AvatarAdapter.qml</file>
<file alias="l10n.js">js/l10n.js</file>
<file alias="fluent-bundle.js">js/transformed-libs/fluent-bundle.js</file>
<file alias="fluent-sequence.js">js/transformed-libs/fluent-sequence.js</file>

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 2:47 PM (12 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39846
Default Alt Text
D47.1732488431.diff (6 KB)

Event Timeline