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:
Florian Müllner 2019-06-30 01:03:46 +02:00 committed by Georges Basile Stavracas Neto
parent 404bc34089
commit 7d2c5c1ac9

View File

@ -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,