From a862ce87678cfc14af4e09df1ba8c1e1deb60f2b Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Fri, 24 Jan 2020 23:41:56 +0100 Subject: [PATCH] Add themed icon --- README.references.txt | 4 ++++ app/SysTray-X/systrayxicon.cpp | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.references.txt b/README.references.txt index af8bac8..50aadf9 100644 --- a/README.references.txt +++ b/README.references.txt @@ -25,3 +25,7 @@ Tree table https://stackoverflow.com/questions/5636375/how-to-create-a-collapsing-tree-table-in-html-css-js http://maxdesign.com.au/articles/tree-table/ + +Image to Base64 conversion + +https://stackoverflow.com/questions/6150289/how-to-convert-image-into-base64-string-using-javascript diff --git a/app/SysTray-X/systrayxicon.cpp b/app/SysTray-X/systrayxicon.cpp index b3889bc..fc0647e 100644 --- a/app/SysTray-X/systrayxicon.cpp +++ b/app/SysTray-X/systrayxicon.cpp @@ -116,12 +116,18 @@ void SysTrayXIcon::renderIcon() switch( m_icon_type ) { case Preferences::PREF_BLANK_ICON: - case Preferences::PREF_NEWMAIL_ICON: { pixmap = QPixmap( ":/files/icons/blank-icon.png" ); break; } + case Preferences::PREF_NEWMAIL_ICON: + { + QIcon new_mail = QIcon::fromTheme("mail-unread", QIcon(":/files/icons/blank-icon.png")); + pixmap = QPixmap( new_mail.pixmap( 256, 256 ) ); + break; + } + case Preferences::PREF_CUSTOM_ICON: { pixmap.loadFromData( m_icon_data );