using Gtk 4.0;
using Adw 1;

Adw.Window _root {
  default-width: 400;
  modal: true;
  resizable: false;
  
  content: Adw.ToolbarView {
    [top]
    Adw.HeaderBar {
      title-widget: Gtk.Label {};
    }

    Gtk.WindowHandle {
      Gtk.Box {
        orientation: vertical;
        spacing: 24;

        Gtk.Label _titleLabel {
          styles ["title-2"]
        }

        Adw.PreferencesGroup {
          margin-start: 24;
          margin-end: 24;

          Adw.PasswordEntryRow _newPasswordEntry {
            title: _("New Password");
            activates-default: true;
          }

          Adw.PasswordEntryRow _confirmPasswordEntry {
            title: _("Confirm Password");
            activates-default: true;
          }
        }

        Gtk.Button _addButton {
          halign: center;
          valign: center;
          margin-top: 24;
          margin-bottom: 24;
          label: _("Add");

          styles ["pill", "suggested-action"]
        }
      }
    }
  };
  
  Gtk.ShortcutController {
    Gtk.Shortcut {
      trigger: "Escape";
      action: "action(window.close)";
    }
  }

  default-widget: _addButton;
}