[gnome-shell] loginDialog: Allow right-clicking on button items



commit a0d7d7bc4b2cec15273a5e3f41914d8651dbb270
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Jan 11 14:05:17 2013 -0500

    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

 js/gdm/loginDialog.js |    4 ++++
 js/ui/modalDialog.js  |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 6bdd9af..31c04eb 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -128,6 +128,7 @@ const UserListItem = new Lang.Class({
 
         let layout = new St.BoxLayout({ vertical: false });
         this.actor = new St.Button({ style_class: 'login-dialog-user-list-item',
+                                     button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
                                      can_focus: true,
                                      child: layout,
                                      reactive: true,
@@ -492,6 +493,7 @@ const SessionListItem = new Lang.Class({
         this.id = id;
 
         this.actor = new St.Button({ style_class: 'login-dialog-session-list-item',
+                                     button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
                                      can_focus: true,
                                      reactive: true,
                                      x_fill: true,
@@ -552,6 +554,7 @@ const SessionList = new Lang.Class({
         this.actor.child = this._box;
 
         this._button = new St.Button({ style_class: 'login-dialog-session-list-button',
+                                       button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
                                        can_focus: true,
                                        x_fill: true,
                                        y_fill: true });
@@ -787,6 +790,7 @@ const LoginDialog = new Lang.Class({
         let notListedLabel = new St.Label({ text: _("Not listed?"),
                                             style_class: 'login-dialog-not-listed-label' });
         this._notListedButton = new St.Button({ style_class: 'login-dialog-not-listed-button',
+                                                button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
                                                 can_focus: true,
                                                 child: notListedLabel,
                                                 reactive: true,
diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js
index ac74afd..78e36dc 100644
--- a/js/ui/modalDialog.js
+++ b/js/ui/modalDialog.js
@@ -157,6 +157,7 @@ const ModalDialog = new Lang.Class({
             keys = [];
 
         let button = new St.Button({ style_class: 'modal-dialog-button',
+                                     button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
                                      reactive:    true,
                                      can_focus:   true,
                                      label:       label });



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]