ModalDialog: add 'default' pseudo-class to default button
Add 'default' parameter to setButtons, that controls the binding of Return (unless overridden) and applies the 'default' pseudo-class. Currently it has no effect, but it will start having after the login dialog redesign. https://bugzilla.gnome.org/show_bug.cgi?id=619955
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user