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

@2x icons #184

Closed
andia89 opened this issue Oct 31, 2016 · 15 comments
Closed

@2x icons #184

andia89 opened this issue Oct 31, 2016 · 15 comments
Assignees

Comments

@andia89
Copy link
Collaborator

andia89 commented Oct 31, 2016

We should somehow implement, that if a icon name contains @2x it should be doubled in size (if it is a png at least). This should enable us to have HiDPi support

@bilelmoussaoui
Copy link
Owner

bilelmoussaoui commented Oct 31, 2016

This was already implemented in order to fix Caprine icons #169
Edit: if you have any issue with that, you can reopen this one

@andia89
Copy link
Collaborator Author

andia89 commented Oct 31, 2016

Ah I see, but this is not a good fix, isn't it?
Instead of looking for a 22px icon and double it in size, the script is now looking for a 44px sized icon which arguably does not exist. The theme_lookup funtion should still looking for a 22px icon, and after converting it to png (no further action needed for svg icons) it should double its size

@bilelmoussaoui
Copy link
Owner

Ah i didn't think of that! Do you have any idea how to double an svg icon on size? I thnik we can only use Inksape for an easy solution..

@andia89
Copy link
Collaborator Author

andia89 commented Oct 31, 2016

How did you do it for numix-core? There I guess you have to do multiple sizes, right?

@bilelmoussaoui
Copy link
Owner

Ah completly forgot that i have already did that :P I will implement the same code here 👍

@bilelmoussaoui bilelmoussaoui added this to the v4.0 milestone Oct 31, 2016
@bilelmoussaoui bilelmoussaoui self-assigned this Oct 31, 2016
@andia89
Copy link
Collaborator Author

andia89 commented Oct 31, 2016

We have to think about how to handle all the script (electron) things though, where there are also potentially @2x icons.

@bilelmoussaoui
Copy link
Owner

I will save the icons on /tmp folder and i can give the icon path to electron script which only have to handle the case where the icon is a path, what do you think?

@andia89
Copy link
Collaborator Author

andia89 commented Oct 31, 2016

Hmm, I really like the current situation where everthing is written into ram instead of saving it to hard disc. We can keep the binary blob of the png in working memory, just like we do right now for electron scripts...

@andia89
Copy link
Collaborator Author

andia89 commented Oct 31, 2016

png_io = BytesIO()
        img.write_to_png(png_io)
        with open(outfile, 'wb') as fout:
            fout.write(png_io.getvalue())
        svg.close()
        png_io.close()
        img.finish()

png_io should be the correct icon right? No need to write a temporary icon anywhere imo

@bilelmoussaoui
Copy link
Owner

Ah yeah! i will implement it that way 👍

@andia89
Copy link
Collaborator Author

andia89 commented Oct 31, 2016

maybe we can rewrite the svgtopng script to accept a size argument?

@bilelmoussaoui
Copy link
Owner

Yeah :) it's the easiest solution we can implement !

@andia89
Copy link
Collaborator Author

andia89 commented Oct 31, 2016

Top 👍

@bilelmoussaoui
Copy link
Owner

Done! Will push the new code in few minutes
capture du 2016-11-02 16-55-25
icontrayunread
icontrayunread 2x
icontrayunread 4x
The quality is quite nice 👍

@bilelmoussaoui
Copy link
Owner

bilelmoussaoui commented Nov 2, 2016

Fixed

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