🏡 index : quine-global/bazaar.git

using Gtk 4.0;
using Adw 1;

template $BzRemotesDialog: $BzDialog {
  title: _("Remotes");
  content-width: 640;
  width-request: 360;
  height-request: 294;

  Adw.Breakpoint {
    condition ("max-width: 500sp")
    apply => $on_breakpoint_changed();
    unapply => $on_breakpoint_changed();

    setters {
      list_box.margin-start: 12;
      list_box.margin-end: 12;
      list_box.margin-bottom: 12;
    }
  }

  child: Adw.NavigationView navigation_view {
    Adw.NavigationPage {
      title: _("Remotes");
      tag: "list";

      child: Adw.ToolbarView {
        [top]
        Adw.HeaderBar {}

        content: ScrolledWindow {
          hscrollbar-policy: never;
          propagate-natural-height: true;

          child: Adw.Clamp {
            maximum-size: 600;
            tightening-threshold: 400;

            child: Box list_box {
              orientation: vertical;
              spacing: 24;
              margin-top: 24;
              margin-bottom: 48;
              margin-start: 24;
              margin-end: 24;

              Adw.PreferencesGroup system_group {
                visible: false;
                title: _("System Installation");
                description: _("Available to all users on this computer");
              }

              Adw.PreferencesGroup user_group {
                visible: false;
                title: _("User Installation");
                description: _("Only available to you");
              }
            };
          };
        };
      };
    }

    Adw.NavigationPage {
      title: _("Remove Remote");
      tag: "confirm";

      child: Adw.ToolbarView {
        [top]
        Adw.HeaderBar {
          show-title: false;
        }

        content: ScrolledWindow {
          hscrollbar-policy: never;
          propagate-natural-height: true;
          vexpand: true;

          child: Adw.Clamp {
            maximum-size: 582;

            child: Box {
              orientation: vertical;
              spacing: 32;
              margin-top: 12;
              margin-start: 12;
              margin-end: 12;

              Box {
                orientation: vertical;
                spacing: 12;

                Label confirm_title {
                  wrap: true;
                  justify: center;
                  margin-top: 8;

                  styles [
                    "title-1",
                  ]
                }

                Label confirm_body {
                  wrap: true;
                  justify: center;
                  max-width-chars: 48;
                }
              }

              Adw.PreferencesGroup apps_group {
                Box apps_box {
                  orientation: vertical;
                  spacing: 10;
                  margin-bottom: 5;
                }
              }
            };
          };
        };

        [bottom]
        Button {
          label: _("_Remove");
          use-underline: true;
          halign: center;
          margin-top: 12;
          margin-bottom: 12;
          clicked => $on_confirm_clicked();

          styles [
            "destructive-action",
            "pill",
          ]
        }
      };
    }
  };
}