Use different colors for unread/mentioned in windows task bar. Like we do for tray icons.
This commit is contained in:
@@ -461,10 +461,10 @@ var showUnreadBadgeWindows = function(unreadCount, mentionCount) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (mentionCount > 0) {
|
if (mentionCount > 0) {
|
||||||
const dataURL = badge.createDataURL(mentionCount.toString());
|
const dataURL = badge.createDataURL(mentionCount.toString(), "#FF1744"); // Material Red A400
|
||||||
sendBadge(dataURL, 'You have unread mention (' + mentionCount + ')');
|
sendBadge(dataURL, 'You have unread mention (' + mentionCount + ')');
|
||||||
} else if (unreadCount > 0) {
|
} else if (unreadCount > 0) {
|
||||||
const dataURL = badge.createDataURL('•');
|
const dataURL = badge.createDataURL('•', "#00e5ff"); // Material Cyan A400
|
||||||
sendBadge(dataURL, 'You have unread channels');
|
sendBadge(dataURL, 'You have unread channels');
|
||||||
} else {
|
} else {
|
||||||
sendBadge(null, 'You have no unread messages');
|
sendBadge(null, 'You have no unread messages');
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var createDataURL = function(text) {
|
var createDataURL = function(text, color) {
|
||||||
const scale = 2; // should rely display dpi
|
const scale = 2; // should rely display dpi
|
||||||
const size = 16 * scale;
|
const size = 16 * scale;
|
||||||
const canvas = document.createElement('canvas');
|
const canvas = document.createElement('canvas');
|
||||||
@@ -9,10 +9,11 @@ var createDataURL = function(text) {
|
|||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
// circle
|
// circle
|
||||||
ctx.fillStyle = "#FF1744"; // Material Red A400
|
ctx.fillStyle = color;
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.arc(size / 2, size / 2, size / 2, 0, Math.PI * 2);
|
ctx.arc(size / 2, size / 2, size / 2, 0, Math.PI * 2);
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
|
ctx.stroke();
|
||||||
|
|
||||||
// text
|
// text
|
||||||
ctx.fillStyle = "#ffffff"
|
ctx.fillStyle = "#ffffff"
|
||||||
|
Reference in New Issue
Block a user