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

[Icon request] ayatana-indicator-keyboard #3053

Closed
ilya-fedin opened this issue Apr 3, 2022 · 31 comments
Closed

[Icon request] ayatana-indicator-keyboard #3053

ilya-fedin opened this issue Apr 3, 2022 · 31 comments

Comments

@ilya-fedin
Copy link

This a keyboard layout indicator from Ayatana Indicators project (can be used on e.g. MATE), original icons are here: https://github.com/AyatanaIndicators/ayatana-indicator-keyboard/tree/main/data/icons/scalable/status (they're installed with the same directory layout, i.e. /usr/share/icons/hicolor/scalable/status), they also have a generation script: https://github.com/AyatanaIndicators/ayatana-indicator-keyboard/blob/main/contrib/ayatana-indicator-keyboard-icon-generator.py

Looks like this on my system:
изображение

@varlesh
Copy link
Contributor

varlesh commented May 1, 2022

added only as symlinks from (unity 7) indicator-keyboard-*

@varlesh varlesh closed this as completed May 1, 2022
@ilya-fedin
Copy link
Author

It looks really weird
image

@varlesh
Copy link
Contributor

varlesh commented Jul 3, 2022

It's HiDPi? You try HiDPi branch? On sources used 24px icons size and this size available on Papirus...

@varlesh
Copy link
Contributor

varlesh commented Jul 3, 2022

it should look like this:
image

@varlesh
Copy link
Contributor

varlesh commented Jul 3, 2022

How it's looks with another ayatana indicators?
https://github.com/AyatanaIndicators

@varlesh
Copy link
Contributor

varlesh commented Jul 3, 2022

I didn't find any information about the size in the sources, difficult code to understand... in general, it's strange, ayatana is an appindicator receiver and the size 22px is used there, as standard, here 24px is used in SVG icon files. Why?
If you look at other ayatana projects, the icons are taken from the theme and should use the size that corresponds to the working environment.

@ilya-fedin
Copy link
Author

ilya-fedin commented Jul 3, 2022

Maybe it's because you're using 22x22 folder rather than scalable? E.g. Qt provides only sizes specified in folder size names when you use QIcon::availableSizes/QIcon::actualSize on an icon gotten with QIcon::fromTheme that is svg. In other words, if Qt application uses svg icon theme and follows the information from QIcon::availableSizes/QIcon::actualSize, it will think only 22x22 pixmap could be gotten even if the icon is svg one (unless KDE platformtheme is used that provides a list of pre-defined sizes for svg icons). Maybe gtk has similar behavior.

@ilya-fedin
Copy link
Author

It's HiDPi? You try HiDPi branch?

Yeah, it's HiDPI. I use distro package, checked HiDPI branch - the same result.

@varlesh
Copy link
Contributor

varlesh commented Jul 4, 2022

QIcon::fromTheme works fine even without specifying the size of the icons and automatically selects the right one for rendering. Because, in Index.theme, all sizes and directories are specified. As for KDE, there is an unspoken standard size of 22px for the tray (the same as Unity). Other work environments have an undefined size of 16px/22px or 24px. The decision to move icons to the scalable folder (or 128px, which in fact is it) violates the entire logic of our icon theme design, because pixel alignment will be broken and icons will be blurred. Actually, other icons, for example Kotatogram, are displayed correctly and located only in folders 16px/22px and 24px. Kotatogram not exist on scalable folder (or 128px)

@varlesh
Copy link
Contributor

varlesh commented Jul 4, 2022

You can experiment with Fixed and Scalable values in the HiDPI brunch.
https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/blob/HiDPI/Papirus.HiDPI/index.theme
But once again I note that other libraries such as QSystemTrayIcon or AppIndicator do not have similar problems.

@ilya-fedin
Copy link
Author

QIcon::fromTheme works fine even without specifying the size of the icons and automatically selects the right one for rendering.

No, no, that's far from the truth. Have you actually tried to write something using it? QIcon is just a handle. You need to rasterize the icon with QIcon::pixmap that requires specifying a size. If application follows the information provided by QIcon::availableSizes/QIcon::actualSize and KDE frameworks aren't injected in the environment, the behavior is buggy with svg.

The decision to move icons to the scalable folder

Why to move? Copy them. At least the ayatana ones.

@varlesh
Copy link
Contributor

varlesh commented Jul 5, 2022

