diff --git a/CMakeLists.txt b/CMakeLists.txt index 47daa50..e3a122a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,38 +8,27 @@ find_package(Qt6 REQUIRED COMPONENTS Quick) qt_standard_project_setup(REQUIRES 6.10) -# Content of downloaded design from Figma to Qt or similar -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/importedcontent/CMakeLists.txt") - add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/importedcontent) -endif() - qt_add_executable(apparchpack - main.cpp + main.cpp +) + +set_source_files_properties(qml/style/Theme.qml + PROPERTIES QT_QML_SINGLETON_TYPE TRUE ) qt_add_qml_module(apparchpack URI archpack QML_FILES - Main.qml -) - -# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. -# If you are developing for iOS or macOS you should consider setting an -# explicit, fixed bundle identifier manually though. -set_target_properties(apparchpack PROPERTIES -# MACOSX_BUNDLE_GUI_IDENTIFIER com.example.apparchpack - MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} - MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} - MACOSX_BUNDLE TRUE - WIN32_EXECUTABLE TRUE + Main.qml + qml/style/Theme.qml ) target_link_libraries(apparchpack - PRIVATE Qt6::Quick + PRIVATE Qt6::Quick ) install(TARGETS apparchpack - BUNDLE DESTINATION . - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + BUNDLE DESTINATION . + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) diff --git a/Main.qml b/Main.qml index da3d954..3d001e7 100644 --- a/Main.qml +++ b/Main.qml @@ -1,6 +1,8 @@ import QtQuick import QtQuick.Controls.Basic +import archpack + ApplicationWindow { id: window @@ -12,5 +14,5 @@ ApplicationWindow { minimumWidth: 200 minimumHeight: 250 visible: true - color: "#303446" + color: Theme.base } diff --git a/qml/style/Theme.qml b/qml/style/Theme.qml new file mode 100644 index 0000000..0d3f06d --- /dev/null +++ b/qml/style/Theme.qml @@ -0,0 +1,7 @@ +pragma Singleton + +import QtQuick 2.15 + +QtObject { + readonly property color base: "#303446" +}