slint/docs/tutorial/rust/src/main_memory_tile.rs
2023-02-09 16:59:25 +01:00

26 lines
535 B
Rust

// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
#[allow(dead_code)]
fn main() {
MainWindow::new().run();
}
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
}