diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index 7fb8aeefd..33307dd8a 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -998,7 +998,8 @@ const LoginDialog = new Lang.Class({ { action: Lang.bind(this, function() { hold.release(); }), - label: C_("button", "Sign In") }]; + label: C_("button", "Sign In"), + default: true }]; this._promptEntryActivateCallbackId = this._promptEntry.clutter_text.connect('activate', Lang.bind(this, function() { diff --git a/js/ui/extensionDownloader.js b/js/ui/extensionDownloader.js index 83f8a36fc..72e1177e8 100644 --- a/js/ui/extensionDownloader.js +++ b/js/ui/extensionDownloader.js @@ -197,7 +197,8 @@ const InstallExtensionDialog = new Lang.Class({ key: Clutter.Escape }, { label: _("Install"), - action: Lang.bind(this, this._onInstallButtonPressed) + action: Lang.bind(this, this._onInstallButtonPressed), + default: true }]); let message = _("Download and install '%s' from extensions.gnome.org?").format(info.name); diff --git a/js/ui/keyringPrompt.js b/js/ui/keyringPrompt.js index 91163263c..da26d2a82 100644 --- a/js/ui/keyringPrompt.js +++ b/js/ui/keyringPrompt.js @@ -65,7 +65,8 @@ const KeyringDialog = new Lang.Class({ key: Clutter.Escape }, { label: '', - action: Lang.bind(this, this._onContinueButton) + action: Lang.bind(this, this._onContinueButton), + default: true }] this.setButtons(buttons); diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js index e30b70596..bdeee7352 100644 --- a/js/ui/modalDialog.js +++ b/js/ui/modalDialog.js @@ -119,11 +119,17 @@ const ModalDialog = new Lang.Class({ let label = buttonInfo['label']; let action = buttonInfo['action']; let key = buttonInfo['key']; + let isDefault = buttonInfo['default']; + + if (isDefault && !key) + key = Clutter.KEY_Return; buttonInfo.button = new St.Button({ style_class: 'modal-dialog-button', reactive: true, can_focus: true, label: label }); + if (isDefault) + buttonInfo.button.add_style_pseudo_class('default'); let x_alignment; if (buttons.length == 1) diff --git a/js/ui/networkAgent.js b/js/ui/networkAgent.js index 0615a908b..8435a0950 100644 --- a/js/ui/networkAgent.js +++ b/js/ui/networkAgent.js @@ -147,7 +147,7 @@ const NetworkSecretDialog = new Lang.Class({ this._okButton = { label: _("Connect"), action: Lang.bind(this, this._onOk), - key: Clutter.KEY_Return, + default: true }; this.setButtons([{ label: _("Cancel"), diff --git a/js/ui/polkitAuthenticationAgent.js b/js/ui/polkitAuthenticationAgent.js index 152c11f6d..982b0f8c7 100644 --- a/js/ui/polkitAuthenticationAgent.js +++ b/js/ui/polkitAuthenticationAgent.js @@ -178,7 +178,8 @@ const AuthenticationDialog = new Lang.Class({ key: Clutter.Escape }, { label: _("Authenticate"), - action: Lang.bind(this, this._onAuthenticateButtonPressed) + action: Lang.bind(this, this._onAuthenticateButtonPressed), + default: true }]); this._doneEmitted = false; diff --git a/js/ui/shellMountOperation.js b/js/ui/shellMountOperation.js index f524a1322..a8f706478 100644 --- a/js/ui/shellMountOperation.js +++ b/js/ui/shellMountOperation.js @@ -398,7 +398,8 @@ const ShellMountPasswordDialog = new Lang.Class({ key: Clutter.Escape }, { label: _("Unlock"), - action: Lang.bind(this, this._onUnlockButton) + action: Lang.bind(this, this._onUnlockButton), + default: true }]; this.setButtons(buttons);