Skip to content

Commit

Permalink
Merge pull request #410 from corecoding/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
corecoding authored Feb 23, 2024
2 parents 664b7ad + 51b55dd commit 1224212
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var VitalsMenuButton = GObject.registerClass({
});

this._drawMenu();
this.add_actor(this._menuLayout);
this.add_child(this._menuLayout);
this._settingChangedSignals = [];
this._refreshTimeoutId = null;

Expand Down Expand Up @@ -140,26 +140,26 @@ var VitalsMenuButton = GObject.registerClass({
// refresh sensors now
this._querySensors();
});
customButtonBox.add_actor(refreshButton);
customButtonBox.add_child(refreshButton);

// custom round monitor button
let monitorButton = this._createRoundButton('org.gnome.SystemMonitor-symbolic', _('System Monitor'));
monitorButton.connect('clicked', (self) => {
this.menu._getTopMenu().close();
Util.spawn(this._settings.get_string('monitor-cmd').split(" "));
});
customButtonBox.add_actor(monitorButton);
customButtonBox.add_child(monitorButton);

// custom round preferences button
let prefsButton = this._createRoundButton('preferences-system-symbolic', _('Preferences'));
prefsButton.connect('clicked', (self) => {
this.menu._getTopMenu().close();
this._extensionObject.openPreferences();
});
customButtonBox.add_actor(prefsButton);
customButtonBox.add_child(prefsButton);

// now add the buttons to the top bar
item.actor.add_actor(customButtonBox);
item.actor.add_child(customButtonBox);

// add buttons
this.menu.addMenuItem(item);
Expand Down Expand Up @@ -254,7 +254,7 @@ var VitalsMenuButton = GObject.registerClass({
_createHotItem(key, value) {
let icon = this._defaultIcon(key);
this._hotIcons[key] = icon;
this._menuLayout.add_actor(icon)
this._menuLayout.add_child(icon)

// don't add a label when no sensors are in the panel
if (key == '_default_icon_') return;
Expand All @@ -273,7 +273,7 @@ var VitalsMenuButton = GObject.registerClass({
this._hotLabels[key] = label;

// prevent "called on the widget" "which is not in the stage" errors by adding before width below
this._menuLayout.add_actor(label);
this._menuLayout.add_child(label);

// support for fixed widths #55, save label (text) width
this._widths[key] = label.width;
Expand Down
6 changes: 3 additions & 3 deletions menuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ export const MenuItem = GObject.registerClass({
this._gIcon = icon;

// add icon
this.add(new St.Icon({ style_class: 'popup-menu-icon', gicon : this._gIcon }));
this.add_child(new St.Icon({ style_class: 'popup-menu-icon', gicon : this._gIcon }));

// add label
this._labelActor = new St.Label({ text: label });
this.add(this._labelActor);
this.add_child(this._labelActor);

// add value
this._valueLabel = new St.Label({ text: value });
this._valueLabel.set_x_align(Clutter.ActorAlign.END);
this._valueLabel.set_x_expand(true);
this._valueLabel.set_y_expand(true);
this.add(this._valueLabel);
this.add_child(this._valueLabel);

this.actor._delegate = this;
}
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Vitals",
"settings-schema": "org.gnome.shell.extensions.vitals",
"shell-version": [
"45"
"45", "46"
],
"url": "https://github.com/corecoding/Vitals",
"uuid": "[email protected]",
Expand Down

0 comments on commit 1224212

Please sign in to comment.