mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-23 04:55:39 +00:00
Consolidate language tutorials (#5037)
All the language tutorials are merged into the Slint reference as "quick starts".
This commit is contained in:
parent
5389367895
commit
ab9d7f342b
78 changed files with 632 additions and 1135 deletions
26
docs/reference/src/quickstart/main_memory_tile.rs
Normal file
26
docs/reference/src/quickstart/main_memory_tile.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn main() {
|
||||
MainWindow::new().unwrap().run().unwrap();
|
||||
}
|
||||
slint::slint! {
|
||||
// ANCHOR: tile
|
||||
component MemoryTile inherits Rectangle {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
background: #3960D5;
|
||||
|
||||
Image {
|
||||
source: @image-url("icons/bus.png");
|
||||
width: parent.width;
|
||||
height: parent.height;
|
||||
}
|
||||
}
|
||||
|
||||
export component MainWindow inherits Window {
|
||||
MemoryTile {}
|
||||
}
|
||||
// ANCHOR_END: tile
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue