mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-24 13:21:43 +00:00
Extract all .60 code in the rust tutorial into separate files
That gives maximum test coverage
This commit is contained in:
parent
cf5d554338
commit
5864411eca
6 changed files with 203 additions and 104 deletions
32
docs/tutorial/src/main_memory_tile.rs
Normal file
32
docs/tutorial/src/main_memory_tile.rs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/* LICENSE BEGIN
|
||||
This file is part of the SixtyFPS Project -- https://sixtyfps.io
|
||||
Copyright (c) 2020 Olivier Goffart <olivier.goffart@sixtyfps.io>
|
||||
Copyright (c) 2020 Simon Hausmann <simon.hausmann@sixtyfps.io>
|
||||
|
||||
SPDX-License-Identifier: GPL-3.0-only
|
||||
This file is also available under commercial licensing terms.
|
||||
Please contact info@sixtyfps.io for more information.
|
||||
LICENSE END */
|
||||
#[allow(dead_code)]
|
||||
fn main() {
|
||||
MainWindow::new().run();
|
||||
}
|
||||
sixtyfps::sixtyfps! {
|
||||
// ANCHOR: tile
|
||||
MemoryTile := Rectangle {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
background: #3960D5;
|
||||
|
||||
Image {
|
||||
source: @image-url("icons/bus.png");
|
||||
width: parent.width;
|
||||
height: parent.height;
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow := Window {
|
||||
MemoryTile {}
|
||||
}
|
||||
// ANCHOR_END: tile
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue