Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

Commit

Permalink
Render-asset-gtk3.sh: Separate 'eta' specific window-button rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
tista500 committed May 10, 2017
1 parent db46cfc commit 0612946
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 26 deletions.
6 changes: 4 additions & 2 deletions gtk/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ indexeta_file = $(srcdir)/index.theme-eta
index_noktoeta_file = $(srcdir)/index.theme-nokto-eta

sassc_option = -a -M -t compact
parallel_option = -0 --no-notice --line-buffer --jobs 100% --noswap

# *******************************************
# * Generate CSS stylesheets and PNG images *
Expand Down Expand Up @@ -517,7 +518,7 @@ if ENABLE_PARALLEL
cd $(srcdir)/asset/assets-gtk3-scripts && \
./recolor-assets-gtk3.sh
cd $(srcdir)/asset/assets-gtk2-scripts && \
$(PARALLEL) -0 --no-notice --line-buffer --jobs 100% --noswap bash ::: \
$(PARALLEL) $(parallel_option) bash ::: \
render-assets-gtk2-arrow.sh \
render-assets-gtk2-button.sh \
render-assets-gtk2-checkradio.sh \
Expand All @@ -530,13 +531,14 @@ if ENABLE_PARALLEL
render-assets-gtk2-spin.sh \
clone-assets-gtk2.sh
cd $(srcdir)/asset/assets-gtk3-scripts && \
$(PARALLEL) -0 --no-notice --line-buffer --jobs 100% --noswap bash ::: \
$(PARALLEL) $(parallel_option) bash ::: \
render-assets-gtk3-checkbox.sh \
render-assets-gtk3-misc.sh \
render-assets-gtk3-radio.sh \
render-assets-gtk3-slider.sh \
render-assets-gtk3-toggle.sh \
render-assets-gtk3-windowbutton.sh \
render-assets-gtk3-windowbutton-eta.sh \
clone-assets-gtk3.sh
else
cd $(srcdir)/asset/assets-gtk2-scripts && \
Expand Down
24 changes: 24 additions & 0 deletions gtk/asset/assets-gtk3-scripts/assets-gtk3-windowbutton-eta.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
window-close-ssd-eta
window-close-ssd-eta-active
window-close-ssd-eta-backdrop
window-close-ssd-eta-backdrop-active
window-close-ssd-eta-backdrop-hover
window-close-ssd-eta-hover
window-minimize-ssd-eta
window-minimize-ssd-eta-active
window-minimize-ssd-eta-backdrop
window-minimize-ssd-eta-backdrop-active
window-minimize-ssd-eta-backdrop-hover
window-minimize-ssd-eta-hover
window-maximize-ssd-eta
window-maximize-ssd-eta-active
window-maximize-ssd-eta-backdrop
window-maximize-ssd-eta-backdrop-active
window-maximize-ssd-eta-backdrop-hover
window-maximize-ssd-eta-hover
window-unmaximize-ssd-eta
window-unmaximize-ssd-eta-active
window-unmaximize-ssd-eta-backdrop
window-unmaximize-ssd-eta-backdrop-active
window-unmaximize-ssd-eta-backdrop-hover
window-unmaximize-ssd-eta-hover
24 changes: 0 additions & 24 deletions gtk/asset/assets-gtk3-scripts/assets-gtk3-windowbutton.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,3 @@ window-unmaximize-ssd-backdrop
window-unmaximize-ssd-backdrop-active
window-unmaximize-ssd-backdrop-hover
window-unmaximize-ssd-hover
window-close-ssd-eta
window-close-ssd-eta-active
window-close-ssd-eta-backdrop
window-close-ssd-eta-backdrop-active
window-close-ssd-eta-backdrop-hover
window-close-ssd-eta-hover
window-minimize-ssd-eta
window-minimize-ssd-eta-active
window-minimize-ssd-eta-backdrop
window-minimize-ssd-eta-backdrop-active
window-minimize-ssd-eta-backdrop-hover
window-minimize-ssd-eta-hover
window-maximize-ssd-eta
window-maximize-ssd-eta-active
window-maximize-ssd-eta-backdrop
window-maximize-ssd-eta-backdrop-active
window-maximize-ssd-eta-backdrop-hover
window-maximize-ssd-eta-hover
window-unmaximize-ssd-eta
window-unmaximize-ssd-eta-active
window-unmaximize-ssd-eta-backdrop
window-unmaximize-ssd-eta-backdrop-active
window-unmaximize-ssd-eta-backdrop-hover
window-unmaximize-ssd-eta-hover
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#! /bin/bash
#
# This file is part of adapta-gtk-theme
#
# Copyright (C) 2016-2017 Tista <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#

INKSCAPE="`command -v inkscape`"

SRC_FILE="../assets-gtk3.svg"
ASSETS_DIR="../assets-gtk3"
INDEX="assets-gtk3-windowbutton-eta.txt"
KEY_FILE="../../sass/common/_key_colors.scss"

inkver="`$INKSCAPE --version | awk '{print $2}' | cut -c 1-4`"
if [ "$inkver" = 0.91 ]; then
non_scale_dpi=90
scale_dpi=180
else
non_scale_dpi=96
scale_dpi=192
fi

#Renderer
render-non-scale() {
$INKSCAPE --export-id=$i \
--export-dpi="$non_scale_dpi" \
--export-id-only \
--export-png=$ASSETS_DIR/$i.png $SRC_FILE >/dev/null \
2>>../inkscape.log
}

render-scale() {
$INKSCAPE --export-id=$i \
--export-dpi="$scale_dpi" \
--export-id-only \
--export-png=$ASSETS_DIR/$i@2.png $SRC_FILE >/dev/null \
2>>../inkscape.log
}

# Generate PNG files
for i in $(<$INDEX)
do
if [ -f $ASSETS_DIR/$i.png ] && [ $KEY_FILE -ot $ASSETS_DIR/$i.png ]; then
echo $ASSETS_DIR/$i.png exists.
elif [ -f $ASSETS_DIR/$i.png ] && [ $KEY_FILE -nt $ASSETS_DIR/$i.png ]; then
echo Re-rendering $ASSETS_DIR/$i.png
echo $i.png >>../inkscape.log
rm -f $ASSETS_DIR/$i.png
render-non-scale
else
echo Rendering $ASSETS_DIR/$i.png
echo $i.png >>../inkscape.log
render-non-scale
fi

if [ -f $ASSETS_DIR/$i@2.png ] && [ $KEY_FILE -ot $ASSETS_DIR/$i@2.png ]; then
echo $ASSETS_DIR/$i@2.png exists.
elif [ -f $ASSETS_DIR/$i@2.png ] && [ $KEY_FILE -nt $ASSETS_DIR/$i@2.png ]; then
echo Re-rendering $ASSETS_DIR/$i@2.png
echo $i@2.png >>../inkscape.log
rm -f $ASSETS_DIR/$i@2.png
render-scale
else
echo Rendering $ASSETS_DIR/$i@2.png
echo $i@2.png >>../inkscape.log
render-scale
fi
done
1 change: 1 addition & 0 deletions gtk/asset/assets-gtk3-scripts/render-assets-gtk3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
. "render-assets-gtk3-slider.sh"
. "render-assets-gtk3-toggle.sh"
. "render-assets-gtk3-windowbutton.sh"
. "render-assets-gtk3-windowbutton-eta.sh"
. "clone-assets-gtk3.sh"

exit 0

0 comments on commit 0612946

Please sign in to comment.