Let's close the topic about Qt, it has absolutely nothing to do with the current issue. I just wanted to tell you that the indicators for the tray are ONLY in folders 16/22/24 and have no problems, unlike ayatana-indicator-keyboard. I discovered the problem in the ayatana-indicator-keyboard repository, but the developers have not responded yet.
As for Scalable, it's a dirty solution because it doesn't meet our requirements, one of them is pixel alignment. Perhaps this will solve the problem (although I'm not sure) for HiDPI displays, but it may cause a number of problems for the standard screen resolution.
Also the folder 128x128 in Papirus Light is a symbolic link to ../Papirus/128x128. Creating status/ayatana-indicator-keyboard-*.svg files (links) in it will break the theme. The symbolic folder has exactly the same structure.

@varlesh
Copy link
Contributor

varlesh commented Jul 5, 2022

Yes, we can create a new folder, for example, scalable/status/ayatana-indicator-keyboard-*.svg. But once again I note that this can cause problems for non-HiDPI displays and violates our HIG.

@varlesh
Copy link
Contributor

varlesh commented Jul 5, 2022

I'm now test Ubuntu 22.04 Mate LiveCD and all worked fine:
Снимок экрана в 2022-07-05 05-28-41
200% scale:
Снимок экрана в 2022-07-05 05-30-15

@ilya-fedin
Copy link
Author

It doesn't look like on your screenshot even without scaling
изображение

@varlesh
Copy link
Contributor

varlesh commented Jul 5, 2022

Maybe you try change vertical panel size (some pixels to up)... On my screen it's 30px

@varlesh
Copy link
Contributor

varlesh commented Jul 5, 2022

I think you use scale x2 16px icons, but this size not available for indicator-keyboard icons on Papirus, only 22px and 24px.

@ilya-fedin
Copy link
Author

Helps, kind of...
изображение
This size is too big for me though, I use the default 24px panel size.

@varlesh
Copy link
Contributor

varlesh commented Jul 5, 2022

So my guesses are correct, we need to port the indicator-keyboard icons to the size of 16px. This is more than 150 icons

@varlesh
Copy link
Contributor

varlesh commented Jul 5, 2022

I explain the problem, ayatana-indicator-keyboard -* now these are symbolic links to indicator-keyboard. But only for the size of 22px, which was previously the default in Unity and 24px, it is most likely XFCE (or the old version of elementaryOS). There was no need for 16px earlier, since GNOME drew the icon programmatically, and other working environments practically did not use this size. Notice how long ago these icons were added: https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/commits/master/Papirus/22x22/panel/indicator-keyboard-En.svg

@ilya-fedin
Copy link
Author

Well, I installed ayatana-indicator-keyboard by hand as standard MATE keyboard indicator bugs in my distro for some reason
изображение

@varlesh
Copy link
Contributor

varlesh commented Jul 5, 2022

Well, I installed ayatana-indicator-keyboard by hand as standard MATE keyboard indicator bugs in my distro for some reason

It's strange, on Ubuntu MATE original keyboard indicator working good (You seen my screens). Anyway it's not solve this issue. As i say ealier, we need port icons to 16px, becuase HiDPI displays use it. wifi, battery, volume and kotatogram - it,s 16px @2x* but ayatana-indicator-keyboard-* it's 22px @2x

@ilya-fedin
Copy link
Author

on Ubuntu MATE original keyboard indicator working good

Yeah, it's specific to my distro, some problem in some dependency apparently, but no one knows which one

@varlesh varlesh reopened this Jul 5, 2022
@varlesh
Copy link
Contributor

varlesh commented Jul 5, 2022

Offtopic:
@ilya-fedin On your distro this bug reproduced? I'm run Ubuntu Mate and added some icons, but it's not applied for Mate Control Center

@ilya-fedin
Copy link
Author

Works just fine
изображение

@varlesh
Copy link
Contributor

varlesh commented Jul 5, 2022

hm...

@varlesh
Copy link
Contributor

varlesh commented Jul 5, 2022

@ilya-fedin У вас точно mate-screensaver , а не xscreenserver, потому как у них траблы с лицензией начались?
mate-desktop/mate-screensaver#243

@ilya-fedin
Copy link
Author

   ps aux | grep screensave
ilya        1318  0.0  0.6 379520 42092 ?        Sl   17:18   0:00 mate-screensaver
ilya        2442  0.3  0.9 628516 57416 ?        Sl   17:32   0:01 mate-screensaver-preferences
ilya        2493  0.7  0.6 163040 41312 ?        Sl   17:32   0:02 /nix/store/sddkixv6cxvacw07bcd3ivi2b4jxh47j-mate-screensaver-1.26.1/libexec/mate-screensaver/slideshow --location=/nix/store/sddkixv6cxvacw07bcd3ivi2b4jxh47j-mate-screensaver-1.26.1/share/backgrounds/cosmos

@varlesh
Copy link
Contributor

varlesh commented Jul 5, 2022

Значит опять убунтовские костыли. Спасибо Илья!

varlesh added a commit that referenced this issue Jul 6, 2022
@varlesh
Copy link
Contributor

varlesh commented Jul 6, 2022

@ilya-fedin added 16px, please try it

@ilya-fedin
Copy link
Author

изображение
sticker

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

No branches or pull requests

2 participants