rsaber_lib 0.7.0

Beat Saber clone written in Rust
import { Const } from "Const.slint";
import { WindowBase } from "WindowBase.slint";

export component GameStatsWindow inherits WindowBase {
    default-font-family: Const.default-font-family;
    default-font-size: Const.default-font-size;
    background: Const.border-color;

    in property<int> note_count;
    in property<int> note_total;
    in property<int> bomb_count;
    in property<int> bomb_total;

    VerticalLayout {
        Text {
            text: "Stats";
            horizontal-alignment: center;
            vertical-alignment: center;
            color: Const.title-color;
            height: Const.title-height;
        }

        rect := Rectangle {
            background: Const.content-background;
            border-color: Const.border-color;
            border-width: Const.border-width;
            border-radius: 2 * Const.border-width;

            VerticalLayout {
                width: rect.width - 2 * rect.border-width;
                height: rect.height - 2 * rect.border-width;
                alignment: center;
                cross-axis-alignment: center;

                Text {
                    text: "Note hits: \{root.note_count}/\{root.note_total}";
                }

                Text {
                    text: "Bomb hits: \{root.bomb_count}/\{root.bomb_total}";
                }
            }
        }
    }
}