49 lines
1.5 KiB
Plaintext
49 lines
1.5 KiB
Plaintext
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;
|
|
in property <[string]> usernames <=> combo_box_username.model;
|
|
callback users_clicked();
|
|
callback pw_accepted(int, string, string);
|
|
callback test_string_accepted <=> line_edit_test.accepted;
|
|
Rectangle { }
|
|
|
|
HorizontalLayout {
|
|
spacing: Style.spacing;
|
|
IconButton {
|
|
icon: @image-url("images/users.svg");
|
|
clicked => {
|
|
users_clicked();
|
|
}
|
|
}
|
|
|
|
combo_box_username := ComboBox { }
|
|
|
|
line_edit_user_pw := LineEdit {
|
|
input-type: InputType.password;
|
|
placeholder-text: "Password";
|
|
accepted(text) => {
|
|
root.pw_accepted(combo_box_username.current-index, combo_box_username.current-value, text);
|
|
line_edit_user_pw.text = "";
|
|
}
|
|
}
|
|
|
|
IconButton {
|
|
icon: @image-url("images/log-in.svg");
|
|
clicked => {
|
|
root.pw_accepted(combo_box_username.current-index, combo_box_username.current-value, line_edit_user_pw.text);
|
|
line_edit_user_pw.text = "";
|
|
}
|
|
}
|
|
}
|
|
|
|
line_edit_test := LineEdit {
|
|
placeholder-text: "Text to send to host.";
|
|
}
|
|
|
|
Rectangle { }
|
|
}
|