Jannomag / Yaru-Colors

A fork of Ubuntu's Yaru theme - in different colors
GNU General Public License v3.0
512 stars 42 forks source link

Missing GTK2 scale-slider.png asset on Dark variants #122

Closed koplo199 closed 2 years ago

koplo199 commented 3 years ago

Hi, It looks like there's a missing GTK2 asset for Dark variants of the theme, from the logs :

/usr/share/themes/Yaru-Purple-dark/gtk-2.0/main.rc:1140: Unable to locate image file in pixmap_path: "assets/scale-slider.png"
/usr/share/themes/Yaru-Purple-dark/gtk-2.0/main.rc:1141: Background image options specified without filename
/usr/share/themes/Yaru-Purple-dark/gtk-2.0/main.rc:1167: Unable to locate image file in pixmap_path: "assets/scale-slider.png"
/usr/share/themes/Yaru-Purple-dark/gtk-2.0/main.rc:1168: Background image options specified without filename

Screenshots illustrating the issue :

Screenshot from 2021-10-02 16-55-05

Light/Normal variants working as expected :

Screenshot from 2021-10-02 16-54-55

There's also no issue with the disabled/hover version of scale-slider.png, this is especially visible for Qt applications when QT_QPA_PLATFORMTHEME=gtk2 is set, which is (to my knowledge) the only way to make Qt apps to respect the system theme

I checked in the assets folder and indeed scale-slider.png is missing in Dark variants, but as these files are generated I don't know where to make the change to resolve the issue, could you please have a look on this ? Thank you !

koplo199 commented 3 years ago

Ok I was able to fix it by modifying assets-dark-fixed.svg and dark/gtk-2.0/assets.svg, in which the scale-slider.png entry looked odd compared to other entries :

Screenshot from 2021-10-02 21-56-37

Here is the .diff of the changes :

diff --git a/src/assets-dark-fixed.svg b/src/assets-dark-fixed.svg
index ad951ba1..f005a91d 100644
--- a/src/assets-dark-fixed.svg
+++ b/src/assets-dark-fixed.svg
@@ -2404,7 +2404,10 @@
     <g
        id="scale-slider"
        inkscape:label="#g5227"
-       transform="translate(-43,230)">
+       transform="translate(-43,230)"
+       inkscape:export-filename="/home/jupiter007/yaru/gtk/src/dark/gtk-2.0/assets/scale-slider.png"
+       inkscape:export-xdpi="96"
+       inkscape:export-ydpi="96">
       <rect
          style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;enable-background:accumulate"
          id="rect5356-6"
diff --git a/src/dark/gtk-2.0/assets.svg b/src/dark/gtk-2.0/assets.svg
index 8feef7f1..f005a91d 100644
--- a/src/dark/gtk-2.0/assets.svg
+++ b/src/dark/gtk-2.0/assets.svg
@@ -2402,7 +2402,9 @@
          style="opacity:1;fill:none;fill-opacity:1;stroke:#b56d54;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
     </g>
     <g
-       id="g1967"
+       id="scale-slider"
+       inkscape:label="#g5227"
+       transform="translate(-43,230)"
        inkscape:export-filename="/home/jupiter007/yaru/gtk/src/dark/gtk-2.0/assets/scale-slider.png"
        inkscape:export-xdpi="96"
        inkscape:export-ydpi="96">

fix_gtk2_scaleslider.diff.txt

Jannomag commented 3 years ago

I don't have much time atm. Can you check this with the latest Yaru source files?

This would help a lot. If their files are wrong, may you open a pull request for Yaru?

koplo199 commented 3 years ago

After checking Yaru source files, It looks like it is already fixed upstream by a PR made by... you ? haha : https://github.com/ubuntu/yaru/pull/2817/files

Looks like you just didn't reflect this change there yet ^^