jpfleury / clearlooks-phenix

GTK3 port of the Clearlooks theme
GNU General Public License v3.0
96 stars 42 forks source link

Adapt for HiDPI compliance #19

Closed yurikhan closed 7 years ago

yurikhan commented 9 years ago

Hello,

I have adapted the gtk-3.0 part of Clearlooks-Phénix to play nice with HiDPI monitors.

Problem statement: The theme uses bitmap images for checkboxes, radios, grips and sliders. When displayed at 2× scale, these look blurry.

Solution mechanism: In the gtk-widgets-img.css file, for every background-image which references a PNG file, specify a second PNG file which represents the same shape rendered at double scale. E.g.:

.check,
.check row:selected,
.check row:selected:focus {
    -gtk-icon-source: -gtk-scaled(
        url("img/checkbox-unchecked.png"),
        url("img/checkbox-unchecked@2.png"));
}

In order to obtain 2× images, I chose to re-draw all images in SVG, then render them to PNG at single and double scale.

(I didn’t try very hard to preserve 1× images pixel-perfectly equivalent to original PNGs — only the spirit. If that’s a problem for you, say so.)

Since SVGs are now the sources from which PNGs are generated, I removed the PNGs and added a _src directory containing the SVGs and a Makefile to do the rendering. It assumes that inkscape is installed and available.

jpfleury commented 8 years ago

Sorry for the delay. I'll try to look at it as soon as possible. Thanks a lot.

jpfleury commented 8 years ago

Hi. Which version of GTK it was tested with? Thanks.

yurikhan commented 8 years ago

Sorry for not mentioning it. I’m currently on libgtk-3-0 version 3.10.8-0ubuntu1.6.

Upd: Hm, this doesn’t sound right. I am using 3.10.8 and developed and tested the change on that; but it might not have been a clean rebase to master.

Consider it untested. I guess I submitted the pull request for review, not as a suggestion to merge it right away. If you agree the feature is desirable and the method acceptable, I will test it on a more recent GTK.

jpfleury commented 7 years ago

See #32. Thanks a lot.