From 5f27ce235b3992a6a7799b179ca628069147b877 Mon Sep 17 00:00:00 2001 From: "Antoine C." Date: Sun, 18 May 2025 22:16:09 +0000 Subject: [PATCH 1/2] feat(QML): add controller settings --- CMakeLists.txt | 56 ++ packaging/debian/control.in | 1 + res/controllers/Dummy Device Screen.hid.xml | 8 + res/controllers/DummyDeviceDefaultScreen.qml | 403 +++++----- res/qml/ActionPopup.qml | 83 +- res/qml/Button.qml | 4 +- res/qml/ComboBox.qml | 221 ++++-- res/qml/EmbeddedBackground.qml | 4 +- res/qml/Settings.qml | 3 + res/qml/Settings/Controller.qml | 253 +++++- res/qml/Settings/ControllerCard.qml | 742 ++++++++++++++++++ res/qml/Settings/ControllerMappingLink.qml | 32 + res/qml/Settings/ControllerScreens.qml | 85 ++ res/qml/Settings/ControllerSettings.qml | 431 ++++++++++ res/qml/Settings/InfoBubble.qml | 29 + .../images/controllers/ni_traktor_s4_mk3.png | Bin 0 -> 105889 bytes tools/debian_buildenv.sh | 1 + 17 files changed, 2049 insertions(+), 307 deletions(-) mode change 100755 => 100644 res/controllers/DummyDeviceDefaultScreen.qml create mode 100644 res/qml/Settings/ControllerCard.qml create mode 100644 res/qml/Settings/ControllerMappingLink.qml create mode 100644 res/qml/Settings/ControllerScreens.qml create mode 100644 res/qml/Settings/ControllerSettings.qml create mode 100644 res/qml/Settings/InfoBubble.qml create mode 100644 res/qml/images/controllers/ni_traktor_s4_mk3.png diff --git a/CMakeLists.txt b/CMakeLists.txt index 46547ce6106f..05e2a7e064ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3758,6 +3758,7 @@ if(QML) list(APPEND QT_EXTRA_COMPONENTS "Quick") list(APPEND QT_EXTRA_COMPONENTS "QuickControls2") list(APPEND QT_EXTRA_COMPONENTS "QuickControls2Impl") + list(APPEND QT_EXTRA_COMPONENTS "QuickDialogs2") list(APPEND QT_EXTRA_COMPONENTS "QuickLayouts") list(APPEND QT_EXTRA_COMPONENTS "QuickShapesPrivate") list(APPEND QT_EXTRA_COMPONENTS "QuickTemplates2") @@ -4219,6 +4220,40 @@ else() applocal ) + # FIXME: Install using IMPORTED_RUNTIME_ARTIFACTS seems to create plugins in the wrong place, leading to packaging issue and runtime problems. + install( + DIRECTORY "${Qt6_DIR}/../../Qt${QT_VERSION_MAJOR}/plugins/multimedia" + DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt${QT_VERSION_MAJOR}/plugins" + COMPONENT applocal + ) + + install( + IMPORTED_RUNTIME_ARTIFACTS + Qt${QT_VERSION_MAJOR}::QuickDialogs2 + DESTINATION + "${MIXXX_INSTALL_DATADIR}" + COMPONENT + applocal + ) + + install( + IMPORTED_RUNTIME_ARTIFACTS + Qt${QT_VERSION_MAJOR}::QuickDialogs2QuickImpl + DESTINATION + "${MIXXX_INSTALL_DATADIR}" + COMPONENT + applocal + ) + + install( + IMPORTED_RUNTIME_ARTIFACTS + Qt${QT_VERSION_MAJOR}::QuickDialogs2Utils + DESTINATION + "${MIXXX_INSTALL_DATADIR}" + COMPONENT + applocal + ) + #install qml6-module-qt5compat-graphicaleffects install( DIRECTORY @@ -4234,6 +4269,13 @@ else() DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml" COMPONENT applocal ) + # Qt6MultimediaQuick doesn't seem to be included in any defined target but it is required. + install( + FILES + "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin/Qt6MultimediaQuick$<$:d>${CMAKE_SHARED_LIBRARY_SUFFIX}" + DESTINATION "${MIXXX_INSTALL_DATADIR}" + COMPONENT applocal + ) # install qml6-module-qtqml-workerscript install( @@ -4251,6 +4293,14 @@ else() COMPONENT applocal ) + # install qml6-module-qtquick-dialogs + install( + DIRECTORY + "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/Qt6/qml/QtQuick/Dialogs" + DESTINATION "${MIXXX_INSTALL_DATADIR}/Qt6/qml/QtQuick" + COMPONENT applocal + ) + # install qml6-module-qtquick-layouts install( DIRECTORY @@ -5144,6 +5194,9 @@ if(HID) ) endif() target_compile_definitions(mixxx-lib PUBLIC __HID__) + if(QML) + target_compile_definitions(mixxx-qml-lib PUBLIC __HID__) + endif() endif() # USB Bulk controller support @@ -5171,6 +5224,9 @@ if(BULK) endif() target_compile_definitions(mixxx-lib PUBLIC __BULK__) target_link_libraries(mixxx-lib PRIVATE LibUSB::LibUSB) + if(QML) + target_compile_definitions(mixxx-qml-lib PUBLIC __BULK__) + endif() endif() # Vinyl Control diff --git a/packaging/debian/control.in b/packaging/debian/control.in index 098779ea25e5..f5faa0254c42 100644 --- a/packaging/debian/control.in +++ b/packaging/debian/control.in @@ -16,6 +16,7 @@ Build-Depends: debhelper (>= 11), qml6-module-qtmultimedia, qml6-module-qtqml-workerscript, qml6-module-qtquick-controls, + qml6-module-qtquick-dialogs, qml6-module-qtquick-layouts, qml6-module-qtquick-shapes, qml6-module-qtquick-templates, diff --git a/res/controllers/Dummy Device Screen.hid.xml b/res/controllers/Dummy Device Screen.hid.xml index 1d6526459a82..4a0b7fd23a5c 100644 --- a/res/controllers/Dummy Device Screen.hid.xml +++ b/res/controllers/Dummy Device Screen.hid.xml @@ -62,6 +62,14 @@ white +