Skip to content

Commit 19a7284

Browse files
committed
Add option to disable notification badges
1 parent 494c829 commit 19a7284

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

files/usr/share/cinnamon/applets/[email protected]/appGroup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ class AppGroup {
480480
}
481481

482482
updateBadgesTextSize() {
483-
const badgeTextSize = Math.round(this.iconBox.width / 2.5 / global.ui_scale);
483+
const badgeTextSize = Math.round(Math.min(this.iconBox.width, this.iconBox.height) / 2.5 / global.ui_scale);
484484
const badgePadding = Math.round(badgeTextSize / 4);
485485
const sizeStyle = `font-size: ${badgeTextSize}px; padding-left: ${badgePadding}px; padding-right: ${badgePadding}px;`;
486486
this.windowsBadgeLabel.set_style(sizeStyle);
@@ -1126,7 +1126,7 @@ class AppGroup {
11261126
}
11271127

11281128
updateNotificationsBadge() {
1129-
if (this.notifications.length > 0) {
1129+
if (this.notifications.length > 0 && this.state.settings.enableNotificationBadges) {
11301130
this.notificationsBadgeLabel.text = this.notifications.length.toString();
11311131
this.notificationsBadge.show();
11321132
} else {

files/usr/share/cinnamon/applets/[email protected]/applet.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ class GroupedWindowListApplet extends Applet.Applet {
310310
{key: 'super-num-hotkeys', value: 'SuperNumHotkeys', cb: this.bindAppKeys},
311311
{key: 'title-display', value: 'titleDisplay', cb: this.updateTitleDisplay},
312312
{key: 'launcher-animation-effect', value: 'launcherAnimationEffect', cb: null},
313+
{key: 'enable-notification-badges', value: 'enableNotificationBadges', cb: this.onEnableNotificationsChange},
313314
{key: 'enable-app-button-dragging', value: 'enableDragging', cb: this.draggableSettingChanged},
314315
{key: 'thumbnail-scroll-behavior', value: 'thumbnailScrollBehavior', cb: null},
315316
{key: 'show-thumbnails', value: 'showThumbs', cb: this.updateVerticalThumbnailState},
@@ -1095,6 +1096,16 @@ class GroupedWindowListApplet extends Applet.Applet {
10951096
});
10961097
});
10971098
}
1099+
1100+
onEnableNotificationsChange() {
1101+
this.workspaces.forEach(workspace => {
1102+
if (!workspace) return;
1103+
workspace.appGroups.forEach(appGroup => {
1104+
if (!appGroup || !appGroup.groupState || appGroup.groupState.willUnmount) return;
1105+
appGroup.updateNotificationsBadge();
1106+
});
1107+
});
1108+
}
10981109
}
10991110

11001111
function main(metadata, orientation, panel_height, instance_id) {

files/usr/share/cinnamon/applets/[email protected]/settings-schema.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"keys": [
5151
"title-display",
5252
"launcher-animation-effect",
53+
"enable-notification-badges",
5354
"enable-app-button-dragging"
5455
]
5556
},
@@ -183,6 +184,12 @@
183184
"Scale": 3
184185
}
185186
},
187+
"enable-notification-badges": {
188+
"type": "checkbox",
189+
"default": true,
190+
"description": "Show notification Badges",
191+
"tooltip": "Indicate on the panel when an application has notifications"
192+
},
186193
"enable-app-button-dragging": {
187194
"type": "checkbox",
188195
"default": true,

0 commit comments

Comments
 (0)