recently I wanted to clean-up my taskbar/systray a little bit and since I wanted only white icons for my systray I had a hard time achieving what I wanted.
The No.1 problem for me is the icon-sizing, which is, very problematic across several apps. Let's say I've a theme with 24x24 icons, which are used. All of these icons respect a guideline and have a padding of say 2px. On the other hand there are apps like teamspeak-client, where you can (Wowsa!) set your own icon-theme in the app-settings, but those icons are 32x32 and doesn't respect those guidelines - there isn't an equivalent padding. So yeah, I know unifying linux is difficult and this task is nearly impossible to automate.
What I'm thinking of is a list in the configuration-window with each app of the systray in it and numeric input-filed besides it, where you can set the scale-factor. We could even hardcode some scale-factors for known problematic apps.
I don't know if this is possible or even easy to achieve, but when I find some time and you're okay with that idea, I would try to code something.
I altered your code to temporarily achieve what I want:
_resizeStatusItem: function(role, icon) {
if (icon.obsolete == true) {
return;
}
if (["shutter", "filezilla"].indexOf(role) != -1) {
global.log("Not resizing " + role + " as it's known to be buggy (" + icon.get_width() + "x" + icon.get_height() + "px)");
} else if (["teamspeak 3"].indexOf(role) != -1) {
icon.set_size(20, 20);
} else {
let size = this._getIconSize(this._panelHeight);
icon.set_size(size, size);
global.log("Resized " + role + " with normalized size (" + icon.get_width() + "x" + icon.get_height() + "px)");
//Note: dropbox doesn't scale, even though we resize it...
}
},
Oh and we could also remove the hardcoded stuff for shutter and filezilla by i.e. setting the scale-factor to 1, which then should ignore resizing and leave the icon as it is.
Hi feuerfuchs,
recently I wanted to clean-up my taskbar/systray a little bit and since I wanted only white icons for my systray I had a hard time achieving what I wanted.
The No.1 problem for me is the icon-sizing, which is, very problematic across several apps. Let's say I've a theme with 24x24 icons, which are used. All of these icons respect a guideline and have a padding of say 2px. On the other hand there are apps like teamspeak-client, where you can (Wowsa!) set your own icon-theme in the app-settings, but those icons are 32x32 and doesn't respect those guidelines - there isn't an equivalent padding. So yeah, I know unifying linux is difficult and this task is nearly impossible to automate.
What I'm thinking of is a list in the configuration-window with each app of the systray in it and numeric input-filed besides it, where you can set the scale-factor. We could even hardcode some scale-factors for known problematic apps.
I don't know if this is possible or even easy to achieve, but when I find some time and you're okay with that idea, I would try to code something.
I altered your code to temporarily achieve what I want: