acid/firmware/acid-firmware/ui/login-view.slint

39 lines
1 KiB
Plaintext
Raw Normal View History

import { ComboBox, LineEdit } from "std-widgets.slint";
import { Style } from "globals.slint";
import { IconButton } from "widgets/icon-button.slint";
export component LoginView inherits VerticalLayout {
padding: Style.spacing;
spacing: Style.spacing;
callback pw_accepted(string, string);
Rectangle { }
HorizontalLayout {
spacing: Style.spacing;
IconButton {
icon: @image-url("images/users.svg");
}
combo_box_username := ComboBox {
model: ["first", "second"];
}
line_edit_user_pw := LineEdit {
input-type: InputType.password;
placeholder-text: "Password";
accepted(text) => {
root.pw_accepted(combo_box_username.current-value, text);
}
}
IconButton {
icon: @image-url("images/log-in.svg");
clicked => {
root.pw_accepted(combo_box_username.current-value, line_edit_user_pw.text);
}
}
}
Rectangle { }
}