Skip to content

Commit

Permalink
Add custom Windows tile
Browse files Browse the repository at this point in the history
  • Loading branch information
J5lx committed Aug 31, 2023
1 parent 160435c commit e1c00fc
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 14 deletions.
12 changes: 8 additions & 4 deletions .github/actions/create-package/create-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-inte
create_package_macos() {
echo "::group::Clean"
make clean
mv bin Pencil2D
mkdir Pencil2D
mv app/Pencil2D.app Pencil2D/
pushd Pencil2D >/dev/null
echo "::endgroup::"

Expand Down Expand Up @@ -88,16 +89,19 @@ create_package_macos() {
}

create_package_windows() {
echo "::group::Set up application files"
nmake install INSTALL_ROOT="$(cygpath -w "${PWD}/Pencil2D")"
echo "::endgroup::"

echo "Copy FFmpeg plugin"
local platform="${INPUT_ARCH%%_*}"
local ffmpeg="ffmpeg-${platform}.zip"
curl -fsSLO "https://github.com/pencil2d/pencil2d-deps/releases/download/ffmpge-v4.1.1/$ffmpeg"
"${WINDIR}\\System32\\tar" xf "${ffmpeg}"
mkdir bin/plugins
mv "ffmpeg.exe" bin/plugins/
mkdir Pencil2D/plugins
mv "ffmpeg.exe" Pencil2D/plugins/
rm -rf "${ffmpeg}"

mv bin Pencil2D
echo "Remove files"
find \( -name '*.pdb' -o -name '*.ilk' \) -delete
echo "::group::Deploy Qt libraries"
Expand Down
32 changes: 22 additions & 10 deletions app/app.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,11 @@

! include( ../util/common.pri ) { error( Could not find the common.pri file! ) }

QT += core widgets gui xml multimedia svg network

TEMPLATE = app
TARGET = pencil2d
QMAKE_APPLICATION_BUNDLE_NAME = Pencil2D

CONFIG += precompile_header lrelease embed_translations
QT += core widgets gui xml multimedia svg network

DESTDIR = ../bin
MOC_DIR = .moc
OBJECTS_DIR = .obj
UI_DIR = .ui
TARGET = pencil2d

RESOURCES += data/app.qrc

Expand Down Expand Up @@ -111,7 +104,6 @@ HEADERS += \
src/checkupdatesdialog.h \
src/presetdialog.h \
src/repositionframesdialog.h \
src/presetdialog.h \
src/commandlineparser.h \
src/commandlineexporter.h \
src/statusbar.h \
Expand Down Expand Up @@ -219,10 +211,30 @@ macx {
QMAKE_BUNDLE_DATA += FILE_ICONS

QMAKE_TARGET_BUNDLE_PREFIX += org.pencil2d
QMAKE_APPLICATION_BUNDLE_NAME = Pencil2D
}

win32 {
target.path = /
visualelements.path = /
visualelements.files = data/pencil2d.VisualElementsManifest.xml $$OUT_PWD\resources.pri
visualelements.CONFIG += no_check_exist
visualelements.depends += resources.pri
resources.path = /resources
resources.files = data/resources/*

PRI_CONFIG = data/resources.xml
PRI_INDEX_NAME = Pencil2D
RC_FILE = data/pencil2d.rc
INSTALLS += target visualelements resources

makepri.name = makepri
makepri.input = PRI_CONFIG
makepri.output = ${QMAKE_FILE_IN_BASE}.pri
makepri.commands = makepri new /o /in $$PRI_INDEX_NAME /pr ${QMAKE_FILE_PATH} /cf ${QMAKE_FILE_IN} /of ${QMAKE_FILE_OUT}
silent: makepri.commands = @echo makepri ${QMAKE_FILE_IN} && $$makepri.commands
makepri.CONFIG = no_link
QMAKE_EXTRA_COMPILERS += makepri
}

unix:!macx {
Expand Down
8 changes: 8 additions & 0 deletions app/data/pencil2d.VisualElementsManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<VisualElements
BackgroundColor="white"
ForegroundText="dark"
Square70x70Logo="tile70.png"
Square150x150Logo="tile150.png"
ShowNameOnSquare150x150Logo="off"/>
</Application>
10 changes: 10 additions & 0 deletions app/data/resources.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources targetOsVersion="6.2.1" majorVersion="1">
<index root="\" startIndexAt="resources\">
<default>
<qualifier name="scale" value="100"/>
<qualifier name="Language" value="en-US"/>
</default>
<indexer-config type="folder" foldernameAsQualifier="true" filenameAsQualifier="true" qualifierDelimiter="."/>
</index>
</resources>
Binary file added app/data/resources/tile150.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/data/resources/tile150.scale-140.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/data/resources/tile150.scale-180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/data/resources/tile150.scale-80.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/data/resources/tile70.scale-100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/data/resources/tile70.scale-140.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/data/resources/tile70.scale-180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/data/resources/tile70.scale-80.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e1c00fc

Please sign in to comment.