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

Session icons are blurry on hidpi screens when window scaling is greater than 1 #403

Open
dccoder84 opened this issue Sep 26, 2023 · 10 comments · May be fixed by #476
Open

Session icons are blurry on hidpi screens when window scaling is greater than 1 #403

dccoder84 opened this issue Sep 26, 2023 · 10 comments · May be fixed by #476

Comments

@dccoder84
Copy link

session_logout

From what I see the icons are available with a maximum size of 48 px but for example I would need 96 px when window scaling is set to 2x.

For example the icon system-shutdown is only available in these sizes:


actions/16/system-shutdown.png
actions/22/system-shutdown.png
actions/24/system-shutdown-symbolic.svg
actions/24/system-shutdown.png
actions/32/system-shutdown.png
actions/48/system-shutdown.png
actions/symbolic/system-shutdown-symbolic.svg
panel/16/system-shutdown-panel-restart.png
panel/16/system-shutdown-panel.png
panel/22/system-shutdown-panel-restart.png
panel/22/system-shutdown-panel.png

So can we have higher res PNGs of these icons with 96 px?

newhoa added a commit to newhoa/elementary-xfce that referenced this issue Apr 5, 2024
Add an optional --hidpi configure flag to allow installing
as a fully SVG theme, with an updated index.theme for HiDPI
support. This will be seen when Scaling is set to 2x or 3x.

Fixes issues where wrong icons are shown in some places with
scaling enabled (like the Places sidebars in file managers),
and blurry icon issues, especially with scaling enabled.
The PNG non-HiDPI theme also restricted the amount of zoom
steps the icons had with scaling enabled, so this should
resolve that as well.

Fixes shimmerproject#124
Fixes shimmerproject#317
Fixes shimmerproject#362
Fixes shimmerproject#403
newhoa added a commit to newhoa/elementary-xfce that referenced this issue Apr 5, 2024
Add an optional --hidpi configure flag to allow installing
as a fully SVG theme, with an updated index.theme for HiDPI
support. This will be seen when Scaling is set to 2x or 3x.

Fixes issues where wrong icons are shown in some places with
scaling enabled (like the Places sidebars in file managers),
and blurry icon issues, especially with scaling enabled.
The PNG non-HiDPI theme also restricted the amount of zoom
steps the icons had with scaling enabled, so this should
resolve that as well.

Fixes shimmerproject#124
Fixes shimmerproject#317
Fixes shimmerproject#362
Fixes shimmerproject#403
newhoa added a commit to newhoa/elementary-xfce that referenced this issue May 16, 2024
Add an optional --hidpi configure flag to allow installing
as a fully SVG theme, with an updated index.theme for HiDPI
support. This will be seen when Scaling is set to 2x or 3x.

Fixes issues where wrong icons are shown in some places with
scaling enabled (like the Places sidebars in file managers),
and blurry icon issues, especially with scaling enabled.
The PNG non-HiDPI theme also restricted the amount of zoom
steps the icons had with scaling enabled, so this should
resolve that as well.

Fixes shimmerproject#124
Fixes shimmerproject#317
Fixes shimmerproject#362
Fixes shimmerproject#403
newhoa added a commit to newhoa/elementary-xfce that referenced this issue May 16, 2024
Add an optional --hidpi configure flag to allow installing
as a fully SVG theme, with an updated index.theme for HiDPI
support. This will be seen when Scaling is set to 2x or 3x.

Fixes issues where wrong icons are shown in some places with
scaling enabled (like the Places sidebars in file managers),
and blurry icon issues, especially with scaling enabled.
The PNG non-HiDPI theme also restricted the amount of zoom
steps the icons had with scaling enabled, so this should
resolve that as well.

Fixes shimmerproject#124
Fixes shimmerproject#317
Fixes shimmerproject#362
Fixes shimmerproject#403
newhoa added a commit to newhoa/elementary-xfce that referenced this issue May 16, 2024
Add an optional --hidpi configure flag to allow installing
as a fully SVG theme, with an updated index.theme for HiDPI
support. This will be seen when Scaling is set to 2x or 3x.

Fixes issues where wrong icons are shown in some places with
scaling enabled (like the Places sidebars in file managers),
and blurry icon issues, especially with scaling enabled.
The PNG non-HiDPI theme also restricted the amount of zoom
steps the icons had with scaling enabled, so this should
resolve that as well.

Fixes shimmerproject#124
Fixes shimmerproject#317
Fixes shimmerproject#362
Fixes shimmerproject#403
@newhoa
Copy link
Contributor

newhoa commented May 16, 2024

@dccoder84 Sorry for the delay on this, and thanks for reporting!

I added a PR for HiDPI support. If you'd like to test this branch out on your system (use --hidpi when building, ./configure --hidpi --prefix=$HOME/.local) and see if it fixes some of your icon scaling issues.

Installing the HiDPI/SVG theme should scale icons better. And if the app supports scaling, it will properly use the 48px icon doubled to 96px. Xfce has been adding icon scaling to their apps during the 4.18/4.19 development. xfce4-session seems to work with this on my test (using 4.18.3), but let me know if you run into any issues. Thanks!

@dccoder84
Copy link
Author

