Jannomag/Yaru-Colors

On GTK4, "arrow slider" handles are too big and get cut off

nyanpasu64 opened this issue · 7 comments

In GTK4 apps, "sliders with arrows" are rendered at 2x their intended size, and overflow the bounding box and get cut off. This does not happen in Yaru (whose layout doesn't match Yaru Colors for some reason) or Adwaita.

Yaru Colors:
yaru colors sliders

Yaru:
yaru sliders

When I run gtk4-widget-factory and switch between themes in the Inspector, Yaru Colors and Default have almost the same layout, but Yaru layouts differently. When I run gtk3-widget-factory and switch between themes in the Inspector, Yaru Colors, Yaru, and Adwaita have the same layout.

Arch Linux, AUR yaru-colors-gtk-theme and yaru-colors-gtk-theme-git are both affected.

Latest Yaru supports gtk4 completely while the 21.04 Yaru, which is used in my latest release, doesn't.
It'll be fixed when I updated Yaru-Colors for 21.10 (hopefully).

I'm very busy atm, so I don't have any eta.

It also happens with GTK3 apps, I believe the bug is caused in these code snippets :

echo Rendering $ASSETS_DIR/$i@2.png
$INKSCAPE --export-id=$i \
--export-dpi=180 \
--export-id-only \
-o $ASSETS_DIR/$i.png $SRC_FILE >/dev/null \
&& $OPTIPNG -o7 --quiet $ASSETS_DIR/$i.png

echo Rendering $ASSETS_DIR/$i@2.png
$INKSCAPE --export-id=$i \
--export-dpi=180 \
--export-id-only \
-o $ASSETS_DIR/$i.png $SRC_FILE >/dev/null \
&& $OPTIPNG -o7 --quiet $ASSETS_DIR/$i.png

echo Rendering $ASSETS_DIR/$i@2.png
$INKSCAPE --export-id=$i \
--export-dpi=180 \
--export-id-only \
-o $ASSETS_DIR/$i.png $SRC_FILE >/dev/null \
#--export-background-opacity=0 \ # Old for Inkscape 0.9x
#--export-png=$ASSETS_DIR/$i.png $SRC_FILE >/dev/null \ # Old for Inkscape 0.9x

Where both $ASSETS_DIR/$i.png should be $ASSETS_DIR/$i@2.png (othrwise it's overwriting already generated normal-sized assets)

Few other typos, making some GTK2 assets not rendering :

-o $ASSETS_DIR/$i.png $SRC_FILE >/dev/null \
&& $OPTIPNG -o7 --quiet $ASSETS_DIR/$i.png
#--export-background-opacity=0 \ # Old for Inkscape 0.9x
#--export-png=$ASSETS_DIR/$i.png $SRC_FILE >/dev/null \ # Old for Inkscape 0.9x

-o $ASSETS_DIR/$i.png $SRC_FILE >/dev/null \
&& $OPTIPNG -o7 --quiet $ASSETS_DIR/$i.png
#--export-background-opacity=0 \ # Old for Inkscape 0.9x
#--export-png=$ASSETS_DIR/$i.png $SRC_FILE >/dev/null \ # Old for Inkscape 0.9x

-o $ASSETS_DIR/$i.png $SRC_FILE >/dev/null \
&& $OPTIPNG -o7 --quiet $ASSETS_DIR/$i.png
#--export-background-opacity=0 \ # Old for Inkscape 0.9x
#--export-png=$ASSETS_DIR/$i.png $SRC_FILE >/dev/null \ # Old for Inkscape 0.9x

Where each time $SRC_FILE should be replaced by $SRC_FILE_EXTERNAL

And finally :

sed -i -e "s/f6b6a0/$svg1_color/g" $source20l_path/assets.svgpi

.svgpi -> .svg

Can you do a pull request for this? The lack of time for this project is really hard for me...sorry.

@Jannomag No problem ! Should I also regenerate the Themes folder or do you want a PR only changing the theme-script.sh file ? In the first case, do I also include changes to fix #122 ?

Here is the PR : #127, I separated the regeneration of the Themes folder into a distinct commit (and this commit also contains a small change in theme-script.sh which fix --all not compiling GTK4).

@Jannomag Could you have a look at this when you have some time ?