Skip to content

Commit

Permalink
power applet: Apply the proper class name to the active profile
Browse files Browse the repository at this point in the history
  • Loading branch information
clefebvre committed Jan 7, 2025
1 parent d220706 commit 3773ac1
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions files/usr/share/cinnamon/applets/[email protected]/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,22 +624,18 @@ class CinnamonPowerApplet extends Applet.TextIconApplet {

for (let profileNum = 0; profileNum < this.Profiles.length; profileNum++) {
let profileName = this.Profiles[profileNum].Profile.unpack();
let activeItem;
let item;
if (profileName == this.ActiveProfile) {
activeItem = true;
this.profileIndex = profileNum;
item = new PopupMenu.PopupMenuItem(POWER_PROFILES[profileName], { style_class: 'popup-device-menu-item', reactive: false });
item.setShowDot(true);
} else {
activeItem = false;
}

let item = new PopupMenu.PopupMenuItem(POWER_PROFILES[profileName], { reactive: !activeItem });
item.setShowDot(activeItem);
if (!activeItem)
item = new PopupMenu.PopupMenuItem(POWER_PROFILES[profileName]);
item.connect("activate", Lang.bind(this, function () {
this._changeProfile(profileName);
this.menu.toggle();
}));

}
this.contentSection.addMenuItem(item);
}

Expand Down

0 comments on commit 3773ac1

Please sign in to comment.