loginDialog: fix up cancel button visibility

This commit makes sure we hide when there's nothing to cancel
to and show it when there's something to cancel to.

https://bugzilla.gnome.org/show_bug.cgi?id=683437
This commit is contained in:
Ray Strode 2013-07-28 20:55:12 -04:00
parent f38d5a9c06
commit 43357a1b69

View File

@ -475,7 +475,12 @@ const LoginDialog = new Lang.Class({
x_align: St.Align.START, x_align: St.Align.START,
x_fill: true }); x_fill: true });
this._notListedButton.connect('clicked', Lang.bind(this, this._hideUserListAndLogIn)); this._notListedButton.connect('clicked',
Lang.bind(this, function() {
this._authPrompt.cancelButton.show();
this._hideUserListAndLogIn();
}));
this._notListedButton.hide(); this._notListedButton.hide();
this._userSelectionBox.add(this._notListedButton, this._userSelectionBox.add(this._notListedButton,
@ -569,9 +574,6 @@ const LoginDialog = new Lang.Class({
if (this._shouldShowSessionMenuButton()) if (this._shouldShowSessionMenuButton())
this._authPrompt.setActorInDefaultButtonWell(this._sessionMenuButton.actor); this._authPrompt.setActorInDefaultButtonWell(this._sessionMenuButton.actor);
this._authPrompt.cancelButton.show();
this._showPrompt(); this._showPrompt();
}, },
@ -583,10 +585,12 @@ const LoginDialog = new Lang.Class({
this._user = null; this._user = null;
if (this._disableUserList) if (this._disableUserList) {
this._authPrompt.cancelButton.hide();
this._hideUserListAndLogIn(); this._hideUserListAndLogIn();
else } else {
this._showUserList(); this._showUserList();
}
}, },
_onDefaultSessionChanged: function(client, sessionId) { _onDefaultSessionChanged: function(client, sessionId) {
@ -645,13 +649,13 @@ const LoginDialog = new Lang.Class({
this._authPrompt.updateSensitivity(false); this._authPrompt.updateSensitivity(false);
let answer = this._authPrompt.getAnswer(); let answer = this._authPrompt.getAnswer();
this._authPrompt.clear(); this._authPrompt.clear();
this._authPrompt.cancelButton.show();
this._authPrompt.startSpinning(); this._authPrompt.startSpinning();
this._authPrompt.begin({ userName: answer }); this._authPrompt.begin({ userName: answer });
realmManager.disconnect(realmSignalId) realmManager.disconnect(realmSignalId)
realmManager.release(); realmManager.release();
})); }));
this._authPrompt.cancelButton.hide();
this._showPrompt(); this._showPrompt();
}, },
@ -823,6 +827,7 @@ const LoginDialog = new Lang.Class({
_showUserList: function() { _showUserList: function() {
this._authPrompt.hide(); this._authPrompt.hide();
this._sessionMenuButton.close(); this._sessionMenuButton.close();
this._authPrompt.cancelButton.show();
this._setUserListExpanded(true); this._setUserListExpanded(true);
this._notListedButton.show(); this._notListedButton.show();
this._userList.actor.grab_key_focus(); this._userList.actor.grab_key_focus();