Add Files
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
[target.x86_64-pc-windows-msvc]
|
||||
# Increase default stack size to avoid running out of stack
|
||||
# space in debug builds. The size matches Linux's default.
|
||||
rustflags = [
|
||||
"-C", "link-arg=/STACK:8000000"
|
||||
]
|
||||
[target.aarch64-pc-windows-msvc]
|
||||
# Increase default stack size to avoid running out of stack
|
||||
# space in debug builds. The size matches Linux's default.
|
||||
rustflags = [
|
||||
"-C", "link-arg=/STACK:8000000"
|
||||
]
|
||||
Generated
+6887
File diff suppressed because it is too large
Load Diff
+15
@@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "slint-rust-template"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
reqwest = "0.13.3"
|
||||
slint = "1.14.1"
|
||||
|
||||
[build-dependencies]
|
||||
slint-build = "1.14.1"
|
||||
|
||||
[profile.release]
|
||||
codegen-units = 1
|
||||
lto = true
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
slint_build::compile("ui/app-window.slint").expect("Slint build failed");
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
use std::error::Error;
|
||||
mod rutracker;
|
||||
|
||||
slint::include_modules!();
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
rutracker::main();
|
||||
let ui = AppWindow::new()?;
|
||||
|
||||
ui.on_request_increase_value({
|
||||
let ui_handle = ui.as_weak();
|
||||
move || {
|
||||
let ui = ui_handle.unwrap();
|
||||
ui.set_counter(ui.get_counter() + 1);
|
||||
}
|
||||
});
|
||||
|
||||
ui.run()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
pub fn main() {
|
||||
//let results = reqwest::get("")
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Button, LineEdit, VerticalBox } from "std-widgets.slint";
|
||||
|
||||
export component AppWindow inherits Window {
|
||||
in-out property <int> counter: 42;
|
||||
callback request-increase-value();
|
||||
VerticalBox {
|
||||
Text {
|
||||
text: "Counter: \{root.counter}";
|
||||
}
|
||||
|
||||
LineEdit {
|
||||
placeholder-text: "Search for Software"
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Increase value";
|
||||
clicked => {
|
||||
root.request-increase-value();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user