This commit is contained in:
aOK 2023-10-21 16:36:58 +03:00
parent e3e4b66ed3
commit dde97ec8be
43 changed files with 691 additions and 0 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
# Generated by Cargo
# will have compiled files and executables
/target/
# These are backup files generated by rustfmt
**/*.rs.bk

7
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"recommendations": [
"rust-lang.rust-analyzer",
"vadimcn.vscode-lldb",
"Slint.slint"
]
}

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

16
testbackend/Cargo.toml Normal file
View File

@ -0,0 +1,16 @@
[package]
name = "testbackend"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
slint = "1.0"
# testfrontend.workspace = true
testfrontend = "*"
chrono = { version = "0.4", default-features = false, features = ["clock", "std"]}
[build-dependencies]
slint-build = "1.0"

103
testbackend/src/main.rs Normal file
View File

@ -0,0 +1,103 @@
// slint::include_modules!();
#[cfg(target_arch = "wasm32")]
use slint_ui::*;
extern crate testfrontend;
use std::rc::Rc;
/// Returns the current time formated as a string
fn current_time() -> slint::SharedString {
#[cfg(not(target_arch = "wasm32"))]
return chrono::Local::now().format("%H:%M:%S %d/%m/%Y").to_string().into();
#[cfg(target_arch = "wasm32")]
return "".into();
}
// use crate::slint_ui::TodoItem;
// use crate::slint_ui::MainWindow;
fn main() {
// fn main() -> Result<(), slint::PlatformError> {
// This provides better error messages in debug mode.
// It's disabled in release mode so it doesn't bloat up the file size.
#[cfg(all(debug_assertions, target_arch = "wasm32"))]
console_error_panic_hook::set_once();
let main_window = MainWindow::new().unwrap();
main_window.set_todo_model(
[
TodoItem { checked: true, title: "Implement the .slint file".into() },
TodoItem { checked: true, title: "Do the Rust part".into() },
TodoItem { checked: false, title: "Make the C++ code".into() },
TodoItem { checked: false, title: "Write some JavaScript code".into() },
TodoItem { checked: false, title: "Test the application".into() },
TodoItem { checked: false, title: "Ship to customer".into() },
TodoItem { checked: false, title: "???".into() },
TodoItem { checked: false, title: "Profit".into() },
]
.into(),
);
// let todo_model = Rc::new(slint::VecModel::<TodoItem>::from(vec![
// TodoItem { checked: true, title: "Implement the .slint file".into() },
// TodoItem { checked: true, title: "Do the Rust part".into() },
// TodoItem { checked: false, title: "Make the C++ code".into() },
// TodoItem { checked: false, title: "Write some JavaScript code".into() },
// TodoItem { checked: false, title: "Test the application".into() },
// TodoItem { checked: false, title: "Ship to customer".into() },
// TodoItem { checked: false, title: "???".into() },
// TodoItem { checked: false, title: "Profit".into() },
// ]));
// let ui = AppWindow::new()?;
main_window.on_todo_added({
let todo_model = todo_model.clone();
move |text| todo_model.push(TodoItem { checked: false, title: text })
});
main_window.on_quit(move || {
#[cfg(not(target_arch = "wasm32"))]
std::process::exit(0);
});
let weak_window = main_window.as_weak();
// main_window.on_popup_confirmed(move || {
// let window = weak_window.unwrap();
// window.hide().unwrap();
// });
{
let weak_window = main_window.as_weak();
let todo_model = todo_model.clone();
// main_window.window().on_close_requested(move || {
// let window = weak_window.unwrap();
// // if todo_model.iter().any(|t| !t.checked) {
// // // window.invoke_show_confirm_popup();
// // slint::CloseRequestResponse::KeepWindowShown
// // } else {
// // slint::CloseRequestResponse::HideWindow
// // }
// });
}
// let ui_handle = main_window.as_weak();
// main_window.on_request_increase_value(move || {
// let ui = ui_handle.unwrap();
// ui.set_counter(main_window.get_counter() + 1);
// });
// main_window.run()
main_window.set_show_header(true);
main_window.set_todo_model(todo_model.into());
main_window.run().unwrap();
}
mod slint_ui {
pub use testfrontend::*;
// pub use ui_settings_profile_server_window::*;
// pub use ui_settings_profile_window::*;
}

12
testfrontend/Cargo.toml Normal file
View File

@ -0,0 +1,12 @@
[package]
name = "testfrontend"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
slint = "1.0"
[build-dependencies]
slint-build = "1.0"

15
testfrontend/build.rs Normal file
View File

@ -0,0 +1,15 @@
fn main() {
slint_build::compile("src/appwindow.slint").unwrap();
}
// fn main() {
// // let style = "fluent";
// let style = "material";
// slint_build::compile_with_config(
// "src/appwindow.slint",
// slint_build::CompilerConfiguration::new()
// .with_style(style.to_string())
// .into(),
// )
// .unwrap();
// }

View File

@ -0,0 +1,111 @@
import { Button, VerticalBox, CheckBox, ComboBox, ListView, HorizontalBox, LineEdit } from "std-widgets.slint";
import { DemoPalette, Page } from "common.slint";
import { HomePage, TodoItem } from "./homepage.slint";
import { DevicesPage } from "welcome.slint";
// export struct TodoItem {
// title: string,
// checked: bool,
// }
component AppNavigation inherits Rectangle {
in-out property <bool> active;
callback activate;
GridLayout {
padding: 0px;
@children
}
TouchArea {
clicked => { root.activate(); }
}
}
export component MainWindow inherits Window {
callback quit();
preferred-width: 400px;
preferred-height: 600px;
title: @tr("Serial");
out property<int> active-page: 0;
// out property<string> active-page: home;
callback todo-added(string);
in property <[TodoItem]> todo-model: [
{ title: "Implement the .slint file", checked: true },
{ title: "Do the Rust part", checked: false },
{ title: "Make the C++ code", checked: false },
{ title: "Write some JavaScript code", checked: false },
{ title: "Test the application", checked: false },
{ title: "Ship to customer", checked: false },
{ title: "???", checked: false },
{ title: "Profit", checked: false },
];
HorizontalLayout {
padding: 10px;
// padding-left: 67px;
// alignment: center;
main-view := Rectangle {
// height: 100%;
// border-radius: 30px;
// background: DemoPalette.page-background-color;
Rectangle {
clip: true;
x: main-view.border-radius / 2;
y: main-view.border-radius / 2;
width: main-view.width - main-view.border-radius;
height: main-view.height - main-view.border-radius;
home-page := DevicesPage {
y: root.active-page == 0 ? 0 : root.active-page < 0 ? - self.height - 1px : parent.height + 1px;
animate y { duration: 125ms; easing: ease; }
}
HomePage {
y: root.active-page == 1 ? 0 : root.active-page < 1 ? - self.height - 1px : parent.height + 1px;
animate y { duration: 125ms; easing: ease; }
}
}
}
}
navigation := Rectangle {
width: 57px;
x: 10px;
function icon-y(index: int) -> length {
return 200px // top padding
+ index * 72px;
}
for page-icon[idx] in [
@image-url("images/home.svg"),
@image-url("images/scan.svg"),
// @image-url("images/ink.svg"),
] : AppNavigation {
y: navigation.icon-y(idx);
x: 16px;
height: 35px;
width: 30px;
icon := Image {
// colorize: (root.active-page == idx) ? DemoPalette.active-page-icon-color : DemoPalette.inactive-page-icon-color;
// animate colorize {
// duration: 125ms;
// }
source: page-icon;
image-fit: contain;
width: 100%;
height: 100%;
}
activate => {
root.active-page = idx;
}
}
}
}

View File

@ -0,0 +1,89 @@
struct ButtonColors {
base: color,
pressed: color,
hovered: color,
}
export global DemoPalette {
// Color of the home/settings/ink buttons on the left side bar
out property <color> active-page-icon-color: root.night-mode ? #6284FF : #122F7B;
out property <color> inactive-page-icon-color: #BDC0D1;
out property <color> main-background: #0E133F;
out property <color> neutral-box: #BDC0D1;
out property <color> page-background-color: root.night-mode ? #122F7B : white;
out property <color> text-foreground-color: root.night-mode ? #F4F6FF : black;
out property <color> secondary-foreground-color: root.night-mode ? #C1C3CA : #6C6E7A;
out property <color> printer-action-background-color: root.night-mode ? root.main-background : white;
out property <color> printer-queue-item-background-color: root.page-background-color;
out property <color> status-label-text-color: root.night-mode ? #F1FF98 : #6284FF;
// Color used for the border / outline of items that can be clicked on, such as the
// "Print"/"Scan" buttons, the printer queue items (for expansion) or controls such
// as the combo box or spin box.
out property <color> control-outline-color: #FFBF63;
out property <color> control-secondary: #6284FF;
out property <color> control-foreground: root.night-mode ? white : #122F7B; // FIXME: the night mode color was not part of the design
out property <color> primary-push-button-base: #6284FF;
out property <ButtonColors> primary-push-button-colors: {
base: root.primary-push-button-base,
pressed: root.primary-push-button-base.darker(40%),
hovered: root.primary-push-button-base.darker(20%),
};
out property <color> secondary-push-button-base: #FFBF63;
out property <ButtonColors> secondary-push-button-colors: {
base: root.secondary-push-button-base,
pressed: root.secondary-push-button-base.darker(40%),
hovered: root.secondary-push-button-base.darker(20%),
};
out property <color> push-button-text-color: white;
out property <length> base-font-size: 16px;
in property <bool> night-mode: false;
}
export component Page inherits Rectangle {
in property<string> header <=> h.text;
// background: DemoPalette.page-background-color;
in property <bool> has-back-button: false;
callback back;
TouchArea {} // protect underneath controls
if (root.has-back-button) : Image {
x:0;
source: @image-url("images/back.svg");
image-fit: contain;
colorize: DemoPalette.control-secondary;
y: h.y + (h.height - self.height) / 2;
width: 14px;
height: 24px;
TouchArea {
x:0;
clicked => { root.back() }
width: 150%;
}
}
h := Text {
font-weight: 900;
font-size: DemoPalette.base-font-size * 2;
color: DemoPalette.text-foreground-color;
y: 46px - self.font-size;
x: root.has-back-button ? 24px + 16px : 0px;
// Allow clicking on the title as well to get back easier when just
// using fingers on a small screen.
if (root.has-back-button) : TouchArea {
clicked => { root.back() }
}
}
}

View File

@ -0,0 +1,125 @@
import { DemoPalette, Page } from "./common.slint";
// import { WidePrinterQueueList } from "./printer_queue.slint";
import { Button, VerticalBox, CheckBox, ComboBox, ListView, HorizontalBox, LineEdit } from "std-widgets.slint";
export struct TodoItem {
title: string,
checked: bool,
}
export component HomePage inherits Page {
// has-back-button: true;
// header: @tr("Print");
// preferred-width: 400px;
// preferred-height: 600px;
// title: @tr("Serial");
callback todo-added(string);
in-out property<int> counter: 42;
callback request-increase-value();
callback apply_sorting_and_filtering();
in property <[TodoItem]> todo-model;
in property <bool> show-header: true;
in-out property <bool> is-sort-by-name: false;
in-out property <bool> hide-done-items: false;
VerticalBox {
HorizontalBox {
// ComboBox {
// value: @tr("119200");
// choices: [@tr("300"), @tr("1200"), @tr("2400"), @tr("4800"), @tr("19200"), @tr("38400"), @tr("57600")];
// }
ComboBox {
model: [@tr("Select Port"), @tr("300"), @tr("1200"), @tr("2400"), @tr("4800"), @tr("19200"), @tr("38400"), @tr("57600")];
// enabled: GallerySettings.widgets-enabled;
}
connectbtn := Button {
text: "Connect";
enabled: text-edit.text != "";
clicked => {
root.todo-added(text-edit.text);
text-edit.text = "";
}
}
disconectbtn := Button {
text: "Disconnect";
enabled: text-edit.text != "";
clicked => {
root.todo-added(text-edit.text);
text-edit.text = "";
}
}
}
if (root.show-header) : HorizontalBox {
alignment: start;
CheckBox {
text: "Sort by name";
checked <=> root.is-sort-by-name;
toggled => {
root.apply_sorting_and_filtering();
}
}
CheckBox {
text: "Hide done items";
checked <=> root.hide-done-items;
toggled => {
root.apply_sorting_and_filtering();
}
}
}
list-view := ListView {
for todo in root.todo-model: HorizontalLayout {
Text {
padding: 2px;
text: todo.title;
}
// CheckBox {
// text: todo.title;
// checked: todo.checked;
// toggled => {
// todo.checked = self.checked;
// }
// }
}
}
HorizontalBox {
padding: 0px;
text-edit := LineEdit {
placeholder-text: "Enter Command";
accepted(text) => {
root.todo-added(self.text);
self.text = "";
}
}
btn := Button {
text: "Send";
enabled: text-edit.text != "";
clicked => {
root.todo-added(text-edit.text);
text-edit.text = "";
}
}
}
// Text {
// text: "Counter: \{root.counter}";
// }
// Button {
// text: "Increase value";
// clicked => {
// root.request-increase-value();
// }
// }
}
}

View File

@ -0,0 +1,3 @@
<svg width="14" height="24" viewBox="0 0 14 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.532265 13.264C-0.177422 12.5666 -0.177422 11.4336 0.532265 10.7362L10.9024 0.523018C11.6104 -0.174339 12.7593 -0.174339 13.4689 0.523018C14.177 1.22038 14.177 2.35343 13.4689 3.05079L4.38226 12L13.4689 20.9492C14.177 21.6466 14.177 22.7796 13.4689 23.477C12.7593 24.1743 11.6104 24.1743 10.9024 23.477L0.532265 13.264Z" fill="#6284FF"/>
</svg>

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2013 zaimoku_woodpile <https://www.flickr.com/photos/11250735@N07/>
SPDX-License-Identifier: CC-BY-2.0
Comment: Taken from: https://www.flickr.com/photos/11250735@N07/8561945042 with Modifications: Cropped, resized the image

View File

@ -0,0 +1,3 @@
<svg width="12" height="12" viewBox="0 0 17 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.5539 0.529746C15.2152 0.191054 14.7584 0 14.2825 0C13.8048 0 13.348 0.187586 13.0111 0.529746L5.48686 8.01572L3.07606 5.58758C2.38131 4.89283 1.23845 4.88416 0.53676 5.57369C-0.171909 6.26497 -0.178846 7.4061 0.515917 8.11823L4.19808 11.8265C4.53677 12.1651 4.99359 12.3562 5.47469 12.3562C5.95232 12.3562 6.4039 12.1686 6.74263 11.8317L15.5487 3.07756C16.2435 2.38281 16.2522 1.23995 15.5626 0.538261L15.5592 0.529577L15.5539 0.529746Z" fill="#6284FF"/>
</svg>

After

Width:  |  Height:  |  Size: 571 B

View File

@ -0,0 +1,3 @@
<svg width="61" height="81" viewBox="0 0 61 81" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M48.9421 19.0163V64.6845L48.9429 64.6844C48.9429 66.6219 47.4207 68.1442 45.4832 68.0058H3.55089C1.61352 68.0058 0.0911865 66.4835 0.0911865 64.5461V3.65456C0.0911865 1.71719 1.61343 0.194855 3.55089 0.194855H29.2909H29.9829C30.0625 0.274436 30.0963 0.308254 30.137 0.322625C30.167 0.333245 30.2009 0.333245 30.2597 0.333245C30.3289 0.333245 30.3981 0.367842 30.4673 0.402439C30.5365 0.437037 30.6056 0.471634 30.6748 0.471634C30.744 0.471634 30.7786 0.506232 30.8132 0.54083C30.8478 0.575427 30.8824 0.610024 30.9516 0.610024C31.0208 0.610024 31.0554 0.644622 31.09 0.679219C31.1246 0.713816 31.1592 0.748414 31.2284 0.748414L31.5052 1.02519C31.6436 1.02519 31.782 1.16358 31.782 1.16358L47.9733 16.3869C48.0425 16.4561 48.0771 16.5253 48.1117 16.5945C48.1463 16.6637 48.1809 16.7329 48.2501 16.8021L48.3885 16.9405C48.4414 17.0462 48.474 17.1317 48.5019 17.2047L48.5019 17.2048C48.5471 17.323 48.5798 17.4085 48.6653 17.494V17.6324C48.8037 18.0475 48.9421 18.6011 48.9421 19.0163ZM36.7639 15.5557L32.7506 11.8192V15.5557H36.7639ZM7.01051 61.224V7.25159H25.8315V19.0145C25.8315 20.952 27.3539 22.4742 29.2912 22.4742H42.0231V61.2233L7.01051 61.224ZM19.8807 73.1258C17.9434 73.1258 16.421 74.6481 16.421 76.5855L16.4212 76.5854C16.4212 78.5227 18.0819 80.0451 19.8809 80.0451H57.5229C59.4603 80.0451 60.9826 78.5228 60.9826 76.5854V37.9744C60.9826 36.037 59.4603 34.5147 57.5229 34.5147C55.5856 34.5147 54.0632 36.0369 54.0632 37.9744V73.1258H19.8807Z" fill="#00102B"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,3 @@
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.616652 0.616652C1.47164 -0.205551 2.85251 -0.205551 3.70688 0.616652L7.48763 4.43023L11.3012 0.616652C12.1234 -0.205551 13.5036 -0.205551 14.3588 0.616652C15.2137 1.47164 15.2137 2.85251 14.3588 3.70688L10.578 7.48763L14.3588 11.3012C15.2137 12.1234 15.2137 13.5036 14.3588 14.3588C13.5038 15.2139 12.1229 15.2137 11.3012 14.3588L7.48763 10.578L3.70688 14.3588C2.85189 15.2137 1.47103 15.2137 0.616652 14.3588C-0.205551 13.5038 -0.205551 12.1229 0.616652 11.3012L4.43023 7.48763L0.616652 3.70688C-0.205551 2.85189 -0.205551 1.47103 0.616652 0.616652Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -0,0 +1,3 @@
SPDX-License-Identifier: CC-PDDC
SPDX-FileCopyrightText: This work has been released into the public domain by its author, Imk0278 at the Wikipedia project. This applies worldwide.
Comment: Taken from: https://commons.wikimedia.org/wiki/File:Kintamani_dog_white.jpg with Modifications: Cropped, resized

View File

@ -0,0 +1,3 @@
<svg width="12" height="9" viewBox="0 0 12 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.76579 8.08811C6.36616 8.56399 5.63384 8.56399 5.23421 8.08811L0.451638 2.3931C-0.094744 1.74247 0.367809 0.75 1.21742 0.75L10.7826 0.750001C11.6322 0.750001 12.0947 1.74247 11.5484 2.3931L6.76579 8.08811Z" fill="#6284FF"/>
</svg>

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -0,0 +1,3 @@
SPDX-License-Identifier: CC-PDDC
SPDX-FileCopyrightText: This work is in the public domain in the United States
Comment: Taken from: https://commons.wikimedia.org/wiki/File:1968-elefante.jpg with Modifications: Cropped, resized

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="none"><path d="M1.372 29.992L28.5 30c.782 0 1.5-.715 1.5-1.5v-14c0-.392-.238-.74-.5-1L16 .5c-.522-.522-1.414-.522-2 0L.5 13.5c-.392.392-.696.978-.5 1.5s.98 1 1.5 1h17c.782 0 1.5-.715 1.5-1.5s-.715-1.51-1.5-1.5H4.75L15 3.5 27 15v12H3v-6c0-.196-.303-.455-.303-.585-.196-.522-.611-.915-1.197-.915-.782 0-1.5.715-1.5 1.5v7.5c.003.777.718 1.5 1.5 1.5z" fill="#122f7b"/></svg>

After

Width:  |  Height:  |  Size: 440 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="#bdc0d1"><path d="M24.671 13.576L15.853.467A1.03 1.03 0 0 0 14.991 0a1.03 1.03 0 0 0-.862.467L5.326 13.576a.95.95 0 0 0-.059.102 11.25 11.25 0 0 0 .316 10.94C7.573 27.958 11.147 30 14.999 30s7.426-2.042 9.418-5.381a11.25 11.25 0 0 0 .315-10.94.97.97 0 0 0-.062-.102zm-3.357 11.686c-2.028 2.051-4.904 2.993-7.734 2.531s-5.269-2.268-6.559-4.859a9.14 9.14 0 0 1 .048-8.227l7.929-11.79 7.929 11.79a9.1 9.1 0 0 1 .908 5.546c-.29 1.9-1.174 3.654-2.521 5.009zm-8.55-2.443a4.18 4.18 0 0 1-1.953-2.532 4.24 4.24 0 0 1 .395-3.187 1.06 1.06 0 0 0-.382-1.434 1.03 1.03 0 0 0-1.417.387 6.34 6.34 0 0 0-.584 4.777 6.27 6.27 0 0 0 2.927 3.792c.497.289 1.132.116 1.418-.387a1.06 1.06 0 0 0-.384-1.434z"/></svg>

After

Width:  |  Height:  |  Size: 764 B

View File

@ -0,0 +1 @@
<svg height="21" viewBox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" stroke="#2a2e3b" stroke-linecap="round" stroke-linejoin="round" transform="translate(2 4)"><path d="m2.5.48528137h11c.5522847 0 1 .44771525 1 1v8.01471863h-13v-8.01471863c0-.55228475.44771525-1 1-1z"/><path d="m1.11803399 9.5h13.76393201c.5522848 0 1 .44771525 1 1 0 .1552451-.0361451.3083582-.1055728.4472136l-1.2763932 2.5527864h-13l-1.2763932-2.5527864c-.24698925-.4939785-.0467649-1.09465154.44721359-1.34164079.13885544-.06942772.2919685-.10557281.4472136-.10557281z" transform="matrix(1 0 0 -1 0 23)"/></g></svg>

After

Width:  |  Height:  |  Size: 637 B

View File

@ -0,0 +1 @@
<svg height="21" viewBox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" transform="translate(4 5)"><g stroke="#2a2e3b" stroke-linecap="round" stroke-linejoin="round"><path d="m11.5 5.5h-7"/><path d="m11.5 9.5h-7"/><path d="m11.5 1.5h-7"/></g><path d="m1.49884033 2.5c.5 0 1-.5 1-1s-.5-1-1-1-.99884033.5-.99884033 1 .49884033 1 .99884033 1zm0 4c.5 0 1-.5 1-1s-.5-1-1-1-.99884033.5-.99884033 1 .49884033 1 .99884033 1zm0 4c.5 0 1-.5 1-1s-.5-1-1-1-.99884033.5-.99884033 1 .49884033 1 .99884033 1z" fill="#2a2e3b"/></g></svg>

After

Width:  |  Height:  |  Size: 568 B

View File

@ -0,0 +1,3 @@
<svg width="13" height="3" viewBox="0 0 13 3" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 1.5C0 0.671875 0.529356 0 1.18182 0H11.8182C12.4706 0 13 0.671875 13 1.5C13 2.32812 12.4706 3 11.8182 3H1.18182C0.529356 3 0 2.32812 0 1.5Z" fill="#6284FF"/>
</svg>

After

Width:  |  Height:  |  Size: 271 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="none"><path d="M2.003 14.979c-.079 3.893 1.331 7.66 3.921 10.475s6.15 4.45 9.899 4.546c2.472-.03 4.89-.749 7.003-2.084a14.08 14.08 0 0 0 4.998-5.505 1.55 1.55 0 0 0-.051-1.528 1.43 1.43 0 0 0-1.316-.686l-.158.013c-.19.015-.38.029-.578.029-2.983-.096-5.807-1.413-7.857-3.667s-3.153-5.256-3.075-8.355c0-2.095.504-4.158 1.468-5.998a1.55 1.55 0 0 0-.051-1.527A1.43 1.43 0 0 0 14.89.003C11.321.355 8.01 2.093 5.621 4.87s-3.681 6.386-3.618 10.109zM12.609 3.503c-.467 1.524-.705 3.114-.705 4.715-.057 3.559 1.12 7.019 3.316 9.751s5.264 4.554 8.645 5.132c-2.009 2.449-4.943 3.871-8.041 3.899-2.983-.094-5.807-1.413-7.856-3.666s-3.155-5.257-3.076-8.355c-.034-2.511.693-4.971 2.078-7.029s3.357-3.615 5.639-4.447z" fill="#bdc0d1"/></svg>

After

Width:  |  Height:  |  Size: 796 B

View File

@ -0,0 +1,3 @@
<svg width="24" height="27" viewBox="0 0 24 27" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.00287444 13.4812C-0.0696142 16.985 1.23143 20.3752 3.62219 22.9088C6.01311 25.4435 9.2988 26.9138 12.7597 27C15.0419 26.9734 17.274 26.3255 19.2238 25.1246C21.1735 23.9225 22.7669 22.2116 23.8369 20.1704C24.0706 19.7377 24.0518 19.21 23.7894 18.7949C23.5256 18.3798 23.0607 18.1432 22.5745 18.1774L22.4283 18.1888C22.2533 18.2027 22.0771 18.2153 21.8946 18.2153C19.1413 18.1293 16.5341 16.9436 14.6419 14.9149C12.7509 12.8877 11.7311 10.1846 11.8036 7.39569C11.8036 5.51019 12.2685 3.65372 13.1584 1.99736C13.3908 1.56459 13.3733 1.03817 13.1109 0.623091C12.8484 0.208012 12.3835 -0.029865 11.8986 0.0030161C8.60399 0.319374 5.54811 1.88346 3.34235 4.38284C1.13768 6.8808 -0.0556771 10.1302 0.00287444 13.4812Z" fill="#F1FF98"/>
</svg>

After

Width:  |  Height:  |  Size: 844 B

View File

@ -0,0 +1,3 @@
<svg width="24" height="27" viewBox="0 0 24 27" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.00287444 13.4812C-0.0696142 16.985 1.23143 20.3752 3.62219 22.9088C6.01311 25.4435 9.2988 26.9138 12.7597 27C15.0419 26.9734 17.274 26.3255 19.2238 25.1246C21.1735 23.9225 22.7669 22.2116 23.8369 20.1704C24.0706 19.7377 24.0518 19.21 23.7894 18.7949C23.5256 18.3798 23.0607 18.1432 22.5745 18.1774L22.4283 18.1888C22.2533 18.2027 22.0771 18.2153 21.8946 18.2153C19.1413 18.1293 16.5341 16.9436 14.6419 14.9149C12.7509 12.8877 11.7311 10.1846 11.8036 7.39569C11.8036 5.51019 12.2685 3.65372 13.1584 1.99736C13.3908 1.56459 13.3733 1.03817 13.1109 0.623091C12.8484 0.208013 12.3835 -0.029865 11.8986 0.0030161C8.60399 0.319374 5.54811 1.88346 3.34235 4.38284C1.13768 6.8808 -0.0558723 10.1304 0.00267916 13.4813L0.00287444 13.4812ZM9.79281 3.15264C9.36161 4.52438 9.14164 5.95556 9.14164 7.39575C9.08915 10.5986 10.1753 13.7128 12.2024 16.1716C14.2296 18.6316 17.0619 20.2702 20.1824 20.7905C18.3277 22.9949 15.6192 24.2743 12.7598 24.2995C10.0064 24.2148 7.3993 23.0278 5.50838 21.0004C3.61614 18.9732 2.59629 16.2691 2.66879 13.4812C2.63755 11.2211 3.3087 9.00774 4.58726 7.15538C5.86458 5.30151 7.68557 3.90194 9.79291 3.15296L9.79281 3.15264Z" fill="#BDC0D1"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="49" height="86" fill="none"><path d="M33 16h-7C11.465 16 0 28.707 0 43.5S11.465 68 26 68h7c9.071 0 16 8.768 16 18V0c0 9.232-6.929 16-16 16z" fill="#fff"/></svg>

After

Width:  |  Height:  |  Size: 208 B

View File

@ -0,0 +1,4 @@
<svg width="12" height="15" viewBox="0 0 12 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.00043 13.1244V1.87454C4.00043 0.839723 3.10472 0 2.00092 0C0.895709 0 0 0.839723 0 1.87454V13.1244C0 14.1592 0.895709 14.9989 2.00092 14.9989C3.10472 14.9989 4.00043 14.1592 4.00043 13.1244Z" fill="white"/>
<path d="M12 13.1244V1.87454C12 0.839723 11.1043 0 9.99909 0C8.89528 0 7.99957 0.839723 7.99957 1.87454V13.1244C7.99957 14.1592 8.89528 14.9989 9.99909 14.9989C11.1043 14.9989 12 14.1592 12 13.1244Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 537 B

View File

@ -0,0 +1,4 @@
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 6.5C0 5.67188 0.529356 5 1.18182 5H11.8182C12.4706 5 13 5.67188 13 6.5C13 7.32812 12.4706 8 11.8182 8H1.18182C0.529356 8 0 7.32812 0 6.5Z" fill="#6284FF"/>
<path d="M6.5 13C5.67188 13 5 12.4706 5 11.8182L5 1.18182C5 0.529356 5.67187 -2.93686e-08 6.5 -6.55671e-08C7.32812 -1.01766e-07 8 0.529356 8 1.18182L8 11.8182C8 12.4706 7.32812 13 6.5 13Z" fill="#6284FF"/>
</svg>

After

Width:  |  Height:  |  Size: 477 B

View File

@ -0,0 +1,41 @@
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24.303 24.303" style="enable-background:new 0 0 24.303 24.303;" xml:space="preserve">
<g>
<path style="fill:#030104;" d="M10.269,11.298V1.883C10.269,0.844,11.113,0,12.152,0s1.883,0.844,1.883,1.883v9.415
c0,1.039-0.844,1.883-1.883,1.883S10.269,12.337,10.269,11.298z M19.616,2.761c-0.61-0.483-1.5-0.377-1.983,0.234
c-0.483,0.612-0.378,1.5,0.234,1.984c2.24,1.767,3.524,4.413,3.524,7.261c0,5.094-4.145,9.239-9.238,9.239
c-5.094,0-9.239-4.145-9.239-9.239c0-2.847,1.283-5.492,3.521-7.258c0.612-0.483,0.717-1.371,0.234-1.984
c-0.483-0.612-1.37-0.716-1.984-0.234C1.764,5.069,0.089,8.523,0.089,12.24c0,6.652,5.412,12.063,12.063,12.063
s12.063-5.412,12.063-12.063C24.215,8.521,22.538,5.067,19.616,2.761z"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 995 B

View File

@ -0,0 +1,3 @@
<svg width="82" height="82" viewBox="0 0 82 82" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M26.4746 0.91531C20.4699 0.91531 15.5196 5.86131 15.5196 11.8684V15.5172H11.8702C5.86201 15.5172 0.915161 20.4667 0.915161 26.4704V55.6775C0.915161 61.6813 5.86543 66.6307 11.8702 66.6307H15.5162V70.2829C15.5162 76.2866 20.4802 81.25 26.4852 81.25H55.6773C61.682 81.25 66.6525 76.2869 66.6525 70.2829V66.6341H70.295C76.2997 66.6341 81.25 61.6847 81.25 55.681V26.4703C81.25 20.4666 76.3031 15.5171 70.295 15.5171H66.6455V11.8684C66.6455 5.86122 61.6953 0.915222 55.6905 0.915222L26.4746 0.91531ZM26.4748 8.21623H55.6869C57.7718 8.21623 59.3397 9.78051 59.3397 11.8684V15.5172H22.8253V11.8684C22.8253 9.78051 24.3899 8.21623 26.4748 8.21623ZM70.2982 22.8216H11.8703L11.8708 22.8215C9.78255 22.8215 8.218 24.3858 8.218 26.4703V55.681C8.218 57.7655 9.78255 59.3298 11.8708 59.3298H15.5133V55.6741C15.5133 49.6673 20.4776 44.735 26.4824 44.735H55.6771C61.6814 44.735 66.6522 49.6704 66.6522 55.6741V59.3332H70.2982C72.3865 59.3332 73.9511 57.7655 73.9511 55.681V26.4738C73.9511 24.3858 72.3831 22.8216 70.2982 22.8216ZM19.1725 30.1225C17.1561 30.1225 15.5197 31.7586 15.5197 33.7747C15.5197 35.7908 17.1561 37.4269 19.1725 37.4269C21.1889 37.4269 22.8253 35.7908 22.8253 33.7747C22.8253 31.7586 21.1889 30.1225 19.1725 30.1225ZM55.6762 52.0357H26.4815L26.4841 52.0322C24.3958 52.0322 22.8176 53.5862 22.8176 55.6707V70.283C22.8176 72.371 24.3958 73.9489 26.4807 73.9489H55.6728C57.7611 73.9489 59.3393 72.3675 59.3393 70.283V55.6742C59.3393 53.5863 57.7611 52.0357 55.6762 52.0357Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1 @@
<svg height="21" viewBox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" transform="matrix(0 -1 1 0 2 19)"><path d="m3.5 4.38378906v-1.89752528c0-1.1045695.8954305-2 2-2h4c1.1045695 0 2 .8954305 2 2v12.01373622c0 1.1045695-.8954305 2-2 2h-4c-1.1045695 0-2-.8954305-2-2v-2" stroke="#2a2e3b" stroke-linecap="round" stroke-linejoin="round"/><path d="m1.5 4.5h5.0013251v8h-5.0013251c-.55228475 0-1-.4477153-1-1v-6c0-.55228475.44771525-1 1-1zm11.5 0h2.5c.5522847 0 1 .44771525 1 1v6c0 .5522847-.4477153 1-1 1h-2.5" stroke="#2a2e3b" stroke-linecap="round" stroke-linejoin="round"/><circle cx="9" cy="14" fill="#2a2e3b" r="1"/></g></svg>

After

Width:  |  Height:  |  Size: 676 B

View File

@ -0,0 +1 @@
<svg height="21" viewBox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" stroke="#2a2e3b" stroke-linecap="round" stroke-linejoin="round" transform="translate(2 3)"><path d="m9.5.5h-7c-1.1045695 0-2 .8954305-2 2v7c0 1.1045695.8954305 2 2 2h7c1.1045695 0 2-.8954305 2-2v-7c0-1.1045695-.8954305-2-2-2z" transform="matrix(0 1 -1 0 12 0)"/><path d="m11.5 15.5h2c1.1045695 0 2-.8954305 2-2v-7c0-1.1045695-.8954305-2-2-2h-7c-1.1045695 0-2 .8954305-2 2v2" transform="matrix(0 1 -1 0 20 0)"/></g></svg>

After

Width:  |  Height:  |  Size: 539 B

View File

@ -0,0 +1,7 @@
<svg width="71" height="72" viewBox="0 0 71 72" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.17278 14.1732C9.17278 11.6669 11.2384 9.60129 13.7446 9.60129H22.7413C23.5538 9.60129 24.2163 8.93869 24.2163 8.1263L24.2192 2.44819C24.2192 1.63577 23.5566 0.973206 22.7442 0.973206H13.7446C6.44457 0.973206 0.544922 6.87315 0.544922 14.1729V23.1695C0.544922 23.982 1.20752 24.6445 2.01991 24.6445H7.69802C8.51044 24.6445 9.173 23.9819 9.173 23.1695L9.17278 14.1732Z" fill="#00102B"/>
<path d="M57.4072 0.973511H48.4076C47.5952 0.973511 46.9326 1.6361 46.9326 2.4485V8.12661C46.9326 8.93903 47.5952 9.60159 48.4076 9.60159H57.4043C59.9106 9.60159 61.9762 11.6672 61.9762 14.1735V23.1701C61.9762 23.9826 62.6387 24.6451 63.4511 24.6451H69.1292C69.9417 24.6451 70.6042 23.9825 70.6042 23.1701L70.6071 14.1735C70.6071 6.87346 64.7072 0.973806 57.4075 0.973806L57.4072 0.973511Z" fill="#00102B"/>
<path d="M61.9789 57.8357C61.9789 60.342 59.9133 62.4076 57.407 62.4076H48.4074C47.5949 62.4076 46.9324 63.0702 46.9324 63.8826V69.5607C46.9324 70.3731 47.595 71.0357 48.4074 71.0357H57.404C64.704 71.0357 70.6037 65.1357 70.6037 57.836L70.6066 48.8364C70.6066 48.024 69.944 47.3614 69.1316 47.3614H63.4535C62.6411 47.3614 61.9785 48.024 61.9785 48.8364L61.9789 57.8357Z" fill="#00102B"/>
<path d="M9.17288 57.8358V48.8361C9.17288 48.0237 8.51029 47.3611 7.6979 47.3611H2.01979C1.20736 47.3611 0.5448 48.0237 0.5448 48.8361V57.8328C0.5448 65.1328 6.44475 71.0325 13.7445 71.0325H22.7411C23.5536 71.0325 24.2161 70.3699 24.2161 69.5575V63.8794C24.2161 63.067 23.5535 62.4044 22.7411 62.4044L13.7445 62.4073C11.1632 62.4073 9.17259 60.4166 9.17259 57.8354L9.17288 57.8358Z" fill="#00102B"/>
<path d="M2.01991 40.2827H69.1318C69.9442 40.2827 70.6068 39.6201 70.6068 38.8077V33.1296C70.6068 32.3172 69.9442 31.6546 69.1318 31.6546H2.01991C1.20749 31.6546 0.544922 32.3172 0.544922 33.1296V38.8077C0.544922 39.6172 1.20752 40.2827 2.01991 40.2827Z" fill="#00102B"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="#bdc0d1" fill-rule="evenodd"><path d="M5.178 6.25H1.25a1.25 1.25 0 1 1 0-2.5h3.928c.366-1.44 1.356-2.641 2.7-3.275a4.97 4.97 0 0 1 4.243 0 4.98 4.98 0 0 1 2.7 3.275H28.75a1.25 1.25 0 0 1 0 2.5H14.822c-.366 1.44-1.356 2.641-2.7 3.275a4.97 4.97 0 0 1-4.243 0 4.98 4.98 0 0 1-2.7-3.275zm7.131-2.207A2.5 2.5 0 0 0 10 2.5h0a2.5 2.5 0 1 0 2.31 1.543zm2.869 12.207H1.25A1.25 1.25 0 0 1 0 15.001a1.25 1.25 0 0 1 1.25-1.25h13.928c.366-1.44 1.356-2.642 2.7-3.275s2.9-.634 4.243 0a4.98 4.98 0 0 1 2.7 3.275h3.928a1.25 1.25 0 0 1 0 2.5h-3.928c-.366 1.44-1.356 2.641-2.7 3.275s-2.9.633-4.243 0-2.334-1.835-2.7-3.275zm7.131-2.207A2.5 2.5 0 0 0 20 12.501h0a2.5 2.5 0 1 0 2.31 1.542zM5.178 26.251H1.25a1.25 1.25 0 1 1 0-2.5h3.928c.366-1.44 1.356-2.642 2.7-3.275s2.9-.634 4.243 0a4.98 4.98 0 0 1 2.7 3.275H28.75a1.25 1.25 0 1 1 0 2.5H14.822c-.366 1.44-1.356 2.641-2.7 3.275a4.97 4.97 0 0 1-4.243 0 4.98 4.98 0 0 1-2.7-3.275zm7.131-2.207A2.5 2.5 0 0 0 10 22.501h0a2.5 2.5 0 1 0 2.31 1.543z"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -0,0 +1,3 @@
SPDX-License-Identifier: CC-PDDC
SPDX-FileCopyrightText: This work is in the public domain in the United States because it is a work prepared by an officer or employee of the United States Government as part of that persons official duties under the terms of Title 17, Chapter 1, Section 105 of the US Code
Comment: Taken from: https://commons.wikimedia.org/wiki/File:Gopher_Snake_(11970141595).jpg with Modifications: Cropped, resized

View File

@ -0,0 +1,3 @@
<svg width="96" height="103" viewBox="0 0 96 103" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M62.9123 6.27167L55.5156 15.1874L53.8164 13.7776C52.6296 12.9698 50.8463 13.2245 49.9372 14.3321C36.6688 30.3727 23.3937 46.4215 10.1278 62.4592C6.14832 67.1256 5.03761 77.6899 17.6817 88.2187C30.3032 98.6505 40.45 95.4849 44.3232 90.8284L84.2024 42.7593C85.1728 41.5896 84.9913 39.6411 83.8216 38.6706L82.3318 37.4347L89.7285 28.519C90.6989 27.3493 90.5175 25.4008 89.3478 24.4303L67.0008 5.89077C65.7262 5.00526 63.6861 5.38589 62.9121 6.27151L62.9123 6.27167ZM65.5278 12.2143L83.4053 27.0459L77.8627 33.7268C72.1732 29.0263 66.2491 24.1114 59.9852 18.8951L65.5278 12.2143ZM52.5526 20.2747C61.8907 28.0612 69.6535 34.4964 77.8792 41.2862L39.8731 87.0975C38.878 88.2911 36.4375 90.1373 32.2764 89.4803C31.4798 84.5013 29.5592 80.4273 26.283 77.7093C23.0153 74.9983 18.6721 73.8562 13.6501 73.9883C12.2405 70.0384 13.5765 67.3445 14.5586 66.214C27.2182 50.9071 39.8878 35.5883 52.5529 20.2747L52.5526 20.2747ZM64.6052 31.5167C60.0757 33.5064 55.9735 34.9813 51.4428 36.9606L54.3293 39.3553L36.6784 60.6311L34.6837 56.972L43.5283 46.311C44.4308 46.1706 45.2871 45.7069 45.9147 44.9504C47.281 43.3035 47.0539 40.8651 45.4071 39.4988C43.7602 38.1325 41.3218 38.3596 39.9555 40.0065C39.3351 40.7543 39.0588 41.6795 39.0782 42.5798L29.3833 54.2658C28.3476 55.5141 27.9598 56.8283 28.7685 58.2753L32.6608 65.4737L29.3584 69.4543C28.47 69.6015 27.6311 70.0206 27.0106 70.7684C25.6443 72.4153 25.8714 74.8537 27.5183 76.22C29.1652 77.5863 31.6035 77.3592 32.9698 75.7123C33.5974 74.9558 33.8758 74.0519 33.8471 73.139C35.7716 70.8252 37.6903 68.5066 39.6021 66.2021L47.6629 68.8023C49.0115 69.2433 50.1869 68.6022 51.2225 67.3539L59.4491 57.4378L60.9389 58.6738L67.1188 51.2248L59.6698 45.0449L53.4899 52.4939L54.9797 53.7299L47.5831 62.6456L43.6185 61.3609L58.7975 43.0647L61.684 45.4593C62.7713 40.6433 63.4642 36.3204 64.604 31.5181L64.6052 31.5167ZM22.5748 82.1787C23.8812 83.2626 24.9243 84.7764 25.6714 86.8306C24.3394 86.0203 22.9252 85.019 21.3893 83.7497C19.8064 82.4365 18.5402 81.1797 17.4736 79.9902C19.6091 80.3471 21.277 81.102 22.5747 82.1786L22.5748 82.1787Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

1
testfrontend/src/lib.rs Normal file
View File

@ -0,0 +1 @@
slint::include_modules!();

View File

@ -0,0 +1,78 @@
import { DemoPalette, Page } from "./common.slint";
import { HomePage } from "./homepage.slint";
import { Button, VerticalBox, CheckBox, ComboBox, ListView, HorizontalBox, LineEdit } from "std-widgets.slint";
component ActionButton inherits Rectangle {
in property <image> icon <=> img.source;
in property <string> text <=> label.text;
callback clicked;
VerticalLayout {
spacing: 4px;
Rectangle {
border-radius: 25px;
border-width: 5px;
// border-color: DemoPalette.control-outline-color;
background: DemoPalette.printer-action-background-color;
img := Image {
x: (parent.width / 2) - (self.width / 2);
y: (parent.height / 2) - (self.height / 2);
colorize: DemoPalette.text-foreground-color;
}
}
label := Text {
font-size: DemoPalette.base-font-size * 1.375;
font-weight: 800;
horizontal-alignment: center;
color: DemoPalette.text-foreground-color;
}
}
TouchArea { clicked => { root.clicked() } }
}
export component DevicesPage inherits Page {
in-out property <length> header-row-height: 40px;
in-out property <length> button-spacing: 105px;
in-out property <length> button-width: 127px;
in-out property <length> button-height: root.button-width + 37px;
pure callback validate-date(string) -> bool;
// header: @tr("Slint Printer Demo");
private property <bool> message-visible;
in-out property <int> current-subpage: 0;
VerticalBox {
width: root.button-width;
height: root.button-height;
combo := ComboBox {
// row: 0;
model: ["/dev/device", "bluetooth"];
current-value: "bluetooth";
current-index: 0;
}
Button {
// row: 3;
text: "Connect";
clicked() => { root.message-visible = true; }
// enabled: combo.current-index != 1 ? root.validate-date(t1.text) : root.compare-date(t1.text, t2.text);
}
for action[idx] in [
{ name: @tr("Scan"), icon: @image-url("images/scan.svg") },
// { name: @tr("USB"), icon: @image-url("images/usb.svg") },
]: ActionButton {
width: root.button-width;
height: root.button-height;
icon: action.icon;
text: action.name;
clicked => { root.current-subpage = idx + 1; }
}
}
}