Hi @newhoa, thank you but I already solved the hidpi problems of elementary xfce icon theme for all icons. Though it's only working for me personally. I did two things. First I changed all occurences of Type=Scalable in the index.theme file with Type=Fixed. With this change almost all icons are displaying correctly. For icons which are still blurry I created the missing .png files for the missing resolutions and stored them in the correct sub folders of ~/.local/share/icons/elementary-xfce. Then I refreshed the icon caches with this command: sudo update-icon-caches /usr/share/icons/*.

As I said most icons are displaying correct on my 4K display with gui scaling of 2x when I change the index.theme file. Among the few icons which were still blurry were the session icons and a few others. Due to the blurryness of some icons I could easily see which icons were missing in some specific resolutions for the elementary xfce icon theme. I guess I should report the few other icons which are missing in specific resolutions.

@dccoder84
Copy link
Author

@newhoa What do you think? Should I report the few other icons which are missing in specific resolutions as .png files. Or is this no longer necessary with your PR?

@dccoder84
Copy link
Author

@newhoa Also, wasn't @ochosi against a hidpi setup due to performance reasons when using svg files? I mean don't get me wrong, I am totally in favor of a hidpi setup of the elementary xfce icon theme :)

@newhoa
Copy link
Contributor

newhoa commented May 19, 2024

@dccoder84 Sorry for the trouble! Glad you worked it out, but Type=Fixed is more of a band-aid/workaround for this issue and can cause widgets (buttons, etc) to shrink/expand if it can only find the fixed icon in a different size than requested. So I don't think it's something we can do by default.

For proper 2x/3x scaling, Type=Scaling is required along with SVGs. Danielle Foré of elementaryOS did a nice writeup on it here if you're interested in the details. The blog explains how it works and shows how a 64px@2x icon is different than a 128px icon.

A quick example, aside from the border/alignment stuff, is that in the Thunar sidebar, we have the circle-with-down-arrow for Downloads at 16x and 24x, and the folder design in higher sizes. If you use 2x scaling with a non-HiDPI theme, you will get 32px and 48px folder icons. But with the Hi-DPI theme (and Thunar 4.19 with HiDPI icon support - anything after this commit I believe), you should get the 16px and 24px circle-with-down-arrow doubled.

And no need to report PNG icons that are missing when using scaling (but thanks for offering, and for the other reports). With this PR, the SVG/Hi-DPI is optional, so by default it is still PNG. But the PNG theme shouldn't be used for scaling anymore once we get a proper SVG option.

If you get time, maybe give that branch and the --hidpi option a try. I think you would see a big improvement. And getting feedback on it would be helpful. It should look better in parts of Xfce 4.18, and much better once 4.20 is released.

@dccoder84
Copy link
Author

dccoder84 commented May 25, 2024

@newhoa Sorry but how do I test your branch? Where can I apply the --hidpi option? Seems not to be in the Makefile and not to be in the configure file.

@dccoder84
Copy link
Author

@newhoa Please forget my last comment. I downloaded the wrong data. I now found there is an option for configure. I also tested it of course but without pretty results unfortunately. Please checkout this screenshot comparison:

With SVG icons, your new branch with --hidpi enabled:

thunar with svg icons

My personal index.theme hack based on PNG files:

thunar with png icons

Open the images with a program which displays them in their native size. Firefox is bad at this because Firefox ignores GUI scaling and so with GUI scaling set to for example 2x will show images in Firefox with 200% scaling if you only open the image (no web page) in Firefox. A recent version of Ristretto does a much better job ;) So with Ristretto you can see a clear difference between the images.

@dccoder84
Copy link
Author

Maybe that rendering of the SVG icon is intended that way. But if so I don't like it. Actually the icons don't look blurry but they look like they are drawn with a thicker pencil.

@newhoa
Copy link
Contributor

newhoa commented May 26, 2024

@dccoder84 Thank you for testing and for the screenshots!

Some questions if you have time:

  1. What version of Thunar are you using?
  2. What is your monitor size, and what is its display resolution?
  3. What size do you have your sidebar icons set to? (Edit > Preferences > Side Pane)
  4. What zoom level in the icon view?

Thanks!

@dccoder84
Copy link
Author

dccoder84 commented May 26, 2024

You're welcome!

  1. What version of Thunar are you using?
    4.19.2git-UNKNOWN
  2. What is your monitor size, and what is its display resolution?
    27", 4K, GUI scaling 2x (Xfce Settings -> Appearance -> Settings Tab -> Window Scaling)
    Xfce has two different GUI scaling settings in different locations. The other is in the display settings but I have only set the one under "Appearance"
  3. What size do you have your sidebar icons set to? (Edit > Preferences > Side Pane)
    16px
  4. What zoom level in the icon view?
    "normal size" aka minimum

newhoa added a commit to newhoa/elementary-xfce that referenced this issue Aug 24, 2024
Install SVG-based HiDPI theme alongside the PNG-based theme.
This should be used for better icon scaling, specifically when
Scaling is set to 2x or 3x. PNG may be a bit faster to load,
so the SVG HiDPI theme is optional.

Using the HiDPI theme will fix issues where the wrong icons are shown in
some places with scaling enabled (like the Places sidebars in file managers).
It should also fix and blurry icon issues, especially with scaling enabled.
The PNG non-HiDPI theme restricted the amount of zoom steps the icons had
in file managers with scaling enabled, so this should resolve that as well.

Fixes shimmerproject#124
Fixes shimmerproject#317
Fixes shimmerproject#362
Fixes shimmerproject#403
@newhoa newhoa linked a pull request Aug 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants