loginDialog: Allow right-clicking on button items

In a gdm session, we may not know what mouse orientation the user
may be in, so it makes sense to support both the left and right
mouse buttons to activate login or other items.

Additionally, add the behavior to all modal dialog items, even in
a user session, because it's unlikely that the user will right-click
on buttons, and it makes for an easier implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=688748
This commit is contained in:
Jasper St. Pierre 2013-01-11 14:05:17 -05:00
parent 758764ea75
commit a0d7d7bc4b
2 changed files with 5 additions and 0 deletions

View File

@ -128,6 +128,7 @@ const UserListItem = new Lang.Class({
let layout = new St.BoxLayout({ vertical: false }); let layout = new St.BoxLayout({ vertical: false });
this.actor = new St.Button({ style_class: 'login-dialog-user-list-item', this.actor = new St.Button({ style_class: 'login-dialog-user-list-item',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
can_focus: true, can_focus: true,
child: layout, child: layout,
reactive: true, reactive: true,
@ -492,6 +493,7 @@ const SessionListItem = new Lang.Class({
this.id = id; this.id = id;
this.actor = new St.Button({ style_class: 'login-dialog-session-list-item', this.actor = new St.Button({ style_class: 'login-dialog-session-list-item',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
can_focus: true, can_focus: true,
reactive: true, reactive: true,
x_fill: true, x_fill: true,
@ -552,6 +554,7 @@ const SessionList = new Lang.Class({
this.actor.child = this._box; this.actor.child = this._box;
this._button = new St.Button({ style_class: 'login-dialog-session-list-button', this._button = new St.Button({ style_class: 'login-dialog-session-list-button',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
can_focus: true, can_focus: true,
x_fill: true, x_fill: true,
y_fill: true }); y_fill: true });
@ -787,6 +790,7 @@ const LoginDialog = new Lang.Class({
let notListedLabel = new St.Label({ text: _("Not listed?"), let notListedLabel = new St.Label({ text: _("Not listed?"),
style_class: 'login-dialog-not-listed-label' }); style_class: 'login-dialog-not-listed-label' });
this._notListedButton = new St.Button({ style_class: 'login-dialog-not-listed-button', this._notListedButton = new St.Button({ style_class: 'login-dialog-not-listed-button',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
can_focus: true, can_focus: true,
child: notListedLabel, child: notListedLabel,
reactive: true, reactive: true,

View File

@ -157,6 +157,7 @@ const ModalDialog = new Lang.Class({
keys = []; keys = [];
let button = new St.Button({ style_class: 'modal-dialog-button', let button = new St.Button({ style_class: 'modal-dialog-button',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
reactive: true, reactive: true,
can_focus: true, can_focus: true,
label: label }); label: label });