Page MenuHomePhorge

D133.1732291360.diff
No OneTemporary

Size
15 KB
Referenced Files
None
Subscribers
None

D133.1732291360.diff

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,3 +1,25 @@
+function(kazv_add_qml_files)
+ set(options "")
+ set(oneValueArgs BASE_DIRECTORY)
+ set(multiValueArgs SOURCES)
+ cmake_parse_arguments(PARSE_ARGV 0 kazv_add_qml_files "${options}" "${oneValueArgs}" "${multiValueArgs}")
+
+ set(target "${kazv_add_qml_files_UNPARSED_ARGUMENTS}")
+ foreach(source ${kazv_add_qml_files_SOURCES})
+ message(STATUS "Adding source: ${kazv_add_qml_files_BASE_DIRECTORY} / ${source}")
+ set_source_files_properties(
+ "${kazv_add_qml_files_BASE_DIRECTORY}/${source}"
+ PROPERTIES
+ QT_RESOURCE_ALIAS "${source}"
+ )
+ qt_target_qml_sources(
+ "${target}"
+ QML_FILES "${kazv_add_qml_files_BASE_DIRECTORY}/${source}"
+ )
+ endforeach()
+endfunction()
+
+
if(WIN32)
set(KAZV_IS_WINDOWS 1)
else()
@@ -114,9 +136,119 @@
kazvshortcutsqmlmoduleplugin
)
+qt_add_qml_module(kazvqmlqmlmodule
+ STATIC
+ URI moe.kazv.mxc.kazvqml
+ VERSION 0.0
+)
+kazv_add_qml_files(kazvqmlqmlmodule
+ BASE_DIRECTORY contents/ui
+ SOURCES
+ Main.qml
+ PageManager.qml
+ LoginPage.qml
+ MainPage.qml
+ TabView.qml
+ Tab.qml
+ ClosableScrollablePage.qml
+ SelfDestroyableOverlaySheet.qml
+ RoomListView.qml
+ RoomListViewItemDelegate.qml
+ RoomPage.qml
+ RoomPinnedEventsPage.qml
+ RoomTimelineView.qml
+ SendMessageBox.qml
+ EventView.qml
+ EventViewWrapper.qml
+ EventViewCompact.qml
+ EventSourceView.qml
+ EventHistoryView.qml
+ Bubble.qml
+ MediaFileMenu.qml
+ KazvIOMenu.qml
+ ConfirmUploadPopup.qml
+ StickerPicker.qml
+ AddStickerPopup.qml
+ ConfirmationOverlay.qml
+ event-types/Simple.qml
+ event-types/Text.qml
+ event-types/Emote.qml
+ event-types/Notice.qml
+ event-types/State.qml
+ event-types/TextTemplate.qml
+ event-types/Image.qml
+ event-types/File.qml
+ event-types/Video.qml
+ event-types/Audio.qml
+ event-types/MediaBubble.qml
+ event-types/Redacted.qml
+ event-types/Reaction.qml
+ event-types/Fallback.qml
+ TypingIndicator.qml
+ EventReadIndicator.qml
+ SelectableText.qml
+ ReactToEventPopup.qml
+ FileHandler.qml
+
+ ActionSettingsPage.qml
+ CreateRoomPage.qml
+ JoinRoomPage.qml
+ RoomMemberListView.qml
+ RoomMemberListViewItemDelegate.qml
+ UserNameProvider.qml
+ RoomNameProvider.qml
+ Completion.qml
+
+ AsyncHandler.qml
+ UploadFileHelper.qml
+ SettingsPage.qml
+ settings/ProfileSettings.qml
+ settings/CacheSettings.qml
+
+ room-settings/RoomSettingsPage.qml
+ room-settings/RoomTagHandler.qml
+ room-settings/RoomMemberListPage.qml
+ room-settings/RoomInvitePage.qml
+
+ device-mgmt/Device.qml
+ device-mgmt/DeviceList.qml
+
+ UserPage.qml
+
+ shortcuts/ActionCollection.qml
+ shortcuts/ActionItem.qml
+ shortcuts/ActionSettings.qml
+ shortcuts/ShortcutInput.qml
+
+ MessageNotification.qml
+ Notifier.qml
+ NotificationAction.qml
+ AvatarAdapter.qml
+ FileDialogAdapter.qml
+ FolderDialogAdapter.qml
+ ScrollablePageAdapter.qml
+)
+kazv_add_qml_files(kazvqmlqmlmodule
+ BASE_DIRECTORY js
+ SOURCES
+ l10n.js
+ global-this.js
+ matrix-helpers.js
+)
+
+kazv_add_qml_files(kazvqmlqmlmodule
+ BASE_DIRECTORY js/transformed-libs
+ SOURCES
+ fluent-bundle.js
+ fluent-sequence.js
+ fluent-langneg.js
+ bundled-deps.js
+)
+
+target_link_libraries(kazvqmlqmlmodule PUBLIC kazvprivlib)
+
set(kazv_SRCS
main.cpp
- resources.qrc
l10n/translations.qrc
)
@@ -124,6 +256,8 @@
target_link_libraries(kazv
PRIVATE
+ kazvqmlqmlmodule
+ kazvqmlqmlmoduleplugin
kazvprivlib
)
set(kazv_INSTALL_ARGS ${KF_INSTALL_TARGETS_DEFAULT_ARGS})
diff --git a/src/contents/ui/Bubble.qml b/src/contents/ui/Bubble.qml
--- a/src/contents/ui/Bubble.qml
+++ b/src/contents/ui/Bubble.qml
@@ -132,7 +132,8 @@
ColumnLayout {
Layout.fillWidth: true
- property var inReplyTo: MouseArea {
+ MouseArea {
+ visible: bubbleRootLayout.replyToOrAnnotatedEventId && !compactMode
Layout.fillWidth: true
Layout.margins: 0
Layout.preferredHeight: inReplyToLayout.implicitHeight
@@ -158,10 +159,9 @@
Loader {
id: inReplyToLoader
clip: true
- source: 'qrc:/EventViewCompact.qml'
+ source: Qt.resolvedUrl('EventViewCompact.qml')
active: bubbleRootLayout.replyToOrAnnotatedEventId && !compactMode
asynchronous: true
- Layout.preferredHeight: inReplyToLayout.item?.height
Layout.fillWidth: true
property var event: room.messageById(bubbleRootLayout.replyToOrAnnotatedEventId)
@@ -174,11 +174,11 @@
}
}
}
- children: [
- ...(bubbleRootLayout.replyToOrAnnotatedEventId && !compactMode ? [inReplyTo] : []),
- ...(Array.isArray(upper.children) ? upper.children :
- upper.children ? [upper.children] : []),
- ]
+
+ ColumnLayout {
+ id: children
+ data: upper.children
+ }
}
property var popupAction: Kirigami.Action {
diff --git a/src/contents/ui/main.qml b/src/contents/ui/Main.qml
rename from src/contents/ui/main.qml
rename to src/contents/ui/Main.qml
--- a/src/contents/ui/main.qml
+++ b/src/contents/ui/Main.qml
@@ -228,7 +228,7 @@
}
function activateUserPage(user, room, userId) {
- pageStack.push(Qt.resolvedUrl("qrc:///UserPage.qml"), {
+ pageStack.push(Qt.resolvedUrl("UserPage.qml"), {
userId: userId || user.userId,
user,
room
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
@@ -13,10 +13,11 @@
import '..' as Kazv
ColumnLayout {
+ objectName: 'eventViewMainItem'
property var event
property var sender
- default property var children
+ default property alias children: container.data
property var isSelected
/// The item shown after the username, in compact mode
property var summaryItem: Item {}
@@ -124,7 +125,6 @@
RowLayout {
id: container
Layout.fillWidth: true
- data: layout.children
}
}
}
diff --git a/src/contents/ui/room-settings/RoomSettingsPage.qml b/src/contents/ui/room-settings/RoomSettingsPage.qml
--- a/src/contents/ui/room-settings/RoomSettingsPage.qml
+++ b/src/contents/ui/room-settings/RoomSettingsPage.qml
@@ -192,7 +192,7 @@
text: l10n.get('room-settings-members-action')
icon.name: 'im-user'
Layout.fillWidth: true
- onClicked: pageStack.push(Qt.resolvedUrl('qrc:/room-settings/RoomMemberListPage.qml'), { room: room, members: room.members() })
+ onClicked: pageStack.push(Qt.resolvedUrl('RoomMemberListPage.qml'), { room: room, members: room.members() })
}
Button {
@@ -200,7 +200,7 @@
icon.name: 'im-kick-user'
icon.color: Kirigami.Theme.negativeTextColor
Layout.fillWidth: true
- onClicked: pageStack.push(Qt.resolvedUrl('qrc:/room-settings/RoomMemberListPage.qml'), { room: room, members: room.bannedMembers() })
+ onClicked: pageStack.push(Qt.resolvedUrl('RoomMemberListPage.qml'), { room: room, members: room.bannedMembers() })
}
Label {
diff --git a/src/kazv-io-job.hpp b/src/kazv-io-job.hpp
--- a/src/kazv-io-job.hpp
+++ b/src/kazv-io-job.hpp
@@ -27,6 +27,8 @@
class KazvIOBaseJob : public QObject
{
Q_OBJECT
+ QML_ELEMENT
+ QML_UNCREATABLE("")
Q_PROPERTY(float progress READ progress NOTIFY progressChanged)
diff --git a/src/main.cpp b/src/main.cpp
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -62,7 +62,7 @@
if (!iconThemeToSet.isEmpty()) {
QIcon::setThemeName(iconThemeToSet);
}
- engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
+ engine.loadFromModule("moe.kazv.mxc.kazvqml", "Main");
if (engine.rootObjects().isEmpty()) {
return -1;
diff --git a/src/resources.qrc b/src/resources.qrc
deleted file mode 100644
--- a/src/resources.qrc
+++ /dev/null
@@ -1,94 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file alias="main.qml">contents/ui/main.qml</file>
- <file alias="PageManager.qml">contents/ui/PageManager.qml</file>
- <file alias="LoginPage.qml">contents/ui/LoginPage.qml</file>
- <file alias="MainPage.qml">contents/ui/MainPage.qml</file>
- <file alias="TabView.qml">contents/ui/TabView.qml</file>
- <file alias="Tab.qml">contents/ui/Tab.qml</file>
- <file alias="ClosableScrollablePage.qml">contents/ui/ClosableScrollablePage.qml</file>
- <file alias="SelfDestroyableOverlaySheet.qml">contents/ui/SelfDestroyableOverlaySheet.qml</file>
- <file alias="RoomListView.qml">contents/ui/RoomListView.qml</file>
- <file alias="RoomListViewItemDelegate.qml">contents/ui/RoomListViewItemDelegate.qml</file>
- <file alias="RoomPage.qml">contents/ui/RoomPage.qml</file>
- <file alias="RoomPinnedEventsPage.qml">contents/ui/RoomPinnedEventsPage.qml</file>
- <file alias="RoomTimelineView.qml">contents/ui/RoomTimelineView.qml</file>
- <file alias="SendMessageBox.qml">contents/ui/SendMessageBox.qml</file>
- <file alias="EventView.qml">contents/ui/EventView.qml</file>
- <file alias="EventViewWrapper.qml">contents/ui/EventViewWrapper.qml</file>
- <file alias="EventViewCompact.qml">contents/ui/EventViewCompact.qml</file>
- <file alias="EventSourceView.qml">contents/ui/EventSourceView.qml</file>
- <file alias="EventHistoryView.qml">contents/ui/EventHistoryView.qml</file>
- <file alias="Bubble.qml">contents/ui/Bubble.qml</file>
- <file alias="MediaFileMenu.qml">contents/ui/MediaFileMenu.qml</file>
- <file alias="KazvIOMenu.qml">contents/ui/KazvIOMenu.qml</file>
- <file alias="ConfirmUploadPopup.qml">contents/ui/ConfirmUploadPopup.qml</file>
- <file alias="StickerPicker.qml">contents/ui/StickerPicker.qml</file>
- <file alias="AddStickerPopup.qml">contents/ui/AddStickerPopup.qml</file>
- <file alias="ConfirmationOverlay.qml">contents/ui/ConfirmationOverlay.qml</file>
- <file alias="event-types/Simple.qml">contents/ui/event-types/Simple.qml</file>
- <file alias="event-types/Text.qml">contents/ui/event-types/Text.qml</file>
- <file alias="event-types/Emote.qml">contents/ui/event-types/Emote.qml</file>
- <file alias="event-types/Notice.qml">contents/ui/event-types/Notice.qml</file>
- <file alias="event-types/State.qml">contents/ui/event-types/State.qml</file>
- <file alias="event-types/TextTemplate.qml">contents/ui/event-types/TextTemplate.qml</file>
- <file alias="event-types/Image.qml">contents/ui/event-types/Image.qml</file>
- <file alias="event-types/File.qml">contents/ui/event-types/File.qml</file>
- <file alias="event-types/Video.qml">contents/ui/event-types/Video.qml</file>
- <file alias="event-types/Audio.qml">contents/ui/event-types/Audio.qml</file>
- <file alias="event-types/MediaBubble.qml">contents/ui/event-types/MediaBubble.qml</file>
- <file alias="event-types/Redacted.qml">contents/ui/event-types/Redacted.qml</file>
- <file alias="event-types/Reaction.qml">contents/ui/event-types/Reaction.qml</file>
- <file alias="event-types/Fallback.qml">contents/ui/event-types/Fallback.qml</file>
- <file alias="TypingIndicator.qml">contents/ui/TypingIndicator.qml</file>
- <file alias="EventReadIndicator.qml">contents/ui/EventReadIndicator.qml</file>
- <file alias="SelectableText.qml">contents/ui/SelectableText.qml</file>
- <file alias="ReactToEventPopup.qml">contents/ui/ReactToEventPopup.qml</file>
- <file alias="FileHandler.qml">contents/ui/FileHandler.qml</file>
-
- <file alias="ActionSettingsPage.qml">contents/ui/ActionSettingsPage.qml</file>
- <file alias="CreateRoomPage.qml">contents/ui/CreateRoomPage.qml</file>
- <file alias="JoinRoomPage.qml">contents/ui/JoinRoomPage.qml</file>
- <file alias="RoomMemberListView.qml">contents/ui/RoomMemberListView.qml</file>
- <file alias="RoomMemberListViewItemDelegate.qml">contents/ui/RoomMemberListViewItemDelegate.qml</file>
- <file alias="UserNameProvider.qml">contents/ui/UserNameProvider.qml</file>
- <file alias="RoomNameProvider.qml">contents/ui/RoomNameProvider.qml</file>
- <file alias="Completion.qml">contents/ui/Completion.qml</file>
-
- <file alias="AsyncHandler.qml">contents/ui/AsyncHandler.qml</file>
- <file alias="UploadFileHelper.qml">contents/ui/UploadFileHelper.qml</file>
- <file alias="SettingsPage.qml">contents/ui/SettingsPage.qml</file>
- <file alias="settings/ProfileSettings.qml">contents/ui/settings/ProfileSettings.qml</file>
- <file alias="settings/CacheSettings.qml">contents/ui/settings/CacheSettings.qml</file>
-
- <file alias="room-settings/RoomSettingsPage.qml">contents/ui/room-settings/RoomSettingsPage.qml</file>
- <file alias="room-settings/RoomTagHandler.qml">contents/ui/room-settings/RoomTagHandler.qml</file>
- <file alias="room-settings/RoomMemberListPage.qml">contents/ui/room-settings/RoomMemberListPage.qml</file>
- <file alias="room-settings/RoomInvitePage.qml">contents/ui/room-settings/RoomInvitePage.qml</file>
-
- <file alias="device-mgmt/Device.qml">contents/ui/device-mgmt/Device.qml</file>
- <file alias="device-mgmt/DeviceList.qml">contents/ui/device-mgmt/DeviceList.qml</file>
-
- <file alias="UserPage.qml">contents/ui/UserPage.qml</file>
-
- <file alias="shortcuts/ActionCollection.qml">contents/ui/shortcuts/ActionCollection.qml</file>
- <file alias="shortcuts/ActionItem.qml">contents/ui/shortcuts/ActionItem.qml</file>
- <file alias="shortcuts/ActionSettings.qml">contents/ui/shortcuts/ActionSettings.qml</file>
- <file alias="shortcuts/ShortcutInput.qml">contents/ui/shortcuts/ShortcutInput.qml</file>
-
- <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="FileDialogAdapter.qml">contents/ui/FileDialogAdapter.qml</file>
- <file alias="FolderDialogAdapter.qml">contents/ui/FolderDialogAdapter.qml</file>
- <file alias="ScrollablePageAdapter.qml">contents/ui/ScrollablePageAdapter.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 alias="fluent-langneg.js">js/transformed-libs/fluent-langneg.js</file>
- <file alias="bundled-deps.js">js/transformed-libs/bundled-deps.js</file>
- <file alias="global-this.js">js/global-this.js</file>
- <file alias="matrix-helpers.js">js/matrix-helpers.js</file>
- </qresource>
-</RCC>
diff --git a/src/tests/quick-tests/tst_EventView.qml b/src/tests/quick-tests/tst_EventView.qml
--- a/src/tests/quick-tests/tst_EventView.qml
+++ b/src/tests/quick-tests/tst_EventView.qml
@@ -513,19 +513,19 @@
}
function test_htmlMessage() {
- const text = findChild(eventViewHtml, 'textEventContent');
+ const text = findChild(eventViewHtml, 'eventViewMainItem');
verify(text.textFormat === TextEdit.RichText);
verify(text.text.includes('some body'));
}
function test_htmlMessageReply() {
- const text = findChild(eventViewHtmlReply, 'textEventContent');
+ const text = findChild(eventViewHtmlReply, 'eventViewMainItem');
verify(text.textFormat === TextEdit.RichText);
verify(!text.text.includes('<blockquote>'));
}
function test_htmlMessageReplyNoQuote() {
- const text = findChild(eventViewHtmlReplyNoQuote, 'textEventContent');
+ const text = findChild(eventViewHtmlReplyNoQuote, 'eventViewMainItem');
verify(text.textFormat === TextEdit.RichText);
verify(!text.text.includes('<blockquote>'));
verify(text.text.includes('some body'));

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 8:02 AM (5 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38913
Default Alt Text
D133.1732291360.diff (15 KB)

Event Timeline