dialog: Use Object.assign() for default property value
Either Params.parse() or Object.assign() are more concise for providing default values in object literals (sadly default parameters won't work here). https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626
This commit is contained in:
parent
404bc34089
commit
7d2c5c1ac9
@ -180,10 +180,8 @@ var MessageDialogContent = GObject.registerClass({
|
|||||||
this._subtitle.clutter_text.set(textProps);
|
this._subtitle.clutter_text.set(textProps);
|
||||||
this._body.clutter_text.set(textProps);
|
this._body.clutter_text.set(textProps);
|
||||||
|
|
||||||
if (!params.hasOwnProperty('style_class'))
|
let defaultParams = { style_class: 'message-dialog-main-layout' };
|
||||||
params.style_class = 'message-dialog-main-layout';
|
super._init(Object.assign(defaultParams, params));
|
||||||
|
|
||||||
super._init(params);
|
|
||||||
|
|
||||||
this.messageBox = new St.BoxLayout({ style_class: 'message-dialog-content',
|
this.messageBox = new St.BoxLayout({ style_class: 'message-dialog-content',
|
||||||
x_expand: true,
|
x_expand: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user