further revised icon system
- Move QRC generation to CMake so they can be generated automatically rather than with generate-style.sh - Removed QRC generation from generate-style.sh - Added extra "disabled icon" generation in generate-style.sh - Added disabled icon loading to main code
@@ -139,7 +139,9 @@ QIcon icon::Create(const QString& theme, const QString &name)
|
||||
|
||||
for (int i=0;i<ICON_SIZE_COUNT;i++) {
|
||||
icon.addFile(QStringLiteral("%1/png/%2.%3.png").arg(theme, name, QString::number(ICON_SIZES[i])),
|
||||
QSize(ICON_SIZES[i], ICON_SIZES[i]));
|
||||
QSize(ICON_SIZES[i], ICON_SIZES[i]), QIcon::Normal);
|
||||
icon.addFile(QStringLiteral("%1/png/%2.%3.disabled.png").arg(theme, name, QString::number(ICON_SIZES[i])),
|
||||
QSize(ICON_SIZES[i], ICON_SIZES[i]), QIcon::Disabled);
|
||||
}
|
||||
|
||||
return icon;
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
add_subdirectory(olive-dark)
|
||||
add_subdirectory(olive-light)
|
||||
|
||||
set(OLIVE_RESOURCES
|
||||
${OLIVE_RESOURCES}
|
||||
ui/style/olive-light/olive-light.qrc
|
||||
ui/style/olive-dark/olive-dark.qrc
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
|
||||
@@ -31,46 +31,23 @@ OUTPUT_SIZES=( 16 32 64 128 )
|
||||
|
||||
if [ $# -lt 1 ]
|
||||
then
|
||||
echo "Usage: $0 icon-pack-name [options]"
|
||||
echo "Generates sized PNG icons from SVG files"
|
||||
echo "Usage: $0 icon-pack-name"
|
||||
echo
|
||||
echo "Example: $0 olive-dark"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -n Only generate QRC file"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PACKNAME=$1
|
||||
SVGDIR=$1/svg
|
||||
PNGDIR=$1/png
|
||||
QRCFILE=$1/$1.qrc
|
||||
|
||||
mkdir -p $PNGDIR
|
||||
|
||||
ONLYQRC=0
|
||||
|
||||
if [ "$2" == "-n" ]
|
||||
then
|
||||
ONLYQRC=1
|
||||
fi
|
||||
|
||||
truncate -s 0 $QRCFILE
|
||||
|
||||
echo "<RCC>" >> $QRCFILE
|
||||
echo " <qresource prefix=\"/style/$PACKNAME\">" >> $QRCFILE
|
||||
echo " <file>style.css</file>" >> $QRCFILE
|
||||
echo " <file>palette.ini</file>" >> $QRCFILE
|
||||
|
||||
OutputPng() {
|
||||
echo Creating $2...
|
||||
|
||||
echo " <file>png/$(basename $2)</file>" >> $QRCFILE
|
||||
|
||||
if [ $ONLYQRC -eq 0 ]
|
||||
then
|
||||
inkscape -z -e $(pwd)/$2 -w $s -h $s $1
|
||||
fi
|
||||
inkscape --export-filename $2.png --export-width $s --export-height $s $1
|
||||
convert $2.png -alpha set -background none -channel A -evaluate multiply 0.25 +channel $2.disabled.png
|
||||
}
|
||||
|
||||
for f in $SVGDIR/*.svg
|
||||
@@ -79,9 +56,6 @@ do
|
||||
|
||||
for s in "${OUTPUT_SIZES[@]}"
|
||||
do
|
||||
OutputPng $f $PNGDIR/$FNBASE.$s.png
|
||||
OutputPng $f $PNGDIR/$FNBASE.$s
|
||||
done
|
||||
done
|
||||
|
||||
echo " </qresource>" >> $QRCFILE
|
||||
echo "</RCC>" >> $QRCFILE
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# Olive - Non-Linear Video Editor
|
||||
# Copyright (C) 2021 Olive Team
|
||||
#
|
||||
# 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 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
file(GLOB_RECURSE STYLE_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/png *.png)
|
||||
set(QRC_BODY "")
|
||||
list(TRANSFORM STYLE_RESOURCES PREPEND "png/")
|
||||
list(APPEND STYLE_RESOURCES "palette.ini")
|
||||
list(APPEND STYLE_RESOURCES "style.css")
|
||||
foreach(ICON_FILE ${STYLE_RESOURCES})
|
||||
string(APPEND QRC_BODY "<file>${ICON_FILE}</file>\n")
|
||||
configure_file("${ICON_FILE}" "${ICON_FILE}" COPYONLY)
|
||||
endforeach()
|
||||
configure_file(res.qrc.in res.qrc @ONLY)
|
||||
|
||||
set(OLIVE_RESOURCES
|
||||
${OLIVE_RESOURCES}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/res.qrc
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 541 B |
|
After Width: | Height: | Size: 603 B |
|
After Width: | Height: | Size: 783 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 565 B |
|
After Width: | Height: | Size: 647 B |
|
After Width: | Height: | Size: 966 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 573 B |
|
After Width: | Height: | Size: 695 B |
|
After Width: | Height: | Size: 985 B |
|
After Width: | Height: | Size: 864 B |
|
After Width: | Height: | Size: 446 B |
|
After Width: | Height: | Size: 506 B |
|
After Width: | Height: | Size: 600 B |
|
After Width: | Height: | Size: 775 B |
|
After Width: | Height: | Size: 435 B |
|
After Width: | Height: | Size: 481 B |
|
After Width: | Height: | Size: 550 B |
|
After Width: | Height: | Size: 854 B |
|
After Width: | Height: | Size: 446 B |
|
After Width: | Height: | Size: 506 B |
|
After Width: | Height: | Size: 597 B |
|
After Width: | Height: | Size: 831 B |
|
After Width: | Height: | Size: 443 B |
|
After Width: | Height: | Size: 498 B |
|
After Width: | Height: | Size: 583 B |
|
After Width: | Height: | Size: 836 B |
|
After Width: | Height: | Size: 442 B |
|
After Width: | Height: | Size: 500 B |
|
After Width: | Height: | Size: 589 B |
|
After Width: | Height: | Size: 841 B |
|
After Width: | Height: | Size: 444 B |
|
After Width: | Height: | Size: 498 B |
|
After Width: | Height: | Size: 586 B |
|
After Width: | Height: | Size: 844 B |
|
After Width: | Height: | Size: 441 B |
|
After Width: | Height: | Size: 502 B |
|
After Width: | Height: | Size: 593 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 560 B |
|
After Width: | Height: | Size: 719 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 517 B |
|
After Width: | Height: | Size: 609 B |
|
After Width: | Height: | Size: 803 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 560 B |
|
After Width: | Height: | Size: 685 B |
|
After Width: | Height: | Size: 901 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 585 B |
|
After Width: | Height: | Size: 736 B |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 639 B |
|
After Width: | Height: | Size: 909 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 928 B |
|
After Width: | Height: | Size: 526 B |
|
After Width: | Height: | Size: 540 B |
|
After Width: | Height: | Size: 637 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 505 B |
|
After Width: | Height: | Size: 597 B |
|
After Width: | Height: | Size: 803 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 546 B |
|
After Width: | Height: | Size: 622 B |
|
After Width: | Height: | Size: 817 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 764 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 565 B |
|
After Width: | Height: | Size: 687 B |
|
After Width: | Height: | Size: 880 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 532 B |
|
After Width: | Height: | Size: 651 B |
|
After Width: | Height: | Size: 839 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 520 B |
|
After Width: | Height: | Size: 578 B |
|
After Width: | Height: | Size: 730 B |
|
After Width: | Height: | Size: 841 B |
|
After Width: | Height: | Size: 487 B |
|
After Width: | Height: | Size: 522 B |
|
After Width: | Height: | Size: 598 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 608 B |
|
After Width: | Height: | Size: 855 B |
|
After Width: | Height: | Size: 1.3 KiB |