Skip to content

Commit

Permalink
Initialiazes Wizard (#1108)
Browse files Browse the repository at this point in the history
Co-authored-by: tompro <tomas.prochazka@apertia.cz>
  • Loading branch information
SuchAFuriousDeath and SuchAFuriousDeath authored Nov 17, 2024
1 parent 68affad commit a4c79a9
Show file tree
Hide file tree
Showing 10 changed files with 373 additions and 106 deletions.
76 changes: 76 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ required-features = ["slint"]
slint = [
"dep:slint",
"dep:clap",
"dep:rfd",
]
qt = []

Expand All @@ -34,6 +35,7 @@ ciborium = "0.2.2"
serde = { version = "1.0.209", features = ["derive"] }
thiserror = "1.0"
uuid = { version = "1.10.0", features = ["serde", "v4"] }
rfd = { version = "0.14.0", optional = true}

[target.'cfg(target_arch = "aarch64")'.dependencies]
aarch64 = { path = "../arch/aarch64" }
Expand Down
3 changes: 3 additions & 0 deletions gui/slint/globals.slint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export global GlobalCallbacks {
pure callback select_file(string, string, string) -> string;
}
4 changes: 4 additions & 0 deletions gui/slint/main.slint
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Tabs } from "main/tabs.slint";
import { Actions } from "main/actions.slint";
import { Wizard, FileValidationResult } from "wizard.slint";
import { GlobalCallbacks } from "globals.slint";

export { Wizard, FileValidationResult, GlobalCallbacks }

export component MainWindow inherits Window {
icon: @image-url("../resources/obliteration-icon.png");
Expand Down
40 changes: 23 additions & 17 deletions gui/slint/main/tabs/cpu.slint
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
import { Button, Slider, LineEdit } from "std-widgets.slint";
import { Button, Slider, LineEdit, HorizontalBox, VerticalBox } from "std-widgets.slint";

export component CpuTab {
HorizontalLayout {
VerticalLayout {
padding: 10px;
vertical-stretch: 0;
HorizontalBox {
VerticalBox {
alignment: start;

property <float> cpus: 8;

Text {
text: "Count";
}
Slider {
value: 8;
minimum: 1;
maximum: 16;
HorizontalBox {
Slider {
value <=> cpus;
minimum: 1;
maximum: 16;
changed => {
cpus = Math.round(cpus);
}
}
Text {
vertical-alignment: center;
text: cpus;
}
}
Text {
text: "Changing this value to other than 8 may crash the game.";
}
}
VerticalLayout {
padding: 10px;
vertical-stretch: 0;
}
VerticalBox {
alignment: start;

Text {
text: "Debug";
}
HorizontalLayout {
spacing: 5px;
HorizontalBox {
Text {
text: "Listen address";
vertical-alignment: center;
Expand All @@ -44,6 +50,6 @@ export component CpuTab {
Text {
text: "Specify a TCP address to listen for a debugger. The kernel will wait for a debugger to connect before start.";
}
}
}
}
}
}
34 changes: 13 additions & 21 deletions gui/slint/main/tabs/display.slint
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { ComboBox } from "std-widgets.slint";
import { ComboBox, HorizontalBox, VerticalBox } from "std-widgets.slint";

export component DisplayTab {
in property <[string]> devices: [];

HorizontalLayout {
padding: 10px;
spacing: 10px;
VerticalLayout {
vertical-stretch: 0;
spacing: 10px;
HorizontalBox {
VerticalBox {
alignment: start;

Text {
Expand All @@ -18,20 +14,16 @@ export component DisplayTab {
model: devices;
}
}
VerticalLayout {
VerticalLayout {
vertical-stretch: 0;
spacing: 10px;
alignment: start;
VerticalBox {
alignment: start;

Text {
text: "Resolution";
}
ComboBox {
model: ["1280 × 720", "1920 × 1080", "3840 × 2160"];
current-value: "1920 × 1080";
}
}
Text {
text: "Resolution";
}
ComboBox {
model: ["1280 × 720", "1920 × 1080", "3840 × 2160"];
current-value: "1920 × 1080";
}
}
}
}
}
Loading

0 comments on commit a4c79a9

Please sign in to comment.