diff --git a/CMakeLists.txt b/CMakeLists.txt index cc44817e6..ba9b9e8e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,19 @@ if(NEOCHAT_FLATPAK) include(cmake/Flatpak.cmake) endif() +if(QT_MAJOR_VERSION STREQUAL "6") + set(BASICLISTITEM_BOLD "font.bold") + set(OVERLAYSHEET_OPEN "onOpened") + set(QTQUICK_MODULE_QML_VERSION "") + set(QTLOCATION_MODULE_QML_VERSION "") +else() + set(BASICLISTITEM_BOLD "bold") + set(OVERLAYSHEET_OPEN "onSheetOpenChanged") + set(QTQUICK_MODULE_QML_VERSION "2.15") + set(QTLOCATION_MODULE_QML_VERSION "5.15") +endif() + + ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX NEOCHAT VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/neochat-version.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 686a0782b..cb019bf32 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,6 +3,14 @@ # SPDX-FileCopyrightText: 2020-2021 Tobias Fella # SPDX-License-Identifier: BSD-2-Clause +configure_file(qml/Page/RoomList/RoomDelegate.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Page/RoomList/RoomDelegate.qml) +configure_file(qml/Component/QuickSwitcher.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Component/QuickSwitcher.qml) +configure_file(qml/Dialog/UserDetailDialog.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Dialog/UserDetailDialog.qml) +configure_file(qml/Dialog/PowerLevelDialog.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Dialog/PowerLevelDialog.qml) +configure_file(qml/Component/Timeline/OsmLocationPlugin.qml ${CMAKE_CURRENT_BINARY_DIR}/qml/Component/Timeline/OsmLocationPlugin.qml) + +configure_file(res.qrc ${CMAKE_CURRENT_SOURCE_DIR}/res.generated.qrc) + add_library(neochat STATIC controller.cpp controller.h @@ -129,7 +137,7 @@ ecm_qt_declare_logging_category(neochat add_executable(neochat-app main.cpp - res.qrc + ${CMAKE_CURRENT_SOURCE_DIR}/res.generated.qrc ) target_include_directories(neochat-app PRIVATE ${CMAKE_BINARY_DIR}) diff --git a/src/qml/Component/QuickSwitcher.qml b/src/qml/Component/QuickSwitcher.qml index 81e44c6de..95367e535 100644 --- a/src/qml/Component/QuickSwitcher.qml +++ b/src/qml/Component/QuickSwitcher.qml @@ -113,7 +113,7 @@ QQC2.Dialog { RoomManager.enterRoom(roomListItem.currentRoom); root.close(); } - bold: roomListItem.notificationCount > 0 + @BASICLISTITEM_BOLD@: roomListItem.notificationCount > 0 label: roomListItem.displayName ?? "" labelItem.textFormat: Text.PlainText subtitle: roomListItem.subtitleText diff --git a/src/qml/Component/Timeline/OsmLocationPlugin.qml b/src/qml/Component/Timeline/OsmLocationPlugin.qml index 0b37a8fcf..f936398a7 100644 --- a/src/qml/Component/Timeline/OsmLocationPlugin.qml +++ b/src/qml/Component/Timeline/OsmLocationPlugin.qml @@ -3,8 +3,8 @@ pragma Singleton -import QtQuick 2.15 -import QtLocation 5.15 +import QtQuick @QTQUICK_MODULE_QML_VERSION@ +import QtLocation @QTLOCATION_MODULE_QML_VERSION@ QtObject { property var plugin: Plugin { diff --git a/src/qml/Dialog/PowerLevelDialog.qml b/src/qml/Dialog/PowerLevelDialog.qml index 9d84789c5..64ff35dc8 100644 --- a/src/qml/Dialog/PowerLevelDialog.qml +++ b/src/qml/Dialog/PowerLevelDialog.qml @@ -17,7 +17,7 @@ Kirigami.OverlaySheet { property var userId property int powerLevel - onSheetOpenChanged: { + @OVERLAYSHEET_OPEN@: { if (sheetOpen) { powerLevelComboBox.currentIndex = powerLevelComboBox.indexOfValue(root.powerLevel) } diff --git a/src/qml/Dialog/UserDetailDialog.qml b/src/qml/Dialog/UserDetailDialog.qml index 5bc838762..bc916de3d 100644 --- a/src/qml/Dialog/UserDetailDialog.qml +++ b/src/qml/Dialog/UserDetailDialog.qml @@ -195,8 +195,7 @@ Kirigami.OverlaySheet { } } } - - onSheetOpenChanged: { + @OVERLAYSHEET_OPEN@: { if (!sheetOpen) { closed() } diff --git a/src/qml/Page/RoomList/RoomDelegate.qml b/src/qml/Page/RoomList/RoomDelegate.qml index 1702c2a8a..06a789733 100644 --- a/src/qml/Page/RoomList/RoomDelegate.qml +++ b/src/qml/Page/RoomList/RoomDelegate.qml @@ -36,7 +36,7 @@ Kirigami.BasicListItem { highlighted: ListView.view.currentIndex === index focus: true icon: undefined - bold: root.hasNotifications + @BASICLISTITEM_BOLD@: root.hasNotifications label: root.displayName labelItem.textFormat: Text.PlainText diff --git a/src/res.qrc b/src/res.qrc index eb64713d0..f9bcbf7b8 100644 --- a/src/res.qrc +++ b/src/res.qrc @@ -9,7 +9,7 @@ qml/Page/RoomList/ExploreComponent.qml qml/Page/RoomList/ContextMenu.qml qml/Page/RoomList/CollapsedRoomDelegate.qml - qml/Page/RoomList/RoomDelegate.qml + @CMAKE_CURRENT_BINARY_DIR@/qml/Page/RoomList/RoomDelegate.qml qml/Page/RoomList/Page.qml qml/Page/RoomList/SpaceListContextMenu.qml qml/Page/RoomList/UserInfo.qml @@ -31,7 +31,7 @@ qml/Component/FancyEffectsContainer.qml qml/Component/TypingPane.qml qml/Component/ShimmerGradient.qml - qml/Component/QuickSwitcher.qml + @CMAKE_CURRENT_BINARY_DIR@/qml/Component/QuickSwitcher.qml qml/Component/HoverActions.qml qml/Component/ChatBox/ChatBox.qml qml/Component/ChatBox/ChatBar.qml @@ -74,14 +74,14 @@ qml/Panel/RoomDrawer.qml qml/Panel/DirectChatDrawerHeader.qml qml/Panel/GroupChatDrawerHeader.qml - qml/Dialog/UserDetailDialog.qml + @CMAKE_CURRENT_BINARY_DIR@/qml/Dialog/UserDetailDialog.qml qml/Dialog/CreateRoomDialog.qml qml/Dialog/CreateSpaceDialog.qml qml/Dialog/EmojiDialog.qml qml/Dialog/OpenFileDialog.qml qml/Dialog/KeyVerification/KeyVerificationDialog.qml qml/Dialog/ConfirmLogout.qml - qml/Dialog/PowerLevelDialog.qml + @CMAKE_CURRENT_BINARY_DIR@/qml/Dialog/PowerLevelDialog.qml qml/Dialog/KeyVerification/Message.qml qml/Dialog/KeyVerification/EmojiItem.qml qml/Dialog/KeyVerification/EmojiRow.qml @@ -126,7 +126,7 @@ qml/Component/InvitationView.qml qml/Component/AvatarTabButton.qml qml/Page/RoomList/SpaceDrawer.qml - qml/Component/Timeline/OsmLocationPlugin.qml + @CMAKE_CURRENT_BINARY_DIR@/qml/Component/Timeline/OsmLocationPlugin.qml qml/Component/Timeline/LiveLocationDelegate.qml qml/Component/FullScreenMap.qml qml/Component/LocationPage.qml