using Gtk 4.0;
using Adw 1;

template game : Box {
  orientation: vertical;
  halign: center;
  valign: start;

  Adw.Clamp {
    maximum-size: 200;
    Box {
      orientation: vertical;
      Button cover_button {
        overflow: hidden;
        Picture cover {
          width-request: 200;
          height-request: 300;
          hexpand: true;
          vexpand: true;
        }

        styles [
          "card",
          "flat",
        ]
      }
      Overlay overlay {
        [overlay]
        Revealer play_revealer {
          reveal-child: false;
          transition-type: crossfade;
          Box {
            Button button_play {
              halign: start;
              margin-start: 6;
              margin-end: 6;
              margin-top: 6;
              margin-bottom: 6;
            }
            MenuButton menu_button {
              icon-name: "view-more-symbolic";
              margin-top: 6;
              margin-bottom: 6;
              margin-end: 6;
              margin-start: 6;
              hexpand: true;
              halign: end;

              styles [
                "flat",
              ]
            }
          }
        }
        Revealer title_revealer {
          transition-type: slide_down;
          reveal-child: true;
          valign: start;
          Label title {
            label: _("Title");
            ellipsize: end;
            hexpand: true;
            halign: start;
            margin-top: 14;
            margin-bottom: 14;
            margin-start: 12;
            margin-end: 12;
          }
        }
      }
    }
  }

  styles [
    "card",
  ]
}

menu game_options {
  section {
    item {
      label: _("Edit");
      action: "app.edit_details";
    }

    item {
      label: _("Hide");
      action: "app.hide_game";
    }

    item {
      label: _("Remove");
      action: "app.remove_game";
    }
  }
}

menu hidden_game_options {
  section {
    item {
      label: _("Edit");
      action: "app.edit_details";
    }

    item {
      label: _("Unhide");
      action: "app.hide_game";
    }

    item {
      label: _("Remove");
      action: "app.remove_game";
    }
  }
}
