import { InterFont } from "@kit-fonts/inter.slint";
// SPDX-License-Identifier: GPL-3.0-or-later
import { KitDropdownMenu, KitTheme, KitThemes } from "@kit";

export component Example inherits Window {
    default-font-family: InterFont.family;
    title: "Exemple KitDropdownMenu";
    preferred-width: 480px;
    preferred-height: 320px;
    max-width: 100000px;
    max-height: 100000px;
    background: root.theme.canvas;
    in-out property <KitTheme> theme: KitThemes.light;
    in-out property <string> status: "Aucune action";
    VerticalLayout {
        padding: 24px;
        spacing: 12px;
        alignment: start;
        KitDropdownMenu {
            theme: root.theme;
            text: "Actions";
            options: [{ token: 11, generation: 1, label: "Renommer", description: "Changer le nom du projet", disabled: false }, { token: 23, generation: 1, label: "Dupliquer", description: "Copier le projet", disabled: false }, { token: 38, generation: 1, label: "Archiver", description: "Sortir de la liste", disabled: false }];
            chosen(row) => { root.status = "Choisi : " + row.label; }
        }
        Text { text: root.status; color: root.theme.text-secondary; font-size: 12px * root.theme.text-scale; }
    }
}
