From c63875b56c4d446fb7b2637f0bb116369d4fdbe7 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 9 Feb 2022 16:25:38 +0100 Subject: [PATCH] Update to Slint 0.2 --- .vscode/extensions.json | 2 +- CMakeLists.txt | 22 +++++++++++----------- README.md | 22 +++++++++++----------- ui/{appwindow.60 => appwindow.slint} | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) rename ui/{appwindow.60 => appwindow.slint} (85%) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 5866422..f666bb7 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,6 +3,6 @@ "vadimcn.vscode-lldb", "ms-vscode.cmake-tools", "llvm-vs-code-extensions.vscode-clangd", - "SixtyFPS.sixtyfps-vscode" + "Slint.slint" ] } diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fd8e7e..80be6f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,19 +1,19 @@ cmake_minimum_required(VERSION 3.19) project(my_application LANGUAGES CXX) -find_package(SixtyFPS QUIET) -if (NOT SixtyFPS_FOUND) - message("SixtyFPS could not be located in the CMake module search path. Downloading it from Git and building it locally") +find_package(Slint QUIET) +if (NOT Slint_FOUND) + message("Slint could not be located in the CMake module search path. Downloading it from Git and building it locally") include(FetchContent) FetchContent_Declare( - SixtyFPS - GIT_REPOSITORY https://github.com/sixtyfpsui/sixtyfps.git - GIT_TAG v0.1.6 - SOURCE_SUBDIR api/sixtyfps-cpp + Slint + GIT_REPOSITORY https://github.com/slint-ui/slint.git + GIT_TAG v0.2.0 + SOURCE_SUBDIR api/cpp ) - FetchContent_MakeAvailable(SixtyFPS) -endif (NOT SixtyFPS_FOUND) + FetchContent_MakeAvailable(Slint) +endif (NOT Slint_FOUND) add_executable(my_application src/main.cpp) -target_link_libraries(my_application PRIVATE SixtyFPS::SixtyFPS) -sixtyfps_target_60_sources(my_application ui/appwindow.60) +target_link_libraries(my_application PRIVATE Slint::Slint) +slint_target_sources(my_application ui/appwindow.slint) diff --git a/README.md b/README.md index 798d13c..75233e5 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# SixtyFPS C++ Template +# Slint C++ Template -A template for a C++ application that's using SixtyFPS for the user interface and CMake for the build system. +A template for a C++ application that's using Slint for the user interface and CMake for the build system. ## About -This template helps you get started developing a C++ application with SixtyFPS as toolkit -for the user interface. It demonstrates the integration between the `.60` UI markup and +This template helps you get started developing a C++ application with Slint as toolkit +for the user interface. It demonstrates the integration between the `.slint` UI markup and C++ code, how to trigger react to callbacks, get and set properties and use basic widgets. ## Prerequisites @@ -15,17 +15,17 @@ In order to use this template and build a C++ application, you need to install a * **[cmake](https://cmake.org/download/)** (3.19 or newer) * A C++ compiler that supports C++ version 17 or newer -If your target environment is Linux or Windows on an x86-64 architecture, then you may also opt into downloading one of our binary SixtyFPS packages. These are pre-compiled and require no further tools. You can find setup instructions and download links at +If your target environment is Linux or Windows on an x86-64 architecture, then you may also opt into downloading one of our binary Slint packages. These are pre-compiled and require no further tools. You can find setup instructions and download links at - + -Alternatively, this template will automatically download the SixtyFPS sources and compile them. This option requires you to install Rust by following the [Rust Getting Started Guide](https://www.rust-lang.org/learn/get-started). Once this is done, you should have the ```rustc``` compiler and the ```cargo``` build system installed in your path. +Alternatively, this template will automatically download the Slint sources and compile them. This option requires you to install Rust by following the [Rust Getting Started Guide](https://www.rust-lang.org/learn/get-started). Once this is done, you should have the ```rustc``` compiler and the ```cargo``` build system installed in your path. ## Usage 1. Clone or download this repository ``` - git clone https://github.com/sixtyfpsui/sixtyfps-cpp-template my-project + git clone https://github.com/slint-ui/slint-cpp-template my-project cd my-project ``` 2. Configure with CMake @@ -47,9 +47,9 @@ Alternatively, this template will automatically download the SixtyFPS sources an build\my_application.exe ``` -We recommend using an IDE for development, along with our [LSP-based IDE integration for `.60` files](https://github.com/sixtyfpsui/sixtyfps/blob/master/tools/lsp/README.md). You can also load this project directly in [Visual Studio Code](https://code.visualstudio.com) and install our [SixtyFPS extension](https://marketplace.visualstudio.com/items?itemName=SixtyFPS.sixtyfps-vscode). +We recommend using an IDE for development, along with our [LSP-based IDE integration for `.slint` files](https://github.com/slint-ui/slint/blob/master/tools/lsp/README.md). You can also load this project directly in [Visual Studio Code](https://code.visualstudio.com) and install our [Slint extension](https://marketplace.visualstudio.com/items?itemName=Slint.slint). ## Next Steps -We hope that this template helps you get started and you enjoy exploring making user interfaces with SixtyFPS. To learn more -about the SixtyFPS APIs and the `.60` markup language check out our [online documentation](https://sixtyfps.io/docs/cpp/). \ No newline at end of file +We hope that this template helps you get started and you enjoy exploring making user interfaces with Slint. To learn more +about the Slint APIs and the `.slint` markup language check out our [online documentation](https://slint-ui.com/docs/cpp/). \ No newline at end of file diff --git a/ui/appwindow.60 b/ui/appwindow.slint similarity index 85% rename from ui/appwindow.60 rename to ui/appwindow.slint index c993b04..5345759 100644 --- a/ui/appwindow.60 +++ b/ui/appwindow.slint @@ -1,4 +1,4 @@ -import { Button, VerticalBox } from "sixtyfps_widgets.60"; +import { Button, VerticalBox } from "std-widgets.slint"; export AppWindow := Window { property counter: 42;