using Gtk 4.0;
using Adw 1;

template $DataBox : ListBox {
    selection-mode: none;
    styles ["boxed-list"]
    Adw.ActionRow row {
        activatable: bind check_button.visible;
        width-request: 275;
        [child]
        Box root_box {
            orientation: vertical;
            Box title_box {
                margin-top: 12;
                margin-bottom: 12;
                Image image {
                    margin-start: 12;
                    margin-end: 12;
                    icon-name: "application-x-executable-symbolic";
                    icon-size: large;
                }
                Box label_box {
                    orientation: vertical;
                    Label title_label {
                        label: "No Title Set";
                        hexpand: true;
                        halign: start;
                        ellipsize: middle;
                        margin-end: 12;
                        styles ["title-4"]
                    }
                    Label subtitle_label {
                        label: "No subtitle set";
                        // hexpand: true;
                        halign: start;
                        ellipsize: middle;
                        margin-end: 12;
                    }
                }
            }
            Box content_box {
                spacing: 6;
                margin-start: 12;
                margin-end: 6;
                margin-bottom: 6;
                Spinner spinner {
                    spinning: true;
                }
                Label size_label {
                    label: "No size set";
                    halign: start;
                    hexpand: true;
                }
                Button copy_button {
                    icon-name: "copy-symbolic";
                    tooltip-text: _("Copy Path");
                    visible: bind check_button.visible inverted;
                    styles ["flat", "circular"]
                }
                Button open_button {
                    icon-name: "folder-open-symbolic";
                    tooltip-text: _("Open User Data");
                    visible: bind check_button.visible inverted;
                    styles ["flat", "circular"]
                }
                Button install_button {
                    icon-name: "arrow-pointing-at-line-down-symbolic";
                    tooltip-text: _("Attempt to Install");
                    visible: bind check_button.visible inverted;
                    styles ["flat", "circular"]
                }
                Button trash_button {
                    icon-name: "user-trash-symbolic";
                    tooltip-text: _("Trash User Data");
                    visible: bind check_button.visible inverted;
                    styles ["flat", "circular"]
                }
                CheckButton check_button {
                    visible: false;
                    sensitive: bind check_button.visible;
                    styles ["selection-mode"]
                }
            }
        }
    }
}
