diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53905f9c..8d5510b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -324,7 +324,6 @@ set(SRC_FILES
src/timeline/Reaction.cpp
src/timeline/TimelineViewManager.cpp
src/timeline/TimelineModel.cpp
- src/timeline/DelegateChooser.cpp
src/timeline/Permissions.cpp
src/timeline/PresenceEmitter.cpp
src/timeline/RoomlistModel.cpp
@@ -506,7 +505,7 @@ if (NOT APPLE AND NOT WIN32)
add_compile_definitions(NHEKO_DBUS_SYS)
endif()
-qt_wrap_cpp(MOC_HEADERS
+set(MOC_HEADERS
# Dialogs
src/dialogs/FallbackAuth.h
src/dialogs/ReCaptcha.h
@@ -522,7 +521,6 @@ qt_wrap_cpp(MOC_HEADERS
src/timeline/Reaction.h
src/timeline/TimelineViewManager.h
src/timeline/TimelineModel.h
- src/timeline/DelegateChooser.h
src/timeline/Permissions.h
src/timeline/PresenceEmitter.h
src/timeline/RoomlistModel.h
@@ -533,7 +531,6 @@ qt_wrap_cpp(MOC_HEADERS
src/ui/MxcMediaProxy.h
src/ui/NhekoCursorShape.h
src/ui/NhekoEventObserver.h
- src/ui/NhekoDropArea.h
src/ui/NhekoGlobalObject.h
src/ui/RoomSettings.h
src/ui/Theme.h
@@ -646,6 +643,113 @@ endif()
file(GLOB LANG_TS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/resources/langs/*.ts")
qt_add_translations(nheko RESOURCE_PREFIX "/translations" TS_FILES ${LANG_TS_SRC})
+set_property(TARGET nheko PROPERTY AUTOMOC ON)
+qt_add_qml_module(nheko
+ URI im.nheko2
+ RESOURCE_PREFIX "/"
+ VERSION 1.0
+ SOURCES
+ src/timeline/DelegateChooser.cpp
+ src/timeline/DelegateChooser.h
+ src/ui/NhekoDropArea.h
+ )
+qt_target_qml_sources(nheko
+ #PREFIX "/"
+ QML_FILES
+ qml/Avatar.qml
+ qml/ChatPage.qml
+ qml/ElidedLabel.qml
+ qml/EncryptionIndicator.qml
+ qml/ForwardCompleter.qml
+ qml/ImageButton.qml
+ qml/MatrixText.qml
+ qml/MatrixTextField.qml
+ qml/MessageInput.qml
+ qml/NhekoBusyIndicator.qml
+ qml/NotificationWarning.qml
+ qml/QuickSwitcher.qml
+ qml/Reactions.qml
+ qml/SelfVerificationCheck.qml
+ qml/StatusIndicator.qml
+ qml/ToggleButton.qml
+ qml/TypingIndicator.qml
+ qml/UploadBox.qml
+ qml/components/AdaptiveLayout.qml
+ qml/components/AdaptiveLayoutElement.qml
+ qml/components/AvatarListTile.qml
+ qml/components/MainWindowDialog.qml
+ qml/components/TextButton.qml
+ qml/components/FlatButton.qml
+ qml/delegates/Encrypted.qml
+ qml/delegates/FileMessage.qml
+ qml/delegates/NoticeMessage.qml
+ qml/delegates/Pill.qml
+ qml/delegates/Placeholder.qml
+ qml/delegates/Redacted.qml
+ qml/delegates/Reply.qml
+ qml/delegates/PlayableMediaMessage.qml
+ qml/delegates/ImageMessage.qml
+ qml/delegates/TextMessage.qml
+ qml/delegates/MessageDelegate.qml
+ qml/device-verification/DeviceVerification.qml
+ qml/device-verification/DigitVerification.qml
+ qml/device-verification/EmojiElement.qml
+ qml/device-verification/EmojiVerification.qml
+ qml/device-verification/Failed.qml
+ qml/device-verification/NewVerificationRequest.qml
+ qml/device-verification/Success.qml
+ qml/device-verification/Waiting.qml
+ qml/dialogs/HiddenEventsDialog.qml
+ qml/dialogs/ImageOverlay.qml
+ qml/dialogs/LeaveRoomDialog.qml
+ qml/dialogs/LogoutDialog.qml
+ qml/dialogs/CreateDirect.qml
+ qml/dialogs/CreateRoom.qml
+ qml/dialogs/ImagePackEditorDialog.qml
+ qml/dialogs/ImagePackSettingsDialog.qml
+ qml/dialogs/InputDialog.qml
+ qml/dialogs/InviteDialog.qml
+ qml/dialogs/JoinRoomDialog.qml
+ qml/dialogs/PhoneNumberInputDialog.qml
+ qml/dialogs/RawMessageDialog.qml
+ qml/dialogs/ReadReceipts.qml
+ qml/dialogs/RoomDirectory.qml
+ qml/dialogs/RoomMembers.qml
+ qml/dialogs/UserProfile.qml
+ qml/dialogs/RoomSettings.qml
+ qml/emoji/EmojiPicker.qml
+ qml/emoji/StickerPicker.qml
+ qml/pages/LoginPage.qml
+ qml/pages/RegisterPage.qml
+ qml/pages/WelcomePage.qml
+ qml/pages/UserSettingsPage.qml
+ qml/ui/NhekoSlider.qml
+ qml/ui/Snackbar.qml
+ qml/ui/animations/BlinkAnimation.qml
+ qml/ui/media/MediaControls.qml
+ qml/ui/Ripple.qml
+ qml/ui/Spinner.qml
+ qml/voip/ActiveCallBar.qml
+ qml/voip/CallDevices.qml
+ qml/voip/CallInvite.qml
+ qml/voip/CallInviteBar.qml
+ qml/voip/DeviceError.qml
+ qml/voip/PlaceCall.qml
+ qml/voip/ScreenShare.qml
+ qml/voip/VideoCall.qml
+ qml/PrivacyScreen.qml
+ qml/TimelineRow.qml
+ qml/Root.qml
+ qml/ReplyPopup.qml
+ qml/MessageView.qml
+ qml/RoomList.qml
+ qml/CommunitiesList.qml
+ qml/TopBar.qml
+ qml/Completer.qml
+ qml/TimelineView.qml
+ )
+
+
if(APPLE)
target_link_libraries (nheko PRIVATE Qt5::MacExtras)
elseif(WIN32)
@@ -660,7 +764,7 @@ else()
target_compile_definitions(nheko PRIVATE NHEKO_FLATPAK)
endif()
endif()
-target_include_directories(nheko PRIVATE src includes third_party/blurhash third_party/cpp-httplib-0.5.12)
+target_include_directories(nheko PRIVATE src includes third_party/blurhash third_party/cpp-httplib-0.5.12 src/timeline src/ui)
# Fixup bundled keychain include dirs
if (USE_BUNDLED_QTKEYCHAIN)
diff --git a/resources/qml/Avatar.qml b/qml/Avatar.qml
similarity index 100%
rename from resources/qml/Avatar.qml
rename to qml/Avatar.qml
diff --git a/resources/qml/ChatPage.qml b/qml/ChatPage.qml
similarity index 100%
rename from resources/qml/ChatPage.qml
rename to qml/ChatPage.qml
diff --git a/resources/qml/CommunitiesList.qml b/qml/CommunitiesList.qml
similarity index 100%
rename from resources/qml/CommunitiesList.qml
rename to qml/CommunitiesList.qml
diff --git a/resources/qml/Completer.qml b/qml/Completer.qml
similarity index 98%
rename from resources/qml/Completer.qml
rename to qml/Completer.qml
index d173de87..41c28894 100644
--- a/resources/qml/Completer.qml
+++ b/qml/Completer.qml
@@ -3,11 +3,13 @@
//
// SPDX-License-Identifier: GPL-3.0-or-later
-import "./ui"
-import QtQuick 2.15
-import QtQuick.Controls 2.15
-import QtQuick.Layouts 1.15
-import im.nheko 1.0
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Layouts
+import im.nheko
+import im.nheko2
+
+import "./ui/"
Control {
id: popup
diff --git a/resources/qml/ElidedLabel.qml b/qml/ElidedLabel.qml
similarity index 100%
rename from resources/qml/ElidedLabel.qml
rename to qml/ElidedLabel.qml
diff --git a/resources/qml/EncryptionIndicator.qml b/qml/EncryptionIndicator.qml
similarity index 100%
rename from resources/qml/EncryptionIndicator.qml
rename to qml/EncryptionIndicator.qml
diff --git a/resources/qml/ForwardCompleter.qml b/qml/ForwardCompleter.qml
similarity index 100%
rename from resources/qml/ForwardCompleter.qml
rename to qml/ForwardCompleter.qml
diff --git a/resources/qml/ImageButton.qml b/qml/ImageButton.qml
similarity index 100%
rename from resources/qml/ImageButton.qml
rename to qml/ImageButton.qml
diff --git a/resources/qml/MatrixText.qml b/qml/MatrixText.qml
similarity index 100%
rename from resources/qml/MatrixText.qml
rename to qml/MatrixText.qml
diff --git a/resources/qml/MatrixTextField.qml b/qml/MatrixTextField.qml
similarity index 100%
rename from resources/qml/MatrixTextField.qml
rename to qml/MatrixTextField.qml
diff --git a/resources/qml/MessageInput.qml b/qml/MessageInput.qml
similarity index 100%
rename from resources/qml/MessageInput.qml
rename to qml/MessageInput.qml
diff --git a/resources/qml/MessageView.qml b/qml/MessageView.qml
similarity index 100%
rename from resources/qml/MessageView.qml
rename to qml/MessageView.qml
diff --git a/resources/qml/NhekoBusyIndicator.qml b/qml/NhekoBusyIndicator.qml
similarity index 100%
rename from resources/qml/NhekoBusyIndicator.qml
rename to qml/NhekoBusyIndicator.qml
diff --git a/resources/qml/NotificationWarning.qml b/qml/NotificationWarning.qml
similarity index 100%
rename from resources/qml/NotificationWarning.qml
rename to qml/NotificationWarning.qml
diff --git a/resources/qml/PrivacyScreen.qml b/qml/PrivacyScreen.qml
similarity index 100%
rename from resources/qml/PrivacyScreen.qml
rename to qml/PrivacyScreen.qml
diff --git a/resources/qml/QuickSwitcher.qml b/qml/QuickSwitcher.qml
similarity index 100%
rename from resources/qml/QuickSwitcher.qml
rename to qml/QuickSwitcher.qml
diff --git a/resources/qml/Reactions.qml b/qml/Reactions.qml
similarity index 100%
rename from resources/qml/Reactions.qml
rename to qml/Reactions.qml
diff --git a/resources/qml/ReplyPopup.qml b/qml/ReplyPopup.qml
similarity index 100%
rename from resources/qml/ReplyPopup.qml
rename to qml/ReplyPopup.qml
diff --git a/resources/qml/RoomList.qml b/qml/RoomList.qml
similarity index 100%
rename from resources/qml/RoomList.qml
rename to qml/RoomList.qml
diff --git a/resources/qml/Root.qml b/qml/Root.qml
similarity index 100%
rename from resources/qml/Root.qml
rename to qml/Root.qml
diff --git a/resources/qml/SelfVerificationCheck.qml b/qml/SelfVerificationCheck.qml
similarity index 100%
rename from resources/qml/SelfVerificationCheck.qml
rename to qml/SelfVerificationCheck.qml
diff --git a/resources/qml/StatusIndicator.qml b/qml/StatusIndicator.qml
similarity index 100%
rename from resources/qml/StatusIndicator.qml
rename to qml/StatusIndicator.qml
diff --git a/resources/qml/TimelineRow.qml b/qml/TimelineRow.qml
similarity index 100%
rename from resources/qml/TimelineRow.qml
rename to qml/TimelineRow.qml
diff --git a/resources/qml/TimelineView.qml b/qml/TimelineView.qml
similarity index 99%
rename from resources/qml/TimelineView.qml
rename to qml/TimelineView.qml
index ea3e4e3d..02396b82 100644
--- a/resources/qml/TimelineView.qml
+++ b/qml/TimelineView.qml
@@ -14,7 +14,8 @@ import QtQuick 2.15
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.3
import QtQuick.Window 2.13
-import im.nheko 1.0
+import im.nheko
+import im.nheko2
import im.nheko.EmojiModel 1.0
Item {
diff --git a/resources/qml/ToggleButton.qml b/qml/ToggleButton.qml
similarity index 100%
rename from resources/qml/ToggleButton.qml
rename to qml/ToggleButton.qml
diff --git a/resources/qml/TopBar.qml b/qml/TopBar.qml
similarity index 100%
rename from resources/qml/TopBar.qml
rename to qml/TopBar.qml
diff --git a/resources/qml/TypingIndicator.qml b/qml/TypingIndicator.qml
similarity index 100%
rename from resources/qml/TypingIndicator.qml
rename to qml/TypingIndicator.qml
diff --git a/resources/qml/UploadBox.qml b/qml/UploadBox.qml
similarity index 100%
rename from resources/qml/UploadBox.qml
rename to qml/UploadBox.qml
diff --git a/resources/qml/components/AdaptiveLayout.qml b/qml/components/AdaptiveLayout.qml
similarity index 100%
rename from resources/qml/components/AdaptiveLayout.qml
rename to qml/components/AdaptiveLayout.qml
diff --git a/resources/qml/components/AdaptiveLayoutElement.qml b/qml/components/AdaptiveLayoutElement.qml
similarity index 100%
rename from resources/qml/components/AdaptiveLayoutElement.qml
rename to qml/components/AdaptiveLayoutElement.qml
diff --git a/resources/qml/components/AvatarListTile.qml b/qml/components/AvatarListTile.qml
similarity index 100%
rename from resources/qml/components/AvatarListTile.qml
rename to qml/components/AvatarListTile.qml
diff --git a/resources/qml/components/FlatButton.qml b/qml/components/FlatButton.qml
similarity index 100%
rename from resources/qml/components/FlatButton.qml
rename to qml/components/FlatButton.qml
diff --git a/resources/qml/components/MainWindowDialog.qml b/qml/components/MainWindowDialog.qml
similarity index 100%
rename from resources/qml/components/MainWindowDialog.qml
rename to qml/components/MainWindowDialog.qml
diff --git a/resources/qml/components/TextButton.qml b/qml/components/TextButton.qml
similarity index 100%
rename from resources/qml/components/TextButton.qml
rename to qml/components/TextButton.qml
diff --git a/resources/qml/delegates/Encrypted.qml b/qml/delegates/Encrypted.qml
similarity index 100%
rename from resources/qml/delegates/Encrypted.qml
rename to qml/delegates/Encrypted.qml
diff --git a/resources/qml/delegates/FileMessage.qml b/qml/delegates/FileMessage.qml
similarity index 100%
rename from resources/qml/delegates/FileMessage.qml
rename to qml/delegates/FileMessage.qml
diff --git a/resources/qml/delegates/ImageMessage.qml b/qml/delegates/ImageMessage.qml
similarity index 100%
rename from resources/qml/delegates/ImageMessage.qml
rename to qml/delegates/ImageMessage.qml
diff --git a/resources/qml/delegates/MessageDelegate.qml b/qml/delegates/MessageDelegate.qml
similarity index 99%
rename from resources/qml/delegates/MessageDelegate.qml
rename to qml/delegates/MessageDelegate.qml
index b91223be..f965b298 100644
--- a/resources/qml/delegates/MessageDelegate.qml
+++ b/qml/delegates/MessageDelegate.qml
@@ -6,7 +6,8 @@
import QtQuick 2.6
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.2
-import im.nheko 1.0
+import im.nheko
+import im.nheko2
Item {
id: d
diff --git a/resources/qml/delegates/NoticeMessage.qml b/qml/delegates/NoticeMessage.qml
similarity index 100%
rename from resources/qml/delegates/NoticeMessage.qml
rename to qml/delegates/NoticeMessage.qml
diff --git a/resources/qml/delegates/Pill.qml b/qml/delegates/Pill.qml
similarity index 100%
rename from resources/qml/delegates/Pill.qml
rename to qml/delegates/Pill.qml
diff --git a/resources/qml/delegates/Placeholder.qml b/qml/delegates/Placeholder.qml
similarity index 100%
rename from resources/qml/delegates/Placeholder.qml
rename to qml/delegates/Placeholder.qml
diff --git a/resources/qml/delegates/PlayableMediaMessage.qml b/qml/delegates/PlayableMediaMessage.qml
similarity index 100%
rename from resources/qml/delegates/PlayableMediaMessage.qml
rename to qml/delegates/PlayableMediaMessage.qml
diff --git a/resources/qml/delegates/Redacted.qml b/qml/delegates/Redacted.qml
similarity index 100%
rename from resources/qml/delegates/Redacted.qml
rename to qml/delegates/Redacted.qml
diff --git a/resources/qml/delegates/Reply.qml b/qml/delegates/Reply.qml
similarity index 100%
rename from resources/qml/delegates/Reply.qml
rename to qml/delegates/Reply.qml
diff --git a/resources/qml/delegates/TextMessage.qml b/qml/delegates/TextMessage.qml
similarity index 97%
rename from resources/qml/delegates/TextMessage.qml
rename to qml/delegates/TextMessage.qml
index 9c8ba791..41a56f5d 100644
--- a/resources/qml/delegates/TextMessage.qml
+++ b/qml/delegates/TextMessage.qml
@@ -4,8 +4,9 @@
// SPDX-License-Identifier: GPL-3.0-or-later
import ".."
-import QtQuick.Controls 2.3
-import im.nheko 1.0
+import QtQuick
+import QtQuick.Controls
+import im.nheko
MatrixText {
required property string body
diff --git a/resources/qml/device-verification/DeviceVerification.qml b/qml/device-verification/DeviceVerification.qml
similarity index 100%
rename from resources/qml/device-verification/DeviceVerification.qml
rename to qml/device-verification/DeviceVerification.qml
diff --git a/resources/qml/device-verification/DigitVerification.qml b/qml/device-verification/DigitVerification.qml
similarity index 100%
rename from resources/qml/device-verification/DigitVerification.qml
rename to qml/device-verification/DigitVerification.qml
diff --git a/resources/qml/device-verification/EmojiElement.qml b/qml/device-verification/EmojiElement.qml
similarity index 100%
rename from resources/qml/device-verification/EmojiElement.qml
rename to qml/device-verification/EmojiElement.qml
diff --git a/resources/qml/device-verification/EmojiVerification.qml b/qml/device-verification/EmojiVerification.qml
similarity index 100%
rename from resources/qml/device-verification/EmojiVerification.qml
rename to qml/device-verification/EmojiVerification.qml
diff --git a/resources/qml/device-verification/Failed.qml b/qml/device-verification/Failed.qml
similarity index 100%
rename from resources/qml/device-verification/Failed.qml
rename to qml/device-verification/Failed.qml
diff --git a/resources/qml/device-verification/NewVerificationRequest.qml b/qml/device-verification/NewVerificationRequest.qml
similarity index 100%
rename from resources/qml/device-verification/NewVerificationRequest.qml
rename to qml/device-verification/NewVerificationRequest.qml
diff --git a/resources/qml/device-verification/Success.qml b/qml/device-verification/Success.qml
similarity index 100%
rename from resources/qml/device-verification/Success.qml
rename to qml/device-verification/Success.qml
diff --git a/resources/qml/device-verification/Waiting.qml b/qml/device-verification/Waiting.qml
similarity index 100%
rename from resources/qml/device-verification/Waiting.qml
rename to qml/device-verification/Waiting.qml
diff --git a/resources/qml/device-verification/sas-emoji.json b/qml/device-verification/sas-emoji.json
similarity index 100%
rename from resources/qml/device-verification/sas-emoji.json
rename to qml/device-verification/sas-emoji.json
diff --git a/resources/qml/dialogs/CreateDirect.qml b/qml/dialogs/CreateDirect.qml
similarity index 100%
rename from resources/qml/dialogs/CreateDirect.qml
rename to qml/dialogs/CreateDirect.qml
diff --git a/resources/qml/dialogs/CreateRoom.qml b/qml/dialogs/CreateRoom.qml
similarity index 100%
rename from resources/qml/dialogs/CreateRoom.qml
rename to qml/dialogs/CreateRoom.qml
diff --git a/resources/qml/dialogs/HiddenEventsDialog.qml b/qml/dialogs/HiddenEventsDialog.qml
similarity index 100%
rename from resources/qml/dialogs/HiddenEventsDialog.qml
rename to qml/dialogs/HiddenEventsDialog.qml
diff --git a/resources/qml/dialogs/ImageOverlay.qml b/qml/dialogs/ImageOverlay.qml
similarity index 100%
rename from resources/qml/dialogs/ImageOverlay.qml
rename to qml/dialogs/ImageOverlay.qml
diff --git a/resources/qml/dialogs/ImagePackEditorDialog.qml b/qml/dialogs/ImagePackEditorDialog.qml
similarity index 100%
rename from resources/qml/dialogs/ImagePackEditorDialog.qml
rename to qml/dialogs/ImagePackEditorDialog.qml
diff --git a/resources/qml/dialogs/ImagePackSettingsDialog.qml b/qml/dialogs/ImagePackSettingsDialog.qml
similarity index 100%
rename from resources/qml/dialogs/ImagePackSettingsDialog.qml
rename to qml/dialogs/ImagePackSettingsDialog.qml
diff --git a/resources/qml/dialogs/InputDialog.qml b/qml/dialogs/InputDialog.qml
similarity index 100%
rename from resources/qml/dialogs/InputDialog.qml
rename to qml/dialogs/InputDialog.qml
diff --git a/resources/qml/dialogs/InviteDialog.qml b/qml/dialogs/InviteDialog.qml
similarity index 100%
rename from resources/qml/dialogs/InviteDialog.qml
rename to qml/dialogs/InviteDialog.qml
diff --git a/resources/qml/dialogs/JoinRoomDialog.qml b/qml/dialogs/JoinRoomDialog.qml
similarity index 100%
rename from resources/qml/dialogs/JoinRoomDialog.qml
rename to qml/dialogs/JoinRoomDialog.qml
diff --git a/resources/qml/dialogs/LeaveRoomDialog.qml b/qml/dialogs/LeaveRoomDialog.qml
similarity index 100%
rename from resources/qml/dialogs/LeaveRoomDialog.qml
rename to qml/dialogs/LeaveRoomDialog.qml
diff --git a/resources/qml/dialogs/LogoutDialog.qml b/qml/dialogs/LogoutDialog.qml
similarity index 100%
rename from resources/qml/dialogs/LogoutDialog.qml
rename to qml/dialogs/LogoutDialog.qml
diff --git a/resources/qml/dialogs/PhoneNumberInputDialog.qml b/qml/dialogs/PhoneNumberInputDialog.qml
similarity index 100%
rename from resources/qml/dialogs/PhoneNumberInputDialog.qml
rename to qml/dialogs/PhoneNumberInputDialog.qml
diff --git a/resources/qml/dialogs/RawMessageDialog.qml b/qml/dialogs/RawMessageDialog.qml
similarity index 100%
rename from resources/qml/dialogs/RawMessageDialog.qml
rename to qml/dialogs/RawMessageDialog.qml
diff --git a/resources/qml/dialogs/ReadReceipts.qml b/qml/dialogs/ReadReceipts.qml
similarity index 100%
rename from resources/qml/dialogs/ReadReceipts.qml
rename to qml/dialogs/ReadReceipts.qml
diff --git a/resources/qml/dialogs/RoomDirectory.qml b/qml/dialogs/RoomDirectory.qml
similarity index 100%
rename from resources/qml/dialogs/RoomDirectory.qml
rename to qml/dialogs/RoomDirectory.qml
diff --git a/resources/qml/dialogs/RoomMembers.qml b/qml/dialogs/RoomMembers.qml
similarity index 100%
rename from resources/qml/dialogs/RoomMembers.qml
rename to qml/dialogs/RoomMembers.qml
diff --git a/resources/qml/dialogs/RoomSettings.qml b/qml/dialogs/RoomSettings.qml
similarity index 100%
rename from resources/qml/dialogs/RoomSettings.qml
rename to qml/dialogs/RoomSettings.qml
diff --git a/resources/qml/dialogs/UserProfile.qml b/qml/dialogs/UserProfile.qml
similarity index 100%
rename from resources/qml/dialogs/UserProfile.qml
rename to qml/dialogs/UserProfile.qml
diff --git a/resources/qml/emoji/EmojiPicker.qml b/qml/emoji/EmojiPicker.qml
similarity index 100%
rename from resources/qml/emoji/EmojiPicker.qml
rename to qml/emoji/EmojiPicker.qml
diff --git a/resources/qml/emoji/StickerPicker.qml b/qml/emoji/StickerPicker.qml
similarity index 100%
rename from resources/qml/emoji/StickerPicker.qml
rename to qml/emoji/StickerPicker.qml
diff --git a/resources/qml/pages/LoginPage.qml b/qml/pages/LoginPage.qml
similarity index 100%
rename from resources/qml/pages/LoginPage.qml
rename to qml/pages/LoginPage.qml
diff --git a/resources/qml/pages/RegisterPage.qml b/qml/pages/RegisterPage.qml
similarity index 100%
rename from resources/qml/pages/RegisterPage.qml
rename to qml/pages/RegisterPage.qml
diff --git a/resources/qml/pages/UserSettingsPage.qml b/qml/pages/UserSettingsPage.qml
similarity index 99%
rename from resources/qml/pages/UserSettingsPage.qml
rename to qml/pages/UserSettingsPage.qml
index 9fc0850f..0602f0ef 100644
--- a/resources/qml/pages/UserSettingsPage.qml
+++ b/qml/pages/UserSettingsPage.qml
@@ -10,7 +10,8 @@ import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.2
import QtQuick.Window 2.15
-import im.nheko 1.0
+import im.nheko
+import im.nheko2
Rectangle {
id: userSettingsDialog
diff --git a/resources/qml/pages/WelcomePage.qml b/qml/pages/WelcomePage.qml
similarity index 100%
rename from resources/qml/pages/WelcomePage.qml
rename to qml/pages/WelcomePage.qml
diff --git a/resources/qml/ui/NhekoSlider.qml b/qml/ui/NhekoSlider.qml
similarity index 100%
rename from resources/qml/ui/NhekoSlider.qml
rename to qml/ui/NhekoSlider.qml
diff --git a/resources/qml/ui/Ripple.qml b/qml/ui/Ripple.qml
similarity index 100%
rename from resources/qml/ui/Ripple.qml
rename to qml/ui/Ripple.qml
diff --git a/resources/qml/ui/Snackbar.qml b/qml/ui/Snackbar.qml
similarity index 100%
rename from resources/qml/ui/Snackbar.qml
rename to qml/ui/Snackbar.qml
diff --git a/resources/qml/ui/Spinner.qml b/qml/ui/Spinner.qml
similarity index 100%
rename from resources/qml/ui/Spinner.qml
rename to qml/ui/Spinner.qml
diff --git a/resources/qml/ui/animations/BlinkAnimation.qml b/qml/ui/animations/BlinkAnimation.qml
similarity index 100%
rename from resources/qml/ui/animations/BlinkAnimation.qml
rename to qml/ui/animations/BlinkAnimation.qml
diff --git a/resources/qml/ui/animations/qmldir b/qml/ui/animations/qmldir
similarity index 100%
rename from resources/qml/ui/animations/qmldir
rename to qml/ui/animations/qmldir
diff --git a/resources/qml/ui/media/MediaControls.qml b/qml/ui/media/MediaControls.qml
similarity index 100%
rename from resources/qml/ui/media/MediaControls.qml
rename to qml/ui/media/MediaControls.qml
diff --git a/resources/qml/ui/media/qmldir b/qml/ui/media/qmldir
similarity index 100%
rename from resources/qml/ui/media/qmldir
rename to qml/ui/media/qmldir
diff --git a/resources/qml/voip/ActiveCallBar.qml b/qml/voip/ActiveCallBar.qml
similarity index 100%
rename from resources/qml/voip/ActiveCallBar.qml
rename to qml/voip/ActiveCallBar.qml
diff --git a/resources/qml/voip/CallDevices.qml b/qml/voip/CallDevices.qml
similarity index 100%
rename from resources/qml/voip/CallDevices.qml
rename to qml/voip/CallDevices.qml
diff --git a/resources/qml/voip/CallInvite.qml b/qml/voip/CallInvite.qml
similarity index 100%
rename from resources/qml/voip/CallInvite.qml
rename to qml/voip/CallInvite.qml
diff --git a/resources/qml/voip/CallInviteBar.qml b/qml/voip/CallInviteBar.qml
similarity index 100%
rename from resources/qml/voip/CallInviteBar.qml
rename to qml/voip/CallInviteBar.qml
diff --git a/resources/qml/voip/DeviceError.qml b/qml/voip/DeviceError.qml
similarity index 100%
rename from resources/qml/voip/DeviceError.qml
rename to qml/voip/DeviceError.qml
diff --git a/resources/qml/voip/PlaceCall.qml b/qml/voip/PlaceCall.qml
similarity index 100%
rename from resources/qml/voip/PlaceCall.qml
rename to qml/voip/PlaceCall.qml
diff --git a/resources/qml/voip/ScreenShare.qml b/qml/voip/ScreenShare.qml
similarity index 100%
rename from resources/qml/voip/ScreenShare.qml
rename to qml/voip/ScreenShare.qml
diff --git a/resources/qml/voip/VideoCall.qml b/qml/voip/VideoCall.qml
similarity index 100%
rename from resources/qml/voip/VideoCall.qml
rename to qml/voip/VideoCall.qml
diff --git a/resources/qml/ui/qmldir b/resources/qml/ui/qmldir
deleted file mode 100644
index a2ce7514..00000000
--- a/resources/qml/ui/qmldir
+++ /dev/null
@@ -1,4 +0,0 @@
-module im.nheko.UI
-NhekoSlider 1.0 NhekoSlider.qml
-Ripple 1.0 Ripple.qml
-Spinner 1.0 Spinner.qml
\ No newline at end of file
diff --git a/resources/res.qrc b/resources/res.qrc
index 092b2de9..f65aca55 100644
--- a/resources/res.qrc
+++ b/resources/res.qrc
@@ -86,96 +86,6 @@
qtquickcontrols2.conf
- qml/Root.qml
- qml/ChatPage.qml
- qml/CommunitiesList.qml
- qml/RoomList.qml
- qml/TimelineView.qml
- qml/Avatar.qml
- qml/Completer.qml
- qml/EncryptionIndicator.qml
- qml/ImageButton.qml
- qml/ElidedLabel.qml
- qml/MatrixText.qml
- qml/MatrixTextField.qml
- qml/ToggleButton.qml
- qml/UploadBox.qml
- qml/MessageInput.qml
- qml/MessageView.qml
- qml/NhekoBusyIndicator.qml
- qml/PrivacyScreen.qml
- qml/Reactions.qml
- qml/ReplyPopup.qml
- qml/StatusIndicator.qml
- qml/TimelineRow.qml
- qml/TopBar.qml
- qml/QuickSwitcher.qml
- qml/ForwardCompleter.qml
- qml/SelfVerificationCheck.qml
- qml/TypingIndicator.qml
- qml/NotificationWarning.qml
- qml/pages/UserSettingsPage.qml
- qml/pages/WelcomePage.qml
- qml/pages/LoginPage.qml
- qml/pages/RegisterPage.qml
- qml/components/AdaptiveLayout.qml
- qml/components/AdaptiveLayoutElement.qml
- qml/components/AvatarListTile.qml
- qml/components/FlatButton.qml
- qml/components/MainWindowDialog.qml
- qml/components/TextButton.qml
- qml/delegates/Encrypted.qml
- qml/delegates/FileMessage.qml
- qml/delegates/ImageMessage.qml
- qml/delegates/MessageDelegate.qml
- qml/delegates/NoticeMessage.qml
- qml/delegates/Pill.qml
- qml/delegates/Placeholder.qml
- qml/delegates/PlayableMediaMessage.qml
- qml/delegates/Redacted.qml
- qml/delegates/Reply.qml
- qml/delegates/TextMessage.qml
- qml/device-verification/DeviceVerification.qml
- qml/device-verification/DigitVerification.qml
- qml/device-verification/EmojiVerification.qml
- qml/device-verification/Failed.qml
- qml/device-verification/NewVerificationRequest.qml
- qml/device-verification/Success.qml
- qml/device-verification/Waiting.qml
- qml/dialogs/CreateDirect.qml
- qml/dialogs/CreateRoom.qml
- qml/dialogs/ImageOverlay.qml
- qml/dialogs/ImagePackEditorDialog.qml
- qml/dialogs/ImagePackSettingsDialog.qml
- qml/dialogs/PhoneNumberInputDialog.qml
- qml/dialogs/InputDialog.qml
- qml/dialogs/InviteDialog.qml
- qml/dialogs/JoinRoomDialog.qml
- qml/dialogs/LeaveRoomDialog.qml
- qml/dialogs/LogoutDialog.qml
- qml/dialogs/RawMessageDialog.qml
- qml/dialogs/ReadReceipts.qml
- qml/dialogs/RoomDirectory.qml
- qml/dialogs/RoomMembers.qml
- qml/dialogs/RoomSettings.qml
- qml/dialogs/UserProfile.qml
- qml/dialogs/HiddenEventsDialog.qml
- qml/emoji/EmojiPicker.qml
- qml/emoji/StickerPicker.qml
- qml/ui/NhekoSlider.qml
- qml/ui/Ripple.qml
- qml/ui/Spinner.qml
- qml/ui/Snackbar.qml
- qml/ui/animations/BlinkAnimation.qml
- qml/ui/media/MediaControls.qml
- qml/voip/ActiveCallBar.qml
- qml/voip/CallDevices.qml
- qml/voip/CallInvite.qml
- qml/voip/CallInviteBar.qml
- qml/voip/DeviceError.qml
- qml/voip/PlaceCall.qml
- qml/voip/ScreenShare.qml
- qml/voip/VideoCall.qml
media/ring.ogg
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index ffc3c6c1..f22bf908 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -42,13 +42,11 @@
#include "emoji/Provider.h"
#include "encryption/DeviceVerificationFlow.h"
#include "encryption/SelfVerificationStatus.h"
-#include "timeline/DelegateChooser.h"
#include "timeline/TimelineViewManager.h"
#include "ui/HiddenEvents.h"
#include "ui/MxcAnimatedImage.h"
#include "ui/MxcMediaProxy.h"
#include "ui/NhekoCursorShape.h"
-#include "ui/NhekoDropArea.h"
#include "ui/NhekoEventObserver.h"
#include "ui/NhekoGlobalObject.h"
#include "ui/UIA.h"
@@ -81,7 +79,7 @@ MainWindow::MainWindow(QWindow *parent)
registerQmlTypes();
setColor(Theme::paletteFromTheme(userSettings_->theme()).window().color());
- setSource(QUrl(QStringLiteral("qrc:///qml/Root.qml")));
+ setSource(QUrl(QStringLiteral("qrc:///im/nheko2/qml/Root.qml")));
trayIcon_ = new TrayIcon(QStringLiteral(":/logos/nheko.svg"), this);
@@ -163,9 +161,6 @@ MainWindow::registerQmlTypes()
"VerificationStatus",
QStringLiteral("Can't instantiate enum!"));
- qmlRegisterType("im.nheko", 1, 0, "DelegateChoice");
- qmlRegisterType("im.nheko", 1, 0, "DelegateChooser");
- qmlRegisterType("im.nheko", 1, 0, "NhekoDropArea");
qmlRegisterType("im.nheko", 1, 0, "CursorShape");
qmlRegisterType("im.nheko", 1, 0, "EventObserver");
qmlRegisterType("im.nheko", 1, 0, "MxcAnimatedImage");
diff --git a/src/timeline/DelegateChooser.h b/src/timeline/DelegateChooser.h
index 19766302..5c8220c3 100644
--- a/src/timeline/DelegateChooser.h
+++ b/src/timeline/DelegateChooser.h
@@ -9,6 +9,7 @@
#pragma once
#include
+#include
#include
#include
#include
@@ -20,6 +21,7 @@ class QQmlAdaptorModel;
class DelegateChoice : public QObject
{
Q_OBJECT
+ QML_ELEMENT
Q_CLASSINFO("DefaultProperty", "delegate")
public:
@@ -46,6 +48,7 @@ private:
class DelegateChooser : public QQuickItem
{
Q_OBJECT
+ QML_ELEMENT
Q_CLASSINFO("DefaultProperty", "choices")
public:
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index c6576507..9499c7a0 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -25,6 +25,15 @@
#include "emoji/EmojiModel.h"
#include "emoji/Provider.h"
+Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationAccept)
+Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationCancel)
+Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationDone)
+Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationKey)
+Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationMac)
+Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationReady)
+Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationRequest)
+Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationStart)
+
namespace msgs = mtx::events::msg;
namespace {
diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h
index 08943e8c..3a916853 100644
--- a/src/timeline/TimelineViewManager.h
+++ b/src/timeline/TimelineViewManager.h
@@ -126,11 +126,3 @@ private:
QHash, QColor> userColors;
};
-Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationAccept)
-Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationCancel)
-Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationDone)
-Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationKey)
-Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationMac)
-Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationReady)
-Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationRequest)
-Q_DECLARE_METATYPE(mtx::events::msg::KeyVerificationStart)
diff --git a/src/ui/NhekoDropArea.h b/src/ui/NhekoDropArea.h
index 70da4451..058c6865 100644
--- a/src/ui/NhekoDropArea.h
+++ b/src/ui/NhekoDropArea.h
@@ -8,6 +8,7 @@
class NhekoDropArea : public QQuickItem
{
Q_OBJECT
+ QML_ELEMENT
Q_PROPERTY(QString roomid READ roomid WRITE setRoomid NOTIFY roomidChanged)
public:
NhekoDropArea(QQuickItem *parent = nullptr);