/*
* Predefines
@@ -93,6 +95,13 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
*/
void showNumber( bool state );
+ /**
+ * @brief showNewIndicator. Set the show new indicator state.
+ *
+ * @param state Show / hide.
+ */
+ void showNewIndicator( bool state );
+
/**
* @brief setNumberColor. Set the number color.
*
@@ -121,6 +130,20 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
*/
void setNumberMargins( QMargins margins );
+ /**
+ * @brief setNewIndicatorType. Set the new indicator type.
+ *
+ * @param new_indicator_type The new indicator type.
+ */
+ void setNewIndicatorType( Preferences::NewIndicatorType new_indicator_type );
+
+ /**
+ * @brief setNewShadeColor. Set the new shade color.
+ *
+ * @param color The color.
+ */
+ void setNewShadeColor( const QString& color );
+
/**
* @brief setMailCount. Set the number of unread/new mails.
*
@@ -131,6 +154,25 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
private:
+ /**
+ * @brief renderBase. Set the base pixmaps for the icon.
+ */
+ void renderBase();
+
+ /**
+ * @brief shade. Shade a pixmap
+ *
+ * @param pixmap Pixmap to shade.
+ */
+ void shade( QPixmap& pixmap );
+
+ /**
+ * @brief indicator. Add a new indicator to the icon.
+ *
+ * @param pixmap Pixmap to alter.
+ */
+ void indicator( QPixmap& pixmap );
+
/**
* @brief setIcon. Set a new rendered icon.
*/
@@ -183,11 +225,21 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
*/
void slotIconDataChange();
+ /**
+ * @brief slotThemeChange. Slot for handling theme change signals.
+ */
+ void slotThemeChange();
+
/**
* @brief slotShowNumberChange. Slot for handling show number change signals.
*/
void slotShowNumberChange();
+ /**
+ * @brief slotShowNewIndicatorChange. Slot for handling show new indicator change signals.
+ */
+ void slotShowNewIndicatorChange();
+
/**
* @brief slotNumberColorChange. Slot for handling number color change signals.
*/
@@ -209,9 +261,14 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
void slotNumberMarginsChange();
/**
- * @brief slotThemeChange. Slot for handling theme change signals.
+ * @brief slotNewIndicatorTypeChange. Slot for handling new indicator type change signals.
*/
- void slotThemeChange();
+ void slotNewIndicatorTypeChange();
+
+ /**
+ * @brief slotNewShadeColorChange. Slot for handling new shade color change signals.
+ */
+ void slotNewShadeColorChange();
private slots:
@@ -242,6 +299,21 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
*/
Preferences* m_pref;
+ /**
+ * @brief m_pixmap_count Pixmap to be used when counting.
+ */
+ QPixmap m_pixmap_count;
+
+ /**
+ * @brief m_pixmap_clean Pixmap to be used when there is no new mail.
+ */
+ QPixmap m_pixmap_clean;
+
+ /**
+ * @brief m_image_indicator Image to be used as new mail indicator.
+ */
+ QImage m_image_indicator;
+
/**
* @brief m_default_icon_type. Storage for the default icon type.
*/
@@ -282,6 +354,11 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
*/
bool m_show_number;
+ /**
+ * @brief m_show_new_indicator. Show the new indicator.
+ */
+ bool m_show_new_indicator;
+
/**
* @brief m_number_color. Color of the unread/new mail number.
*/
@@ -302,6 +379,16 @@ class SysTrayXStatusNotifier : public KStatusNotifierItem
*/
QMargins m_number_margins;
+ /**
+ * @brief m_new_indicator_type. The new indicator type.
+ */
+ Preferences::NewIndicatorType m_new_indicator_type;
+
+ /**
+ * @brief m_new_shade_color. Color of the new shade.
+ */
+ QString m_new_shade_color;
+
/**
* @brief m_unread_mail. Storage for the number of unread mails.
*/
diff --git a/webext/_locales/en-US/messages.json b/webext/_locales/en-US/messages.json
index 48e9fc7..c1d8598 100644
--- a/webext/_locales/en-US/messages.json
+++ b/webext/_locales/en-US/messages.json
@@ -34,6 +34,11 @@
"description": "Tab for Icon options"
},
+ "tab_count": {
+ "message": "Count",
+ "description": "Tab for Count options"
+ },
+
"tab_apps": {
"message": "Apps",
"description": "Tab for Apps options"
@@ -204,11 +209,6 @@
"description": "Caption for Number options"
},
- "icons_number_display": {
- "message": "Display unread message count",
- "description": "Display the number"
- },
-
"icons_number_color": {
"message": "Number color:",
"description": "Color of the number"
@@ -274,21 +274,6 @@
"description": "Number margins (left, top, right, bottom)"
},
- "icons_number_count_type": {
- "message": "Message count type:",
- "description": "Count type options"
- },
-
- "icons_number_count_unread": {
- "message": "Unread",
- "description": "Count unread mails"
- },
-
- "icons_number_count_new": {
- "message": "New",
- "description": "Count new mails"
- },
-
"icons_startup_delay": {
"message": "Startup delay",
"description": "Startup delay"
@@ -309,6 +294,40 @@
"description": "The dark theme"
},
+ "count": {
+ "message": "Count",
+ "description": "Title for Count options"
+ },
+
+ "count_number_display": {
+ "message": "Show unread message count",
+ "description": "Show the new message count"
+ },
+
+ "count_new_indicator_display": {
+ "message": "Show new indicator",
+ "description": "Show the new message indicator"
+ },
+
+
+
+ "count_number_count_type": {
+ "message": "Message count type:",
+ "description": "Count type options"
+ },
+
+ "count_number_count_unread": {
+ "message": "Unread",
+ "description": "Count unread mails"
+ },
+
+ "count_number_count_new": {
+ "message": "New",
+ "description": "Count new mails"
+ },
+
+
+
"apps": {
"message": "Apps",
"description": "Title for Apps options"
diff --git a/webext/background.js b/webext/background.js
index f3fdbf2..1441523 100644
--- a/webext/background.js
+++ b/webext/background.js
@@ -561,6 +561,7 @@ SysTrayX.Messaging = {
"iconMime",
"icon",
"showNumber",
+ "showNewIndicator",
"numberColor",
"numberSize",
"numberAlignment",
@@ -594,6 +595,7 @@ SysTrayX.Messaging = {
const iconMime = result.iconMime || "image/png";
const icon = result.icon || [];
const showNumber = result.showNumber || "true";
+ const showNewIndicator = result.showNewIndicator || "true";
let numberColor = result.numberColor || "#000000";
const numberSize = result.numberSize || "10";
const numberAlignment = result.numberAlignment || "4";
@@ -634,6 +636,7 @@ SysTrayX.Messaging = {
iconMime,
icon,
showNumber,
+ showNewIndicator,
numberColor,
numberSize,
numberAlignment,
@@ -773,6 +776,13 @@ SysTrayX.Link = {
});
}
+ const showNewIndicator = response["preferences"].showNewIndicator;
+ if (showNewIndicator) {
+ await storage().set({
+ showNewIndicator: showNewIndicator,
+ });
+ }
+
const numberColor = response["preferences"].numberColor;
if (numberColor) {
await storage().set({
diff --git a/webext/options.html b/webext/options.html
index 9139e0f..362e16d 100644
--- a/webext/options.html
+++ b/webext/options.html
@@ -29,6 +29,7 @@
+
+