mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-07-05 11:20:00 +08:00

Summary: - Added a basic Slint example for NuttX, demonstrating how to integrate Slint UI framework with Rust on NuttX - Includes a simple UI with a counter and touchscreen input handling - Provides CMake, Kconfig, and Makefile configurations for building the example Impact: - Introduces a new example showcasing Slint UI framework usage on NuttX - Enables developers to explore Rust-based UI development on embedded systems - Demonstrates integration with NuttX framebuffer and touchscreen drivers Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
26 lines
551 B
Plaintext
26 lines
551 B
Plaintext
import { Button, VerticalBox, HorizontalBox , AboutSlint } from "std-widgets.slint";
|
|
|
|
export component AppWindow inherits Window {
|
|
property <int> counter: 0;
|
|
|
|
timer := Timer {
|
|
interval: 1s;
|
|
running: true;
|
|
triggered() => {
|
|
counter += 1;
|
|
}
|
|
}
|
|
|
|
VerticalBox {
|
|
Text {
|
|
horizontal-alignment: center;
|
|
vertical-alignment: center;
|
|
text: "Times since start on NuttX: \n\{root.counter}";
|
|
font-size: 24px;
|
|
}
|
|
|
|
AboutSlint { }
|
|
|
|
}
|
|
}
|