Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not honoring text scaling factor: icons too small #181

Closed
memeplex opened this issue May 29, 2019 · 4 comments
Closed

Not honoring text scaling factor: icons too small #181

memeplex opened this issue May 29, 2019 · 4 comments

Comments

@memeplex
Copy link

memeplex commented May 29, 2019

I've a hidpi screen but I use it with a scale factor of 1 (since 2 would be too much, the resolution is not that high) and up-scaled fonts. The icons in the appindicator extension are slightly smaller than the surrounding icons in the top bar. Changing this:

this._iconBox = new AppIndicator.IconActor(indicator, Panel.PANEL_ICON_SIZE + 6);

to

this._iconBox = new AppIndicator.IconActor(indicator, Panel.PANEL_ICON_SIZE + 12);

fixes the issue in an ugly way.

@memeplex
Copy link
Author

memeplex commented Jun 5, 2019

I think this is due to the fact that the text has been scaled up. PANEL_ICON_SIZE is equal to 16 but other icons in the top bar are clearly larger than that (about 20 pixels). PANEL_ICON_SIZE is a constant that doesn't get updated when the font is scaled. When I change the text scaling factor every other item in the panel get resized except for the icons in the appindicator extension. You can try that by simply changing the text scaling factor from Tweaks. If you have a big font the topbar geometry and icons (except for the indicator ones) are updated to fit the font size.

Take a look at https://gitlab.gnome.org/GNOME/gnome-shell/blob/master/js/ui/panelMenu.js.
Maybe vfunc_allocate points towards a solution. Also notice the use of x_fill and y_fill.

@memeplex memeplex changed the title Icons too small Not honoring text scaling factor: icons too small Jun 5, 2019
@memeplex memeplex changed the title Not honoring text scaling factor: icons too small Not honoring text scaling factor: icons too small (fix suggested) Jun 5, 2019
@memeplex memeplex changed the title Not honoring text scaling factor: icons too small (fix suggested) Not honoring text scaling factor: icons too small Jun 5, 2019
@memeplex
Copy link
Author

Now I'm using a 3000x2000 screen at 2x scale factor and 1x font scaling factor and, on the contrary, I had to set Panel.PANEL_ICON_SIZE + 2. This badly needs to be configurable or smarter. Configurable seems easier though.

3v1n0 added a commit that referenced this issue Feb 26, 2020
Make sure we load the scaled icon and we don't just shrink it to the size we
want

Fixes #101 #181
@3v1n0 3v1n0 closed this as completed in 0a1b725 Mar 11, 2020
3v1n0 added a commit that referenced this issue Mar 11, 2020
Major icons management refactor, rebasing the indicators on upstream status
icons, so that we will reuse the same style rules and maximum icon size
(height, actually) for real: set to 16px (and scaled accordingly).

All the icons are now loaded as GIcon, and using direct async calls when
possible, and trying to reduce the special cases.

Main changes:
 - The AppIndicator is now a St.Icon itself
 - All the icons are Gio.EmblemedIcon with a main icon that could be both
   a Gio.FileIcon in case we have an icon path, or a GdkPixbuf in case we
   get them from dbus.
 - In case the icon is passed through DBus, we get the maximum size we
   receive so that HiDPI icons will work but we need to convert the received
   ARGB icon to RGBA in order to make GdkPixbuf process it properly, this is
   sad but should be quite optimized.
 - We have a special code path for icons such as indicator-multiload that
   have some weird sizing, and in such case we just async load the pixmap as
	 it is. It may still cause some higher CPU usage though.
 - Once we have a Gio.Icon we set it as the gicon of the AppIndicator.

Fixes #181, Fixes #202, Fixes #205, Fixes #208
Fixes LP: #1723827, LP: #1817073, LP: #1832793, LP: #1825623
@memeplex
Copy link
Author

Thanks Marco!

@jarrard
Copy link

jarrard commented Nov 2, 2020

Sadly these changes did not resolve my problem, I have the icons being quite small. And with font scaling up to 1.50.

Using Pop!_OS atm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants