using Gtk 4.0;
using Adw 1;

template $GradiaWelcomePage: Adw.BreakpointBin {
  width-request: 360;
  height-request: 150;

  Adw.Breakpoint {
    condition ("max-width: 600sp")

    setters {
      recent_picker.compact: true;
      button_box.orientation: vertical;
    }
  }

  child: $DropOverlay drop_overlay {
    title: _("Drop Image Here");

    child-widget: Adw.ToolbarView {
      top-bar-style: flat;

      [top]
      Adw.HeaderBar headerbar {
        [end]
        Gtk.MenuButton about_menu_button {
          icon-name: "open-menu-symbolic";
          tooltip-text: _("Main Menu");
          menu-model: app_menu;
          primary: true;
        }

        [end]
        Gtk.Button {
          icon-name: "code-symbolic";
          tooltip-text: _("Source Snippets");
          action-name: "win.create-source-image";
        }
      }

      content: Adw.StatusPage status_page {
        title: _("Enhance an Image");
        description: _("Drag and drop one here");

        child: Gtk.Box main_box {
          orientation: vertical;
          spacing: 24;
          halign: center;

          $GradiaRecentPicker recent_picker {
            compact: false;
          }

          Gtk.Box button_box {
            orientation: horizontal;
            spacing: 12;
            margin-top: 10;
            halign: center;

            Gtk.Button screenshot_button {
              label: _("Take a Screenshot…");
              use-underline: true;
              halign: center;
              action-name: "win.screenshot";

              styles [
                "pill",
                "text-button",
                "suggested-action",
              ]
            }

            Gtk.Button open_image_button {
              label: _("Open Image…");
              use-underline: true;
              halign: center;
              action-name: "win.open";

              styles [
                "pill",
                "text-button",
              ]
            }
          }
        };
      };
    };
  };
}

menu app_menu {
  section {
    item {
      label: _("_Preferences");
      action: "win.preferences";
    }

    item {
      label: _("_Keyboard Shortcuts");
      action: "win.shortcuts";
    }

    item {
      label: _("_D_onate to Gradia");
      action: "win.donate";
    }

    item {
      label: _("_About Gradia");
      action: "win.about";
    }
  }
}

