Add Qt/QML desktop shell and Nebula.UI
Introduce a new production desktop shell at `shells/desktop/shell` built with C++20, Qt Quick/QML, and LayerShellQt, including top bar, launcher, desktop surfaces, shell state, and mock app data. Add the shared `packages/nebula-ui` QML module (theme, controls, focus, icons) and wire it into the shell build. Retire the old GTK/WebKit native host by removing `shells/desktop/native`, move the React shell UI to `shells/desktop/prototype-react` as an archived design reference, and update root/compositor/session documentation to reflect the new Linux-only production architecture and temporary Sway role.
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
message(FATAL_ERROR
|
||||
"nebula-shell is a Linux Wayland shell using LayerShellQt.\n"
|
||||
"Build and run it on the Ubuntu NebulaOS VM. Windows is not a supported target, "
|
||||
"and LayerShellQt is not stubbed with other platform APIs.")
|
||||
endif()
|
||||
|
||||
project(nebula-shell LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
find_package(Qt6 6.4 REQUIRED COMPONENTS Core Gui Qml Quick)
|
||||
find_package(LayerShellQt REQUIRED)
|
||||
|
||||
qt_standard_project_setup(REQUIRES 6.4)
|
||||
|
||||
set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml")
|
||||
|
||||
add_subdirectory(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../../../packages/nebula-ui"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/nebula-ui"
|
||||
)
|
||||
|
||||
qt_add_executable(nebula-shell
|
||||
src/main.cpp
|
||||
)
|
||||
|
||||
set(NEBULA_SHELL_QML_FILES
|
||||
qml/Main.qml
|
||||
qml/ShellState.qml
|
||||
qml/surfaces/DesktopSurface.qml
|
||||
qml/surfaces/TopBarSurface.qml
|
||||
qml/surfaces/LauncherSurface.qml
|
||||
qml/components/TopBar.qml
|
||||
qml/components/NebulaButton.qml
|
||||
qml/components/Clock.qml
|
||||
qml/components/SystemArea.qml
|
||||
qml/components/Launcher.qml
|
||||
qml/components/AppItem.qml
|
||||
qml/mock/MockApps.qml
|
||||
)
|
||||
|
||||
foreach(qml_file IN LISTS NEBULA_SHELL_QML_FILES)
|
||||
get_filename_component(qml_name "${qml_file}" NAME)
|
||||
set_source_files_properties("${qml_file}" PROPERTIES
|
||||
QT_RESOURCE_ALIAS "${qml_name}"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
set_source_files_properties(qml/ShellState.qml PROPERTIES
|
||||
QT_QML_SINGLETON_TYPE TRUE
|
||||
QT_RESOURCE_ALIAS ShellState.qml
|
||||
)
|
||||
set_source_files_properties(qml/mock/MockApps.qml PROPERTIES
|
||||
QT_QML_SINGLETON_TYPE TRUE
|
||||
QT_RESOURCE_ALIAS MockApps.qml
|
||||
)
|
||||
|
||||
qt_add_qml_module(nebula-shell
|
||||
URI Nebula.Shell
|
||||
VERSION 1.0
|
||||
RESOURCE_PREFIX /qt/qml
|
||||
QML_FILES ${NEBULA_SHELL_QML_FILES}
|
||||
DEPENDENCIES
|
||||
QtQuick
|
||||
Nebula.UI
|
||||
)
|
||||
|
||||
target_link_libraries(nebula-shell
|
||||
PRIVATE
|
||||
Qt6::Core
|
||||
Qt6::Gui
|
||||
Qt6::Qml
|
||||
Qt6::Quick
|
||||
LayerShellQt::Interface
|
||||
NebulaUI
|
||||
)
|
||||
|
||||
if(TARGET NebulaUIplugin)
|
||||
target_link_libraries(nebula-shell PRIVATE NebulaUIplugin)
|
||||
endif()
|
||||
|
||||
set_target_properties(nebula-shell PROPERTIES
|
||||
OUTPUT_NAME nebula-shell
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||
)
|
||||
|
||||
if(COMMAND qt_import_qml_plugins)
|
||||
qt_import_qml_plugins(nebula-shell)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
target_compile_options(nebula-shell PRIVATE -Wall -Wextra)
|
||||
endif()
|
||||
Reference in New Issue
Block a user