• 1 Post
  • 2 Comments
Joined 1 year ago
cake
Cake day: December 5th, 2023

help-circle

  • Yeah sure. Well slint is a whole ui library and so you can customize basically anything. You could add extra text, move the clock and the password prompt wherever you want. You could even remove the password prompt and replace it by something else. Here’s the config of the screenshot above:

    import { LineEdit , TextEdit} from "std-widgets.slint";
    export component HelloWorld {
        in property clock_text;
        in property checking_password;
        in-out property password <=> password.text;
        callback submit <=> password.accepted;
        forward-focus: password;
        states [
            checking when checking-password : {
                password.enabled: false;
            }
        ]
    
        Image {
            width: parent.width;
            height: parent.height;
            source: @image-url("wallpaper.png");
            HorizontalLayout {
                VerticalLayout {
                    alignment: end;
                    spacing: 10px;
                    padding: 40px;
                    width: 350px;
                    Text {
                        text: clock_text;
                        horizontal-alignment: center;
                        font-size: 60pt;
                        color: white;
                    }
                    password := LineEdit {
                        enabled: true;
                        horizontal-alignment: left;
                        input-type: InputType.password;
                        placeholder-text: "password...";
                    }
                }
            }
        }
    }