Skip to content

Commit

Permalink
Wrap SM Dialog into registerClass.
Browse files Browse the repository at this point in the history
Closes #551.
  • Loading branch information
ettavolt committed Apr 24, 2021
1 parent 8e54938 commit 25fb5f5
Showing 1 changed file with 41 additions and 40 deletions.
81 changes: 41 additions & 40 deletions [email protected]/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,46 +299,47 @@ const smStyleManager = class SystemMonitor_smStyleManager {
}
}

const smDialog = class SystemMonitor_smDialog extends ModalDialog.ModalDialog {
constructor() {
super({styleClass: 'prompt-dialog'});
let mainContentBox = new St.BoxLayout({style_class: 'prompt-dialog-main-layout',
vertical: false});
this.contentLayout.add(mainContentBox,
{x_fill: true,
y_fill: true});

let messageBox = new St.BoxLayout({style_class: 'prompt-dialog-message-layout',
vertical: true});
mainContentBox.add(messageBox,
{y_align: St.Align.START});

this._subjectLabel = new St.Label({style_class: 'prompt-dialog-headline',
text: _('System Monitor Extension')});

messageBox.add(this._subjectLabel,
{y_fill: false,
y_align: St.Align.START});

this._descriptionLabel = new St.Label({style_class: 'prompt-dialog-description',
text: MESSAGE});

messageBox.add(this._descriptionLabel,
{y_fill: true,
y_align: St.Align.START});


this.setButtons([
{
label: _('Cancel'),
action: () => {
this.close();
},
key: Clutter.Escape
}
]);
}
}
const smDialog = GObject.registerClass(
class SystemMonitor_smDialog extends ModalDialog.ModalDialog {
constructor() {
super({styleClass: 'prompt-dialog'});
let mainContentBox = new St.BoxLayout({style_class: 'prompt-dialog-main-layout',
vertical: false});
this.contentLayout.add(mainContentBox,
{x_fill: true,
y_fill: true});

let messageBox = new St.BoxLayout({style_class: 'prompt-dialog-message-layout',
vertical: true});
mainContentBox.add(messageBox,
{y_align: St.Align.START});

this._subjectLabel = new St.Label({style_class: 'prompt-dialog-headline',
text: _('System Monitor Extension')});

messageBox.add(this._subjectLabel,
{y_fill: false,
y_align: St.Align.START});

this._descriptionLabel = new St.Label({style_class: 'prompt-dialog-description',
text: MESSAGE});

messageBox.add(this._descriptionLabel,
{y_fill: true,
y_align: St.Align.START});


this.setButtons([
{
label: _('Cancel'),
action: () => {
this.close();
},
key: Clutter.Escape
}
]);
}
});

const Chart = class SystemMonitor_Chart {
constructor(width, height, parent) {
Expand Down

0 comments on commit 25fb5f5

Please sign in to comment.