feat: initial version
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
import {
|
||||
SpinBox,
|
||||
Button,
|
||||
CheckBox,
|
||||
Slider,
|
||||
LineEdit,
|
||||
ScrollView,
|
||||
ListView,
|
||||
HorizontalBox,
|
||||
VerticalBox,
|
||||
GridBox,
|
||||
StandardButton,
|
||||
Palette,
|
||||
} from "std-widgets.slint";
|
||||
|
||||
@rust-attr(derive(serde::Serialize, serde::Deserialize))
|
||||
export struct BrowserConfig {
|
||||
path: string,
|
||||
flags: string,
|
||||
}
|
||||
|
||||
export component MainWindow inherits Window {
|
||||
in property <[BrowserConfig]> browser-model: [
|
||||
{ path: "chrome.exe", flags: "profile 1" },
|
||||
{ path: "chrome.exe", flags: "profile 2" },
|
||||
{ path: "zen.exe", flags: "" },
|
||||
{ path: "edge.exe", flags: "" },
|
||||
];
|
||||
|
||||
callback todo-added(string);
|
||||
callback remove-done();
|
||||
callback update_todo(BrowserConfig);
|
||||
|
||||
preferred-width: 400px;
|
||||
preferred-height: 600px;
|
||||
|
||||
VerticalBox {
|
||||
x: root.safe-area-insets.left;
|
||||
y: root.safe-area-insets.top;
|
||||
width: root.width - root.safe-area-insets.right - root.safe-area-insets.left;
|
||||
height: root.height - root.safe-area-insets.bottom - root.safe-area-insets.top;
|
||||
|
||||
list-view := ListView {
|
||||
for browser in root.browser-model: HorizontalLayout {
|
||||
HorizontalBox {
|
||||
padding: 8px;
|
||||
alignment: center;
|
||||
|
||||
Text {
|
||||
text: browser.path;
|
||||
}
|
||||
|
||||
Text {
|
||||
text: browser.flags;
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "use";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user