程序写完

This commit is contained in:
2025-08-09 22:45:15 +08:00
parent 01b37916c1
commit 69469ee1f4
7 changed files with 61 additions and 15 deletions

View File

@@ -1,12 +1,22 @@
import { Button, VerticalBox } from "std-widgets.slint";
export global Globals {
//启动按钮状态
in-out property <bool> StartEnable: false;
//停止按钮状态
in-out property <bool> StopEnable: false;
}
export component MainWindow inherits Window {
title: "VoileTftpTools";
icon: @image-url("../tftp.png");
height: 180px;
width: 320px;
title: "VoileTftpTools";
default-font-family: "Segoe UI";
default-font-size: 16px;
default-font-weight: 700;
in-out property <bool> StartEnable <=> Globals.StartEnable;
in-out property <bool> StopEnable <=> Globals.StopEnable;
//选择路径回调
callback BrowserFolder() -> string;
property <string> SelectFolder: "";
@@ -39,6 +49,7 @@ export component MainWindow inherits Window {
height: parent.height;
width: parent.width;
text: "启动";
enabled: StartEnable;
clicked => {
StartTftp();
}
@@ -54,6 +65,7 @@ export component MainWindow inherits Window {
height: parent.height;
width: parent.width;
text: "停止";
enabled: StopEnable;
clicked => {
StopTftp();
}