Skip to content

Commit

Permalink
[DE PE SSE] Fix plugin icons in dark theme
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaSvinareva committed Sep 18, 2023
1 parent 8c0388b commit f6663c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion apps/common/main/lib/controller/Plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,13 @@ define([
var modes = model.get('variations'),
icons = modes[model.get('currentVariation')].get('icons'),
parsedIcons = me.viewPlugins.parseIcons(icons),
icon_url = model.get('baseUrl') + parsedIcons['normal'],
guid = model.get('guid');
model.set('parsedIcons', parsedIcons);
var menuItem = new Common.UI.MenuItem({
value: guid,
caption: model.get('name'),
iconImg: model.get('baseUrl') + parsedIcons['normal'],
iconImg: icon_url,
template: _.template([
'<div id="<%= id %>" class="menu-item" <% if(!_.isUndefined(options.stopPropagation)) { %> data-stopPropagation="true" <% } %> >',
'<img class="menu-item-icon" src="<%= options.iconImg %>">',
Expand All @@ -304,6 +306,7 @@ define([
stopPropagation: true
});
menu.addItem(menuItem);
model.set('backgroundPlugin', menuItem);
var switcher = new Common.UI.Switcher({
el: menuItem.$el.find('.plugin-toggle')[0],
value: !!model.isSystem,
Expand Down
12 changes: 10 additions & 2 deletions apps/common/main/lib/view/Plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,17 @@ define([
if (!model.get('visible'))
return null;

var btn = model.get('button');
if (btn && btn.cmpEl) {
var btn = model.get('button'),
menuItem = model.get('backgroundPlugin');
if (menuItem && menuItem.cmpEl) {
menuItem.cmpEl.find("img").attr("src", model.get('baseUrl') + model.get('parsedIcons')['normal']);
} else if (btn && btn.cmpEl) {
btn.cmpEl.find(".inner-box-icon img").attr("src", model.get('baseUrl') + model.get('parsedIcons')[btn.isActive() ? 'active' : 'normal']);
var guid = model.get('guid'),
leftBtn = this.pluginBtns[guid];
if (leftBtn && leftBtn.cmpEl) {
leftBtn.cmpEl.find("img").attr("src", model.get('baseUrl') + model.get('parsedIcons')[leftBtn.isActive() ? 'active' : 'normal']);
}
}
},

Expand Down

0 comments on commit f6663c7

Please sign in to comment.