Bug - Port bug 1343921 to TB [Implement support for custom icons through the Theming API]. r=mkmelin
☠☠ backed out by b6669e74cafa ☠ ☠
authorRichard Marti <richard.marti@gmail.com>
Wed, 31 May 2017 21:42:31 +0200
changeset 28368 167a8565ea427bfdd897a1f3835b075a7091a150
parent 28367 da8d01df61c1ddf7aac9d8bbcef3d0ca95237aaf
child 28369 29b9a4a3fc1a9edd224ad789ad7a8e60c3a86cac
push id1986
push userclokep@gmail.com
push dateWed, 02 Aug 2017 14:43:31 +0000
treeherdercomm-beta@b51c9adf2c9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin
bugs1343921
Bug - Port bug 1343921 to TB [Implement support for custom icons through the Theming API]. r=mkmelin
mail/app/profile/all-thunderbird.js
mail/base/content/messenger.css
--- a/mail/app/profile/all-thunderbird.js
+++ b/mail/app/profile/all-thunderbird.js
@@ -217,16 +217,21 @@ pref("extensions.update.background.url",
 pref("extensions.update.interval", 86400);  // Check for updates to Extensions and
                                             // Themes every day
 
 pref("extensions.dss.switchPending", false);    // Non-dynamic switch pending after next
 
 pref("extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name", "chrome://messenger/locale/messenger.properties");
 pref("extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description", "chrome://messenger/locale/messenger.properties");
 
+pref("extensions.webextensions.themes.icons.buttons", "getmsg,newmsg,address,reply,replyall,replylist,forwarding,delete,junk,print,stop,file,nextUnread,prevUnread,mark,tag,back,forward,compact,archive,chat,nextMsg,prevMsg,QFB,conversation,app_menu,newcard,newlist,editcard,newim,send,spelling,attach,security,save,quote,cut,copy,paste,buddy,join_chat,chat_accounts,calendar,tasks,synchronize,newevent,newtask,editevent,today,find,category,complete,priority,saveandclose,attendees,privacy,status,freebusy,timezones");
+#ifndef RELEASE_OR_BETA
+pref("extensions.webextensions.themes.enabled", true);
+#endif
+
 pref("lightweightThemes.update.enabled", true);
 
 pref("xpinstall.whitelist.add", "addons.mozilla.org");
 
 pref("general.smoothScroll", true);
 #ifdef UNIX_BUT_NOT_MAC
 pref("general.autoScroll", false);
 #else
--- a/mail/base/content/messenger.css
+++ b/mail/base/content/messenger.css
@@ -343,16 +343,292 @@ splitmenu {
 /* Preferences */
 
 preftab,
 preftab:root /* override :root */ {
   -moz-binding: url("chrome://messenger/content/preferences/preferences.xml#preftab");
   -moz-box-orient: vertical;
 }
 
+/* WebExtensions icon-variables */
+
+:root[lwthemeicons~="--getmsg-icon"] #button-getmsg:-moz-lwtheme {
+  list-style-image: var(--getmsg-icon) !important;
+}
+
+:root[lwthemeicons~="--newmsg-icon"] #button-newmsg:-moz-lwtheme,
+:root[lwthemeicons~="--newmsg-icon"] #button-newmessage:-moz-lwtheme {
+  list-style-image: var(--newmsg-icon) !important;
+}
+
+:root[lwthemeicons~="--address-icon"] #button-address:-moz-lwtheme,
+:root[lwthemeicons~="--address-icon"] #button-contacts:-moz-lwtheme {
+  list-style-image: var(--address-icon) !important;
+}
+
+:root[lwthemeicons~="--reply-icon"] #button-reply:-moz-lwtheme,
+:root[lwthemeicons~="--reply-icon"] #hdrReplyButton:-moz-lwtheme,
+:root[lwthemeicons~="--reply-icon"] #hdrReplyToSenderButton:-moz-lwtheme {
+  list-style-image: var(--reply-icon) !important;
+}
+
+:root[lwthemeicons~="--replyall-icon"] #button-replyall:-moz-lwtheme,
+:root[lwthemeicons~="--replyall-icon"] #hdrReplyAllButton:-moz-lwtheme {
+  list-style-image: var(--replyall-icon) !important;
+}
+
+:root[lwthemeicons~="--replylist-icon"] #button-replylist:-moz-lwtheme,
+:root[lwthemeicons~="--replylist-icon"] #hdrFollowupButton:-moz-lwtheme,
+:root[lwthemeicons~="--replylist-icon"] #hdrReplyListButton:-moz-lwtheme {
+  list-style-image: var(--replylist-icon) !important;
+}
+
+:root[lwthemeicons~="--forwarding-icon"] #button-forward:-moz-lwtheme,
+:root[lwthemeicons~="--forwarding-icon"] .hdrForwardButton:-moz-lwtheme {
+  list-style-image: var(--forwarding-icon) !important;
+}
+
+:root[lwthemeicons~="--delete-icon"] .delete-button:-moz-lwtheme,
+:root[lwthemeicons~="--delete-icon"] #button-delete:-moz-lwtheme,
+:root[lwthemeicons~="--delete-icon"] #hdrTrashButton:-moz-lwtheme,
+:root[lwthemeicons~="--delete-icon"] #button-abdelete:-moz-lwtheme,
+:root[lwthemeicons~="--delete-icon"] #calendar-delete-button:-moz-lwtheme,
+:root[lwthemeicons~="--delete-icon"] #task-delete-button:-moz-lwtheme,
+:root[lwthemeicons~="--delete-icon"] #calendar-delete-task-button:-moz-lwtheme {
+  list-style-image: var(--delete-icon) !important;
+}
+
+:root[lwthemeicons~="--junk-icon"] .junk-button:-moz-lwtheme,
+:root[lwthemeicons~="--junk-icon"] #hdrJunkButton:-moz-lwtheme {
+  list-style-image: var(--junk-icon) !important;
+}
+
+:root[lwthemeicons~="--print-icon"] #button-print:-moz-lwtheme,
+:root[lwthemeicons~="--print-icon"] #calendar-print-button:-moz-lwtheme,
+:root[lwthemeicons~="--print-icon"] #task-print-button:-moz-lwtheme {
+  list-style-image: var(--print-icon) !important;
+}
+
+:root[lwthemeicons~="--stop-icon"] #button-stop:-moz-lwtheme {
+  list-style-image: var(--stop-icon) !important;
+}
+
+:root[lwthemeicons~="--file-icon"] #button-file:-moz-lwtheme {
+  list-style-image: var(--file-icon) !important;
+}
+
+:root[lwthemeicons~="--nextUnread-icon"] #button-nextUnread:-moz-lwtheme {
+  list-style-image: var(--nextUnread-icon) !important;
+}
+
+:root[lwthemeicons~="--prevUnread-icon"] #button-previousUnread:-moz-lwtheme {
+  list-style-image: var(--prevUnread-icon) !important;
+}
+
+:root[lwthemeicons~="--mark-icon"] #button-mark:-moz-lwtheme {
+  list-style-image: var(--mark-icon) !important;
+}
+
+:root[lwthemeicons~="--tag-icon"] #button-tag:-moz-lwtheme,
+:root[lwthemeicons~="--tag-icon"] #hdrTagButton:-moz-lwtheme {
+  list-style-image: var(--tag-icon) !important;
+}
+
+:root[lwthemeicons~="--back-icon"] #button-goback:-moz-lwtheme {
+  list-style-image: var(--back-icon) !important;
+}
+
+:root[lwthemeicons~="--forward-icon"] #button-goforward:-moz-lwtheme {
+  list-style-image: var(--forward-icon) !important;
+}
+
+:root[lwthemeicons~="--compact-icon"] #button-compact:-moz-lwtheme {
+  list-style-image: var(--compact-icon) !important;
+}
+
+:root[lwthemeicons~="--archive-icon"] #button-archive:-moz-lwtheme,
+:root[lwthemeicons~="--archive-icon"] #hdrArchiveButton:-moz-lwtheme {
+  list-style-image: var(--archive-icon) !important;
+}
+
+:root[lwthemeicons~="--chat-icon"] #button-chat:-moz-lwtheme {
+  list-style-image: var(--chat-icon) !important;
+}
+
+:root[lwthemeicons~="--nextMsg-icon"] #button-nextMsg:-moz-lwtheme {
+  list-style-image: var(--nextMsg-icon) !important;
+}
+
+:root[lwthemeicons~="--prevMsg-icon"] #button-previousMsg:-moz-lwtheme {
+  list-style-image: var(--prevMsg-icon) !important;
+}
+
+:root[lwthemeicons~="--QFB-icon"] #qfb-show-filter-bar:-moz-lwtheme {
+  list-style-image: var(--QFB-icon) !important;
+}
+
+:root[lwthemeicons~="--conversation-icon"] #button-showconversation:-moz-lwtheme,
+:root[lwthemeicons~="--conversation-icon"] #hdrOpenConversationButton:-moz-lwtheme {
+  list-style-image: var(--conversation-icon) !important;
+}
+
+:root[lwthemeicons~="--conversation-icon"] #button-showconversation:-moz-lwtheme {
+  list-style-image: var(--conversation-icon) !important;
+}
+
+:root[lwthemeicons~="--app_menu-icon"] .button-appmenu:-moz-lwtheme {
+  list-style-image: var(--app_menu-icon) !important;
+}
+
+:root[lwthemeicons~="--newcard-icon"] #button-newcard:-moz-lwtheme {
+  list-style-image: var(--newcard-icon) !important;
+}
+
+:root[lwthemeicons~="--newlist-icon"] #button-newlist:-moz-lwtheme {
+  list-style-image: var(--newlist-icon) !important;
+}
+
+:root[lwthemeicons~="--editcard-icon"] #button-editcard:-moz-lwtheme {
+  list-style-image: var(--editcard-icon) !important;
+}
+
+:root[lwthemeicons~="--newim-icon"] #button-newim:-moz-lwtheme {
+  list-style-image: var(--newim-icon) !important;
+}
+
+:root[lwthemeicons~="--send-icon"] #button-send:-moz-lwtheme {
+  list-style-image: var(--send-icon) !important;
+}
+
+:root[lwthemeicons~="--spelling-icon"] #spellingButton:-moz-lwtheme {
+  list-style-image: var(--spelling-icon) !important;
+}
+
+:root[lwthemeicons~="--attach-icon"] #button-url:-moz-lwtheme,
+:root[lwthemeicons~="--attach-icon"] #button-attach:-moz-lwtheme {
+  list-style-image: var(--attach-icon) !important;
+}
+
+:root[lwthemeicons~="--security-icon"] #button-security:-moz-lwtheme {
+  list-style-image: var(--security-icon) !important;
+}
+
+:root[lwthemeicons~="--save-icon"] #button-save:-moz-lwtheme {
+  list-style-image: var(--save-icon) !important;
+}
+
+:root[lwthemeicons~="--quote-icon"] #quoteButton:-moz-lwtheme {
+  list-style-image: var(--quote-icon) !important;
+}
+
+:root[lwthemeicons~="--cut-icon"] #cut-button:-moz-lwtheme {
+  list-style-image: var(--cut-icon) !important;
+}
+
+:root[lwthemeicons~="--copy-icon"] #copy-button:-moz-lwtheme {
+  list-style-image: var(--copy-icon) !important;
+}
+
+:root[lwthemeicons~="--paste-icon"] #paste-button:-moz-lwtheme {
+  list-style-image: var(--paste-icon) !important;
+}
+
+:root[lwthemeicons~="--buddy-icon"] #button-add-buddy:-moz-lwtheme {
+  list-style-image: var(--buddy-icon) !important;
+}
+
+:root[lwthemeicons~="--join_chat-icon"] #button-join-chat:-moz-lwtheme {
+  list-style-image: var(--join_chat-icon) !important;
+}
+
+:root[lwthemeicons~="--chat_accounts-icon"] #button-chat-accounts:-moz-lwtheme {
+  list-style-image: var(--chat_accounts-icon) !important;
+}
+
+:root[lwthemeicons~="--calendar-icon"] #calendar-tab-button:-moz-lwtheme,
+:root[lwthemeicons~="--calendar-icon"] #lightning-button-calendar:-moz-lwtheme {
+  list-style-image: var(--calendar-icon) !important;
+}
+
+:root[lwthemeicons~="--tasks-icon"] #task-tab-button:-moz-lwtheme,
+:root[lwthemeicons~="--tasks-icon"] #lightning-button-tasks:-moz-lwtheme {
+  list-style-image: var(--tasks-icon) !important;
+}
+
+:root[lwthemeicons~="--synchronize-icon"] #calendar-synchronize-button:-moz-lwtheme,
+:root[lwthemeicons~="--synchronize-icon"] #task-synchronize-button:-moz-lwtheme {
+  list-style-image: var(--synchronize-icon) !important;
+}
+
+:root[lwthemeicons~="--newevent-icon"] #extractEventButton:-moz-lwtheme,
+:root[lwthemeicons~="--newevent-icon"] #task-newevent-button:-moz-lwtheme,
+:root[lwthemeicons~="--newevent-icon"] #hdrExtractEventButton:-moz-lwtheme,
+:root[lwthemeicons~="--newevent-icon"] #calendar-newevent-button:-moz-lwtheme,
+:root[lwthemeicons~="--newevent-icon"] #todaypane-new-event-button:-moz-lwtheme {
+  list-style-image: var(--newevent-icon) !important;
+}
+
+:root[lwthemeicons~="--newtask-icon"] #extractTaskButton:-moz-lwtheme,
+:root[lwthemeicons~="--newtask-icon"] #task-newtask-button:-moz-lwtheme,
+:root[lwthemeicons~="--newtask-icon"] #hdrExtractTaskButton:-moz-lwtheme,
+:root[lwthemeicons~="--newtask-icon"] #calendar-newtask-button:-moz-lwtheme,
+:root[lwthemeicons~="--newtask-icon"] #calendar-add-task-button:-moz-lwtheme {
+  list-style-image: var(--newtask-icon) !important;
+}
+
+:root[lwthemeicons~="--editevent-icon"] #calendar-edit-button:-moz-lwtheme,
+:root[lwthemeicons~="--editevent-icon"] #task-edit-button:-moz-lwtheme {
+  list-style-image: var(--editevent-icon) !important;
+}
+
+:root[lwthemeicons~="--today-icon"] #calendar-goto-today-button:-moz-lwtheme {
+  list-style-image: var(--today-icon) !important;
+}
+
+:root[lwthemeicons~="--find-icon"] #calendar-unifinder-button:-moz-lwtheme {
+  list-style-image: var(--find-icon) !important;
+}
+
+:root[lwthemeicons~="--category-icon"] #task-actions-category:-moz-lwtheme {
+  list-style-image: var(--category-icon) !important;
+}
+
+:root[lwthemeicons~="--complete-icon"] #task-actions-markcompleted:-moz-lwtheme {
+  list-style-image: var(--complete-icon) !important;
+}
+
+:root[lwthemeicons~="--priority-icon"] #button-priority:-moz-lwtheme,
+:root[lwthemeicons~="--priority-icon"] #task-actions-priority:-moz-lwtheme {
+  list-style-image: var(--priority-icon) !important;
+}
+
+:root[lwthemeicons~="--saveandclose-icon"] #button-saveandclose:-moz-lwtheme {
+  list-style-image: var(--saveandclose-icon) !important;
+}
+
+:root[lwthemeicons~="--attendees-icon"] #button-attendees:-moz-lwtheme {
+  list-style-image: var(--attendees-icon) !important;
+}
+
+:root[lwthemeicons~="--privacy-icon"] #button-privacy:-moz-lwtheme {
+  list-style-image: var(--privacy-icon) !important;
+}
+
+:root[lwthemeicons~="--status-icon"] #button-status:-moz-lwtheme {
+  list-style-image: var(--status-icon) !important;
+}
+
+:root[lwthemeicons~="--freebusy-icon"] #button-freebusy:-moz-lwtheme {
+  list-style-image: var(--freebusy-icon) !important;
+}
+
+:root[lwthemeicons~="--timezones-icon"] #button-timezones:-moz-lwtheme {
+  list-style-image: var(--timezones-icon) !important;
+}
+
 /* Status panel */
 
 statuspanel {
   -moz-binding: url("chrome://messenger/content/tabmail.xml#statuspanel");
   position: fixed;
   margin-top: -3em;
   left: 0;
   z-index: 20;