This repository has been archived by the owner on Mar 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render-asset-gtk3.sh: Separate 'eta' specific window-button rendering
- Loading branch information
Showing
5 changed files
with
103 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
gtk/asset/assets-gtk3-scripts/assets-gtk3-windowbutton-eta.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
gtk/asset/assets-gtk3-scripts/render-assets-gtk3-windowbutton-eta.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters