Skip to content

Commit 9561b83

Browse files
Andrew ZaechAndrew Zaech
authored andcommitted
Whisker Menu - allow modifying session buttons in settings
1 parent 0a422fd commit 9561b83

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

menuWidgets.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,9 @@ var UserMenuItem = GObject.registerClass(class ArcMenu_UserMenuItem extends ArcM
17481748
let username = GLib.get_user_name();
17491749
this._user = AccountsService.UserManager.get_default().get_user(username);
17501750
this.iconBin = new St.Bin({
1751-
style_class: 'menu-user-avatar'
1751+
style_class: 'menu-user-avatar',
1752+
y_expand: true,
1753+
y_align: Clutter.ActorAlign.CENTER
17521754
});
17531755

17541756
this._userAvatarSize = userAvatarSize ? userAvatarSize : USER_AVATAR_SIZE;

menulayouts/whisker.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var createMenu = class extends BaseMenuLayout.BaseLayout{
4848
vertical: false
4949
});
5050

51-
this.actionsBox.style ="spacing: 10px; margin-right: 10px; padding-right: 0.4em;";
51+
this.actionsBox.style ="spacing: 6px; margin-right: 10px; padding-right: 0.4em;";
5252
this.mainBox.add(this.actionsBox);
5353

5454
let userAvatarSize = 32;
@@ -60,14 +60,22 @@ var createMenu = class extends BaseMenuLayout.BaseLayout{
6060
let settingsButton = new MW.SettingsButton(this);
6161
this.actionsBox.add(settingsButton.actor);
6262

63-
let userButton = new MW.UserButton(this);
64-
this.actionsBox.add(userButton.actor);
65-
66-
let lock = new MW.LockButton(this);
67-
this.actionsBox.add(lock.actor);
68-
69-
let logout = new MW.LogoutButton(this);
70-
this.actionsBox.add(logout.actor);
63+
if(this._settings.get_boolean('show-logout-button')){
64+
let logout = new MW.LogoutButton( this);
65+
this.actionsBox.add(logout.actor);
66+
}
67+
if(this._settings.get_boolean('show-lock-button')){
68+
let lock = new MW.LockButton( this);
69+
this.actionsBox.add(lock.actor);
70+
}
71+
if(this._settings.get_boolean('show-suspend-button')){
72+
let suspend = new MW.SuspendButton( this);
73+
this.actionsBox.add(suspend.actor);
74+
}
75+
if(this._settings.get_boolean('show-power-button')){
76+
let power = new MW.PowerButton( this);
77+
this.actionsBox.add(power.actor);
78+
}
7179

7280
this.searchBox = new MW.SearchBox(this);
7381
this._searchBoxChangedId = this.searchBox.connect('changed', this._onSearchBoxChanged.bind(this));

0 commit comments

Comments
 (0)