Skip to content

Commit

Permalink
appInconIndicators: Improve the computing of the counter badge size
Browse files Browse the repository at this point in the history
Increases the size fo the small screens, ensuring it can be visible in
most cases.

Closes: micheleg#1969
  • Loading branch information
3v1n0 committed Apr 12, 2023
1 parent 0ea7089 commit e9ea11c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions appIconIndicators.js
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,16 @@ var UnityIndicator = class DashToDockUnityIndicator extends IndicatorBase {
fontSize /= 0.75;
}

fontSize = Math.round((iconSize / defaultIconSize) * fontSize);
const leftMargin = Math.round((iconSize / defaultIconSize) * 3);
let sizeMultiplier;
if (iconSize < defaultIconSize) {
sizeMultiplier = Math.max(24, Math.min(iconSize +
iconSize * 0.3, defaultIconSize)) / defaultIconSize;
} else {
sizeMultiplier = iconSize / defaultIconSize;
}

fontSize = Math.round(sizeMultiplier * fontSize);
const leftMargin = Math.round(sizeMultiplier * 3);

this._notificationBadgeLabel.set_style(
`font-size: ${fontSize}px;` +
Expand Down

0 comments on commit e9ea11c

Please sign in to comment.