Preview task-group selections until Meta is released
This commit is contained in:
@@ -14,17 +14,31 @@ list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
||||
include(GNUInstallDirs)
|
||||
include(CTest)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS DBus Gui WaylandClient)
|
||||
find_package(Qt6 REQUIRED COMPONENTS DBus Gui Quick WaylandClient)
|
||||
find_package(KF6 REQUIRED COMPONENTS Config GlobalAccel Service)
|
||||
find_package(LibTaskManager REQUIRED)
|
||||
find_package(Plasma REQUIRED)
|
||||
find_package(PlasmaWaylandProtocols REQUIRED)
|
||||
find_package(XKB REQUIRED)
|
||||
|
||||
# KWin caches both QML components and directory listings for its whole session.
|
||||
# Changed helper code needs a new directory, not just a new filename.
|
||||
file(SHA256 "${CMAKE_CURRENT_SOURCE_DIR}/TaskbarGeometry.qml" geometry_hash)
|
||||
set(geometry_dir "plasma-task-group-shortcuts/${geometry_hash}")
|
||||
configure_file(TaskbarGeometry.qml "qml/${geometry_hash}/TaskbarGeometry.qml" COPYONLY)
|
||||
|
||||
add_executable(plasma-task-group-shortcuts
|
||||
keyboardlayout.cpp
|
||||
main.cpp
|
||||
pendingselection.cpp
|
||||
previewplacement.cpp
|
||||
taskbargeometry.cpp
|
||||
taskselection.cpp
|
||||
windowpreview.cpp
|
||||
)
|
||||
target_compile_definitions(plasma-task-group-shortcuts PRIVATE
|
||||
GEOMETRY_SCRIPT_PATH="${CMAKE_INSTALL_FULL_DATADIR}/${geometry_dir}/TaskbarGeometry.qml")
|
||||
qt_add_resources(plasma-task-group-shortcuts preview PREFIX "/" FILES Preview.qml)
|
||||
qt6_generate_wayland_protocol_client_sources(plasma-task-group-shortcuts
|
||||
PRIVATE_CODE
|
||||
FILES ${PLASMA_WAYLAND_PROTOCOLS_DIR}/keystate.xml
|
||||
@@ -32,15 +46,18 @@ qt6_generate_wayland_protocol_client_sources(plasma-task-group-shortcuts
|
||||
target_link_libraries(plasma-task-group-shortcuts PRIVATE
|
||||
Qt6::Gui
|
||||
Qt6::DBus
|
||||
Qt6::Quick
|
||||
Qt6::WaylandClient
|
||||
KF6::ConfigCore
|
||||
KF6::GlobalAccel
|
||||
KF6::Service
|
||||
PW::LibTaskManager
|
||||
Plasma::Plasma
|
||||
XKB::XKB
|
||||
)
|
||||
|
||||
install(TARGETS plasma-task-group-shortcuts DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(FILES TaskbarGeometry.qml DESTINATION "${CMAKE_INSTALL_DATADIR}/${geometry_dir}")
|
||||
install(FILES se.ajpanton.plasma-task-group-shortcuts.desktop
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
||||
install(FILES se.ajpanton.plasma-task-group-shortcuts-autostart.desktop
|
||||
@@ -71,4 +88,14 @@ if(BUILD_TESTING)
|
||||
XKB::XKB
|
||||
)
|
||||
add_test(NAME keyboardlayout COMMAND test-keyboardlayout)
|
||||
|
||||
add_executable(test-pendingselection tests/test-pendingselection.cpp pendingselection.cpp)
|
||||
target_link_libraries(test-pendingselection PRIVATE Qt6::Test Qt6::Gui)
|
||||
add_test(NAME pendingselection COMMAND test-pendingselection)
|
||||
|
||||
add_executable(test-preview tests/test-preview.cpp taskbargeometry.cpp previewplacement.cpp)
|
||||
target_compile_definitions(test-preview PRIVATE GEOMETRY_SCRIPT_PATH="${CMAKE_CURRENT_BINARY_DIR}/qml/${geometry_hash}/TaskbarGeometry.qml")
|
||||
qt_add_resources(test-preview preview PREFIX "/" FILES Preview.qml)
|
||||
target_link_libraries(test-preview PRIVATE Qt6::Test Qt6::Quick Qt6::DBus Plasma::Plasma PW::LibTaskManager KF6::Service)
|
||||
add_test(NAME preview COMMAND test-preview -platform offscreen)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user