Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22cae20707 | ||
|
|
447a6b45af | ||
|
|
f946247d1d | ||
|
|
f9991998ed | ||
|
|
40d82e757e | ||
|
|
da190a22c1 | ||
|
|
2995f06d49 | ||
|
|
ff6a9ebfae | ||
|
|
e01718928c | ||
|
|
f5dbf44ec7 | ||
|
|
f55f8c731d | ||
|
|
4ed491c78a | ||
|
|
b54cde2cbf | ||
|
|
b1d12cc406 | ||
|
|
aa13355966 | ||
|
|
bd35a8c3e0 | ||
|
|
81413b51da | ||
|
|
a01d640c27 | ||
|
|
16800df138 | ||
|
|
7e8fd4ea21 | ||
|
|
04fa491cd8 | ||
|
|
dbf8c09368 | ||
|
|
369a17ed7d | ||
|
|
b19a4f8723 | ||
|
|
a8e5464e9f | ||
|
|
46f46480cb | ||
|
|
c06f900ac5 | ||
|
|
31303a20c7 | ||
|
|
319fd64fc6 | ||
|
|
cdd0b764a7 | ||
|
|
2a69482adb | ||
|
|
fc3ef1cd7f | ||
|
|
1de1517a81 | ||
|
|
04a4ab9bff | ||
|
|
011c1e858f | ||
|
|
4fe09757b3 | ||
|
|
82f1f10cca | ||
|
|
60eebea741 | ||
|
|
9b151e2fea | ||
|
|
9db9c3e9f7 | ||
|
|
9a18a41b8f | ||
|
|
c93ed94210 | ||
|
|
f4d272e014 | ||
|
|
d536e8c611 | ||
|
|
c8dfccb460 | ||
|
|
6fde9474ae | ||
|
|
c19fcaa560 | ||
|
|
602e2cccf8 | ||
|
|
3c1a3c54a7 | ||
|
|
032752faf9 | ||
|
|
457647c59f | ||
|
|
821e0f9fd6 | ||
|
|
26f51e418d | ||
|
|
cd2eac44f1 | ||
|
|
f0bb945c7d | ||
|
|
870e472f53 | ||
|
|
76677381de | ||
|
|
d2bd521ad0 | ||
|
|
265e894b3f | ||
|
|
6339a93c6c | ||
|
|
6da53ced81 | ||
|
|
8f0d4da7ad | ||
|
|
9c8ffb6c1b | ||
|
|
4c5c5e6fc6 | ||
|
|
b8cb10bb33 | ||
|
|
6e2f40633e | ||
|
|
a0ba7c1d17 | ||
|
|
b6d759d7c6 | ||
|
|
437c2f5618 | ||
|
|
7fd4924e64 | ||
|
|
c77808f3d8 | ||
|
|
86075a1ad0 | ||
|
|
a8e40a725c | ||
|
|
8edb6b015e | ||
|
|
5b2255e903 | ||
|
|
4948ea7445 | ||
|
|
e09348e064 | ||
|
|
fce6a835b7 | ||
|
|
afcd126c00 | ||
|
|
aa025b0f3b | ||
|
|
e6e738412d | ||
|
|
2e748e19e1 | ||
|
|
4b5c9e9ebd | ||
|
|
cdfa8b78a4 | ||
|
|
1ba5ae60dc | ||
|
|
08d1c09033 | ||
|
|
612b542e2a | ||
|
|
d74db66ab5 | ||
|
|
9dd34b3fce | ||
|
|
adfe6c51da | ||
|
|
96565b2ccf | ||
|
|
107440145a | ||
|
|
1c55e3194e | ||
|
|
9021ff2579 | ||
|
|
10e1e91e7b | ||
|
|
ef887d7a06 | ||
|
|
5446d94966 | ||
|
|
a2f42c2e3d | ||
|
|
56b18353db | ||
|
|
9170765344 | ||
|
|
ee7b3beda4 | ||
|
|
919a672c17 | ||
|
|
e52a6d8eed | ||
|
|
8b0c8ec194 | ||
|
|
1da7fff518 | ||
|
|
e216592205 | ||
|
|
8fc9d06937 | ||
|
|
73b15da182 | ||
|
|
f4f7d93e38 | ||
|
|
591b01a83a | ||
|
|
f8d3dcc899 | ||
|
|
f0ed9d0ca1 | ||
|
|
13227cfac9 | ||
|
|
b73df5ea1a | ||
|
|
4375fe1c2d | ||
|
|
4654cb21a0 | ||
|
|
ba23208a7a | ||
|
|
ed5a602332 | ||
|
|
347681e604 | ||
|
|
505ab9e2a6 | ||
|
|
c787e14a69 | ||
|
|
29c5783a66 | ||
|
|
ddc75f7cd0 | ||
|
|
f976fea418 | ||
|
|
2846e4907b | ||
|
|
c828f86b74 | ||
|
|
040e2a7b5f | ||
|
|
b566096b1f | ||
|
|
2bee79c064 | ||
|
|
91696963ae | ||
|
|
1623ca315a | ||
|
|
3cfb25db9a | ||
|
|
36854d19f4 | ||
|
|
3f7ebd2f6c | ||
|
|
291a98ea97 | ||
|
|
24a0b581f3 | ||
|
|
369aa13be3 | ||
|
|
b964fdc77f | ||
|
|
d6d2703c93 | ||
|
|
c6068ba23d | ||
|
|
fbdd858fbd | ||
|
|
8333f17199 | ||
|
|
30eb06cba7 | ||
|
|
0a45cd7c22 | ||
|
|
fc417b30e5 | ||
|
|
8568f6d4ef | ||
|
|
8832c2daa9 | ||
|
|
da9d7d6989 | ||
|
|
317d296507 | ||
|
|
f24743e381 | ||
|
|
fd4af282af | ||
|
|
4de03dd02e | ||
|
|
bfaf702606 | ||
|
|
3203d7f598 | ||
|
|
cbd006bae7 | ||
|
|
fc13a497d3 | ||
|
|
183a61b2f6 | ||
|
|
ae07c5fe44 | ||
|
|
a33381557b | ||
|
|
6d8ec6a54a | ||
|
|
dd3209e3ff | ||
|
|
088066197f | ||
|
|
3a8e907f28 | ||
|
|
eb04ac362b | ||
|
|
6d7d0e4e1d | ||
|
|
ff4f71c1e6 | ||
|
|
101f111209 | ||
|
|
c227c74e23 | ||
|
|
32ff813609 | ||
|
|
2de9ff810d | ||
|
|
57354fc135 | ||
|
|
07d0b0270e | ||
|
|
78e3e45a2e | ||
|
|
5a34441c72 | ||
|
|
b01601085b | ||
|
|
64c4d2e064 | ||
|
|
e64b871a2f | ||
|
|
06af632914 | ||
|
|
99abf3b69d | ||
|
|
42b6510877 | ||
|
|
aa746721f0 | ||
|
|
42e3d4c691 | ||
|
|
a993437983 | ||
|
|
8cce48e6b0 | ||
|
|
d0bdc71cf5 | ||
|
|
2071e82e1d | ||
|
|
b2f10b9193 | ||
|
|
9eb91dedf9 | ||
|
|
6f3c30fc5b | ||
|
|
3eade9c3cf | ||
|
|
fad7a668e3 | ||
|
|
c68e82c7c8 | ||
|
|
7e04ba84eb | ||
|
|
29355c7fc1 | ||
|
|
95f85374cf | ||
|
|
471a3b15ef | ||
|
|
5d2ddc199a | ||
|
|
fa0b86a995 | ||
|
|
b880406474 | ||
|
|
470a29c38c | ||
|
|
3a5ead8cc2 | ||
|
|
4dd3f22d88 | ||
|
|
3a4ea573f6 | ||
|
|
d574018a8e | ||
|
|
ae0f11c153 | ||
|
|
2bca7bd691 | ||
|
|
c2226ef5c7 | ||
|
|
3596f9eac4 | ||
|
|
a6e31a2c4d | ||
|
|
cd01a05f23 | ||
|
|
f32cb998ae | ||
|
|
eb2e2e93f9 | ||
|
|
4a095a0cfd | ||
|
|
d01297043e | ||
|
|
ae257ea567 | ||
|
|
edb1a84601 | ||
|
|
0436dfab39 | ||
|
|
87ed730891 | ||
|
|
85d6762828 | ||
|
|
a6360d5e66 | ||
|
|
a217ce9ee8 | ||
|
|
9fe3aca774 | ||
|
|
c636b14af8 | ||
|
|
f8587020d7 | ||
|
|
495ff31518 | ||
|
|
2671b6061d | ||
|
|
d52f22c0de | ||
|
|
471f6b9f32 | ||
|
|
2a30cc0dd3 | ||
|
|
8435fa0a9d | ||
|
|
99252ab732 | ||
|
|
7ec4420eaf | ||
|
|
a83cc61148 | ||
|
|
e0fda8f3b0 | ||
|
|
37cfdad799 | ||
|
|
370e64f192 | ||
|
|
d27f94bc4d | ||
|
|
be20c3d389 | ||
|
|
6145925283 | ||
|
|
bba4863853 | ||
|
|
a459dc2be6 | ||
|
|
f1da25f766 | ||
|
|
0e8370c39a | ||
|
|
a452ea2644 | ||
|
|
2fc6c59a30 | ||
|
|
67e6eac520 | ||
|
|
710d633678 | ||
|
|
23f160221b | ||
|
|
2d718b013b | ||
|
|
19de914046 | ||
|
|
1aa9674179 | ||
|
|
fd5929bc47 | ||
|
|
6158dfa630 | ||
|
|
9300f7812f | ||
|
|
9677fed3f2 | ||
|
|
7634c6db2b | ||
|
|
438103587a | ||
|
|
6e5bde68d8 | ||
|
|
27be83184e | ||
|
|
e79b5d3448 | ||
|
|
f420a61077 | ||
|
|
e927708f78 | ||
|
|
248f889cb3 | ||
|
|
ecfaf7f02b | ||
|
|
116d24087a | ||
|
|
32fc6735bd | ||
|
|
c5a5d07f50 | ||
|
|
eea7b24f6e | ||
|
|
67762b357d | ||
|
|
d80c661c66 | ||
|
|
0e1ec979cf | ||
|
|
ee3198f448 | ||
|
|
0c78d3668b | ||
|
|
4c2af150a6 | ||
|
|
9a9f61ae2f | ||
|
|
0e1635e0e7 | ||
|
|
d4ded92734 | ||
|
|
f96da17e78 | ||
|
|
1431f2b9d0 | ||
|
|
7db7cfd85a | ||
|
|
1e3d68df1c | ||
|
|
6fc9534184 | ||
|
|
6f28878837 | ||
|
|
c51ec4bd5d | ||
|
|
a29a1806a3 | ||
|
|
c69483eff1 | ||
|
|
edceac754f | ||
|
|
6a992f4c1f | ||
|
|
5aeb0f821f | ||
|
|
235e50439f | ||
|
|
ae931c8c51 | ||
|
|
3b279fca6a | ||
|
|
a55e873c48 | ||
|
|
20e028a643 | ||
|
|
777589e2dc | ||
|
|
c7727d233e | ||
|
|
e8722c687a | ||
|
|
2e2cbd40fa | ||
|
|
aa1e1b12ac | ||
|
|
c6a7032d73 | ||
|
|
e472000507 | ||
|
|
b11ea43ee5 | ||
|
|
bf89476421 | ||
|
|
e03a6e6c34 | ||
|
|
24f10168dc | ||
|
|
09dfbb0630 | ||
|
|
69f3d9920a | ||
|
|
dfc0571fbe | ||
|
|
62f80b1cbc | ||
|
|
d1fbf64011 | ||
|
|
51e49ab8a8 | ||
|
|
de394389e9 | ||
|
|
5534753786 | ||
|
|
b83de962cb | ||
|
|
a24c246fc7 | ||
|
|
8347028871 | ||
|
|
1cc5480f7d | ||
|
|
4fecf2da84 | ||
|
|
d535dedf60 | ||
|
|
cc7d58d4ec | ||
|
|
756d0be32f | ||
|
|
24f1c4e6d8 | ||
|
|
8b007bbc3e | ||
|
|
ec0427a153 | ||
|
|
0bbf148af6 | ||
|
|
93d1ca928e | ||
|
|
56e5f078c7 | ||
|
|
814068fa34 | ||
|
|
9f2e004951 | ||
|
|
75da5e8ca5 | ||
|
|
b033370d8e | ||
|
|
a2d8a0cd12 | ||
|
|
ea588211fc | ||
|
|
f09e5c8349 | ||
|
|
25c27e080d | ||
|
|
6bea81f6b8 | ||
|
|
b5d723017a | ||
|
|
d645c0f3be | ||
|
|
4babf20427 | ||
|
|
6270910e12 | ||
|
|
c9dadcbcad | ||
|
|
432266a6f0 | ||
|
|
5674230c4c | ||
|
|
6accd06864 | ||
|
|
0bf8e380de | ||
|
|
d51eb796b9 | ||
|
|
9e1b10831a | ||
|
|
00168a34f0 | ||
|
|
d7028b5515 | ||
|
|
052d23be60 | ||
|
|
9f4c9c7376 | ||
|
|
82eb53208e | ||
|
|
a6c08f32e5 | ||
|
|
c6b78597e8 | ||
|
|
f202bb58f4 | ||
|
|
560ece0f2f | ||
|
|
3f327f94dc | ||
|
|
7a1816cbac | ||
|
|
3a442b35f6 | ||
|
|
a4416cd77c | ||
|
|
26c4c8871d | ||
|
|
c6d0a4e508 | ||
|
|
b994d3e381 | ||
|
|
c0b9d7c21d | ||
|
|
fcd5e2cb84 | ||
|
|
64fa580131 | ||
|
|
24e259cb8b | ||
|
|
e8e7940abe | ||
|
|
c5e48d07ed | ||
|
|
328800a153 | ||
|
|
950e91a7cf | ||
|
|
7d2816e544 | ||
|
|
6b2db55b84 | ||
|
|
a400dcaeb1 | ||
|
|
62f485006f | ||
|
|
066b8458f4 | ||
|
|
c9e3274188 | ||
|
|
e20562cf16 | ||
|
|
7a0ed5bd56 | ||
|
|
3f9fa65edd | ||
|
|
36c54addce | ||
|
|
4c07a89ca3 | ||
|
|
635199b85b | ||
|
|
3e51cd5603 | ||
|
|
71e8df3107 | ||
|
|
8b86fb1434 | ||
|
|
038d04b3da | ||
|
|
69802a433e | ||
|
|
e4d54e85e2 | ||
|
|
b12328f41e | ||
|
|
6acafc77b4 | ||
|
|
fa4b49ddf7 | ||
|
|
8ae93ac4ae | ||
|
|
52a7883dbf | ||
|
|
8c05969c18 | ||
|
|
8d80f263b0 | ||
|
|
114e7359cd | ||
|
|
622938ac23 | ||
|
|
e1324d901c | ||
|
|
483bb07b09 | ||
|
|
cd94f1a84c | ||
|
|
6a9e5e80d0 | ||
|
|
deed477d49 | ||
|
|
a98b69eb6c | ||
|
|
f7cc22a032 | ||
|
|
05f808a26d | ||
|
|
7e7c36ea72 | ||
|
|
6d460a27d7 | ||
|
|
552d0fe072 | ||
|
|
b146150528 | ||
|
|
aecc3cf163 | ||
|
|
9c460f2ede | ||
|
|
6316431dcc | ||
|
|
713057412f | ||
|
|
7a69bb2fa2 | ||
|
|
50170eb4aa | ||
|
|
858c9e0ccf | ||
|
|
2b4bbc91a7 | ||
|
|
2b51194143 | ||
|
|
356fc6f670 | ||
|
|
a9ce8b0154 | ||
|
|
1449844fdd | ||
|
|
b3011f47e4 | ||
|
|
9b1b125d01 | ||
|
|
6d8f353602 | ||
|
|
4d8d98b2ff | ||
|
|
e658fb20a9 | ||
|
|
3abc16d3ff |
@@ -0,0 +1,3 @@
|
|||||||
|
# .git-blame-ignore-revs
|
||||||
|
# CR LF to LF
|
||||||
|
ed5a6023326fd2ab420ded76976501be33e0b389
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
*.txt text eol=lf
|
||||||
|
*.cpp text eol=lf
|
||||||
|
*.h text eol=lf
|
||||||
|
*.ui text eol=lf
|
||||||
|
*.qml text eol=lf
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ko_fi: blumia
|
||||||
|
custom: ["https://blumia.itch.io/pineapple-pictures"]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
name: macOS CI
|
name: macOS CI
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -8,10 +8,38 @@ jobs:
|
|||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v6
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v6
|
||||||
|
with:
|
||||||
|
enable-cache: true
|
||||||
|
- name: Install MetaGlot
|
||||||
|
run: uv tool install git+https://github.com/SarasasChipWorkshop/metaglot.git
|
||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v2.10.0
|
uses: jurplel/install-qt-action@v4
|
||||||
- name: Run a qt project
|
with:
|
||||||
|
version: '6.11.2'
|
||||||
|
modules: 'qtimageformats'
|
||||||
|
cache: true
|
||||||
|
- name: Install Conan and Dependencies
|
||||||
|
id: conan
|
||||||
|
working-directory: ./
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cmake ./
|
pip3 install wheel setuptools
|
||||||
make
|
pip3 install conan --upgrade
|
||||||
|
conan --version
|
||||||
|
conan profile detect
|
||||||
|
conan install --requires=exiv2/0.28.3 --generator CMakeDeps --generator CMakeToolchain --build=missing
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
cmake . -DTRANSLATION_RESOURCE_EMBEDDING=ON --preset conan-release
|
||||||
|
cmake --build --preset conan-release
|
||||||
|
- name: Deploy
|
||||||
|
run: |
|
||||||
|
macdeployqt ./ppic.app -dmg
|
||||||
|
ls
|
||||||
|
- uses: actions/upload-artifact@v6
|
||||||
|
with:
|
||||||
|
name: "macos-bundle"
|
||||||
|
path: "*.dmg"
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. <https://fsfe.org>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
|
name: REUSE Compliance Check
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
reuse-compliance-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: REUSE Compliance Check
|
||||||
|
uses: fsfe/reuse-action@v5
|
||||||
@@ -1,30 +1,34 @@
|
|||||||
name: Ubuntu 20.04 CI
|
name: Ubuntu CI
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
ubuntu-24-04-build:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v6
|
||||||
- name: Get build dept.
|
- name: Install uv
|
||||||
run: |
|
uses: astral-sh/setup-uv@v6
|
||||||
sudo apt update
|
with:
|
||||||
sudo apt install cmake qtbase5-dev libqt5svg5-dev qttools5-dev libexiv2-dev
|
enable-cache: true
|
||||||
- name: Build it
|
- name: Install MetaGlot
|
||||||
run: |
|
run: uv tool install git+https://github.com/SarasasChipWorkshop/metaglot.git
|
||||||
mkdir build
|
- name: Get build dept.
|
||||||
cd build
|
run: |
|
||||||
cmake ../
|
sudo apt update
|
||||||
make
|
sudo apt install cmake qt6-base-dev qt6-svg-dev qt6-tools-dev libexiv2-dev
|
||||||
cpack -G DEB
|
- name: Build it
|
||||||
- name: Try install it
|
run: |
|
||||||
run: |
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
sudo apt install ./*.deb
|
cmake ../
|
||||||
- uses: actions/upload-artifact@v2
|
make
|
||||||
with:
|
cpack -G DEB
|
||||||
name: ubuntu-20.04-deb-package
|
- name: Try install it
|
||||||
path: build/*.deb
|
run: |
|
||||||
|
cd build
|
||||||
|
sudo apt install ./*.deb
|
||||||
|
- uses: actions/upload-artifact@v6
|
||||||
|
with:
|
||||||
|
name: ubuntu-24.04-deb-package
|
||||||
|
path: build/*.deb
|
||||||
|
|||||||
@@ -0,0 +1,108 @@
|
|||||||
|
name: Windows CI
|
||||||
|
|
||||||
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
msvc-cmake-build:
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- qt_ver: '6.11.2'
|
||||||
|
vs: '2022'
|
||||||
|
aqt_arch: 'win64_msvc2022_64'
|
||||||
|
msvc_arch: 'x64'
|
||||||
|
|
||||||
|
runs-on: windows-2022
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v6
|
||||||
|
with:
|
||||||
|
enable-cache: true
|
||||||
|
- name: Install MetaGlot
|
||||||
|
run: uv tool install git+https://github.com/SarasasChipWorkshop/metaglot.git
|
||||||
|
- name: Install Qt
|
||||||
|
uses: jurplel/install-qt-action@v4
|
||||||
|
with:
|
||||||
|
arch: ${{ matrix.aqt_arch }}
|
||||||
|
version: ${{ matrix.qt_ver }}
|
||||||
|
modules: 'qtimageformats'
|
||||||
|
cache: true
|
||||||
|
# we need this until miurahr/aqtinstall#1007 ships 3.3.1 for Qt >= 6.11.0 for Windows.
|
||||||
|
aqtsource: 'aqtinstall @ git+https://github.com/miurahr/aqtinstall@16db45a70b5905ad596941b223469bc86a56901a'
|
||||||
|
- name: Build
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
:: ------ env ------
|
||||||
|
set PWD=%cd%
|
||||||
|
set VS=${{ matrix.vs }}
|
||||||
|
set VCVARS="C:\Program Files (x86)\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
|
||||||
|
if not exist %VCVARS% set VCVARS="C:\Program Files\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
|
||||||
|
call %VCVARS% ${{ matrix.msvc_arch }}
|
||||||
|
:: ------ dep ------
|
||||||
|
set CMAKE_PREFIX_PATH=%PWD%/dependencies_bin
|
||||||
|
mkdir dependencies_src
|
||||||
|
echo ::group::===== exiv2 =====
|
||||||
|
curl -fsSL -o exiv2_bin.zip https://github.com/Exiv2/exiv2/releases/download/v0.28.7/exiv2-0.28.7-2022msvc-AMD64.zip
|
||||||
|
7z x exiv2_bin.zip -y
|
||||||
|
ren .\exiv2-0.28.7-2022msvc-AMD64 dependencies_bin
|
||||||
|
echo ::endgroup::
|
||||||
|
echo ::group::===== zlib =====
|
||||||
|
curl -fsSL -o zlib_src.zip https://github.com/madler/zlib/releases/download/v1.3.2/zlib132.zip
|
||||||
|
7z x zlib_src.zip -y -o"dependencies_src"
|
||||||
|
ren .\dependencies_src\zlib-1.3.2 zlib || goto :error
|
||||||
|
cmake ./dependencies_src/zlib -Bbuild_dependencies/zlib -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error
|
||||||
|
cmake --build build_dependencies/zlib --config Release --target=install || goto :error
|
||||||
|
echo ::endgroup::
|
||||||
|
echo ::group::===== AOM for libavif AVI decoding support =====
|
||||||
|
git clone -q -b v3.13.1 --depth 1 https://aomedia.googlesource.com/aom dependencies_src/aom
|
||||||
|
cmake ./dependencies_src/aom -Bbuild_dependencies/aom -DCMAKE_INSTALL_PREFIX="dependencies_bin" -DENABLE_DOCS=OFF -DBUILD_SHARED_LIBS=ON -DAOM_TARGET_CPU=generic -DENABLE_TESTS=OFF -DENABLE_TESTDATA=OFF -DENABLE_TOOLS=OFF -DENABLE_EXAMPLES=0 || goto :error
|
||||||
|
cmake --build build_dependencies/aom --config Release --target=install || goto :error
|
||||||
|
echo ::endgroup::
|
||||||
|
echo ::group::===== libavif =====
|
||||||
|
curl -fsSL -o libavif-v1_3_0.zip https://github.com/AOMediaCodec/libavif/archive/v1.3.0.zip
|
||||||
|
7z x libavif-v1_3_0.zip -y -o"dependencies_src"
|
||||||
|
ren .\dependencies_src\libavif-1.3.0 libavif || goto :error
|
||||||
|
cmake ./dependencies_src/libavif -Bbuild_dependencies/libavif -DCMAKE_INSTALL_PREFIX="dependencies_bin" -DAVIF_CODEC_AOM=SYSTEM -DAVIF_CODEC_AOM_DECODE=ON -DAVIF_CODEC_AOM_ENCODE=ON -DAVIF_LIBYUV=LOCAL
|
||||||
|
cmake --build build_dependencies/libavif --config Release --target=install || goto :error
|
||||||
|
echo ::endgroup::
|
||||||
|
echo ::group::===== expat =====
|
||||||
|
curl -fsSL -o expat_src.zip https://github.com/libexpat/libexpat/archive/R_2_7_3.zip
|
||||||
|
7z x expat_src.zip -y -o"dependencies_src"
|
||||||
|
ren .\dependencies_src\libexpat-R_2_7_3 expat || goto :error
|
||||||
|
cmake ./dependencies_src/expat/expat -Bbuild_dependencies/expat -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error
|
||||||
|
cmake --build build_dependencies/expat --config Release --target=install || goto :error
|
||||||
|
echo ::endgroup::
|
||||||
|
echo ::group::===== ECM =====
|
||||||
|
git clone -q https://invent.kde.org/frameworks/extra-cmake-modules.git dependencies_src/extra-cmake-modules
|
||||||
|
cmake .\dependencies_src\extra-cmake-modules -Bbuild_dependencies/extra-cmake-modules -DCMAKE_INSTALL_PREFIX="dependencies_bin" -DBUILD_TESTING=OFF || goto :error
|
||||||
|
cmake --build build_dependencies/extra-cmake-modules --config Release --target=install || goto :error
|
||||||
|
echo ::endgroup::
|
||||||
|
echo ::group::===== KArchive =====
|
||||||
|
git clone -q https://invent.kde.org/frameworks/karchive.git dependencies_src/karchive
|
||||||
|
cmake .\dependencies_src\karchive -Bbuild_dependencies/karchive -DBUILD_TESTING=OFF -DWITH_LIBZSTD=OFF -DWITH_BZIP2=OFF -DWITH_LIBLZMA=OFF -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error
|
||||||
|
cmake --build build_dependencies/karchive --config Release --target=install || goto :error
|
||||||
|
echo ::endgroup::
|
||||||
|
echo ::group::===== KImageFormats =====
|
||||||
|
git clone -q https://invent.kde.org/frameworks/kimageformats.git dependencies_src/kimageformats
|
||||||
|
cmake .\dependencies_src\kimageformats -Bbuild_dependencies/kimageformats -DBUILD_TESTING=OFF -DKDE_INSTALL_QTPLUGINDIR=%QT_ROOT_DIR%\plugins || goto :error
|
||||||
|
cmake --build build_dependencies/kimageformats --config Release --target=install || goto :error
|
||||||
|
echo ::endgroup::
|
||||||
|
:: ------ app ------
|
||||||
|
echo ::group::===== App (Build'n'Install) =====
|
||||||
|
cmake -Bbuild .
|
||||||
|
cmake --build build --config Release
|
||||||
|
cmake --install build --config Release --prefix "%PWD%\build"
|
||||||
|
echo ::endgroup::
|
||||||
|
:: ------ pkg ------
|
||||||
|
windeployqt --verbose=2 --no-compiler-runtime --no-quick-import --no-translations --no-network --no-opengl-sw --no-system-d3d-compiler --no-system-dxc-compiler --skip-plugin-types tls,networkinformation build\bin\ppic.exe
|
||||||
|
robocopy ./dependencies_bin/bin build/bin *.dll
|
||||||
|
if ErrorLevel 8 (exit /B 1)
|
||||||
|
copy LICENSE build\bin
|
||||||
|
exit /B 0
|
||||||
|
- uses: actions/upload-artifact@v6
|
||||||
|
with:
|
||||||
|
name: "windows-msvc${{ matrix.vs }}-qt${{ matrix.qt_ver }}-cmake-package"
|
||||||
|
path: build/bin/*
|
||||||
@@ -2,8 +2,21 @@
|
|||||||
*.user
|
*.user
|
||||||
*.user.*
|
*.user.*
|
||||||
|
|
||||||
|
# Why, macOS, why?
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
# Translation files
|
# Translation files
|
||||||
*.qm
|
*.qm
|
||||||
|
*.mo
|
||||||
|
|
||||||
# Generic Build Dir
|
# Generic Build Dir
|
||||||
[Bb]uild/
|
[Bb]uild/
|
||||||
|
cmake-build-*/
|
||||||
|
|
||||||
|
# IDE/Editor config folders
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
.qtcreator/
|
||||||
|
|
||||||
|
# Clangd cache
|
||||||
|
.cache/
|
||||||
|
|||||||
@@ -1,62 +1,88 @@
|
|||||||
project (pineapple-pictures)
|
# SPDX-FileCopyrightText: 2022 - 2025 Gary Wang <git@blumia.net>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
cmake_minimum_required (VERSION 3.9.5)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
|
project(pineapple-pictures VERSION 1.6.0) # don't forget to update NEWS file and AppStream metadata.
|
||||||
|
|
||||||
include (GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
include (FeatureSummary)
|
include(FeatureSummary)
|
||||||
|
|
||||||
set (CMAKE_AUTOMOC ON)
|
|
||||||
set (CMAKE_AUTORCC ON)
|
|
||||||
set (QT_MINIMUM_VERSION "5.10")
|
|
||||||
|
|
||||||
option (EXIV2_METADATA_SUPPORT "Better image metadata support via libexiv2" ON)
|
option (EXIV2_METADATA_SUPPORT "Better image metadata support via libexiv2" ON)
|
||||||
|
option (TRANSLATION_RESOURCE_EMBEDDING "Embedding .qm translation files inside resource" OFF)
|
||||||
|
|
||||||
find_package(Qt5 ${QT_MINIMUM_VERSION} CONFIG REQUIRED Widgets Svg LinguistTools)
|
set (CMAKE_CXX_STANDARD 17)
|
||||||
|
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set (CMAKE_AUTOMOC ON)
|
||||||
|
set (CMAKE_AUTORCC ON)
|
||||||
|
set (CMAKE_AUTOUIC ON)
|
||||||
|
|
||||||
|
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core)
|
||||||
|
|
||||||
|
set (QT_MINIMUM_VERSION "6.5")
|
||||||
|
|
||||||
|
find_package(Qt${QT_VERSION_MAJOR} ${QT_MINIMUM_VERSION} REQUIRED
|
||||||
|
COMPONENTS Widgets Svg SvgWidgets LinguistTools
|
||||||
|
OPTIONAL_COMPONENTS DBus
|
||||||
|
)
|
||||||
|
|
||||||
if (EXIV2_METADATA_SUPPORT)
|
if (EXIV2_METADATA_SUPPORT)
|
||||||
find_package(LibExiv2)
|
find_package(exiv2)
|
||||||
set_package_properties(LibExiv2 PROPERTIES
|
set_package_properties(exiv2 PROPERTIES
|
||||||
URL "https://www.exiv2.org"
|
URL "https://www.exiv2.org"
|
||||||
DESCRIPTION "image metadata support"
|
DESCRIPTION "image metadata support"
|
||||||
TYPE OPTIONAL
|
TYPE RECOMMENDED
|
||||||
PURPOSE "Bring better image metadata support"
|
PURPOSE "Bring better image metadata support"
|
||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
#LibExiv2_FOUND
|
|
||||||
set (PPIC_CPP_FILES
|
set (PPIC_CPP_FILES
|
||||||
app/main.cpp
|
app/main.cpp
|
||||||
app/mainwindow.cpp
|
app/mainwindow.cpp
|
||||||
|
app/actionmanager.cpp
|
||||||
app/graphicsview.cpp
|
app/graphicsview.cpp
|
||||||
app/graphicsscene.cpp
|
app/graphicsscene.cpp
|
||||||
app/bottombuttongroup.cpp
|
app/bottombuttongroup.cpp
|
||||||
app/navigatorview.cpp
|
app/navigatorview.cpp
|
||||||
app/opacityhelper.cpp
|
|
||||||
app/toolbutton.cpp
|
|
||||||
app/settings.cpp
|
app/settings.cpp
|
||||||
app/settingsdialog.cpp
|
app/settingsdialog.cpp
|
||||||
app/aboutdialog.cpp
|
app/aboutdialog.cpp
|
||||||
app/metadatamodel.cpp
|
app/metadatamodel.cpp
|
||||||
app/metadatadialog.cpp
|
app/metadatadialog.cpp
|
||||||
app/exiv2wrapper.cpp
|
app/exiv2wrapper.cpp
|
||||||
|
app/playlistmanager.cpp
|
||||||
|
app/fileopeneventhandler.cpp
|
||||||
|
app/playlistscout.cpp
|
||||||
|
app/playlistscouts/qtscout.cpp
|
||||||
|
app/playlistscouts/explorerscout.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set (PPIC_HEADER_FILES
|
set (PPIC_HEADER_FILES
|
||||||
app/mainwindow.h
|
app/mainwindow.h
|
||||||
|
app/actionmanager.h
|
||||||
app/graphicsview.h
|
app/graphicsview.h
|
||||||
app/graphicsscene.h
|
app/graphicsscene.h
|
||||||
app/bottombuttongroup.h
|
app/bottombuttongroup.h
|
||||||
app/navigatorview.h
|
app/navigatorview.h
|
||||||
app/opacityhelper.h
|
|
||||||
app/toolbutton.h
|
|
||||||
app/settings.h
|
app/settings.h
|
||||||
app/settingsdialog.h
|
app/settingsdialog.h
|
||||||
app/aboutdialog.h
|
app/aboutdialog.h
|
||||||
app/metadatamodel.h
|
app/metadatamodel.h
|
||||||
app/metadatadialog.h
|
app/metadatadialog.h
|
||||||
app/exiv2wrapper.h
|
app/exiv2wrapper.h
|
||||||
|
app/playlistmanager.h
|
||||||
|
app/fileopeneventhandler.h
|
||||||
|
app/playlistscout.h
|
||||||
|
app/playlistscouts/qtscout.h
|
||||||
|
app/playlistscouts/explorerscout.h
|
||||||
|
)
|
||||||
|
|
||||||
|
set (PPIC_UI_FILES
|
||||||
|
app/settingsdialog.ui
|
||||||
|
app/aboutdialog.ui
|
||||||
|
app/metadatadialog.ui
|
||||||
|
app/mainwindow.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
set (PPIC_QRC_FILES
|
set (PPIC_QRC_FILES
|
||||||
@@ -70,46 +96,85 @@ set (PPIC_RC_FILES
|
|||||||
set (EXE_NAME ppic)
|
set (EXE_NAME ppic)
|
||||||
|
|
||||||
# Translation
|
# Translation
|
||||||
file (GLOB PPIC_TS_FILES translations/*.ts)
|
file (GLOB PPIC_TS_FILES locales/app/*.ts)
|
||||||
set (PPIC_CPP_FILES_FOR_I18N ${PPIC_CPP_FILES})
|
set (PPIC_CPP_FILES_FOR_I18N ${PPIC_CPP_FILES})
|
||||||
|
|
||||||
qt5_create_translation(PPIC_QM_FILES ${PPIC_CPP_FILES_FOR_I18N} ${PPIC_TS_FILES})
|
find_program (UV_EXECUTABLE uv)
|
||||||
|
if (NOT UV_EXECUTABLE)
|
||||||
|
message (FATAL_ERROR "uv is required to run the metaglot tool, install it from https://docs.astral.sh/uv/")
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
list(APPEND PPIC_RC_FILES assets/pineapple-pictures.rc)
|
set (PPIC_RC_TEMPLATE_FILE ${CMAKE_CURRENT_BINARY_DIR}/pineapple-pictures.rc.in)
|
||||||
|
execute_process (
|
||||||
|
COMMAND ${UV_EXECUTABLE} tool run metaglot render rc
|
||||||
|
--manifest ${CMAKE_SOURCE_DIR}/dist/pineapple-pictures.rc.in.toml
|
||||||
|
--po ${CMAKE_SOURCE_DIR}/locales/winrc/*.po
|
||||||
|
--template ${CMAKE_SOURCE_DIR}/dist/pineapple-pictures.rc.in.liquid
|
||||||
|
--output ${PPIC_RC_TEMPLATE_FILE}
|
||||||
|
RESULT_VARIABLE METAGLOT_RESULT
|
||||||
|
)
|
||||||
|
if (NOT METAGLOT_RESULT EQUAL 0)
|
||||||
|
message (FATAL_ERROR "Failed to generate pineapple-pictures.rc.in via MetaGlot (exit code: ${METAGLOT_RESULT}). If it is not installed yet, run: uv tool install git+https://github.com/SarasasChipWorkshop/metaglot.git")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
configure_file (${PPIC_RC_TEMPLATE_FILE} ${CMAKE_CURRENT_BINARY_DIR}/pineapple-pictures.rc @ONLY)
|
||||||
|
list (APPEND PPIC_RC_FILES ${CMAKE_CURRENT_BINARY_DIR}/pineapple-pictures.rc)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_executable (${EXE_NAME}
|
add_executable (${EXE_NAME}
|
||||||
${PPIC_HEADER_FILES}
|
${PPIC_HEADER_FILES}
|
||||||
${PPIC_CPP_FILES}
|
${PPIC_CPP_FILES}
|
||||||
|
${PPIC_UI_FILES}
|
||||||
${PPIC_QRC_FILES}
|
${PPIC_QRC_FILES}
|
||||||
${PPIC_RC_FILES}
|
${PPIC_RC_FILES}
|
||||||
${PPIC_QM_FILES}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries (${EXE_NAME} Qt5::Widgets Qt5::Svg)
|
set(ADD_TRANSLATIONS_ADDITIONAL_ARGS)
|
||||||
|
|
||||||
if (LibExiv2_FOUND)
|
if (Qt6_VERSION VERSION_GREATER_EQUAL "6.9.0")
|
||||||
message(INFO ${LibExiv2_INCLUDE_DIRS})
|
set(ADD_TRANSLATIONS_ADDITIONAL_ARGS MERGE_QT_TRANSLATIONS)
|
||||||
target_include_directories(${EXE_NAME}
|
endif()
|
||||||
PRIVATE
|
|
||||||
${LibExiv2_INCLUDE_DIRS}
|
if (TRANSLATION_RESOURCE_EMBEDDING)
|
||||||
)
|
qt_add_translations(${EXE_NAME} ${ADD_TRANSLATIONS_ADDITIONAL_ARGS} TS_FILES ${PPIC_TS_FILES})
|
||||||
|
else()
|
||||||
|
qt_add_translations(${EXE_NAME} ${ADD_TRANSLATIONS_ADDITIONAL_ARGS} TS_FILES ${PPIC_TS_FILES} QM_FILES_OUTPUT_VARIABLE PPIC_QM_FILES)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# YYC MARK:
|
||||||
|
# This is essential, otherwise Qt UIC generated UI header file
|
||||||
|
# can not find our header files if there are custom widgets inside UI file.
|
||||||
|
target_include_directories(${EXE_NAME} PRIVATE app/)
|
||||||
|
|
||||||
|
target_sources(${EXE_NAME} PRIVATE ${PPIC_QM_FILES})
|
||||||
|
|
||||||
|
target_link_libraries (${EXE_NAME} Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::SvgWidgets)
|
||||||
|
|
||||||
|
if (exiv2_FOUND)
|
||||||
|
if(NOT TARGET Exiv2::exiv2lib AND TARGET exiv2lib)
|
||||||
|
# for exiv2 0.27.x and (macOS?) conan build
|
||||||
|
add_library(Exiv2::exiv2lib ALIAS exiv2lib)
|
||||||
|
endif()
|
||||||
target_link_libraries (${EXE_NAME}
|
target_link_libraries (${EXE_NAME}
|
||||||
LibExiv2::LibExiv2
|
Exiv2::exiv2lib
|
||||||
)
|
)
|
||||||
target_compile_definitions(${EXE_NAME} PRIVATE
|
target_compile_definitions(${EXE_NAME} PRIVATE
|
||||||
HAVE_EXIV2_VERSION="${LibExiv2_VERSION}"
|
HAVE_EXIV2_VERSION="${exiv2_VERSION}"
|
||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if (TARGET Qt6::DBus)
|
||||||
|
target_link_libraries (${EXE_NAME}
|
||||||
|
Qt${QT_VERSION_MAJOR}::DBus
|
||||||
|
)
|
||||||
|
target_compile_definitions(${EXE_NAME} PRIVATE
|
||||||
|
HAVE_QTDBUS
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Extra build settings
|
# Extra build settings
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set_property (
|
|
||||||
TARGET ${EXE_NAME}
|
|
||||||
PROPERTY WIN32_EXECUTABLE true
|
|
||||||
)
|
|
||||||
|
|
||||||
target_compile_definitions(${EXE_NAME} PRIVATE
|
target_compile_definitions(${EXE_NAME} PRIVATE
|
||||||
FLAG_PORTABLE_MODE_SUPPORT=1
|
FLAG_PORTABLE_MODE_SUPPORT=1
|
||||||
)
|
)
|
||||||
@@ -140,6 +205,7 @@ macro (ppic_set_version_via_describe _describe_long)
|
|||||||
endmacro ()
|
endmacro ()
|
||||||
|
|
||||||
# Version setup
|
# Version setup
|
||||||
|
target_compile_definitions(${EXE_NAME} PRIVATE PPIC_VERSION_STRING="${CMAKE_PROJECT_VERSION}")
|
||||||
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||||
find_package(Git)
|
find_package(Git)
|
||||||
set_package_properties(Git PROPERTIES TYPE OPTIONAL PURPOSE "Determine exact build version.")
|
set_package_properties(Git PROPERTIES TYPE OPTIONAL PURPOSE "Determine exact build version.")
|
||||||
@@ -157,53 +223,70 @@ if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
|||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Helper macros for install settings
|
|
||||||
macro (ppic_convert_to_relative_path _var)
|
|
||||||
# Make sure _var is a relative path
|
|
||||||
if (IS_ABSOLUTE "${${_var}}")
|
|
||||||
file (RELATIVE_PATH ${_var} "${CMAKE_INSTALL_PREFIX}" "${${_var}}")
|
|
||||||
endif ()
|
|
||||||
endmacro ()
|
|
||||||
|
|
||||||
# Install settings
|
# Install settings
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
# FIXME: try to avoid install to a "bin" subfolder under windows...
|
set_target_properties(${EXE_NAME} PROPERTIES
|
||||||
# when fixed, don't forget to update the CI config file...
|
WIN32_EXECUTABLE TRUE
|
||||||
set (BIN_INSTALL_DIR "") # seems useless, don't know why...
|
)
|
||||||
|
elseif (APPLE)
|
||||||
|
set_source_files_properties(dist/sarasacw-picture.icns PROPERTIES
|
||||||
|
MACOSX_PACKAGE_LOCATION "Resources"
|
||||||
|
)
|
||||||
|
target_sources(${EXE_NAME} PUBLIC dist/sarasacw-picture.icns)
|
||||||
|
# See https://cmake.org/cmake/help/v3.15/prop_tgt/MACOSX_BUNDLE_INFO_PLIST.html
|
||||||
|
set_target_properties(${EXE_NAME} PROPERTIES
|
||||||
|
MACOSX_BUNDLE TRUE
|
||||||
|
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/dist/MacOSXBundleInfo.plist.in
|
||||||
|
MACOSX_BUNDLE_BUNDLE_NAME "Pineapple Pictures"
|
||||||
|
MACOSX_BUNDLE_GUI_IDENTIFIER net.blumia.pineapple-pictures
|
||||||
|
MACOSX_BUNDLE_ICON_FILE sarasacw-picture.icns # contains the .icns file name, *without* the path.
|
||||||
|
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
||||||
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||||
|
)
|
||||||
elseif (UNIX)
|
elseif (UNIX)
|
||||||
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
set(CMAKE_INSTALL_PREFIX /usr)
|
set(CMAKE_INSTALL_PREFIX /usr)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
set (BIN_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}") # relative, usually "bin"
|
|
||||||
ppic_convert_to_relative_path(BIN_INSTALL_DIR)
|
|
||||||
set (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}") # "lib" or "lib64"
|
|
||||||
ppic_convert_to_relative_path(LIB_INSTALL_DIR)
|
|
||||||
|
|
||||||
# install icon
|
# install icon
|
||||||
|
# TODO: assets/icons/app-icon.svg is missing (lost during an assets restructure), fix this later.
|
||||||
install (
|
install (
|
||||||
FILES assets/icons/app-icon.svg
|
FILES assets/icons/app-icon.svg
|
||||||
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps"
|
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps"
|
||||||
RENAME pineapple-pictures.svg
|
RENAME net.blumia.pineapple-pictures.svg
|
||||||
)
|
)
|
||||||
|
|
||||||
# install shortcut
|
# generate and install desktop entry file
|
||||||
|
set (PPIC_DESKTOP_FILE ${CMAKE_CURRENT_BINARY_DIR}/net.blumia.pineapple-pictures.desktop)
|
||||||
|
execute_process (
|
||||||
|
COMMAND ${UV_EXECUTABLE} tool run metaglot render desktop
|
||||||
|
--manifest ${CMAKE_SOURCE_DIR}/dist/net.blumia.pineapple-pictures.desktop.toml
|
||||||
|
--po ${CMAKE_SOURCE_DIR}/locales/desktop/*.po
|
||||||
|
--template ${CMAKE_SOURCE_DIR}/dist/net.blumia.pineapple-pictures.desktop.liquid
|
||||||
|
--output ${PPIC_DESKTOP_FILE}
|
||||||
|
RESULT_VARIABLE METAGLOT_DESKTOP_RESULT
|
||||||
|
)
|
||||||
|
if (NOT METAGLOT_DESKTOP_RESULT EQUAL 0)
|
||||||
|
message (FATAL_ERROR "Failed to generate net.blumia.pineapple-pictures.desktop via MetaGlot (exit code: ${METAGLOT_DESKTOP_RESULT}). If it is not installed yet, run: uv tool install git+https://github.com/SarasasChipWorkshop/metaglot.git")
|
||||||
|
endif ()
|
||||||
|
|
||||||
install (
|
install (
|
||||||
FILES dist/net.blumia.pineapple-pictures.desktop
|
FILES ${PPIC_DESKTOP_FILE}
|
||||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications"
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications"
|
||||||
)
|
)
|
||||||
|
|
||||||
# install app metadata file for appstream (and some other stuff using this metadata like snapcraft)
|
# install app metadata file for appstream (and some other stuff using this metadata like snapcraft)
|
||||||
install (
|
install (
|
||||||
FILES dist/appstream/net.blumia.pineapple-pictures.appdata.xml
|
FILES dist/appstream/net.blumia.pineapple-pictures.metainfo.xml
|
||||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo"
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set (INSTALL_TARGETS_DEFAULT_ARGS
|
set (INSTALL_TARGETS_DEFAULT_ARGS
|
||||||
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
|
BUNDLE DESTINATION .
|
||||||
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT Devel
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Devel
|
||||||
)
|
)
|
||||||
|
|
||||||
install (
|
install (
|
||||||
@@ -211,20 +294,25 @@ install (
|
|||||||
${INSTALL_TARGETS_DEFAULT_ARGS}
|
${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (WIN32)
|
if (TRANSLATION_RESOURCE_EMBEDDING)
|
||||||
|
target_compile_definitions(${EXE_NAME}
|
||||||
|
PRIVATE TRANSLATION_RESOURCE_EMBEDDING
|
||||||
|
)
|
||||||
|
elseif (WIN32)
|
||||||
set (QM_FILE_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}/translations")
|
set (QM_FILE_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}/translations")
|
||||||
else ()
|
else()
|
||||||
set (QM_FILE_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/pineapple-pictures/translations")
|
set (QM_FILE_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/pineapple-pictures/translations")
|
||||||
target_compile_definitions(${EXE_NAME}
|
target_compile_definitions(${EXE_NAME}
|
||||||
PRIVATE QM_FILE_INSTALL_DIR=${QM_FILE_INSTALL_DIR}
|
PRIVATE QM_FILE_INSTALL_ABSOLUTE_DIR=${QM_FILE_INSTALL_DIR}
|
||||||
)
|
)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
install (
|
|
||||||
FILES ${PPIC_QM_FILES}
|
|
||||||
DESTINATION ${QM_FILE_INSTALL_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
if (DEFINED QM_FILE_INSTALL_DIR)
|
||||||
|
install(
|
||||||
|
FILES ${PPIC_QM_FILES}
|
||||||
|
DESTINATION ${QM_FILE_INSTALL_DIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||||
|
|
||||||
# CPACK: General Settings
|
# CPACK: General Settings
|
||||||
@@ -239,8 +327,8 @@ elseif (APPLE)
|
|||||||
# ...
|
# ...
|
||||||
elseif (UNIX)
|
elseif (UNIX)
|
||||||
set (CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
set (CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
set (CPACK_DEBIAN_PACKAGE_SHILIBDEPS ON)
|
set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||||
set (CPACK_DEBIAN_PACKAGE_RECOMMENDS "kimageformat-plugins")
|
set (CPACK_DEBIAN_PACKAGE_RECOMMENDS "kimageformat6-plugins")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(CPack)
|
include(CPack)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020 BLumia
|
Copyright (c) 2026 BLumia
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -0,0 +1,121 @@
|
|||||||
|
Creative Commons Legal Code
|
||||||
|
|
||||||
|
CC0 1.0 Universal
|
||||||
|
|
||||||
|
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||||
|
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||||
|
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||||
|
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||||
|
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||||
|
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||||
|
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||||
|
HEREUNDER.
|
||||||
|
|
||||||
|
Statement of Purpose
|
||||||
|
|
||||||
|
The laws of most jurisdictions throughout the world automatically confer
|
||||||
|
exclusive Copyright and Related Rights (defined below) upon the creator
|
||||||
|
and subsequent owner(s) (each and all, an "owner") of an original work of
|
||||||
|
authorship and/or a database (each, a "Work").
|
||||||
|
|
||||||
|
Certain owners wish to permanently relinquish those rights to a Work for
|
||||||
|
the purpose of contributing to a commons of creative, cultural and
|
||||||
|
scientific works ("Commons") that the public can reliably and without fear
|
||||||
|
of later claims of infringement build upon, modify, incorporate in other
|
||||||
|
works, reuse and redistribute as freely as possible in any form whatsoever
|
||||||
|
and for any purposes, including without limitation commercial purposes.
|
||||||
|
These owners may contribute to the Commons to promote the ideal of a free
|
||||||
|
culture and the further production of creative, cultural and scientific
|
||||||
|
works, or to gain reputation or greater distribution for their Work in
|
||||||
|
part through the use and efforts of others.
|
||||||
|
|
||||||
|
For these and/or other purposes and motivations, and without any
|
||||||
|
expectation of additional consideration or compensation, the person
|
||||||
|
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
||||||
|
is an owner of Copyright and Related Rights in the Work, voluntarily
|
||||||
|
elects to apply CC0 to the Work and publicly distribute the Work under its
|
||||||
|
terms, with knowledge of his or her Copyright and Related Rights in the
|
||||||
|
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||||
|
|
||||||
|
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||||
|
protected by copyright and related or neighboring rights ("Copyright and
|
||||||
|
Related Rights"). Copyright and Related Rights include, but are not
|
||||||
|
limited to, the following:
|
||||||
|
|
||||||
|
i. the right to reproduce, adapt, distribute, perform, display,
|
||||||
|
communicate, and translate a Work;
|
||||||
|
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||||
|
iii. publicity and privacy rights pertaining to a person's image or
|
||||||
|
likeness depicted in a Work;
|
||||||
|
iv. rights protecting against unfair competition in regards to a Work,
|
||||||
|
subject to the limitations in paragraph 4(a), below;
|
||||||
|
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||||
|
in a Work;
|
||||||
|
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||||
|
European Parliament and of the Council of 11 March 1996 on the legal
|
||||||
|
protection of databases, and under any national implementation
|
||||||
|
thereof, including any amended or successor version of such
|
||||||
|
directive); and
|
||||||
|
vii. other similar, equivalent or corresponding rights throughout the
|
||||||
|
world based on applicable law or treaty, and any national
|
||||||
|
implementations thereof.
|
||||||
|
|
||||||
|
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||||
|
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||||
|
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||||
|
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||||
|
of action, whether now known or unknown (including existing as well as
|
||||||
|
future claims and causes of action), in the Work (i) in all territories
|
||||||
|
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||||
|
treaty (including future time extensions), (iii) in any current or future
|
||||||
|
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||||
|
including without limitation commercial, advertising or promotional
|
||||||
|
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||||
|
member of the public at large and to the detriment of Affirmer's heirs and
|
||||||
|
successors, fully intending that such Waiver shall not be subject to
|
||||||
|
revocation, rescission, cancellation, termination, or any other legal or
|
||||||
|
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||||
|
as contemplated by Affirmer's express Statement of Purpose.
|
||||||
|
|
||||||
|
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||||
|
be judged legally invalid or ineffective under applicable law, then the
|
||||||
|
Waiver shall be preserved to the maximum extent permitted taking into
|
||||||
|
account Affirmer's express Statement of Purpose. In addition, to the
|
||||||
|
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||||
|
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||||
|
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||||
|
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||||
|
maximum duration provided by applicable law or treaty (including future
|
||||||
|
time extensions), (iii) in any current or future medium and for any number
|
||||||
|
of copies, and (iv) for any purpose whatsoever, including without
|
||||||
|
limitation commercial, advertising or promotional purposes (the
|
||||||
|
"License"). The License shall be deemed effective as of the date CC0 was
|
||||||
|
applied by Affirmer to the Work. Should any part of the License for any
|
||||||
|
reason be judged legally invalid or ineffective under applicable law, such
|
||||||
|
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||||
|
of the License, and in such case Affirmer hereby affirms that he or she
|
||||||
|
will not (i) exercise any of his or her remaining Copyright and Related
|
||||||
|
Rights in the Work or (ii) assert any associated claims and causes of
|
||||||
|
action with respect to the Work, in either case contrary to Affirmer's
|
||||||
|
express Statement of Purpose.
|
||||||
|
|
||||||
|
4. Limitations and Disclaimers.
|
||||||
|
|
||||||
|
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||||
|
surrendered, licensed or otherwise affected by this document.
|
||||||
|
b. Affirmer offers the Work as-is and makes no representations or
|
||||||
|
warranties of any kind concerning the Work, express, implied,
|
||||||
|
statutory or otherwise, including without limitation warranties of
|
||||||
|
title, merchantability, fitness for a particular purpose, non
|
||||||
|
infringement, or the absence of latent or other defects, accuracy, or
|
||||||
|
the present or absence of errors, whether or not discoverable, all to
|
||||||
|
the greatest extent permissible under applicable law.
|
||||||
|
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||||
|
that may apply to the Work or any use thereof, including without
|
||||||
|
limitation any person's Copyright and Related Rights in the Work.
|
||||||
|
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||||
|
consents, permissions or other rights required for any use of the
|
||||||
|
Work.
|
||||||
|
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||||
|
party to this document and has no duty or obligation with respect to
|
||||||
|
this CC0 or use of the Work.
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) <year> <copyright holders>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
@@ -0,0 +1,301 @@
|
|||||||
|
Version 1.6.0
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2026-08-22
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Allow dragging window from titlebar to move window when maximized
|
||||||
|
* Add an option to show/hide bird-eye view
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Maximize the window when the image size matches the screen size
|
||||||
|
* Fix window might stuck when drag move on some ill-formed window manager
|
||||||
|
* Make titlebar respect RTL layout
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* Update translations
|
||||||
|
* Update Qt version to 6.11.2 for Windows and macOS pre-built binaries
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Tech-Tac, Heimen Stoffels (vistaus), VenusGirl, Oğuz Ersen
|
||||||
|
|
||||||
|
Version 1.5.0
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2026-07-04
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Introduced an optional titlebar that display file name and allows drag and double-click to move and toggle maximize state
|
||||||
|
* Windows: Now the application will use the system's built-in animation for open window animation
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Show empty url list should also reset window title to blank
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* Update translations
|
||||||
|
* Add vcs-browser link to AppStream metadata
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Heimen Stoffels (vistaus), VenusGirl (VenusGirl)
|
||||||
|
|
||||||
|
Version 1.4.1
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2026-04-05
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* Update translations
|
||||||
|
* Update Qt version to 6.10.3 for Windows and macOS pre-built binaries
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Heimen Stoffels (vistaus), Loc Huynh (hthienloc)
|
||||||
|
|
||||||
|
Version 1.4.0
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2026-02-11
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Action to save image as new file with different format
|
||||||
|
* Add Vietnamese and Slovenian translation
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* Update copyright year to 2026
|
||||||
|
* Update translations
|
||||||
|
* Update Qt version to 6.10.2 for Windows and macOS pre-built binaries
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Loc Huynh, Sabri Ünal, VenusGirl, Andrej Poženel, Andrey
|
||||||
|
|
||||||
|
Version 1.3.0
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2025-12-20
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* New option to limit SVG support to SVG Tiny 1.2 standard
|
||||||
|
* Windows: ship tools and configurations that help user associate image files to this program
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Fix window not appear at the screen that the mouse cursor is at
|
||||||
|
* Fix Windows prebuilt binary having AVIF plugin included but not actually support it
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* CPack DEB: will now recommend "kimageformat6-plugins" instead of the KF5 version
|
||||||
|
* Update translations
|
||||||
|
* Update exiv2 version for Windows binary build
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
VenusGirl, Andrey
|
||||||
|
|
||||||
|
Version 1.2.1
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2025-11-22
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Fix incorrect color when display some CMYK images.
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* Now use Qt 6.10.1 for pre-built binary
|
||||||
|
* Update README description and AppStream metainfo
|
||||||
|
* Update translations
|
||||||
|
* Update libavif, AOM and expat version for Windows binary build
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
albanobattistella
|
||||||
|
|
||||||
|
Version 1.2.0
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2025-09-21
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Long image mode that detect extra wide image and auto fit by its thin side
|
||||||
|
* Windows: Add product version to binary metadata / resource file
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* Update translations
|
||||||
|
* Update libavif version for Windows binary build
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Heimen Stoffels, albanobattistella, Sabri Ünal
|
||||||
|
|
||||||
|
Version 1.1.1
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2025-08-02
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Click dock icon should show window when it's hidden on macOS
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Ensure "Fit by Width" position the view to the beginning of the image
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* Update translations
|
||||||
|
* Update Exiv2 version for Windows binary build
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Heimen Stoffels, VenusGirl, தமிழ்நேரம்
|
||||||
|
|
||||||
|
Version 1.1.0
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2025-07-06
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* New option to disable built-in close window animation
|
||||||
|
* New option to disable gallery looping
|
||||||
|
* Support load m3u8 as image gallery playlist
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* Drop Qt 5 support
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Heimen Stoffels, albanobattistella, தமிழ்நேரம்
|
||||||
|
|
||||||
|
Version 1.0.0
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2025-05-03
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Support enforces windowed mode on start-up
|
||||||
|
* Reload image automatically when current image gets updated
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Display correct text language on macOS
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* Use native text for shortcut editor's label
|
||||||
|
* Display native commandline message when possible
|
||||||
|
* Merge Qt translations into app applications as well
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Heimen Stoffels, albanobattistella, mmahhi
|
||||||
|
|
||||||
|
Version 0.9.2
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2025-03-05
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Refer to the right exiv2 CMake module so it can be found on Linux
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* Convert DEP5 to REUSE.toml for better REUSE compliance
|
||||||
|
* Update translations
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Pino Toscano, TamilNeram
|
||||||
|
|
||||||
|
Version 0.9.1
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2025-01-25
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Option to double-click to fullscreen
|
||||||
|
* Build-time option to embed translation resources
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Fix window size not adjusted when open file on macOS
|
||||||
|
* Should center window according to available screen geometry
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* Change close window bahavior on macOS
|
||||||
|
* Update translations
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
albanobattistella, Sabri Ünal
|
||||||
|
|
||||||
|
Version 0.9.0
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2024-12-08
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Support custom shortcuts for existing actions
|
||||||
|
* Actions for frame-by-frame animated image playback support
|
||||||
|
|
||||||
|
Miscellaneous:
|
||||||
|
* Initial macOS bundle support
|
||||||
|
* bump minimum required CMake version to 3.16
|
||||||
|
* Update translations
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
albanobattistella, VenusGirl, gallegonovato, Sabri Ünal
|
||||||
|
|
||||||
|
Version 0.8.2.1
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2024-10-27
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Cannot load translations caused by a change in 0.8.2
|
||||||
|
|
||||||
|
Version 0.8.2
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2024-10-26
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* New option to allow use light-color checkerboard by default
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
albanobattistella, mmahhi, gallegonovato
|
||||||
|
|
||||||
|
Version 0.8.1
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2024-08-25
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* New command line option to list all supported formats
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
albanobattistella, mmahhi, ovl-1, gallegonovato, Oğuz Ersen
|
||||||
|
|
||||||
|
Version 0.8.0
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2024-06-29
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Support move image file to trash
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
albanobattistella, mmahhi, gallegonovato, Oğuz Ersen
|
||||||
|
|
||||||
|
Version 0.7.4
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2024-04-04
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Add some icons for corresponding menu actions
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Reza Almanda, mmahhi, Oğuz Ersen, volkov, Сергій
|
||||||
|
|
||||||
|
Version 0.7.3
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2023-10-24
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Add "Keep transformation" to menu
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
mmahhi, VenusGirl, albanobattistella, gallegonovato, Heimen Stoffels
|
||||||
|
|
||||||
|
Version 0.7.2
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2023-08-27
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* Add an option in setting dialog to tweak the High-DPI scaling rounding policy (might only works in Qt 6 build)
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Remove image size limit for Qt 6 build
|
||||||
|
* Fix application icon install location under Linux
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
Heimen Stoffels, Andrey, Dan, gallegonovato, albanobattistella, Sabri Ünal
|
||||||
|
|
||||||
|
Version 0.7.1
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Released: 2023-07-08
|
||||||
|
|
||||||
|
Features:
|
||||||
|
* TIF and TIFF format files in the same folder will now be automatically added to the gallery
|
||||||
|
* Built-in window resizing now also supports Linux desktop. (macOS might also works as well)
|
||||||
|
|
||||||
|
Bugfixes:
|
||||||
|
* Settings dialog will automatedly use a suitable size instead of a hard-coded one
|
||||||
|
* Fix default configuration file location under Linux. (was `~/.config/config.ini`, now it's `~/.config/Pineapple Pictures/config.ini`)
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
yyc12345
|
||||||
@@ -1,30 +1,59 @@
|
|||||||
Yet another image viewer.
|
# Sarasas Chip Workshop Picture
|
||||||
|
|
||||||
|
Yet another legacy Windows Photo Viewer with cross-platform support.
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> SarasaCW Picture are still in refactoring. Please do not use it until this message removes.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Sarasas Chip Workshop Picture (abbr. SarasaCW Picture) is a lightweight image viewer that has cross-platform support and similar user interface about legacy Windows Photo Viewer. It allows you view JPEG, PNG, GIF, SVG, PSD, KRA, XCF, TGA, HDR, AVIF and some other frequently used image formats files quickly and easily without changing your long-term Windows usage experience.
|
||||||
|
|
||||||
|
SarasaCW Picture is the **hard fork** of [Pineapple Pictures](https://github.com/BLumia/pineapple-pictures) since Pineapple Pictures 1.4.1 version.
|
||||||
|
|
||||||
|
<!--
|
||||||
|
|
||||||
|CI|Build Status|
|
|CI|Build Status|
|
||||||
|---|---|
|
|---|---|
|
||||||
|Windows Build|[](https://ci.appveyor.com/project/BLumia/pineapplepictures/branch/master)|
|
|Windows Build|[](https://github.com/BLumia/pineapple-pictures/actions/workflows/windows.yml)|
|
||||||
|macOS Build||
|
|macOS Build|[](https://github.com/BLumia/pineapple-pictures/actions/workflows/macos.yml)|
|
||||||
|Ubuntu 20.04 Build||
|
|Ubuntu Build|[](https://github.com/BLumia/pineapple-pictures/actions/workflows/ubuntu.yml)|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Get it!
|
## Get it!
|
||||||
|
|
||||||
- [GitHub Release Page](https://github.com/BLumia/pineapple-pictures/releases)
|
### Maintained by the original author
|
||||||
- Archlinux AUR: [pineapple-pictures](https://aur.archlinux.org/packages/pineapple-pictures/) | [pineapple-pictures-git](https://aur.archlinux.org/packages/pineapple-pictures-git/)
|
|
||||||
- Debian (sid / testing): `sudo apt install pineapple-pictures`
|
|
||||||
- [Itch.io Store](https://blumia.itch.io/pineapple-pictures)
|
|
||||||
|
|
||||||
## Help Translation!
|
- [GitHub Release Page](https://github.com/BLumia/pineapple-pictures/releases)
|
||||||
|
- [SourceForge](https://sourceforge.net/projects/pineapple-pictures/)
|
||||||
|
- Archlinux AUR: [pineapple-pictures](https://aur.archlinux.org/packages/pineapple-pictures/) | [pineapple-pictures-git](https://aur.archlinux.org/packages/pineapple-pictures-git/)
|
||||||
|
- [Itch.io Store](https://blumia.itch.io/pineapple-pictures)
|
||||||
|
|
||||||
|
### Maintained by contributors / certain distro's package maintainers
|
||||||
|
|
||||||
|
[](https://repology.org/project/pineapple-pictures/versions)
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
|
||||||
|
Beside feedback and code contribution, other contributions are also welcome!
|
||||||
|
|
||||||
|
### Help Translation!
|
||||||
|
|
||||||
[Translate this project on Weblate!](https://hosted.weblate.org/projects/pineapple-pictures/)
|
[Translate this project on Weblate!](https://hosted.weblate.org/projects/pineapple-pictures/)
|
||||||
|
|
||||||
|
### Funding
|
||||||
|
|
||||||
|
[](https://ko-fi.com/blumia)
|
||||||
|
|
||||||
|
[Afdian](https://afdian.com/a/BLumia)
|
||||||
|
|
||||||
## Build it manually:
|
## Build it manually:
|
||||||
|
|
||||||
Current state, we need:
|
Current state, we need:
|
||||||
|
|
||||||
- `cmake`: as the build system.
|
- `cmake`: as the build system.
|
||||||
- `qt5` with `qt5-svg` and `qt5-tools`: since the app is using Qt.
|
- `qt6` with `qt6-svg` and `qt6-tools`: since the app is using Qt.
|
||||||
- `libexiv2`: able to display more image metadata. (optional, but recommended)
|
- `libexiv2`: able to display more image metadata. (optional, but recommended)
|
||||||
|
|
||||||
Then we can build it with any proper c++ compiler like g++ or msvc.
|
Then we can build it with any proper c++ compiler like g++ or msvc.
|
||||||
@@ -43,28 +72,13 @@ The project will try to build with `exiv2` when it's available at build time, if
|
|||||||
|
|
||||||
Image formats supports rely on Qt's imageformats plugins, just get the plugins you need from your distro's package manager will be fine. For Windows user, you may need build and install the imageformats plugin manually, read the content below.
|
Image formats supports rely on Qt's imageformats plugins, just get the plugins you need from your distro's package manager will be fine. For Windows user, you may need build and install the imageformats plugin manually, read the content below.
|
||||||
|
|
||||||
### Linux
|
It's possible to build it under Windows, Linux, macOS, and maybe other desktop platforms that Qt is ported to. For platform specific build instructions, please read the [related wiki page](https://github.com/BLumia/pineapple-pictures/wiki/Platform-Specific-Build-Instructions).
|
||||||
|
|
||||||
Just normal build process as other program will be fine. Nothing special ;)
|
> [!NOTE]
|
||||||
|
> Although there is a `pineapple-pictures.pro` file which can be used for QMake build, it's only for testing purpose and it doesn't have `exiv2` support included. Using QMake to build this project is NOT supported, please use CMake if possible.
|
||||||
For Archlinux there are also a [PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pineapple-pictures-git) you can use.
|
|
||||||
|
|
||||||
For packaging to debian-based distro, the `CMakeLists.txt` provides some cpack configurations for generating a `.deb` package. After the build process, use `cpack -G DEB` to generate the package. You can also take `.github/workflows/ubuntu.yml` as a reference.
|
|
||||||
|
|
||||||
For this project, `DEB` is the only supported cpack generator in current state, feel free to submit a PR if you like improving `cpack` support for this project.
|
|
||||||
|
|
||||||
### Windows
|
|
||||||
|
|
||||||
The normal build steps for Linux is also applied to Windows, but since Windows doesn't have a decent package manager, so if you need any other image formats support other than the supported formats which Qt provided, you need to get and build these imageformats plugins manually and vendor it. It's optional and can be skipped if you don't need extra image formats support.
|
|
||||||
|
|
||||||
For the Windows binary I provided, kimageformats plugin is used (for formats like kra, xcf, psd and etc.). You can take `appveyor.yml` as a reference to learn what I did when building the Windows binary.
|
|
||||||
|
|
||||||
[KDE Craft](https://community.kde.org/Craft) environment also can be used to build and package this program. I did also created a blueprint for building this project, but since I don't have a CI to run KDE Craft build, the blueprint repo are not provided here. Maybe sometimes later.
|
|
||||||
|
|
||||||
### macOS
|
|
||||||
|
|
||||||
I don't have a mac, so no support at all. There is also a GitHub Action (see `.github/workflows/macos.yml`) running macOS build though so at least it can build. Feel free to submit a PR if you would like to give some love to the macOS build ;P
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Pineapple Pictures as a whole is licensed under MIT license. Individual files may have a different, but compatible license.
|
Pineapple Pictures as a whole is licensed under MIT license. Individual files may have a different, but compatible license.
|
||||||
|
|
||||||
|
-->
|
||||||
|
|||||||
@@ -1,30 +1,62 @@
|
|||||||
|
# Sarasas Chip Workshop 照片查看器
|
||||||
|
|
||||||
|
简单轻量的、具有跨平台支持的、经典样式的 Windows 照片查看器。
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> SarasaCW 照片查看器还在重构中。在这条信息被移除之前请不要使用它。
|
||||||
|
|
||||||
|
## 简介
|
||||||
|
|
||||||
|
Sarasas Chip Workshop 照片查看器(简称 SarasaCW 照片查看器)是一个轻量级的图片查看器。支持跨平台。界面风格类似于经典的 Windows 照片查看器。它可以让你快速轻松地浏览 JPEG、PNG、GIF、SVG、PSD、KRA、XCF、TGA、HDR、AVIF 以及其他一些常用的图片格式,且无需改变你长期的 Windows 使用习惯。
|
||||||
|
|
||||||
|
SarasaCW 照片查看器是[菠萝看图](https://github.com/BLumia/pineapple-pictures)的**硬分叉**,该分叉自菠萝看图 1.4.1 版本开始。
|
||||||
|
|
||||||
|
<!--
|
||||||
|
|
||||||
简单轻量的跨平台看图工具。
|
简单轻量的跨平台看图工具。
|
||||||
|
|
||||||
|CI|构建状态|
|
|CI|构建状态|
|
||||||
|---|---|
|
|---|---|
|
||||||
|Windows Build|[](https://ci.appveyor.com/project/BLumia/pineapplepictures/branch/master)|
|
|Windows Build|[](https://github.com/BLumia/pineapple-pictures/actions/workflows/windows.yml)|
|
||||||
|macOS Build||
|
|macOS Build|[](https://github.com/BLumia/pineapple-pictures/actions/workflows/macos.yml)|
|
||||||
|Ubuntu 20.04 Build||
|
|Ubuntu Build|[](https://github.com/BLumia/pineapple-pictures/actions/workflows/ubuntu.yml)|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 立即获取!
|
## 立即获取!
|
||||||
|
|
||||||
- [GitHub Release 页面](https://github.com/BLumia/pineapple-pictures/releases) | [gitee 发布页面](https://gitee.com/blumia/pineapple-pictures/releases)
|
### 由原作者维护
|
||||||
- Archlinux AUR: [pineapple-pictures](https://aur.archlinux.org/packages/pineapple-pictures/) | [pineapple-pictures-git](https://aur.archlinux.org/packages/pineapple-pictures-git/)
|
|
||||||
- Debian (sid / testing): `sudo apt install pineapple-pictures`
|
|
||||||
- [Itch.io 商店](https://blumia.itch.io/pineapple-pictures)
|
|
||||||
|
|
||||||
## 帮助翻译!
|
- [GitHub Release 页面](https://github.com/BLumia/pineapple-pictures/releases)
|
||||||
|
- [SourceForge](https://sourceforge.net/projects/pineapple-pictures/)
|
||||||
|
- Archlinux AUR: [pineapple-pictures](https://aur.archlinux.org/packages/pineapple-pictures/) | [pineapple-pictures-git](https://aur.archlinux.org/packages/pineapple-pictures-git/)
|
||||||
|
- [Itch.io 商店](https://blumia.itch.io/pineapple-pictures)
|
||||||
|
- Flatpak (于 FlatHub): [net.blumia.pineapple-pictures](https://flathub.org/apps/net.blumia.pineapple-pictures) *([我应当使用 flatpak 版吗?](https://github.com/BLumia/pineapple-pictures/wiki/Container%E2%80%90based-Packaging-Solutions-Support))*
|
||||||
|
|
||||||
|
### 由贡献者/对应发行版的打包人员维护
|
||||||
|
|
||||||
|
[](https://repology.org/project/pineapple-pictures/versions)
|
||||||
|
|
||||||
|
## 参与贡献
|
||||||
|
|
||||||
|
除了参与反馈和代码贡献外,也欢迎各种类型的贡献!
|
||||||
|
|
||||||
|
### 帮助翻译!
|
||||||
|
|
||||||
[在 Weblate 上帮助此项目翻译到更多语言!](https://hosted.weblate.org/projects/pineapple-pictures/)
|
[在 Weblate 上帮助此项目翻译到更多语言!](https://hosted.weblate.org/projects/pineapple-pictures/)
|
||||||
|
|
||||||
|
### 打赏
|
||||||
|
|
||||||
|
[Afdian | 爱发电](https://afdian.com/a/BLumia)
|
||||||
|
|
||||||
|
[](https://ko-fi.com/blumia)
|
||||||
|
|
||||||
## 手动构建步骤:
|
## 手动构建步骤:
|
||||||
|
|
||||||
当前状态,我们需要先确保如下依赖可用:
|
当前状态,我们需要先确保如下依赖可用:
|
||||||
|
|
||||||
- `cmake`: 我们所使用的构建系统
|
- `cmake`: 我们所使用的构建系统
|
||||||
- 包含 `qt5-svg` 与 `qt5-tools` 组件的 `qt5`: 此应用基于 Qt
|
- 包含 `qt6-svg` 与 `qt6-tools` 组件的 `qt6`: 此应用基于 Qt
|
||||||
- `libexiv2`: 用以获取和显示更多的图像元信息(可选,推荐)
|
- `libexiv2`: 用以获取和显示更多的图像元信息(可选,推荐)
|
||||||
|
|
||||||
然后我们就可以使用任何常规的 c++ 编译器如 g++ 或 msvc 来进行构建了
|
然后我们就可以使用任何常规的 c++ 编译器如 g++ 或 msvc 来进行构建了
|
||||||
@@ -43,28 +75,13 @@ $ cmake --build . # 如果你使用 Makefile 作为 CMake 生成器,也可以
|
|||||||
|
|
||||||
此应用的图片格式支持依赖于 Qt 的 imageformats 插件,直接从您所用的发行版获取对应的图像格式插件即可。对于 Windows 用户,您可能需要手动构建和使用图像格式插件。下方给出了进一步的说明。
|
此应用的图片格式支持依赖于 Qt 的 imageformats 插件,直接从您所用的发行版获取对应的图像格式插件即可。对于 Windows 用户,您可能需要手动构建和使用图像格式插件。下方给出了进一步的说明。
|
||||||
|
|
||||||
### Linux
|
在 Windows、Linux 以及 macOS 系统均可构建此应用,其它有移植 Qt 支持的平台也可能可以进行构建。若要了解一些平台相关的构建指引,请参阅[相关的 Wiki 页面](https://github.com/BLumia/pineapple-pictures/wiki/Platform-Specific-Build-Instructions)。
|
||||||
|
|
||||||
常规的构建步骤即可完成构建,不需要额外的处理步骤 ;)
|
> [!NOTE]
|
||||||
|
> 尽管存在一个可用于 QMake 构建的 `pineapple-pictures.pro` 文件,但其仅供简单测试所用且其并不包含 `exiv2` 支持。使用 QMake 构建此项目是 **不受支持** 的,请尽可能考虑使用 CMake。
|
||||||
对于 Archlinux 发行版的用户,这里还有一个 [PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pineapple-pictures-git) 可供使用和参考。
|
|
||||||
|
|
||||||
对于在基于 debian 的发行版中进行打包的需求, `CMakeLists.txt` 已经提供了一些基本的 cpack 配置以便生成一个有效的 `.deb` 软件包。在构建步骤完毕后,使用 `cpack -G DEB` 即可生成 DEB 软件包。您也可以参考 `.github/workflows/ubuntu.yml` 来查看当前正在使用的 CI 配置是如何进行打包的。
|
|
||||||
|
|
||||||
目前,`DEB` 是当前唯一受到直接支持的 cpack 生成目标。若希望为此项目添加其它的 cpack 目标支持,欢迎发起合并请求。
|
|
||||||
|
|
||||||
### Windows
|
|
||||||
|
|
||||||
上述的构建步骤在 Windows 中也适用,但由于 Windows 中不具备类如大多 Linux 发行版中所提供的方便的软件包管理机制,故如果您需要任何 Qt 官方支持之外的图像格式例如 psd,xcf,kra 等格式的支持,你就可能需要自行获取并构建对应的 imageformats 插件,并在您最终生成的可执行文件中一并提供这些插件。若您不需要这些额外的图像格式支持,这个步骤也可以直接跳过。
|
|
||||||
|
|
||||||
我们所提供的预编译好的 Windows 程序包含了 kimageformats 插件来提供额外(kra, xcf, psd 等)格式的支持。您可以参考 `appveyor.yml` 来查看我们是如何构建并打包 Windows 可执行程序的。
|
|
||||||
|
|
||||||
[KDE Craft](https://community.kde.org/Craft) 环境也可以被用来构建此应用程序。我也创建了一个蓝图来进行此项目的构建和打包。但由于暂时并未配置 CI 部署此环境来进行 KDE Craft 环境下的构建,故对应的蓝图仓库也尚未公开提供,或许后续会开放出来。
|
|
||||||
|
|
||||||
### macOS
|
|
||||||
|
|
||||||
由于我没有 mac 设备,故 macOS 暂时不受任何支持。不过我们目前有一个 GitHub Action 来执行 macOS 环境下的构建(见 `.github/workflows/macos.yml`)所以至少 macOS 下是可以顺利进行构建的。如果您想完善对 macOS 的支持,也欢迎您创建合并请求 ;P
|
|
||||||
|
|
||||||
## 许可协议
|
## 许可协议
|
||||||
|
|
||||||
菠萝看图整体使用 MIT 协议进行发布。项目所随的部分源文件可能具备不同但与之兼容的许可协议。
|
菠萝看图整体使用 MIT 协议进行发布。项目所随的部分源文件可能具备不同但与之兼容的许可协议。
|
||||||
|
|
||||||
|
-->
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
version = 1
|
||||||
|
SPDX-PackageName = "Pineapple Pictures"
|
||||||
|
SPDX-PackageDownloadLocation = "https://github.com/BLumia/pineapple-pictures"
|
||||||
|
|
||||||
|
[[annotations]]
|
||||||
|
path = [".gitattributes", ".git-blame-ignore-revs", ".gitignore", "appveyor.yml", ".github/**"]
|
||||||
|
precedence = "aggregate"
|
||||||
|
SPDX-FileCopyrightText = "None"
|
||||||
|
SPDX-License-Identifier = "CC0-1.0"
|
||||||
|
|
||||||
|
[[annotations]]
|
||||||
|
path = ["README**.md", "NEWS", "assets/**.rc.in", "assets/**.qrc", "dist/appstream/**", "dist/**.in", "dist/**.desktop", "dist/**.rc.in.toml", "dist/**.rc.in.liquid"]
|
||||||
|
precedence = "aggregate"
|
||||||
|
SPDX-FileCopyrightText = "None"
|
||||||
|
SPDX-License-Identifier = "CC0-1.0"
|
||||||
|
|
||||||
|
[[annotations]]
|
||||||
|
path = ["locales/app/**.ts", "locales/winrc/**", "assets/plain/translators.html"]
|
||||||
|
precedence = "aggregate"
|
||||||
|
SPDX-FileCopyrightText = "Translators from hosted.weblate.org"
|
||||||
|
SPDX-License-Identifier = "MIT"
|
||||||
|
|
||||||
|
[[annotations]]
|
||||||
|
path = "tool/**"
|
||||||
|
precedence = "aggregate"
|
||||||
|
SPDX-FileCopyrightText = "2026 yyc12345"
|
||||||
|
SPDX-License-Identifier = "MIT"
|
||||||
|
|
||||||
|
[[annotations]]
|
||||||
|
path = "assets/icons/**.svg"
|
||||||
|
precedence = "aggregate"
|
||||||
|
SPDX-FileCopyrightText = "2022 Gary Wang"
|
||||||
|
SPDX-License-Identifier = "MIT"
|
||||||
|
|
||||||
|
[[annotations]]
|
||||||
|
path = "assets/icons/app-icon.**"
|
||||||
|
precedence = "aggregate"
|
||||||
|
SPDX-FileCopyrightText = "2020 Lovelyblack"
|
||||||
|
SPDX-License-Identifier = "MIT"
|
||||||
@@ -1,162 +1,96 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#include "aboutdialog.h"
|
#include "aboutdialog.h"
|
||||||
|
#include "ui_aboutdialog.h"
|
||||||
|
|
||||||
#include <QAbstractButton>
|
|
||||||
#include <QDialogButtonBox>
|
|
||||||
#include <QTextBrowser>
|
|
||||||
#include <QTabWidget>
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QLabel>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
|
using namespace Qt::Literals::StringLiterals;
|
||||||
|
|
||||||
|
static QString loadEmbeddedHtml(QString&& path) {
|
||||||
|
QFile htmlFile(path);
|
||||||
|
bool canOpenFile = htmlFile.open(QIODevice::ReadOnly);
|
||||||
|
QByteArray htmlRawContent = canOpenFile ? htmlFile.readAll() : QByteArrayLiteral("");
|
||||||
|
return QString::fromUtf8(htmlRawContent);
|
||||||
|
}
|
||||||
|
|
||||||
AboutDialog::AboutDialog(QWidget *parent)
|
AboutDialog::AboutDialog(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent), ui(new QT_PREPEND_NAMESPACE(Ui::AboutDialog))
|
||||||
, m_tabWidget(new QTabWidget)
|
|
||||||
, m_buttonBox(new QDialogButtonBox)
|
|
||||||
, m_helpTextEdit(new QTextBrowser)
|
|
||||||
, m_aboutTextEdit(new QTextBrowser)
|
|
||||||
, m_specialThanksTextEdit(new QTextBrowser)
|
|
||||||
, m_licenseTextEdit(new QTextBrowser)
|
|
||||||
, m_3rdPartyLibsTextEdit(new QTextBrowser)
|
|
||||||
{
|
{
|
||||||
this->setWindowTitle(tr("About"));
|
ui->setupUi(this);
|
||||||
|
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||||
|
|
||||||
const QStringList helpStr {
|
// blumia: Chain two arg() here since it seems lupdate will remove one of them if we use
|
||||||
QStringLiteral("<p>%1</p>").arg(tr("Launch application with image file path as argument to load the file.")),
|
// the old `arg(QCoreApp::translate(), tr())` way, but it's worth to mention
|
||||||
QStringLiteral("<p>%1</p>").arg(tr("Drag and drop image file onto the window is also supported.")),
|
// `arg(QCoreApp::translate(), this->tr())` works, but lupdate will complain about the usage.
|
||||||
QStringLiteral("<p>%1</p>").arg(tr("Context menu option explanation:")),
|
const QString HELP_HTML = loadEmbeddedHtml(u":/htmls/help.html"_s)
|
||||||
QStringLiteral("<ul>"),
|
.arg(tr("General Help"))
|
||||||
QStringLiteral("<li><b>%1</b>:<br/>%2</li>").arg(
|
.arg(tr("Launch application with image file path as argument to load the file."))
|
||||||
QCoreApplication::translate("MainWindow", "Stay on top"),
|
.arg(tr("Passing in a single image file will load all the images in that directory and start viewing from that image."))
|
||||||
this->tr("Make window stay on top of all other windows.")
|
.arg(tr("Passing in multiple image files lets you view them one by one."))
|
||||||
),
|
.arg(tr("Drag and drop image file onto the window is also supported."))
|
||||||
QStringLiteral("<li><b>%1</b>:<br/>%2</li>").arg(
|
.arg(tr("None of the operations in this application will alter the pictures on disk."))
|
||||||
QCoreApplication::translate("MainWindow", "Protected mode"),
|
.arg(tr("Context Menu Help"))
|
||||||
this->tr("Avoid close window accidentally. (eg. by double clicking the window)")
|
.arg(tr("Keep transformation", "The same meaning of MainWindow's Keep transformation."))
|
||||||
),
|
.arg(tr("Avoid resetting the zoom/rotation/flip state that was applied to the image view when switching between images."))
|
||||||
QStringLiteral("</ul>")
|
.arg(tr("Checkerboard", "The same meaning of MainWindow's Checkerboard."))
|
||||||
};
|
.arg(tr("Checkerboard light and dark theme can be adjusted in the configuration window, or easily switch it by holding Shift and clicking the button."));
|
||||||
|
|
||||||
const QStringList aboutStr {
|
const QString APP_NAME_ARG = qApp->applicationDisplayName();
|
||||||
QStringLiteral("<center><img width='128' height='128' src=':/icons/app-icon.svg'/><br/>"),
|
const QString APP_VERSION_ARG =
|
||||||
qApp->applicationDisplayName(),
|
|
||||||
#ifdef GIT_DESCRIBE_VERSION_STRING
|
#ifdef GIT_DESCRIBE_VERSION_STRING
|
||||||
(QStringLiteral("<br/>") + tr("Version: %1").arg(GIT_DESCRIBE_VERSION_STRING)),
|
GIT_DESCRIBE_VERSION_STRING;
|
||||||
|
#else
|
||||||
|
qApp->applicationVersion();
|
||||||
#endif // GIT_DESCRIBE_VERSION_STRING
|
#endif // GIT_DESCRIBE_VERSION_STRING
|
||||||
QStringLiteral("<hr/>"),
|
const QString QT_VERSION_ARG = QT_VERSION_STR;
|
||||||
tr("Copyright (c) 2020 %1").arg(QStringLiteral("<a href='https://github.com/BLumia'>@BLumia</a>")),
|
const QString QT_ARCH_ARG = QSysInfo::buildCpuArchitecture();
|
||||||
QStringLiteral("<br/>"),
|
const QString ABOUT_HTML = loadEmbeddedHtml(u":/htmls/about.html"_s)
|
||||||
tr("Logo designed by %1").arg(QStringLiteral("<a href='https://github.com/Lovelyblack'>@Lovelyblack</a>")),
|
.arg(APP_NAME_ARG)
|
||||||
QStringLiteral("<hr/>"),
|
.arg(tr("Version: %1").arg(APP_VERSION_ARG))
|
||||||
tr("Built with Qt %1 (%2)").arg(QT_VERSION_STR, QSysInfo::buildCpuArchitecture()),
|
.arg(tr("Upstream author"))
|
||||||
QStringLiteral("<br/><a href='%1'>%2</a>").arg("https://github.com/BLumia/pineapple-pictures", tr("Source code")),
|
.arg(tr("Hard fork author"))
|
||||||
QStringLiteral("</center>")
|
.arg(tr("Logo designer"))
|
||||||
};
|
.arg(tr("Built with Qt %1 (%2)").arg(QT_VERSION_ARG).arg(QT_ARCH_ARG))
|
||||||
|
.arg(tr("Source code"));
|
||||||
|
|
||||||
QFile translaterHtml(":/plain/translators.html");
|
const QString SPECIAL_THANKS_HTML = loadEmbeddedHtml(u":/htmls/special-thanks.html"_s)
|
||||||
bool canOpenFile = translaterHtml.open(QIODevice::ReadOnly);
|
.arg(tr("Contributors"))
|
||||||
const QByteArray & translatorList = canOpenFile ? translaterHtml.readAll() : "";
|
.arg(tr("List of contributors on GitHub"))
|
||||||
|
.arg(tr("Thanks to all people who contributed to this project."))
|
||||||
|
.arg(tr("Translators"))
|
||||||
|
.arg(tr("I would like to thank the following people who volunteered to translate this application."));
|
||||||
|
|
||||||
const QStringList specialThanksStr {
|
const QString LICENSE_HTML = loadEmbeddedHtml(u":/htmls/license.html"_s)
|
||||||
QStringLiteral("<h1 align='center'>%1</h1><a href='%2'>%3</a><p>%4</p>").arg(
|
.arg(tr("License"))
|
||||||
tr("Contributors"),
|
.arg(tr("This application is released under the MIT License."))
|
||||||
QStringLiteral("https://github.com/BLumia/pineapple-pictures/graphs/contributors"),
|
.arg(tr("License Verbatim Copy"));
|
||||||
tr("List of contributors on GitHub"),
|
|
||||||
tr("Thanks to all people who contributed to this project.")
|
|
||||||
),
|
|
||||||
|
|
||||||
QStringLiteral("<h1 align='center'>%1</h1><p>%2</p>%3").arg(
|
const QString THIRD_PARTY_LIBS_HTML = loadEmbeddedHtml(u":/htmls/third-party-libs.html"_s)
|
||||||
tr("Translators"),
|
.arg(tr("Third-party Libraries"))
|
||||||
tr("I would like to thank the following people who volunteered to translate this application."),
|
.arg(tr("This application is built on the following free software libraries.", "Free as in freedom"))
|
||||||
translatorList
|
.arg(tr("Some of them are optional and might not be included with this distribution depending on the build environment."));
|
||||||
)
|
|
||||||
};
|
|
||||||
|
|
||||||
const QStringList licenseStr {
|
ui->m_helpTextEdit->setHtml(HELP_HTML);
|
||||||
QStringLiteral("<h1 align='center'><b>%1</b></h1>").arg(tr("Your Rights")),
|
ui->m_aboutTextEdit->setHtml(ABOUT_HTML);
|
||||||
QStringLiteral("<p>%1</p><p>%2</p><ul><li>%3</li><li>%4</li><li>%5</li><li>%6</li></ul>").arg(
|
ui->m_specialThanksTextEdit->setHtml(SPECIAL_THANKS_HTML);
|
||||||
tr("%1 is released under the MIT License."), // %1
|
ui->m_licenseTextEdit->setHtml(LICENSE_HTML);
|
||||||
tr("This license grants people a number of freedoms:"), // %2
|
ui->m_3rdPartyLibsTextEdit->setHtml(THIRD_PARTY_LIBS_HTML);
|
||||||
tr("You are free to use %1, for any purpose"), // %3
|
|
||||||
tr("You are free to distribute %1"), // %4
|
|
||||||
tr("You can study how %1 works and change it"), // %5
|
|
||||||
tr("You can distribute changed versions of %1") // %6
|
|
||||||
).arg(QStringLiteral("<i>%1</i>")),
|
|
||||||
QStringLiteral("<p>%1</p>").arg(tr("The MIT license guarantees you this freedom. Nobody is ever permitted to take it away.")),
|
|
||||||
QStringLiteral("<hr/><pre>%2</pre>")
|
|
||||||
};
|
|
||||||
|
|
||||||
const QString mitLicense(QStringLiteral(R"(Expat/MIT License
|
connect(ui->m_buttonBox, QOverload<QAbstractButton *>::of(&QDialogButtonBox::clicked), this, [this](QAbstractButton * btn){
|
||||||
|
Q_UNUSED(btn)
|
||||||
Copyright (c) 2020 BLumia
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
)"));
|
|
||||||
|
|
||||||
const QStringList thirdPartyLibsStr {
|
|
||||||
QStringLiteral("<h1 align='center'><b>%1</b></h1>").arg(tr("Third-party Libraries used by %1")),
|
|
||||||
tr("%1 is built on the following free software libraries:", "Free as in freedom"),
|
|
||||||
QStringLiteral("<ul>"),
|
|
||||||
#ifdef HAVE_EXIV2_VERSION
|
|
||||||
QStringLiteral("<li><a href='%1'>%2</a>: %3</li>").arg("https://www.exiv2.org/", "Exiv2", "GPLv2"),
|
|
||||||
#endif // EXIV2_VERSION
|
|
||||||
QStringLiteral("<li><a href='%1'>%2</a>: %3</li>").arg("https://www.qt.io/", "Qt", "GPLv2 + GPLv3 + LGPLv2.1 + LGPLv3"),
|
|
||||||
QStringLiteral("</ul>")
|
|
||||||
};
|
|
||||||
|
|
||||||
m_helpTextEdit->setText(helpStr.join('\n'));
|
|
||||||
|
|
||||||
m_aboutTextEdit->setText(aboutStr.join('\n'));
|
|
||||||
m_aboutTextEdit->setOpenExternalLinks(true);
|
|
||||||
|
|
||||||
m_specialThanksTextEdit->setText(specialThanksStr.join('\n'));
|
|
||||||
m_specialThanksTextEdit->setOpenExternalLinks(true);
|
|
||||||
|
|
||||||
m_licenseTextEdit->setText(licenseStr.join('\n').arg(qApp->applicationDisplayName(), mitLicense));
|
|
||||||
|
|
||||||
m_3rdPartyLibsTextEdit->setText(thirdPartyLibsStr.join('\n').arg(QStringLiteral("<i>%1</i>")).arg(qApp->applicationDisplayName()));
|
|
||||||
m_3rdPartyLibsTextEdit->setOpenExternalLinks(true);
|
|
||||||
|
|
||||||
m_tabWidget->addTab(m_helpTextEdit, tr("&Help"));
|
|
||||||
m_tabWidget->addTab(m_aboutTextEdit, tr("&About"));
|
|
||||||
m_tabWidget->addTab(m_specialThanksTextEdit, tr("&Special Thanks"));
|
|
||||||
m_tabWidget->addTab(m_licenseTextEdit, tr("&License"));
|
|
||||||
m_tabWidget->addTab(m_3rdPartyLibsTextEdit, tr("&Third-party Libraries"));
|
|
||||||
|
|
||||||
m_buttonBox->setStandardButtons(QDialogButtonBox::Close);
|
|
||||||
connect(m_buttonBox, QOverload<QAbstractButton *>::of(&QDialogButtonBox::clicked), this, [this](){
|
|
||||||
this->close();
|
this->close();
|
||||||
});
|
});
|
||||||
|
|
||||||
setLayout(new QVBoxLayout);
|
|
||||||
|
|
||||||
layout()->addWidget(m_tabWidget);
|
|
||||||
layout()->addWidget(m_buttonBox);
|
|
||||||
|
|
||||||
setMinimumSize(361, 161); // not sure why it complain "Unable to set geometry"
|
setMinimumSize(361, 161); // not sure why it complain "Unable to set geometry"
|
||||||
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AboutDialog::~AboutDialog()
|
AboutDialog::~AboutDialog()
|
||||||
{
|
{
|
||||||
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize AboutDialog::sizeHint() const
|
QSize AboutDialog::sizeHint() const
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#ifndef ABOUTDIALOG_H
|
#ifndef ABOUTDIALOG_H
|
||||||
#define ABOUTDIALOG_H
|
#define ABOUTDIALOG_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QTextBrowser;
|
namespace Ui {
|
||||||
class QTabWidget;
|
class AboutDialog;
|
||||||
class QDialogButtonBox;
|
}
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
class AboutDialog : public QDialog
|
class AboutDialog : public QDialog
|
||||||
@@ -19,14 +23,7 @@ public:
|
|||||||
QSize sizeHint() const override;
|
QSize sizeHint() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTabWidget * m_tabWidget = nullptr;
|
QT_PREPEND_NAMESPACE(Ui::AboutDialog) *ui;
|
||||||
QDialogButtonBox * m_buttonBox = nullptr;
|
|
||||||
|
|
||||||
QTextBrowser * m_helpTextEdit = nullptr;
|
|
||||||
QTextBrowser * m_aboutTextEdit = nullptr;
|
|
||||||
QTextBrowser * m_specialThanksTextEdit = nullptr;
|
|
||||||
QTextBrowser * m_licenseTextEdit = nullptr;
|
|
||||||
QTextBrowser * m_3rdPartyLibsTextEdit = nullptr;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ABOUTDIALOG_H
|
#endif // ABOUTDIALOG_H
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>AboutDialog</class>
|
||||||
|
<widget class="QDialog" name="AboutDialog">
|
||||||
|
<property name="windowModality">
|
||||||
|
<enum>Qt::NonModal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>About</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>361</width>
|
||||||
|
<height>161</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTabWidget" name="m_tabWidget">
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="helpTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>&Help</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="helpTabLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTextBrowser" name="m_helpTextEdit">
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="aboutTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>&About</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="aboutTabLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTextBrowser" name="m_aboutTextEdit">
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="specialThanksTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>&Special Thanks</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="specialThanksTabLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTextBrowser" name="m_specialThanksTextEdit">
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="licenseTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>&License</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="licenseTabLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTextBrowser" name="m_licenseTextEdit">
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="thirdPartyLibsTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>&Third-party Libraries</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="thirdPartyLibsTabLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTextBrowser" name="m_3rdPartyLibsTextEdit">
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="m_buttonBox">
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Close</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#include "actionmanager.h"
|
||||||
|
|
||||||
|
#include "settings.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "playlistmanager.h"
|
||||||
|
#include "graphicsview.h"
|
||||||
|
#include "graphicsscene.h"
|
||||||
|
|
||||||
|
#include <QGuiApplication>
|
||||||
|
#include <QSvgRenderer>
|
||||||
|
#include <QPainter>
|
||||||
|
|
||||||
|
static QIcon loadHidpiIcon(const QString &resp, QSize sz = QSize(32, 32))
|
||||||
|
{
|
||||||
|
QPixmap pm = QPixmap(resp);
|
||||||
|
pm.scaled(sz * qApp->devicePixelRatio(), Qt::KeepAspectRatio);
|
||||||
|
pm.setDevicePixelRatio(qApp->devicePixelRatio());
|
||||||
|
return QIcon(pm);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActionManager::setupAction(MainWindow *mainWindow)
|
||||||
|
{
|
||||||
|
// region: Action and Its Icon Creation
|
||||||
|
|
||||||
|
// Declare some convenient macros and lambdas.
|
||||||
|
|
||||||
|
#define ICON_NAME(name)\
|
||||||
|
QStringLiteral(":/icons/" #name ".png")
|
||||||
|
|
||||||
|
#define ACTION_NAME(s) QStringLiteral(STRIFY(s))
|
||||||
|
#define STRIFY(s) #s
|
||||||
|
|
||||||
|
auto create_action = [] (QWidget *w, QAction **a, QString i, QString an, bool iconFromTheme = false) {
|
||||||
|
*a = new QAction(w);
|
||||||
|
if (!i.isNull())
|
||||||
|
(*a)->setIcon(iconFromTheme ? QIcon::fromTheme(i) : loadHidpiIcon(i));
|
||||||
|
(*a)->setObjectName(an);
|
||||||
|
w->addAction(*a);
|
||||||
|
};
|
||||||
|
|
||||||
|
/// This macro for register normal action.
|
||||||
|
#define CREATE_NEW_ACTION(w, a) create_action(w, &a, QString(), ACTION_NAME(a))
|
||||||
|
/// This macro for register Qt theme action.
|
||||||
|
#define CREATE_NEW_THEMEICON_ACTION(w, a, i) create_action(w, &a, QLatin1String(STRIFY(i)), ACTION_NAME(a), true)
|
||||||
|
/// This macro for register action with our custom icon.
|
||||||
|
#define CREATE_NEW_ICON_ACTION(w, a, i) create_action(w, &a, ICON_NAME(i), ACTION_NAME(a), false)
|
||||||
|
|
||||||
|
CREATE_NEW_ACTION(mainWindow, actionCopyPixmap);
|
||||||
|
CREATE_NEW_ACTION(mainWindow, actionCopyFilePath);
|
||||||
|
|
||||||
|
CREATE_NEW_ICON_ACTION(mainWindow, actionPrevPicture, go-previous);
|
||||||
|
CREATE_NEW_ICON_ACTION(mainWindow, actionNextPicture, go-next);
|
||||||
|
|
||||||
|
CREATE_NEW_ICON_ACTION(mainWindow, actionActualSize, fit-to-size);
|
||||||
|
CREATE_NEW_ICON_ACTION(mainWindow, actionFitToScreen, fit-to-screen);
|
||||||
|
CREATE_NEW_ACTION(mainWindow, actionFitByWidth);
|
||||||
|
CREATE_NEW_ACTION(mainWindow, actionFitByHeight);
|
||||||
|
CREATE_NEW_ICON_ACTION(mainWindow, actionZoomIn, zoom-in);
|
||||||
|
CREATE_NEW_ICON_ACTION(mainWindow, actionZoomOut, zoom-out);
|
||||||
|
|
||||||
|
CREATE_NEW_ICON_ACTION(mainWindow, actionFlipHorizontal, flip-horizontal);
|
||||||
|
CREATE_NEW_ICON_ACTION(mainWindow, actionFlipVertical, flip-vertical);
|
||||||
|
CREATE_NEW_ICON_ACTION(mainWindow, actionRotateClockwise, rotate-right);
|
||||||
|
CREATE_NEW_ICON_ACTION(mainWindow, actionRotateCounterClockwise, rotate-left);
|
||||||
|
|
||||||
|
CREATE_NEW_ACTION(mainWindow, actionToggleAvoidResetTransform);
|
||||||
|
CREATE_NEW_ACTION(mainWindow, actionToggleCheckerboard);
|
||||||
|
CREATE_NEW_ACTION(mainWindow, actionTogglePauseAnimation);
|
||||||
|
CREATE_NEW_ACTION(mainWindow, actionAnimationNextFrame);
|
||||||
|
|
||||||
|
CREATE_NEW_ACTION(mainWindow, actionTrash/*, edit-delete*/);
|
||||||
|
CREATE_NEW_ACTION(mainWindow, actionLocateInFileManager/*, system-file-manager*/);
|
||||||
|
CREATE_NEW_ICON_ACTION(mainWindow, actionProperties, image-info);
|
||||||
|
|
||||||
|
CREATE_NEW_ACTION(mainWindow, actionSettings);
|
||||||
|
CREATE_NEW_ACTION(mainWindow, actionHelp/*, system-help*/);
|
||||||
|
|
||||||
|
// Remove convenient macros
|
||||||
|
|
||||||
|
#undef CREATE_NEW_ICON_ACTION
|
||||||
|
#undef CREATE_NEW_THEMEICON_ACTION
|
||||||
|
#undef CREATE_NEW_ACTION
|
||||||
|
|
||||||
|
#undef STRIFY
|
||||||
|
#undef ACTION_NAME
|
||||||
|
#undef ICON_NAME
|
||||||
|
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region: Setup Checkable Action
|
||||||
|
|
||||||
|
actionToggleAvoidResetTransform->setCheckable(true);
|
||||||
|
actionToggleCheckerboard->setCheckable(true);
|
||||||
|
actionTogglePauseAnimation->setCheckable(true);
|
||||||
|
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region: Action Translatable Text Setup
|
||||||
|
|
||||||
|
actionCopyPixmap->setText(QCoreApplication::translate("MainWindow", "Copy P&ixmap", nullptr));
|
||||||
|
actionCopyFilePath->setText(QCoreApplication::translate("MainWindow", "Copy &File Path", nullptr));
|
||||||
|
|
||||||
|
actionPrevPicture->setText(QCoreApplication::translate("MainWindow", "Previous image", nullptr));
|
||||||
|
actionNextPicture->setText(QCoreApplication::translate("MainWindow", "Next image", nullptr));
|
||||||
|
|
||||||
|
actionActualSize->setText(QCoreApplication::translate("MainWindow", "Actual size", nullptr));
|
||||||
|
actionFitToScreen->setText(QCoreApplication::translate("MainWindow", "Fit to screen", nullptr));
|
||||||
|
actionFitByWidth->setText(QCoreApplication::translate("MainWindow", "Fit by width", nullptr));
|
||||||
|
actionFitByHeight->setText(QCoreApplication::translate("MainWindow", "Fit by height", nullptr));
|
||||||
|
actionZoomIn->setText(QCoreApplication::translate("MainWindow", "Zoom in", nullptr));
|
||||||
|
actionZoomOut->setText(QCoreApplication::translate("MainWindow", "Zoom out", nullptr));
|
||||||
|
|
||||||
|
actionFlipHorizontal->setText(QCoreApplication::translate("MainWindow", "Flip &Horizontally", nullptr));
|
||||||
|
actionFlipVertical->setText(QCoreApplication::translate("MainWindow", "Flip &Vertically", nullptr));
|
||||||
|
actionRotateClockwise->setText(QCoreApplication::translate("MainWindow", "Rotate right", nullptr));
|
||||||
|
actionRotateCounterClockwise->setText(QCoreApplication::translate("MainWindow", "Rotate left", nullptr));
|
||||||
|
|
||||||
|
actionToggleAvoidResetTransform->setText(QCoreApplication::translate("MainWindow", "Keep transformation", "The 'transformation' means the flip/rotation status that currently applied to the image view"));
|
||||||
|
actionToggleCheckerboard->setText(QCoreApplication::translate("MainWindow", "Toggle Checkerboard", nullptr));
|
||||||
|
actionTogglePauseAnimation->setText(QCoreApplication::translate("MainWindow", "Pause/Resume Animation", nullptr));
|
||||||
|
actionAnimationNextFrame->setText(QCoreApplication::translate("MainWindow", "Animation Go to Next Frame", nullptr));
|
||||||
|
|
||||||
|
actionTrash->setText(QCoreApplication::translate("MainWindow", "Move to Trash", nullptr));
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
actionLocateInFileManager->setText(
|
||||||
|
QCoreApplication::translate(
|
||||||
|
"MainWindow", "Show in File Explorer",
|
||||||
|
"File Explorer is the name of explorer.exe under Windows"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
#else
|
||||||
|
actionLocateInFileManager->setText(QCoreApplication::translate("MainWindow", "Show in directory", nullptr));
|
||||||
|
#endif // Q_OS_WIN
|
||||||
|
actionProperties->setText(QCoreApplication::translate("MainWindow", "Properties", nullptr));
|
||||||
|
|
||||||
|
actionSettings->setText(QCoreApplication::translate("MainWindow", "Configure...", nullptr));
|
||||||
|
actionHelp->setText(QCoreApplication::translate("MainWindow", "Help", nullptr));
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
QMetaObject::connectSlotsByName(mainWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActionManager::setupShortcuts()
|
||||||
|
{
|
||||||
|
actionCopyPixmap->setShortcut(QKeySequence::Copy);
|
||||||
|
|
||||||
|
actionPrevPicture->setShortcuts({
|
||||||
|
QKeySequence(Qt::Key_Left),
|
||||||
|
QKeySequence(Qt::Key_PageUp),
|
||||||
|
});
|
||||||
|
actionNextPicture->setShortcuts({
|
||||||
|
QKeySequence(Qt::Key_Right),
|
||||||
|
QKeySequence(Qt::Key_PageDown),
|
||||||
|
});
|
||||||
|
|
||||||
|
actionActualSize->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_0));
|
||||||
|
actionZoomIn->setShortcut(QKeySequence::ZoomIn);
|
||||||
|
actionZoomOut->setShortcut(QKeySequence::ZoomOut);
|
||||||
|
|
||||||
|
actionTrash->setShortcut(QKeySequence::Delete);
|
||||||
|
actionProperties->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_I));
|
||||||
|
|
||||||
|
actionSettings->setShortcut(QKeySequence::Preferences);
|
||||||
|
actionHelp->setShortcut(QKeySequence::HelpContents);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActionManager::updateActionState(PlaylistManager* pm, GraphicsView* gv)
|
||||||
|
{
|
||||||
|
const auto* gs = gv->scene();
|
||||||
|
const auto* settings = Settings::instance();
|
||||||
|
|
||||||
|
// Update copy actions
|
||||||
|
bool canCopy = pm->currentIndex().has_value();
|
||||||
|
actionCopyPixmap->setEnabled(canCopy);
|
||||||
|
actionCopyFilePath->setEnabled(canCopy);
|
||||||
|
|
||||||
|
// Update Prev/Next Picture State
|
||||||
|
const int galleryFileCount = pm->totalCount();
|
||||||
|
const bool loopGallery = settings->loopGallery();
|
||||||
|
actionPrevPicture->setEnabled(galleryFileCount > 1 && (loopGallery || !pm->isFirstIndex()));
|
||||||
|
actionNextPicture->setEnabled(galleryFileCount > 1 && (loopGallery || !pm->isLastIndex()));
|
||||||
|
|
||||||
|
// Update Avoid Reset Transform
|
||||||
|
actionToggleAvoidResetTransform->setChecked(gv->isAvoidResetTransform());
|
||||||
|
// Update Checkerboard
|
||||||
|
actionToggleCheckerboard->setChecked(gv->isCheckerboard());
|
||||||
|
// Update Animation Graphics Action
|
||||||
|
bool canPauseAnimation = gs->canPauseAnimation();
|
||||||
|
actionTogglePauseAnimation->setEnabled(canPauseAnimation);
|
||||||
|
if (canPauseAnimation) {
|
||||||
|
actionTogglePauseAnimation->setChecked(gs->isPauseAnimation());
|
||||||
|
} else {
|
||||||
|
actionTogglePauseAnimation->setChecked(false);
|
||||||
|
}
|
||||||
|
bool canSkipAnimation = gs->canSkipAnimationFrame();
|
||||||
|
actionAnimationNextFrame->setEnabled(canSkipAnimation);
|
||||||
|
|
||||||
|
// Update trash, located in explorer and properties.
|
||||||
|
bool hasLoadedFile = pm->currentIndex().has_value();
|
||||||
|
actionTrash->setEnabled(hasLoadedFile);
|
||||||
|
actionLocateInFileManager->setEnabled(hasLoadedFile);
|
||||||
|
actionProperties->setEnabled(hasLoadedFile);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#ifndef ACTIONMANAGER_H
|
||||||
|
#define ACTIONMANAGER_H
|
||||||
|
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
class MainWindow;
|
||||||
|
class PlaylistManager;
|
||||||
|
class GraphicsView;
|
||||||
|
|
||||||
|
/// Action Manager is separated from Main Window
|
||||||
|
/// to manage all actions specifically.
|
||||||
|
class ActionManager
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit ActionManager() = default;
|
||||||
|
~ActionManager() = default;
|
||||||
|
|
||||||
|
void setupAction(MainWindow * mainWindow);
|
||||||
|
void setupShortcuts();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void updateActionState(PlaylistManager* pm, GraphicsView* gv);
|
||||||
|
|
||||||
|
public:
|
||||||
|
QAction *actionCopyPixmap;
|
||||||
|
QAction *actionCopyFilePath;
|
||||||
|
|
||||||
|
QAction *actionPrevPicture;
|
||||||
|
QAction *actionNextPicture;
|
||||||
|
|
||||||
|
QAction *actionActualSize;
|
||||||
|
QAction *actionFitToScreen;
|
||||||
|
QAction *actionFitByWidth;
|
||||||
|
QAction *actionFitByHeight;
|
||||||
|
QAction *actionZoomIn;
|
||||||
|
QAction *actionZoomOut;
|
||||||
|
|
||||||
|
QAction *actionFlipHorizontal;
|
||||||
|
QAction *actionFlipVertical;
|
||||||
|
QAction *actionRotateClockwise;
|
||||||
|
QAction *actionRotateCounterClockwise;
|
||||||
|
|
||||||
|
QAction *actionToggleAvoidResetTransform;
|
||||||
|
QAction *actionToggleCheckerboard;
|
||||||
|
QAction *actionTogglePauseAnimation;
|
||||||
|
QAction *actionAnimationNextFrame;
|
||||||
|
|
||||||
|
QAction *actionTrash;
|
||||||
|
QAction *actionLocateInFileManager;
|
||||||
|
QAction *actionProperties;
|
||||||
|
|
||||||
|
QAction *actionSettings;
|
||||||
|
QAction *actionHelp;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ACTIONMANAGER_H
|
||||||
@@ -1,68 +1,45 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#include "bottombuttongroup.h"
|
#include "bottombuttongroup.h"
|
||||||
|
|
||||||
#include "opacityhelper.h"
|
#include <QToolButton>
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
BottomButtonGroup::BottomButtonGroup(QWidget *parent)
|
BottomButtonGroup::BottomButtonGroup(QWidget *parent)
|
||||||
: QGroupBox (parent)
|
: QGroupBox (parent)
|
||||||
, m_opacityHelper(new OpacityHelper(this))
|
|
||||||
{
|
{
|
||||||
QHBoxLayout * mainLayout = new QHBoxLayout(this);
|
QHBoxLayout * mainLayout = new QHBoxLayout(this);
|
||||||
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
|
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
this->setLayout(mainLayout);
|
this->setLayout(mainLayout);
|
||||||
this->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
this->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||||
this->setStyleSheet("BottomButtonGroup {"
|
this->setStyleSheet(R"#(
|
||||||
"border: 1px solid gray;"
|
BottomButtonGroup {
|
||||||
"border-top-left-radius: 10px;"
|
border-style: none;
|
||||||
"border-top-right-radius: 10px;"
|
background: transparent;
|
||||||
"border-style: none;"
|
}
|
||||||
"background-color:rgba(0,0,0,120)"
|
QToolButton {
|
||||||
"}"
|
background: transparent;
|
||||||
"QPushButton {"
|
border-style: none;
|
||||||
"background-color:rgba(225,255,255,0);"
|
}
|
||||||
"color: white;"
|
)#");
|
||||||
"border-style: none;"
|
}
|
||||||
"}");
|
|
||||||
|
|
||||||
auto newBtn = [](QString text, std::function<void()> func) -> QPushButton * {
|
void BottomButtonGroup::addActions(const std::vector<QAction *> & actionList) {
|
||||||
QPushButton * btn = new QPushButton(QIcon(QStringLiteral(":/icons/") + text), "");
|
for (QAction * action : actionList) {
|
||||||
btn->setIconSize(QSize(40, 40));
|
// Create button
|
||||||
|
QToolButton * btn = new QToolButton(this);
|
||||||
|
btn->setDefaultAction(action);
|
||||||
|
btn->setIconSize(QSize(32, 32));
|
||||||
btn->setFixedSize(40, 40);
|
btn->setFixedSize(40, 40);
|
||||||
QObject::connect(btn, &QAbstractButton::clicked, btn, func);
|
// Add button
|
||||||
return btn;
|
layout()->addWidget(btn);
|
||||||
};
|
}
|
||||||
addButton(newBtn("zoom-original", [this]() {
|
|
||||||
emit resetToOriginalBtnClicked();
|
|
||||||
}));
|
|
||||||
addButton(newBtn("view-fullscreen", [this]() {
|
|
||||||
emit toggleWindowMaximum();
|
|
||||||
}));
|
|
||||||
addButton(newBtn("zoom-in", [this]() {
|
|
||||||
emit zoomInBtnClicked();
|
|
||||||
}));
|
|
||||||
addButton(newBtn("zoom-out", [this]() {
|
|
||||||
emit zoomOutBtnClicked();
|
|
||||||
}));
|
|
||||||
addButton(newBtn("view-background-checkerboard", [this]() {
|
|
||||||
emit toggleCheckerboardBtnClicked();
|
|
||||||
}));
|
|
||||||
addButton(newBtn("object-rotate-right", [this]() {
|
|
||||||
emit rotateRightBtnClicked();
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
void BottomButtonGroup::setOpacity(qreal opacity, bool animated)
|
|
||||||
{
|
|
||||||
m_opacityHelper->setOpacity(opacity, animated);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BottomButtonGroup::addButton(QAbstractButton *button)
|
|
||||||
{
|
|
||||||
layout()->addWidget(button);
|
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BottomButtonGroup::addAction(QAction* action) {
|
||||||
|
addActions({action});
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,29 +1,23 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#ifndef BOTTOMBUTTONGROUP_H
|
#ifndef BOTTOMBUTTONGROUP_H
|
||||||
#define BOTTOMBUTTONGROUP_H
|
#define BOTTOMBUTTONGROUP_H
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <QAbstractButton>
|
#include <QAbstractButton>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
|
|
||||||
class OpacityHelper;
|
|
||||||
class BottomButtonGroup : public QGroupBox
|
class BottomButtonGroup : public QGroupBox
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit BottomButtonGroup(QWidget *parent = nullptr);
|
explicit BottomButtonGroup(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void setOpacity(qreal opacity, bool animated = true);
|
void addActions(const std::vector<QAction *> & actionList);
|
||||||
void addButton(QAbstractButton *button);
|
void addAction(QAction* action);
|
||||||
|
|
||||||
signals:
|
|
||||||
void resetToOriginalBtnClicked();
|
|
||||||
void toggleWindowMaximum();
|
|
||||||
void zoomInBtnClicked();
|
|
||||||
void zoomOutBtnClicked();
|
|
||||||
void toggleCheckerboardBtnClicked();
|
|
||||||
void rotateRightBtnClicked();
|
|
||||||
|
|
||||||
private:
|
|
||||||
OpacityHelper * m_opacityHelper;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BOTTOMBUTTONGROUP_H
|
#endif // BOTTOMBUTTONGROUP_H
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#include "exiv2wrapper.h"
|
#include "exiv2wrapper.h"
|
||||||
|
|
||||||
#ifdef HAVE_EXIV2_VERSION
|
#ifdef HAVE_EXIV2_VERSION
|
||||||
@@ -23,6 +27,7 @@ Exiv2Wrapper::~Exiv2Wrapper()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_EXIV2_VERSION // stupid AppleClang...
|
||||||
template<typename Collection, typename Iterator>
|
template<typename Collection, typename Iterator>
|
||||||
void Exiv2Wrapper::cacheSection(Collection collection)
|
void Exiv2Wrapper::cacheSection(Collection collection)
|
||||||
{
|
{
|
||||||
@@ -31,16 +36,27 @@ void Exiv2Wrapper::cacheSection(Collection collection)
|
|||||||
for (; it != end; ++it) {
|
for (; it != end; ++it) {
|
||||||
QString key = QString::fromUtf8(it->key().c_str());
|
QString key = QString::fromUtf8(it->key().c_str());
|
||||||
if (it->tagName().substr(0, 2) == "0x") continue;
|
if (it->tagName().substr(0, 2) == "0x") continue;
|
||||||
QString label = QString::fromLocal8Bit(it->tagLabel().c_str());
|
// We might get exceptions like "No namespace info available for XMP prefix `Item'"
|
||||||
std::ostringstream stream;
|
// when trying to get tagLabel() data from a Xmpdatum if the tag is not common-used.
|
||||||
stream << *it;
|
// We don't care for those rare tags so let's just use a try-cache...
|
||||||
QString value = QString::fromLocal8Bit(stream.str().c_str());
|
try {
|
||||||
m_metadataValue.insert(key, value);
|
QString label = QString::fromLocal8Bit(it->tagLabel().c_str());
|
||||||
m_metadataLabel.insert(key, label);
|
std::ostringstream stream;
|
||||||
|
stream << *it;
|
||||||
qDebug() << key << label << value;
|
QString value = QString::fromUtf8(stream.str().c_str());
|
||||||
|
m_metadataValue.insert(key, value);
|
||||||
|
m_metadataLabel.insert(key, label);
|
||||||
|
qDebug() << key << label << value;
|
||||||
|
#if EXIV2_TEST_VERSION(0, 28, 0)
|
||||||
|
} catch (Exiv2::Error & err) {
|
||||||
|
#else // 0.27.x
|
||||||
|
} catch (Exiv2::AnyError & err) {
|
||||||
|
#endif // EXIV2_TEST_VERSION(0, 28, 0)
|
||||||
|
qWarning() << "Error loading key" << key << ":" << err.what();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // HAVE_EXIV2_VERSION
|
||||||
|
|
||||||
bool Exiv2Wrapper::load(const QString &filePath)
|
bool Exiv2Wrapper::load(const QString &filePath)
|
||||||
{
|
{
|
||||||
@@ -99,3 +115,24 @@ QString Exiv2Wrapper::value(const QString &key) const
|
|||||||
return m_metadataValue.value(key);
|
return m_metadataValue.value(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Exiv2Wrapper::XmpValue(const QString &rawValue)
|
||||||
|
{
|
||||||
|
QString ignored;
|
||||||
|
return Exiv2Wrapper::XmpValue(rawValue, ignored);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString Exiv2Wrapper::XmpValue(const QString &rawValue, QString &language)
|
||||||
|
{
|
||||||
|
if (rawValue.size() > 6 && rawValue.startsWith(QLatin1String("lang=\""))) {
|
||||||
|
int pos = rawValue.indexOf('"', 6);
|
||||||
|
|
||||||
|
if (pos != -1) {
|
||||||
|
language = rawValue.mid(6, pos - 6);
|
||||||
|
return (rawValue.mid(pos + 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
language.clear();
|
||||||
|
return rawValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#ifndef EXIV2WRAPPER_H
|
#ifndef EXIV2WRAPPER_H
|
||||||
#define EXIV2WRAPPER_H
|
#define EXIV2WRAPPER_H
|
||||||
|
|
||||||
@@ -23,6 +27,9 @@ public:
|
|||||||
QString label(const QString & key) const;
|
QString label(const QString & key) const;
|
||||||
QString value(const QString & key) const;
|
QString value(const QString & key) const;
|
||||||
|
|
||||||
|
static QString XmpValue(const QString &rawValue);
|
||||||
|
static QString XmpValue(const QString &rawValue, QString & language);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Exiv2::Image> m_exivImage;
|
std::unique_ptr<Exiv2::Image> m_exivImage;
|
||||||
QMap<QString, QString> m_metadataValue;
|
QMap<QString, QString> m_metadataValue;
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2024 Gary Wang <git@blumia.net>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#include "fileopeneventhandler.h"
|
||||||
|
|
||||||
|
#include <QFileOpenEvent>
|
||||||
|
|
||||||
|
FileOpenEventHandler::FileOpenEventHandler(QObject *parent)
|
||||||
|
: QObject(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FileOpenEventHandler::eventFilter(QObject *obj, QEvent *event)
|
||||||
|
{
|
||||||
|
if (event->type() == QEvent::FileOpen) {
|
||||||
|
QFileOpenEvent *fileOpenEvent = static_cast<QFileOpenEvent *>(event);
|
||||||
|
emit fileOpen(fileOpenEvent->url());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return QObject::eventFilter(obj, event);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2024 Gary Wang <git@blumia.net>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
class FileOpenEventHandler : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit FileOpenEventHandler(QObject *parent = nullptr);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void fileOpen(const QUrl &url);
|
||||||
|
};
|
||||||
@@ -1,19 +1,136 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#include "graphicsscene.h"
|
#include "graphicsscene.h"
|
||||||
|
|
||||||
|
#include "settings.h"
|
||||||
|
|
||||||
|
#include <QStyleHints>
|
||||||
|
#include <QOperatingSystemVersion>
|
||||||
|
#include <QGuiApplication>
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QGraphicsSvgItem>
|
#include <QGraphicsSvgItem>
|
||||||
|
#include <QSvgRenderer>
|
||||||
#include <QMovie>
|
#include <QMovie>
|
||||||
#include <QLabel>
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
static const QColor& ColorSchemaToTextForeground(Qt::ColorScheme colorScheme) {
|
||||||
|
// YYC MARK:
|
||||||
|
// If we are using Windows 10 and lower system or Qt which do not support "Windows 11"
|
||||||
|
// theme (lower than Qt 6.7), we should only support light mode.
|
||||||
|
// Because Qt's dark-mode-aware "Windows 11" theme is only well-supported on Windows 11.
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
|
||||||
|
colorScheme = Qt::ColorScheme::Light;
|
||||||
|
#else
|
||||||
|
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows11) {
|
||||||
|
colorScheme = Qt::ColorScheme::Light;
|
||||||
|
}
|
||||||
|
#endif // QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
|
||||||
|
#endif // defined(Q_OS_WIN)
|
||||||
|
|
||||||
|
switch (colorScheme) {
|
||||||
|
case Qt::ColorScheme::Dark:
|
||||||
|
static QColor WHITE = QColor("White");
|
||||||
|
return WHITE;
|
||||||
|
case Qt::ColorScheme::Light:
|
||||||
|
case Qt::ColorScheme::Unknown:
|
||||||
|
default:
|
||||||
|
static QColor BLACK = QColor("Black");
|
||||||
|
return BLACK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PGraphicsPixmapItem : public QGraphicsPixmapItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent = nullptr)
|
||||||
|
: QGraphicsPixmapItem(pixmap, parent)
|
||||||
|
{}
|
||||||
|
|
||||||
|
enum { Type = UserType + 1 };
|
||||||
|
int type() const override { return Type; }
|
||||||
|
|
||||||
|
void setScaleHint(float scaleHint) {
|
||||||
|
m_scaleHint = scaleHint;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QPixmap & scaledPixmap(float scaleHint) {
|
||||||
|
if (qFuzzyCompare(scaleHint, m_cachedScaleHint)) return m_cachedPixmap;
|
||||||
|
QSizeF resizedScale(boundingRect().size());
|
||||||
|
resizedScale *= scaleHint;
|
||||||
|
QPixmap && sourcePixmap = pixmap();
|
||||||
|
m_cachedPixmap = sourcePixmap.scaled(
|
||||||
|
resizedScale.toSize() * sourcePixmap.devicePixelRatioF(),
|
||||||
|
Qt::KeepAspectRatio,
|
||||||
|
Qt::SmoothTransformation);
|
||||||
|
m_cachedScaleHint = scaleHint;
|
||||||
|
return m_cachedPixmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
|
QWidget *widget) override
|
||||||
|
{
|
||||||
|
if (transformationMode() == Qt::FastTransformation) {
|
||||||
|
return QGraphicsPixmapItem::paint(painter, option, widget);
|
||||||
|
} else {
|
||||||
|
// painter->setRenderHints(QPainter::Antialiasing);
|
||||||
|
painter->drawPixmap(QRectF(offset(), boundingRect().size()).toRect(),
|
||||||
|
scaledPixmap(m_scaleHint));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
float m_scaleHint = 1;
|
||||||
|
float m_cachedScaleHint = -1;
|
||||||
|
QPixmap m_cachedPixmap;
|
||||||
|
};
|
||||||
|
|
||||||
|
class PGraphicsMovieItem : public QGraphicsItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PGraphicsMovieItem(QGraphicsItem *parent = nullptr) : QGraphicsItem(parent) {}
|
||||||
|
|
||||||
|
enum { Type = UserType + 2 };
|
||||||
|
int type() const override { return Type; }
|
||||||
|
|
||||||
|
void setMovie(QMovie* movie) {
|
||||||
|
if (m_movie) m_movie->disconnect();
|
||||||
|
m_movie.reset(movie);
|
||||||
|
m_movie->connect(m_movie.data(), &QMovie::updated, [this](){
|
||||||
|
this->update();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QRectF boundingRect() const override {
|
||||||
|
if (m_movie) { return m_movie->frameRect(); }
|
||||||
|
else { return QRectF(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override {
|
||||||
|
if (m_movie) {
|
||||||
|
painter->drawPixmap(m_movie->frameRect(), m_movie->currentPixmap(), m_movie->frameRect());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline QMovie * movie() const {
|
||||||
|
return m_movie.data();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QScopedPointer<QMovie> m_movie;
|
||||||
|
};
|
||||||
|
|
||||||
GraphicsScene::GraphicsScene(QObject *parent)
|
GraphicsScene::GraphicsScene(QObject *parent)
|
||||||
: QGraphicsScene(parent)
|
: QGraphicsScene(parent)
|
||||||
{
|
{
|
||||||
showText(tr("Drag image here"));
|
showText(tr("Drag image here", "The same meaning of MainWindow's hint."));
|
||||||
|
connect(qGuiApp->styleHints(), &QStyleHints::colorSchemeChanged, this, &GraphicsScene::updateStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
GraphicsScene::~GraphicsScene()
|
GraphicsScene::~GraphicsScene()
|
||||||
@@ -24,7 +141,8 @@ GraphicsScene::~GraphicsScene()
|
|||||||
void GraphicsScene::showImage(const QPixmap &pixmap)
|
void GraphicsScene::showImage(const QPixmap &pixmap)
|
||||||
{
|
{
|
||||||
this->clear();
|
this->clear();
|
||||||
QGraphicsPixmapItem * pixmapItem = this->addPixmap(pixmap);
|
PGraphicsPixmapItem * pixmapItem = new PGraphicsPixmapItem(pixmap);
|
||||||
|
this->addItem(pixmapItem);
|
||||||
pixmapItem->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
|
pixmapItem->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
|
||||||
m_theThing = pixmapItem;
|
m_theThing = pixmapItem;
|
||||||
this->setSceneRect(m_theThing->boundingRect());
|
this->setSceneRect(m_theThing->boundingRect());
|
||||||
@@ -34,7 +152,7 @@ void GraphicsScene::showText(const QString &text)
|
|||||||
{
|
{
|
||||||
this->clear();
|
this->clear();
|
||||||
QGraphicsTextItem * textItem = this->addText(text);
|
QGraphicsTextItem * textItem = this->addText(text);
|
||||||
textItem->setDefaultTextColor(QColor("White"));
|
textItem->setDefaultTextColor(ColorSchemaToTextForeground(qGuiApp->styleHints()->colorScheme()));
|
||||||
m_theThing = textItem;
|
m_theThing = textItem;
|
||||||
this->setSceneRect(m_theThing->boundingRect());
|
this->setSceneRect(m_theThing->boundingRect());
|
||||||
}
|
}
|
||||||
@@ -42,39 +160,106 @@ void GraphicsScene::showText(const QString &text)
|
|||||||
void GraphicsScene::showSvg(const QString &filepath)
|
void GraphicsScene::showSvg(const QString &filepath)
|
||||||
{
|
{
|
||||||
this->clear();
|
this->clear();
|
||||||
QGraphicsSvgItem * svgItem = new QGraphicsSvgItem(filepath);
|
QGraphicsSvgItem * svgItem = new QGraphicsSvgItem();
|
||||||
|
QSvgRenderer * render = new QSvgRenderer(svgItem);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
|
||||||
|
if (Settings::instance()->svgTiny12Only()) {
|
||||||
|
render->setOptions(QtSvg::Tiny12FeaturesOnly);
|
||||||
|
}
|
||||||
|
#endif // QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
|
||||||
|
render->load(filepath);
|
||||||
|
svgItem->setSharedRenderer(render);
|
||||||
this->addItem(svgItem);
|
this->addItem(svgItem);
|
||||||
m_theThing = svgItem;
|
m_theThing = svgItem;
|
||||||
this->setSceneRect(m_theThing->boundingRect());
|
this->setSceneRect(m_theThing->boundingRect());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsScene::showGif(const QString &filepath)
|
void GraphicsScene::showAnimated(const QString &filepath)
|
||||||
{
|
{
|
||||||
this->clear();
|
this->clear();
|
||||||
|
|
||||||
|
PGraphicsMovieItem * animatedItem = new PGraphicsMovieItem();
|
||||||
QMovie * movie = new QMovie(filepath);
|
QMovie * movie = new QMovie(filepath);
|
||||||
QLabel * label = new QLabel;
|
|
||||||
label->setStyleSheet("background-color:rgba(225,255,255,0);");
|
|
||||||
label->setMovie(movie);
|
|
||||||
this->addWidget(label);
|
|
||||||
movie->start();
|
movie->start();
|
||||||
m_theThing = this->addRect(QRect(QPoint(0, 0), label->sizeHint()),
|
animatedItem->setMovie(movie);
|
||||||
QPen(Qt::transparent));
|
this->addItem(animatedItem);
|
||||||
|
m_theThing = animatedItem;
|
||||||
|
|
||||||
this->setSceneRect(m_theThing->boundingRect());
|
this->setSceneRect(m_theThing->boundingRect());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GraphicsScene::trySetTransformationMode(Qt::TransformationMode mode)
|
bool GraphicsScene::trySetTransformationMode(Qt::TransformationMode mode, float scaleHint)
|
||||||
{
|
{
|
||||||
QGraphicsPixmapItem * pixmapItem = qgraphicsitem_cast<QGraphicsPixmapItem *>(m_theThing);
|
PGraphicsPixmapItem * pixmapItem = qgraphicsitem_cast<PGraphicsPixmapItem *>(m_theThing);
|
||||||
if (pixmapItem) {
|
if (pixmapItem) {
|
||||||
pixmapItem->setTransformationMode(mode);
|
pixmapItem->setTransformationMode(mode);
|
||||||
|
pixmapItem->setScaleHint(scaleHint);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Fetch graphics item as our custom animated item.
|
||||||
|
/// Return nullptr means this item is not animated item.
|
||||||
|
static PGraphicsMovieItem* fetchAnimatedItem(QGraphicsItem *item) {
|
||||||
|
return qgraphicsitem_cast<PGraphicsMovieItem *>(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GraphicsScene::canPauseAnimation() const {
|
||||||
|
return fetchAnimatedItem(m_theThing) != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GraphicsScene::isPauseAnimation() const {
|
||||||
|
auto* animatedItem = fetchAnimatedItem(m_theThing);
|
||||||
|
if (animatedItem != nullptr) {
|
||||||
|
return animatedItem->movie()->state() == QMovie::Paused;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GraphicsScene::togglePauseAnimation()
|
||||||
|
{
|
||||||
|
auto* animatedItem = fetchAnimatedItem(m_theThing);
|
||||||
|
if (animatedItem != nullptr) {
|
||||||
|
animatedItem->movie()->setPaused(animatedItem->movie()->state() != QMovie::Paused);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GraphicsScene::canSkipAnimationFrame() const {
|
||||||
|
return isPauseAnimation();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GraphicsScene::skipAnimationFrame(int delta)
|
||||||
|
{
|
||||||
|
auto* animatedItem = fetchAnimatedItem(m_theThing);
|
||||||
|
|
||||||
|
// Only paused animated item can skip frame
|
||||||
|
if (animatedItem == nullptr) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (animatedItem->movie()->state() != QMovie::Paused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Perform skip
|
||||||
|
const int frameCount = animatedItem->movie()->frameCount();
|
||||||
|
const int currentFrame = animatedItem->movie()->currentFrameNumber();
|
||||||
|
const int targetFrame = (currentFrame + delta) % frameCount;
|
||||||
|
return animatedItem->movie()->jumpToFrame(targetFrame);
|
||||||
|
}
|
||||||
|
|
||||||
QPixmap GraphicsScene::renderToPixmap()
|
QPixmap GraphicsScene::renderToPixmap()
|
||||||
{
|
{
|
||||||
|
PGraphicsPixmapItem * pixmapItem = qgraphicsitem_cast<PGraphicsPixmapItem *>(m_theThing);
|
||||||
|
if (pixmapItem) {
|
||||||
|
return pixmapItem->pixmap();
|
||||||
|
}
|
||||||
|
|
||||||
QPixmap pixmap(sceneRect().toRect().size());
|
QPixmap pixmap(sceneRect().toRect().size());
|
||||||
pixmap.fill(Qt::transparent);
|
pixmap.fill(Qt::transparent);
|
||||||
QPainter p(&pixmap);
|
QPainter p(&pixmap);
|
||||||
@@ -82,3 +267,14 @@ QPixmap GraphicsScene::renderToPixmap()
|
|||||||
|
|
||||||
return pixmap;
|
return pixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GraphicsScene::updateStyle(Qt::ColorScheme colorScheme) {
|
||||||
|
Q_UNUSED(colorScheme)
|
||||||
|
|
||||||
|
QGraphicsItem * item = this->m_theThing;
|
||||||
|
if (item == nullptr) return;
|
||||||
|
QGraphicsTextItem * textItem = qgraphicsitem_cast<QGraphicsTextItem*>(item);
|
||||||
|
if (textItem == nullptr) return;
|
||||||
|
|
||||||
|
textItem->setDefaultTextColor(ColorSchemaToTextForeground(colorScheme));
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#ifndef GRAPHICSSCENE_H
|
#ifndef GRAPHICSSCENE_H
|
||||||
#define GRAPHICSSCENE_H
|
#define GRAPHICSSCENE_H
|
||||||
|
|
||||||
@@ -13,14 +17,32 @@ public:
|
|||||||
void showImage(const QPixmap &pixmap);
|
void showImage(const QPixmap &pixmap);
|
||||||
void showText(const QString &text);
|
void showText(const QString &text);
|
||||||
void showSvg(const QString &filepath);
|
void showSvg(const QString &filepath);
|
||||||
void showGif(const QString &filepath);
|
void showAnimated(const QString &filepath);
|
||||||
|
|
||||||
bool trySetTransformationMode(Qt::TransformationMode mode);
|
bool trySetTransformationMode(Qt::TransformationMode mode, float scaleHint);
|
||||||
|
|
||||||
|
/// Check whether current thing is animation.
|
||||||
|
/// Only animation thing can be paused.
|
||||||
|
bool canPauseAnimation() const;
|
||||||
|
/// Check whether we are pasuing an animation graphics.
|
||||||
|
bool isPauseAnimation() const;
|
||||||
|
/// Toggle animation graphics pause state.
|
||||||
|
/// Return true for successfully toggle, otherwise false.
|
||||||
|
bool togglePauseAnimation();
|
||||||
|
/// Check whether we can skip animation frame.
|
||||||
|
/// Only paused animation graphics can skip frame.
|
||||||
|
bool canSkipAnimationFrame() const;
|
||||||
|
/// Skip paused animation graphics with given frame.
|
||||||
|
/// Return true for successfully skip, otherwise false.
|
||||||
|
bool skipAnimationFrame(int delta = 1);
|
||||||
|
|
||||||
QPixmap renderToPixmap();
|
QPixmap renderToPixmap();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void updateStyle(Qt::ColorScheme colorScheme);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QGraphicsItem * m_theThing;
|
QGraphicsItem * m_theThing = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GRAPHICSSCENE_H
|
#endif // GRAPHICSSCENE_H
|
||||||
|
|||||||
@@ -1,12 +1,21 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#include "graphicsview.h"
|
#include "graphicsview.h"
|
||||||
|
|
||||||
#include "graphicsscene.h"
|
#include "graphicsscene.h"
|
||||||
|
#include "settings.h"
|
||||||
|
|
||||||
|
#include <QStyleHints>
|
||||||
|
#include <QOperatingSystemVersion>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QColorSpace>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
#include <QImageReader>
|
#include <QImageReader>
|
||||||
|
#include <QStyleOptionGraphicsItem>
|
||||||
|
|
||||||
GraphicsView::GraphicsView(QWidget *parent)
|
GraphicsView::GraphicsView(QWidget *parent)
|
||||||
: QGraphicsView (parent)
|
: QGraphicsView (parent)
|
||||||
@@ -16,84 +25,95 @@ GraphicsView::GraphicsView(QWidget *parent)
|
|||||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
setResizeAnchor(QGraphicsView::AnchorUnderMouse);
|
setResizeAnchor(QGraphicsView::AnchorUnderMouse);
|
||||||
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
|
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
|
||||||
setStyleSheet("background-color: rgba(0, 0, 0, 220);"
|
setAcceptDrops(false);
|
||||||
"border-radius: 3px;");
|
|
||||||
setAcceptDrops(true);
|
|
||||||
setCheckerboardEnabled(false);
|
setCheckerboardEnabled(false);
|
||||||
|
|
||||||
|
updateStyle(qGuiApp->styleHints()->colorScheme());
|
||||||
|
connect(qGuiApp->styleHints(), &QStyleHints::colorSchemeChanged, this, &GraphicsView::updateStyle);
|
||||||
|
|
||||||
connect(horizontalScrollBar(), &QScrollBar::valueChanged, this, &GraphicsView::viewportRectChanged);
|
connect(horizontalScrollBar(), &QScrollBar::valueChanged, this, &GraphicsView::viewportRectChanged);
|
||||||
connect(verticalScrollBar(), &QScrollBar::valueChanged, this, &GraphicsView::viewportRectChanged);
|
connect(verticalScrollBar(), &QScrollBar::valueChanged, this, &GraphicsView::viewportRectChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::showFileFromUrl(const QUrl &url, bool doRequestGallery)
|
void GraphicsView::showFileFromPath(const QString &filePath)
|
||||||
{
|
{
|
||||||
emit navigatorViewRequired(false, 0);
|
emit navigatorViewRequired(false, transform());
|
||||||
|
|
||||||
QString filePath(url.toLocalFile());
|
|
||||||
|
|
||||||
if (filePath.endsWith(".svg")) {
|
if (filePath.endsWith(".svg")) {
|
||||||
showSvg(filePath);
|
showSvg(filePath);
|
||||||
} else if (filePath.endsWith(".gif")) {
|
|
||||||
showGif(filePath);
|
|
||||||
} else {
|
} else {
|
||||||
QImageReader imageReader(filePath);
|
QImageReader imageReader(filePath);
|
||||||
imageReader.setAutoTransform(true);
|
imageReader.setAutoTransform(true);
|
||||||
imageReader.setDecideFormatFromContent(true);
|
imageReader.setDecideFormatFromContent(true);
|
||||||
|
imageReader.setAllocationLimit(0);
|
||||||
|
|
||||||
// Since if the image format / plugin does not support this feature, imageFormat() will returns an invalid format.
|
// Since if the image format / plugin does not support this feature, imageFormat() will returns an invalid format.
|
||||||
// So we cannot use imageFormat() and check if it returns QImage::Format_Invalid to detect if we support the file.
|
// So we cannot use imageFormat() and check if it returns QImage::Format_Invalid to detect if we support the file.
|
||||||
// QImage::Format imageFormat = imageReader.imageFormat();
|
// QImage::Format imageFormat = imageReader.imageFormat();
|
||||||
if (imageReader.format().isEmpty()) {
|
if (imageReader.format().isEmpty()) {
|
||||||
showText(tr("File is not a valid image"));
|
showText(tr("File is not a valid image"));
|
||||||
} else if (!imageReader.supportsAnimation() && !imageReader.canRead()) {
|
} else if (imageReader.supportsAnimation() && imageReader.imageCount() > 1) {
|
||||||
|
showAnimated(filePath);
|
||||||
|
} else if (!imageReader.canRead()) {
|
||||||
showText(tr("Image data is invalid or currently unsupported"));
|
showText(tr("Image data is invalid or currently unsupported"));
|
||||||
} else {
|
} else {
|
||||||
const QPixmap & pixmap = QPixmap::fromImageReader(&imageReader);
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
|
||||||
|
QImage && img = imageReader.read();
|
||||||
|
if (img.isNull()) {
|
||||||
|
showText(tr("Image data is invalid or currently unsupported"));
|
||||||
|
} else {
|
||||||
|
if (img.format() == QImage::Format_CMYK8888) {
|
||||||
|
img.convertToColorSpace(QColorSpace::SRgb);
|
||||||
|
}
|
||||||
|
img.setDevicePixelRatio(devicePixelRatioF());
|
||||||
|
showImage(img);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
QPixmap && pixmap = QPixmap::fromImageReader(&imageReader);
|
||||||
if (pixmap.isNull()) {
|
if (pixmap.isNull()) {
|
||||||
showText(tr("Image data is invalid or currently unsupported"));
|
showText(tr("Image data is invalid or currently unsupported"));
|
||||||
} else {
|
} else {
|
||||||
|
pixmap.setDevicePixelRatio(devicePixelRatioF());
|
||||||
showImage(pixmap);
|
showImage(pixmap);
|
||||||
}
|
}
|
||||||
|
#endif // QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doRequestGallery) {
|
|
||||||
emit requestGallery(filePath);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::showImage(const QPixmap &pixmap)
|
void GraphicsView::showImage(const QPixmap &pixmap)
|
||||||
{
|
{
|
||||||
resetTransform();
|
resetTransform();
|
||||||
scene()->showImage(pixmap);
|
scene()->showImage(pixmap);
|
||||||
checkAndDoFitInView();
|
displayScene();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::showImage(const QImage &image)
|
void GraphicsView::showImage(const QImage &image)
|
||||||
{
|
{
|
||||||
resetTransform();
|
resetTransform();
|
||||||
scene()->showImage(QPixmap::fromImage(image));
|
scene()->showImage(QPixmap::fromImage(image));
|
||||||
checkAndDoFitInView();
|
displayScene();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::showText(const QString &text)
|
void GraphicsView::showText(const QString &text)
|
||||||
{
|
{
|
||||||
resetTransform();
|
resetTransform();
|
||||||
scene()->showText(text);
|
scene()->showText(text);
|
||||||
checkAndDoFitInView();
|
displayScene();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::showSvg(const QString &filepath)
|
void GraphicsView::showSvg(const QString &filepath)
|
||||||
{
|
{
|
||||||
resetTransform();
|
resetTransform();
|
||||||
scene()->showSvg(filepath);
|
scene()->showSvg(filepath);
|
||||||
checkAndDoFitInView();
|
displayScene();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::showGif(const QString &filepath)
|
void GraphicsView::showAnimated(const QString &filepath)
|
||||||
{
|
{
|
||||||
resetTransform();
|
resetTransform();
|
||||||
scene()->showGif(filepath);
|
scene()->showAnimated(filepath);
|
||||||
checkAndDoFitInView();
|
displayScene();
|
||||||
}
|
}
|
||||||
|
|
||||||
GraphicsScene *GraphicsView::scene() const
|
GraphicsScene *GraphicsView::scene() const
|
||||||
@@ -108,39 +128,58 @@ void GraphicsView::setScene(GraphicsScene *scene)
|
|||||||
|
|
||||||
qreal GraphicsView::scaleFactor() const
|
qreal GraphicsView::scaleFactor() const
|
||||||
{
|
{
|
||||||
int angle = static_cast<int>(m_rotateAngle);
|
return QStyleOptionGraphicsItem::levelOfDetailFromTransform(transform());
|
||||||
if (angle == 0 || angle == 180) {
|
|
||||||
return qAbs(transform().m11());
|
|
||||||
} else {
|
|
||||||
return qAbs(transform().m12());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::resetTransform()
|
void GraphicsView::resetTransform()
|
||||||
{
|
{
|
||||||
m_rotateAngle = 0;
|
if (!shouldAvoidTransform()) {
|
||||||
QGraphicsView::resetTransform();
|
QGraphicsView::resetTransform();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::zoomView(qreal scaleFactor)
|
void GraphicsView::zoomView(qreal scaleFactor)
|
||||||
{
|
{
|
||||||
m_enableFitInView = false;
|
m_enableFitToScreen = false;
|
||||||
scale(scaleFactor, scaleFactor);
|
scale(scaleFactor, scaleFactor);
|
||||||
applyTransformationModeByScaleFactor();
|
applyTransformationModeByScaleFactor();
|
||||||
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), m_rotateAngle);
|
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform());
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is always according to user's view.
|
||||||
|
// the direction of the rotation will NOT be clockwise because the y-axis points downwards.
|
||||||
|
void GraphicsView::rotateView(bool clockwise)
|
||||||
|
{
|
||||||
|
resetScale();
|
||||||
|
|
||||||
|
QTransform tf(0, clockwise ? 1 : -1, 0,
|
||||||
|
clockwise ? -1 : 1, 0, 0,
|
||||||
|
0, 0, 1);
|
||||||
|
tf = transform() * tf;
|
||||||
|
setTransform(tf);
|
||||||
|
|
||||||
|
// Apply transformation mode but don't emit navigator signal here
|
||||||
|
// Let displayScene() handle the navigator visibility correctly
|
||||||
|
applyTransformationModeByScaleFactor();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphicsView::flipView(bool horizontal)
|
||||||
|
{
|
||||||
|
QTransform tf(horizontal ? -1 : 1, 0, 0,
|
||||||
|
0, horizontal ? 1 : -1, 0,
|
||||||
|
0, 0, 1);
|
||||||
|
tf = transform() * tf;
|
||||||
|
setTransform(tf);
|
||||||
|
|
||||||
|
// Ensure the navigation view is also flipped.
|
||||||
|
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::resetScale()
|
void GraphicsView::resetScale()
|
||||||
{
|
{
|
||||||
resetWithScaleAndRotate(1, m_rotateAngle);
|
setTransform(resetScale(transform()));
|
||||||
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), m_rotateAngle);
|
applyTransformationModeByScaleFactor();
|
||||||
}
|
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform());
|
||||||
|
|
||||||
void GraphicsView::rotateView(qreal rotateAngel)
|
|
||||||
{
|
|
||||||
m_rotateAngle += rotateAngel;
|
|
||||||
m_rotateAngle = static_cast<int>(m_rotateAngle) % 360;
|
|
||||||
resetWithScaleAndRotate(1, m_rotateAngle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::fitInView(const QRectF &rect, Qt::AspectRatioMode aspectRadioMode)
|
void GraphicsView::fitInView(const QRectF &rect, Qt::AspectRatioMode aspectRadioMode)
|
||||||
@@ -149,21 +188,213 @@ void GraphicsView::fitInView(const QRectF &rect, Qt::AspectRatioMode aspectRadio
|
|||||||
applyTransformationModeByScaleFactor();
|
applyTransformationModeByScaleFactor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::checkAndDoFitInView(bool markItOnAnyway)
|
void GraphicsView::fitByOrientation(Qt::Orientation ori, bool scaleDownOnly)
|
||||||
{
|
{
|
||||||
if (!isThingSmallerThanWindowWith(transform())) {
|
resetScale();
|
||||||
m_enableFitInView = true;
|
|
||||||
fitInView(sceneRect(), Qt::KeepAspectRatio);
|
QRectF viewRect = this->viewport()->rect();
|
||||||
|
QRectF imageRect = transform().mapRect(sceneRect());
|
||||||
|
QSize viewSize = viewRect.size().toSize();
|
||||||
|
|
||||||
|
qreal ratio;
|
||||||
|
|
||||||
|
if (ori == Qt::Horizontal) {
|
||||||
|
// Horizontal fit means fit by width
|
||||||
|
if (scaleDownOnly && imageRect.width() <= viewSize.width()) {
|
||||||
|
// Image width already fits, no scaling needed
|
||||||
|
ratio = 1;
|
||||||
|
} else {
|
||||||
|
ratio = viewRect.width() / imageRect.width();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Vertical fit means fit by height
|
||||||
|
if (scaleDownOnly && imageRect.height() <= viewSize.height()) {
|
||||||
|
// Image height already fits, no scaling needed
|
||||||
|
ratio = 1;
|
||||||
|
} else {
|
||||||
|
ratio = viewRect.height() / imageRect.height();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (markItOnAnyway) {
|
if (ratio != 1) {
|
||||||
m_enableFitInView = true;
|
scale(ratio, ratio);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Position the image correctly based on orientation with rotation consideration
|
||||||
|
QRectF originalScene = sceneRect();
|
||||||
|
QTransform currentTransform = transform();
|
||||||
|
|
||||||
|
// TODO:
|
||||||
|
// I guess following code may be optimized by matrix arithmetic operation.
|
||||||
|
// There is an AI given solution. But I didn't use it.
|
||||||
|
// Because I want to keep the same behavior of upstream.
|
||||||
|
|
||||||
|
// // Horizontal fit: Let the position of top center of viewport, (cx, 0), be inversely mapped to scene.
|
||||||
|
// // And compensate the behavior of `centerOn` which put given point to the center of viewport.
|
||||||
|
// QTransform inv = currentTransform.inverted();
|
||||||
|
// QPointF viewCx = viewport()->rect().center().x();
|
||||||
|
// QPointF viewCy = viewport()->rect().center().y();
|
||||||
|
// // The target is viewport top center. Its y=0, so `centerOn` required scene point is (viewCx, -viewCy).
|
||||||
|
// centerOn(inv.map(QPointF(viewCx, -viewCy)));
|
||||||
|
|
||||||
|
if (ori == Qt::Horizontal) {
|
||||||
|
// For horizontal fit (fit by width), position at top (for tall images)
|
||||||
|
// Find the scene point that corresponds to the top-center of the transformed image
|
||||||
|
QPointF sceneTopCenter;
|
||||||
|
|
||||||
|
if (qFuzzyIsNull(currentTransform.m12()) && qFuzzyIsNull(currentTransform.m21())) {
|
||||||
|
// 0° or 180° rotation
|
||||||
|
if (currentTransform.m11() > 0 && currentTransform.m22() > 0) {
|
||||||
|
// 0° rotation: use original top-center
|
||||||
|
sceneTopCenter = QPointF(originalScene.center().x(), originalScene.top());
|
||||||
|
} else {
|
||||||
|
// 180° rotation: the visual "top" is now at the scene bottom
|
||||||
|
sceneTopCenter = QPointF(originalScene.center().x(), originalScene.bottom());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 90/270 degree rotation: the "top" in view corresponds to left/right in scene
|
||||||
|
if (currentTransform.m12() > 0) {
|
||||||
|
// 90 degree: top in view = left in scene
|
||||||
|
sceneTopCenter = QPointF(originalScene.left(), originalScene.center().y());
|
||||||
|
} else {
|
||||||
|
// 270 degree: top in view = right in scene
|
||||||
|
sceneTopCenter = QPointF(originalScene.right(), originalScene.center().y());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
centerOn(sceneTopCenter);
|
||||||
|
} else {
|
||||||
|
// For vertical fit (fit by height), position at left (for wide images)
|
||||||
|
// Find the scene point that corresponds to the left-center of the transformed image
|
||||||
|
QPointF sceneLeftCenter;
|
||||||
|
|
||||||
|
if (qFuzzyIsNull(currentTransform.m12()) && qFuzzyIsNull(currentTransform.m21())) {
|
||||||
|
// 0° or 180° rotation
|
||||||
|
if (currentTransform.m11() > 0 && currentTransform.m22() > 0) {
|
||||||
|
// 0° rotation: use original left-center
|
||||||
|
sceneLeftCenter = QPointF(originalScene.left(), originalScene.center().y());
|
||||||
|
} else {
|
||||||
|
// 180° rotation: the visual "left" is now at the scene right
|
||||||
|
sceneLeftCenter = QPointF(originalScene.right(), originalScene.center().y());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 90/270 degree rotation: the "left" in view corresponds to top/bottom in scene
|
||||||
|
if (currentTransform.m21() > 0) {
|
||||||
|
// 90 degree: left in view = top in scene
|
||||||
|
sceneLeftCenter = QPointF(originalScene.center().x(), originalScene.top());
|
||||||
|
} else {
|
||||||
|
// 270 degree: left in view = bottom in scene
|
||||||
|
sceneLeftCenter = QPointF(originalScene.center().x(), originalScene.bottom());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
centerOn(sceneLeftCenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_enableFitToScreen = false;
|
||||||
|
|
||||||
|
applyTransformationModeByScaleFactor();
|
||||||
|
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform());
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphicsView::displayScene()
|
||||||
|
{
|
||||||
|
if (shouldAvoidTransform()) {
|
||||||
|
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isSceneBiggerThanView()) {
|
||||||
|
// Do fit-in-view
|
||||||
|
fitInView(sceneRect(), Qt::KeepAspectRatio);
|
||||||
|
// After fitInView, the image should fit the window, so hide navigator
|
||||||
|
emit navigatorViewRequired(false, transform());
|
||||||
|
} else {
|
||||||
|
// Image is already smaller than window, no navigator needed
|
||||||
|
emit navigatorViewRequired(false, transform());
|
||||||
|
}
|
||||||
|
|
||||||
|
m_enableFitToScreen = true;
|
||||||
|
m_firstUserMediaLoaded = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GraphicsView::isSceneBiggerThanView() const
|
||||||
|
{
|
||||||
|
if (!isThingSmallerThanWindowWith(transform())) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::toggleCheckerboard()
|
// Automately do fit in view when viewport(window) smaller than image original size.
|
||||||
|
void GraphicsView::setEnableAutoFitToScreen(bool enable)
|
||||||
{
|
{
|
||||||
setCheckerboardEnabled(!m_checkerboardEnabled);
|
m_enableFitToScreen = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GraphicsView::isAvoidResetTransform() const
|
||||||
|
{
|
||||||
|
return m_avoidResetTransform;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphicsView::setAvoidResetTransform(bool avoidReset)
|
||||||
|
{
|
||||||
|
m_avoidResetTransform = avoidReset;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GraphicsView::isCheckerboard() const {
|
||||||
|
return m_checkerboardEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphicsView::toggleCheckerboard(bool invertCheckerboardColor)
|
||||||
|
{
|
||||||
|
setCheckerboardEnabled(!m_checkerboardEnabled, invertCheckerboardColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline double zeroOrOne(double number)
|
||||||
|
{
|
||||||
|
return qFuzzyIsNull(number) ? 0 : (number > 0 ? 1 : -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note: this only works if we only have 90 degree based rotation
|
||||||
|
// and no shear/translate.
|
||||||
|
QTransform GraphicsView::resetScale(const QTransform & orig)
|
||||||
|
{
|
||||||
|
return QTransform(zeroOrOne(orig.m11()), zeroOrOne(orig.m12()),
|
||||||
|
zeroOrOne(orig.m21()), zeroOrOne(orig.m22()),
|
||||||
|
orig.dx(), orig.dy());
|
||||||
|
}
|
||||||
|
|
||||||
|
void GraphicsView::updateStyle(Qt::ColorScheme colorScheme) {
|
||||||
|
// YYC MARK:
|
||||||
|
// If we are using Windows 10 and lower system or Qt which do not support "Windows 11"
|
||||||
|
// theme (lower than Qt 6.7), we should only support light mode.
|
||||||
|
// Because Qt's dark-mode-aware "Windows 11" theme is only well-supported on Windows 11.
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
|
||||||
|
colorScheme = Qt::ColorScheme::Light;
|
||||||
|
#else
|
||||||
|
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows11) {
|
||||||
|
colorScheme = Qt::ColorScheme::Light;
|
||||||
|
}
|
||||||
|
#endif // QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
|
||||||
|
#endif // defined(Q_OS_WIN)
|
||||||
|
|
||||||
|
switch (colorScheme) {
|
||||||
|
case Qt::ColorScheme::Dark:
|
||||||
|
setStyleSheet(R"#(
|
||||||
|
border-style: none;
|
||||||
|
background-color: black;
|
||||||
|
)#");
|
||||||
|
break;
|
||||||
|
case Qt::ColorScheme::Light:
|
||||||
|
case Qt::ColorScheme::Unknown:
|
||||||
|
default:
|
||||||
|
setStyleSheet(R"#(
|
||||||
|
border-style: none;
|
||||||
|
background-color: white;
|
||||||
|
)#");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::mousePressEvent(QMouseEvent *event)
|
void GraphicsView::mousePressEvent(QMouseEvent *event)
|
||||||
@@ -189,9 +420,13 @@ void GraphicsView::mouseMoveEvent(QMouseEvent *event)
|
|||||||
|
|
||||||
void GraphicsView::mouseReleaseEvent(QMouseEvent *event)
|
void GraphicsView::mouseReleaseEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
QGraphicsItem *item = itemAt(event->pos());
|
if (event->button() == Qt::ForwardButton || event->button() == Qt::BackButton) {
|
||||||
if (!item) {
|
|
||||||
event->ignore();
|
event->ignore();
|
||||||
|
} else {
|
||||||
|
QGraphicsItem *item = itemAt(event->pos());
|
||||||
|
if (!item) {
|
||||||
|
event->ignore();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QGraphicsView::mouseReleaseEvent(event);
|
return QGraphicsView::mouseReleaseEvent(event);
|
||||||
@@ -205,71 +440,23 @@ void GraphicsView::wheelEvent(QWheelEvent *event)
|
|||||||
|
|
||||||
void GraphicsView::resizeEvent(QResizeEvent *event)
|
void GraphicsView::resizeEvent(QResizeEvent *event)
|
||||||
{
|
{
|
||||||
if (m_enableFitInView) {
|
if (m_enableFitToScreen) {
|
||||||
QTransform tf;
|
bool originalSizeSmallerThanWindow = isThingSmallerThanWindowWith(resetScale(transform()));
|
||||||
tf.rotate(m_rotateAngle);
|
if (originalSizeSmallerThanWindow && scaleFactor() >= 1) {
|
||||||
if (isThingSmallerThanWindowWith(tf) && scaleFactor() >= 1) {
|
|
||||||
// no longer need to do fitInView()
|
// no longer need to do fitInView()
|
||||||
// but we leave the m_enableFitInView value unchanged in case
|
// but we leave the m_enableToScreen value unchanged in case
|
||||||
// user resize down the window again.
|
// user resize down the window again.
|
||||||
|
} else if (originalSizeSmallerThanWindow && scaleFactor() < 1) {
|
||||||
|
resetScale();
|
||||||
} else {
|
} else {
|
||||||
fitInView(sceneRect(), Qt::KeepAspectRatio);
|
fitInView(sceneRect(), Qt::KeepAspectRatio);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), m_rotateAngle);
|
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), transform());
|
||||||
}
|
}
|
||||||
return QGraphicsView::resizeEvent(event);
|
return QGraphicsView::resizeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::dragEnterEvent(QDragEnterEvent *event)
|
|
||||||
{
|
|
||||||
if (event->mimeData()->hasUrls() || event->mimeData()->hasImage() || event->mimeData()->hasText()) {
|
|
||||||
event->acceptProposedAction();
|
|
||||||
} else {
|
|
||||||
event->ignore();
|
|
||||||
}
|
|
||||||
// qDebug() << event->mimeData() << "Drag Enter Event"
|
|
||||||
// << event->mimeData()->hasUrls() << event->mimeData()->hasImage()
|
|
||||||
// << event->mimeData()->formats() << event->mimeData()->hasFormat("text/uri-list");
|
|
||||||
|
|
||||||
return QGraphicsView::dragEnterEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GraphicsView::dragMoveEvent(QDragMoveEvent *event)
|
|
||||||
{
|
|
||||||
Q_UNUSED(event)
|
|
||||||
// by default, QGraphicsView/Scene will ignore the action if there are no QGraphicsItem under cursor.
|
|
||||||
// We actually doesn't care and would like to keep the drag event as-is, so just do nothing here.
|
|
||||||
}
|
|
||||||
|
|
||||||
void GraphicsView::dropEvent(QDropEvent *event)
|
|
||||||
{
|
|
||||||
event->acceptProposedAction();
|
|
||||||
|
|
||||||
const QMimeData * mimeData = event->mimeData();
|
|
||||||
|
|
||||||
if (mimeData->hasUrls()) {
|
|
||||||
const QList<QUrl> &urls = mimeData->urls();
|
|
||||||
if (urls.isEmpty()) {
|
|
||||||
showText(tr("File url list is empty"));
|
|
||||||
} else {
|
|
||||||
showFileFromUrl(urls.first(), true);
|
|
||||||
}
|
|
||||||
} else if (mimeData->hasImage()) {
|
|
||||||
QImage img = qvariant_cast<QImage>(mimeData->imageData());
|
|
||||||
QPixmap pixmap = QPixmap::fromImage(img);
|
|
||||||
if (pixmap.isNull()) {
|
|
||||||
showText(tr("Image data is invalid"));
|
|
||||||
} else {
|
|
||||||
showImage(pixmap);
|
|
||||||
}
|
|
||||||
} else if (mimeData->hasText()) {
|
|
||||||
showText(mimeData->text());
|
|
||||||
} else {
|
|
||||||
showText(tr("Not supported mimedata: %1").arg(mimeData->formats().first()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GraphicsView::isThingSmallerThanWindowWith(const QTransform &transform) const
|
bool GraphicsView::isThingSmallerThanWindowWith(const QTransform &transform) const
|
||||||
{
|
{
|
||||||
return rect().size().expandedTo(transform.mapRect(sceneRect()).size().toSize())
|
return rect().size().expandedTo(transform.mapRect(sceneRect()).size().toSize())
|
||||||
@@ -294,17 +481,19 @@ bool GraphicsView::shouldIgnoreMousePressMoveEvent(const QMouseEvent *event) con
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::setCheckerboardEnabled(bool enabled)
|
void GraphicsView::setCheckerboardEnabled(bool enabled, bool invertColor)
|
||||||
{
|
{
|
||||||
m_checkerboardEnabled = enabled;
|
m_checkerboardEnabled = enabled;
|
||||||
|
bool isLightCheckerboard = Settings::instance()->useLightCheckerboard() ^ invertColor;
|
||||||
if (m_checkerboardEnabled) {
|
if (m_checkerboardEnabled) {
|
||||||
// Prepare background check-board pattern
|
// Prepare background check-board pattern
|
||||||
QPixmap tilePixmap(0x20, 0x20);
|
QPixmap tilePixmap(0x20, 0x20);
|
||||||
tilePixmap.fill(QColor(35, 35, 35, 170));
|
tilePixmap.fill(isLightCheckerboard ? QColor(220, 220, 220, 170) : QColor(35, 35, 35, 170));
|
||||||
QPainter tilePainter(&tilePixmap);
|
QPainter tilePainter(&tilePixmap);
|
||||||
QColor color(45, 45, 45, 170);
|
constexpr QColor color(45, 45, 45, 170);
|
||||||
tilePainter.fillRect(0, 0, 0x10, 0x10, color);
|
constexpr QColor invertedColor(210, 210, 210, 170);
|
||||||
tilePainter.fillRect(0x10, 0x10, 0x10, 0x10, color);
|
tilePainter.fillRect(0, 0, 0x10, 0x10, isLightCheckerboard ? invertedColor : color);
|
||||||
|
tilePainter.fillRect(0x10, 0x10, 0x10, 0x10, isLightCheckerboard ? invertedColor : color);
|
||||||
tilePainter.end();
|
tilePainter.end();
|
||||||
|
|
||||||
setBackgroundBrush(tilePixmap);
|
setBackgroundBrush(tilePixmap);
|
||||||
@@ -316,15 +505,13 @@ void GraphicsView::setCheckerboardEnabled(bool enabled)
|
|||||||
void GraphicsView::applyTransformationModeByScaleFactor()
|
void GraphicsView::applyTransformationModeByScaleFactor()
|
||||||
{
|
{
|
||||||
if (this->scaleFactor() < 1) {
|
if (this->scaleFactor() < 1) {
|
||||||
scene()->trySetTransformationMode(Qt::SmoothTransformation);
|
scene()->trySetTransformationMode(Qt::SmoothTransformation, this->scaleFactor());
|
||||||
} else {
|
} else {
|
||||||
scene()->trySetTransformationMode(Qt::FastTransformation);
|
scene()->trySetTransformationMode(Qt::FastTransformation, this->scaleFactor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsView::resetWithScaleAndRotate(qreal scaleFactor, qreal rotateAngle)
|
bool GraphicsView::shouldAvoidTransform() const
|
||||||
{
|
{
|
||||||
QGraphicsView::resetTransform();
|
return m_firstUserMediaLoaded && m_avoidResetTransform;
|
||||||
scale(scaleFactor, scaleFactor);
|
|
||||||
rotate(rotateAngle);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#ifndef GRAPHICSVIEW_H
|
#ifndef GRAPHICSVIEW_H
|
||||||
#define GRAPHICSVIEW_H
|
#define GRAPHICSVIEW_H
|
||||||
|
|
||||||
@@ -11,13 +15,13 @@ class GraphicsView : public QGraphicsView
|
|||||||
public:
|
public:
|
||||||
GraphicsView(QWidget *parent = nullptr);
|
GraphicsView(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void showFileFromUrl(const QUrl &url, bool requestGallery = false);
|
void showFileFromPath(const QString &filePath);
|
||||||
|
|
||||||
void showImage(const QPixmap &pixmap);
|
void showImage(const QPixmap &pixmap);
|
||||||
void showImage(const QImage &image);
|
void showImage(const QImage &image);
|
||||||
void showText(const QString &text);
|
void showText(const QString &text);
|
||||||
void showSvg(const QString &filepath);
|
void showSvg(const QString &filepath);
|
||||||
void showGif(const QString &filepath);
|
void showAnimated(const QString &filepath);
|
||||||
|
|
||||||
GraphicsScene * scene() const;
|
GraphicsScene * scene() const;
|
||||||
void setScene(GraphicsScene *scene);
|
void setScene(GraphicsScene *scene);
|
||||||
@@ -26,19 +30,30 @@ public:
|
|||||||
|
|
||||||
void resetTransform();
|
void resetTransform();
|
||||||
void zoomView(qreal scaleFactor);
|
void zoomView(qreal scaleFactor);
|
||||||
|
void rotateView(bool clockwise = true);
|
||||||
|
void flipView(bool horizontal = true);
|
||||||
void resetScale();
|
void resetScale();
|
||||||
void rotateView(qreal rotateAngel);
|
|
||||||
void fitInView(const QRectF &rect, Qt::AspectRatioMode aspectRadioMode = Qt::IgnoreAspectRatio);
|
void fitInView(const QRectF &rect, Qt::AspectRatioMode aspectRadioMode = Qt::IgnoreAspectRatio);
|
||||||
|
void fitByOrientation(Qt::Orientation ori = Qt::Horizontal, bool scaleDownOnly = false);
|
||||||
|
|
||||||
void checkAndDoFitInView(bool markItOnAnyway = true);
|
void displayScene();
|
||||||
|
bool isSceneBiggerThanView() const;
|
||||||
|
void setEnableAutoFitToScreen(bool enable = true);
|
||||||
|
|
||||||
|
bool isAvoidResetTransform() const;
|
||||||
|
void setAvoidResetTransform(bool avoidReset);
|
||||||
|
|
||||||
|
bool isCheckerboard() const;
|
||||||
|
void toggleCheckerboard(bool invertCheckerboardColor = false);
|
||||||
|
|
||||||
|
static QTransform resetScale(const QTransform & orig);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void navigatorViewRequired(bool required, qreal angle);
|
void navigatorViewRequired(bool required, QTransform transform);
|
||||||
void viewportRectChanged();
|
void viewportRectChanged();
|
||||||
void requestGallery(const QString &filePath);
|
|
||||||
|
|
||||||
public slots:
|
private slots:
|
||||||
void toggleCheckerboard();
|
void updateStyle(Qt::ColorScheme colorScheme);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void mousePressEvent(QMouseEvent * event) override;
|
void mousePressEvent(QMouseEvent * event) override;
|
||||||
@@ -47,20 +62,21 @@ private:
|
|||||||
void wheelEvent(QWheelEvent *event) override;
|
void wheelEvent(QWheelEvent *event) override;
|
||||||
void resizeEvent(QResizeEvent *event) override;
|
void resizeEvent(QResizeEvent *event) override;
|
||||||
|
|
||||||
void dragEnterEvent(QDragEnterEvent *event) override;
|
|
||||||
void dragMoveEvent(QDragMoveEvent *event) override;
|
|
||||||
void dropEvent(QDropEvent *event) override;
|
|
||||||
|
|
||||||
bool isThingSmallerThanWindowWith(const QTransform &transform) const;
|
bool isThingSmallerThanWindowWith(const QTransform &transform) const;
|
||||||
bool shouldIgnoreMousePressMoveEvent(const QMouseEvent *event) const;
|
bool shouldIgnoreMousePressMoveEvent(const QMouseEvent *event) const;
|
||||||
void setCheckerboardEnabled(bool enabled);
|
void setCheckerboardEnabled(bool enabled, bool invertColor = false);
|
||||||
void applyTransformationModeByScaleFactor();
|
void applyTransformationModeByScaleFactor();
|
||||||
|
|
||||||
void resetWithScaleAndRotate(qreal scaleFactor, qreal rotateAngle);
|
inline bool shouldAvoidTransform() const;
|
||||||
|
|
||||||
bool m_enableFitInView = false;
|
// Consider switch to 3 state for "no fit", "always fit" and "fit when view is smaller"?
|
||||||
|
// ... or even more? e.g. "fit/snap width" things...
|
||||||
|
// Currently it's "no fit" when it's false and "fit when view is smaller" when it's true.
|
||||||
|
bool m_enableFitToScreen = false;
|
||||||
|
bool m_avoidResetTransform = false;
|
||||||
bool m_checkerboardEnabled = false;
|
bool m_checkerboardEnabled = false;
|
||||||
qreal m_rotateAngle = 0;
|
bool m_useLightCheckerboard = false;
|
||||||
|
bool m_firstUserMediaLoaded = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GRAPHICSVIEW_H
|
#endif // GRAPHICSVIEW_H
|
||||||
|
|||||||
@@ -1,55 +1,96 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
#include "settings.h"
|
||||||
|
|
||||||
|
#ifdef Q_OS_MACOS
|
||||||
|
#include "fileopeneventhandler.h"
|
||||||
|
#endif // Q_OS_MACOS
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
// QM_FILE_INSTALL_DIR should be defined from the CMakeLists file.
|
using namespace Qt::Literals::StringLiterals;
|
||||||
#ifndef QM_FILE_INSTALL_DIR
|
|
||||||
#define QM_FILE_INSTALL_DIR ":/i18n/"
|
|
||||||
#endif // QM_FILE_INSTALL_DIR
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
QCoreApplication::setApplicationName(u"Pineapple Pictures"_s);
|
||||||
|
QCoreApplication::setApplicationVersion(PPIC_VERSION_STRING);
|
||||||
|
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Settings::instance()->hiDpiScaleFactorBehavior());
|
||||||
|
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
|
||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
QString qmDir;
|
#if defined(TRANSLATION_RESOURCE_EMBEDDING)
|
||||||
#ifdef _WIN32
|
const QString qmDir = u":/i18n/"_s;
|
||||||
qmDir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath("translations");
|
#elif defined(QM_FILE_INSTALL_ABSOLUTE_DIR)
|
||||||
|
const QString qmDir = QT_STRINGIFY(QM_FILE_INSTALL_ABSOLUTE_DIR);
|
||||||
#else
|
#else
|
||||||
qmDir = QT_STRINGIFY(QM_FILE_INSTALL_DIR);
|
const QString qmDir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath("translations");
|
||||||
#endif
|
#endif
|
||||||
if (translator.load(QString("PineapplePictures_%1").arg(QLocale::system().name()), qmDir)) {
|
if (translator.load(QLocale(), u"PineapplePictures"_s, u"_"_s, qmDir)) {
|
||||||
a.installTranslator(&translator);
|
QCoreApplication::installTranslator(&translator);
|
||||||
}
|
}
|
||||||
a.setApplicationName("Pineapple Pictures");
|
|
||||||
a.setApplicationDisplayName(QCoreApplication::translate("main", "Pineapple Pictures"));
|
|
||||||
|
|
||||||
|
QGuiApplication::setApplicationDisplayName(QCoreApplication::translate("main", "Pineapple Pictures"));
|
||||||
|
|
||||||
|
// commandline options
|
||||||
|
QCommandLineOption supportedImageFormats(u"supported-image-formats"_s, QCoreApplication::translate("main", "List supported image format suffixes, and quit program."));
|
||||||
// parse commandline arguments
|
// parse commandline arguments
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
|
parser.addOption(supportedImageFormats);
|
||||||
parser.addPositionalArgument("File list", QCoreApplication::translate("main", "File list."));
|
parser.addPositionalArgument("File list", QCoreApplication::translate("main", "File list."));
|
||||||
parser.addHelpOption();
|
parser.addHelpOption();
|
||||||
|
|
||||||
parser.process(a);
|
parser.process(a);
|
||||||
|
|
||||||
QStringList urlStrList = parser.positionalArguments();
|
if (parser.isSet(supportedImageFormats)) {
|
||||||
QList<QUrl> urlList;
|
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
|
||||||
for (const QString & str : urlStrList) {
|
fputs(qPrintable(MainWindow::supportedImageFormats().join(QChar('\n'))), stdout);
|
||||||
QUrl url = QUrl::fromLocalFile(str);
|
::exit(EXIT_SUCCESS);
|
||||||
if (url.isValid()) {
|
#else
|
||||||
urlList.append(url);
|
QCommandLineParser::showMessageAndExit(QCommandLineParser::MessageType::Information,
|
||||||
}
|
MainWindow::supportedImageFormats().join(QChar('\n')));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
w.show();
|
w.show();
|
||||||
|
|
||||||
if (!urlList.isEmpty()) {
|
#ifdef Q_OS_MACOS
|
||||||
w.showUrls(urlList);
|
FileOpenEventHandler * fileOpenEventHandler = new FileOpenEventHandler(&a);
|
||||||
w.adjustWindowSizeBySceneRect();
|
a.installEventFilter(fileOpenEventHandler);
|
||||||
}
|
a.connect(fileOpenEventHandler, &FileOpenEventHandler::fileOpen, [&w](const QUrl & url){
|
||||||
|
if (w.isHidden()) {
|
||||||
|
w.showNormal();
|
||||||
|
} else {
|
||||||
|
w.activateWindow();
|
||||||
|
}
|
||||||
|
w.showFiles({url});
|
||||||
|
w.initWindowSize();
|
||||||
|
});
|
||||||
|
|
||||||
return a.exec();
|
// Handle dock icon clicks to show hidden window
|
||||||
|
a.connect(&a, &QApplication::applicationStateChanged, [&w](Qt::ApplicationState state) {
|
||||||
|
if (state == Qt::ApplicationActive && w.isHidden()) {
|
||||||
|
w.showFiles({});
|
||||||
|
w.galleryCurrent(false);
|
||||||
|
w.showNormal();
|
||||||
|
w.raise();
|
||||||
|
w.activateWindow();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
#endif // Q_OS_MACOS
|
||||||
|
|
||||||
|
QStringList fileList = parser.positionalArguments();
|
||||||
|
w.showFiles(fileList);
|
||||||
|
|
||||||
|
w.initWindowSize();
|
||||||
|
|
||||||
|
return QApplication::exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,23 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#ifndef MAINWINDOW_H
|
#ifndef MAINWINDOW_H
|
||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QWidget>
|
||||||
#include <QParallelAnimationGroup>
|
|
||||||
#include <QPropertyAnimation>
|
|
||||||
#include <QPushButton>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QGraphicsOpacityEffect;
|
class QFileSystemWatcher;
|
||||||
class QGraphicsView;
|
namespace Ui {
|
||||||
|
class MainWindow;
|
||||||
|
}
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
class ToolButton;
|
class ActionManager;
|
||||||
class GraphicsView;
|
class PlaylistManager;
|
||||||
class NavigatorView;
|
|
||||||
class BottomButtonGroup;
|
class MainWindow : public QWidget
|
||||||
class MainWindow : public QMainWindow
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -23,61 +25,73 @@ public:
|
|||||||
explicit MainWindow(QWidget *parent = nullptr);
|
explicit MainWindow(QWidget *parent = nullptr);
|
||||||
~MainWindow() override;
|
~MainWindow() override;
|
||||||
|
|
||||||
void showUrls(const QList<QUrl> &urls);
|
void showFiles(const QStringList& files);
|
||||||
void adjustWindowSizeBySceneRect();
|
void showFiles(const QList<QUrl>& urls);
|
||||||
QUrl currentImageFileUrl() const;
|
void initWindowSize();
|
||||||
|
|
||||||
void clearGallery();
|
void clearGallery();
|
||||||
void loadGalleryBySingleLocalFile(const QString &path);
|
|
||||||
void galleryPrev();
|
void galleryPrev();
|
||||||
void galleryNext();
|
void galleryNext();
|
||||||
bool isGalleryAvailable();
|
void galleryCurrent(bool fromFileWatcher);
|
||||||
|
|
||||||
signals:
|
static QStringList supportedImageFormats();
|
||||||
void galleryLoaded();
|
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void showEvent(QShowEvent *event) override;
|
|
||||||
void enterEvent(QEvent *event) override;
|
|
||||||
void leaveEvent(QEvent *event) override;
|
|
||||||
void mousePressEvent(QMouseEvent *event) override;
|
|
||||||
void mouseMoveEvent(QMouseEvent *event) override;
|
|
||||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
|
||||||
void mouseDoubleClickEvent(QMouseEvent *event) override;
|
|
||||||
void wheelEvent(QWheelEvent *event) override;
|
void wheelEvent(QWheelEvent *event) override;
|
||||||
void resizeEvent(QResizeEvent *event) override;
|
|
||||||
void contextMenuEvent(QContextMenuEvent *event) override;
|
void contextMenuEvent(QContextMenuEvent *event) override;
|
||||||
|
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||||
bool nativeEvent(const QByteArray& eventType, void* message, long* result) override;
|
void dragMoveEvent(QDragMoveEvent *event) override;
|
||||||
|
void dropEvent(QDropEvent *event) override;
|
||||||
QSize sizeHint() const override;
|
|
||||||
|
|
||||||
void centerWindow();
|
void centerWindow();
|
||||||
void closeWindow();
|
void toggleAvoidResetTransform();
|
||||||
void updateWidgetsPosition();
|
|
||||||
void toggleProtectedMode();
|
|
||||||
void toggleStayOnTop();
|
|
||||||
bool stayOnTop();
|
|
||||||
void quitAppAction(bool force = false);
|
|
||||||
void toggleFullscreen();
|
void toggleFullscreen();
|
||||||
void toggleMaximize();
|
void toggleMaximize();
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
QPoint m_oldMousePos;
|
QSize sizeHint() const override;
|
||||||
QPropertyAnimation *m_fadeOutAnimation;
|
|
||||||
QPropertyAnimation *m_floatUpAnimation;
|
|
||||||
QParallelAnimationGroup *m_exitAnimationGroup;
|
|
||||||
ToolButton *m_closeButton;
|
|
||||||
ToolButton *m_prevButton;
|
|
||||||
ToolButton *m_nextButton;
|
|
||||||
GraphicsView *m_graphicsView;
|
|
||||||
NavigatorView *m_gv;
|
|
||||||
BottomButtonGroup *m_bottomButtonGroup;
|
|
||||||
bool m_protectedMode = false;
|
|
||||||
bool m_clickedOnWindow = false;
|
|
||||||
|
|
||||||
QList<QUrl> m_files;
|
private slots:
|
||||||
int m_currentFileIndex = -1;
|
void on_actionCopyPixmap_triggered();
|
||||||
|
void on_actionCopyFilePath_triggered();
|
||||||
|
|
||||||
|
void on_actionPrevPicture_triggered();
|
||||||
|
void on_actionNextPicture_triggered();
|
||||||
|
|
||||||
|
void on_actionActualSize_triggered();
|
||||||
|
void on_actionFitToScreen_triggered();
|
||||||
|
void on_actionFitByWidth_triggered();
|
||||||
|
void on_actionFitByHeight_triggered();
|
||||||
|
void on_actionZoomIn_triggered();
|
||||||
|
void on_actionZoomOut_triggered();
|
||||||
|
|
||||||
|
void on_actionFlipHorizontal_triggered();
|
||||||
|
void on_actionFlipVertical_triggered();
|
||||||
|
void on_actionRotateClockwise_triggered();
|
||||||
|
void on_actionRotateCounterClockwise_triggered();
|
||||||
|
|
||||||
|
void on_actionToggleAvoidResetTransform_triggered();
|
||||||
|
void on_actionToggleCheckerboard_triggered();
|
||||||
|
void on_actionTogglePauseAnimation_triggered();
|
||||||
|
void on_actionAnimationNextFrame_triggered();
|
||||||
|
|
||||||
|
void on_actionTrash_triggered();
|
||||||
|
void on_actionLocateInFileManager_triggered();
|
||||||
|
void on_actionProperties_triggered();
|
||||||
|
|
||||||
|
void on_actionSettings_triggered();
|
||||||
|
void on_actionHelp_triggered();
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool updateFileWatcher(const QString & basePath = QString());
|
||||||
|
void updateActionState();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QT_PREPEND_NAMESPACE(Ui::MainWindow) *ui;
|
||||||
|
|
||||||
|
ActionManager *m_am;
|
||||||
|
PlaylistManager *m_pm;
|
||||||
|
QFileSystemWatcher *m_fileSystemWatcher;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|||||||
@@ -0,0 +1,169 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MainWindow</class>
|
||||||
|
<widget class="QWidget" name="MainWindow">
|
||||||
|
<property name="windowModality">
|
||||||
|
<enum>Qt::NonModal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>640</width>
|
||||||
|
<height>480</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="acceptDrops">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="m_centralLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="GraphicsView" name="m_gv">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="verticalScrollBarPolicy">
|
||||||
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalScrollBarPolicy">
|
||||||
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="bottomBar" native="true">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>72</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>72</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="bottomBarLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="m_navPH" native="true">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>99</width>
|
||||||
|
<height>72</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>99</width>
|
||||||
|
<height>72</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="leftSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="BottomButtonGroup" name="m_bottomButtonGroup"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="rightSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="NavigatorView" name="m_nav">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>99</width>
|
||||||
|
<height>72</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>99</width>
|
||||||
|
<height>72</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="verticalScrollBarPolicy">
|
||||||
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalScrollBarPolicy">
|
||||||
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
<widget class="QMenu" name="m_subMenuCopy">
|
||||||
|
<property name="title">
|
||||||
|
<string>&Copy</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenu" name="m_subMenuTransform">
|
||||||
|
<property name="title">
|
||||||
|
<string>&Transform</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenu" name="m_menu"/>
|
||||||
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>GraphicsView</class>
|
||||||
|
<extends>QGraphicsView</extends>
|
||||||
|
<header>graphicsview.h</header>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>NavigatorView</class>
|
||||||
|
<extends>QGraphicsView</extends>
|
||||||
|
<header>navigatorview.h</header>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BottomButtonGroup</class>
|
||||||
|
<extends>QGroupBox</extends>
|
||||||
|
<header>bottombuttongroup.h</header>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -1,10 +1,14 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#include "metadatadialog.h"
|
#include "metadatadialog.h"
|
||||||
|
#include "ui_metadatadialog.h"
|
||||||
|
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QStyledItemDelegate>
|
#include <QStyledItemDelegate>
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
|
|
||||||
#include "metadatamodel.h"
|
#include "metadatamodel.h"
|
||||||
@@ -69,30 +73,33 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
MetadataDialog::MetadataDialog(QWidget *parent)
|
MetadataDialog::MetadataDialog(QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent), ui(new QT_PREPEND_NAMESPACE(Ui::MetadataDialog))
|
||||||
, m_treeView(new PropertyTreeView(this))
|
|
||||||
{
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||||
|
|
||||||
|
// YYC MARK:
|
||||||
|
// Because we use custom QTreeView and we do not want to expose it to public domain.
|
||||||
|
// So I have to use this way as the compromise.
|
||||||
|
|
||||||
|
// Create our custom QTreeView and insert them
|
||||||
|
m_treeView = new PropertyTreeView(this);
|
||||||
|
auto* layout = ui->verticalLayout;
|
||||||
|
const int index = layout->indexOf(ui->m_buttonBox);
|
||||||
|
layout->insertWidget(index, m_treeView);
|
||||||
|
|
||||||
|
// Setup our custom QTreeView
|
||||||
m_treeView->setRootIsDecorated(false);
|
m_treeView->setRootIsDecorated(false);
|
||||||
m_treeView->setIndentation(0);
|
m_treeView->setIndentation(0);
|
||||||
m_treeView->setItemDelegate(new PropertyTreeItemDelegate(m_treeView));
|
m_treeView->setItemDelegate(new PropertyTreeItemDelegate(m_treeView));
|
||||||
m_treeView->header()->resizeSection(0, sizeHint().width() / 2);
|
m_treeView->header()->resizeSection(0, sizeHint().width() / 2);
|
||||||
|
|
||||||
setWindowTitle(tr("Image Metadata"));
|
connect(ui->m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::close);
|
||||||
|
|
||||||
QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
|
|
||||||
|
|
||||||
setLayout(new QVBoxLayout);
|
|
||||||
layout()->addWidget(m_treeView);
|
|
||||||
layout()->addWidget(buttonBox);
|
|
||||||
|
|
||||||
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::close);
|
|
||||||
|
|
||||||
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MetadataDialog::~MetadataDialog()
|
MetadataDialog::~MetadataDialog()
|
||||||
{
|
{
|
||||||
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetadataDialog::setMetadataModel(MetadataModel * model)
|
void MetadataDialog::setMetadataModel(MetadataModel * model)
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#ifndef METADATADIALOG_H
|
#ifndef METADATADIALOG_H
|
||||||
#define METADATADIALOG_H
|
#define METADATADIALOG_H
|
||||||
|
|
||||||
@@ -7,6 +11,12 @@ QT_BEGIN_NAMESPACE
|
|||||||
class QTreeView;
|
class QTreeView;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
namespace Ui {
|
||||||
|
class MetadataDialog;
|
||||||
|
}
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
class MetadataModel;
|
class MetadataModel;
|
||||||
class MetadataDialog : public QDialog
|
class MetadataDialog : public QDialog
|
||||||
{
|
{
|
||||||
@@ -21,6 +31,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QTreeView * m_treeView = nullptr;
|
QTreeView * m_treeView = nullptr;
|
||||||
|
QT_PREPEND_NAMESPACE(Ui::MetadataDialog) *ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // METADATADIALOG_H
|
#endif // METADATADIALOG_H
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MetadataDialog</class>
|
||||||
|
<widget class="QDialog" name="MetadataDialog">
|
||||||
|
<property name="windowModality">
|
||||||
|
<enum>Qt::NonModal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Image Metadata</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="m_buttonBox">
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Close</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -1,11 +1,18 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#include "metadatamodel.h"
|
#include "metadatamodel.h"
|
||||||
#include "exiv2wrapper.h"
|
#include "exiv2wrapper.h"
|
||||||
|
|
||||||
|
#include <QDir>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QImageReader>
|
#include <QImageReader>
|
||||||
|
|
||||||
|
using namespace Qt::Literals::StringLiterals;
|
||||||
|
|
||||||
MetadataModel::MetadataModel(QObject *parent)
|
MetadataModel::MetadataModel(QObject *parent)
|
||||||
: QAbstractItemModel(parent)
|
: QAbstractItemModel(parent)
|
||||||
{
|
{
|
||||||
@@ -32,98 +39,132 @@ void MetadataModel::setFile(const QString &imageFilePath)
|
|||||||
const QString & imageDimensionsString = imageSize(imgReader.size());
|
const QString & imageDimensionsString = imageSize(imgReader.size());
|
||||||
const QString & imageRatioString = imageSizeRatio(imgReader.size());
|
const QString & imageRatioString = imageSizeRatio(imgReader.size());
|
||||||
|
|
||||||
appendSection(QStringLiteral("Description"), tr("Description", "Section name."));
|
appendSection(u"Description"_s, tr("Description", "Section name."));
|
||||||
appendSection(QStringLiteral("Origin"), tr("Origin", "Section name."));
|
appendSection(u"Origin"_s, tr("Origin", "Section name."));
|
||||||
appendSection(QStringLiteral("Image"), tr("Image", "Section name."));
|
appendSection(u"Image"_s, tr("Image", "Section name."));
|
||||||
appendSection(QStringLiteral("Camera"), tr("Camera", "Section name."));
|
appendSection(u"Camera"_s, tr("Camera", "Section name."));
|
||||||
appendSection(QStringLiteral("AdvancedPhoto"), tr("Advanced photo", "Section name."));
|
appendSection(u"AdvancedPhoto"_s, tr("Advanced photo", "Section name."));
|
||||||
#if 0
|
appendSection(u"GPS"_s, tr("GPS", "Section name."));
|
||||||
appendSection(QStringLiteral("GPS"), tr("GPS", "Section name."));
|
appendSection(u"File"_s, tr("File", "Section name."));
|
||||||
#endif // 0
|
|
||||||
appendSection(QStringLiteral("File"), tr("File", "Section name."));
|
|
||||||
|
|
||||||
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.Dimensions"),
|
if (imgReader.supportsOption(QImageIOHandler::Size)) {
|
||||||
tr("Dimensions"), imageDimensionsString);
|
appendProperty(u"Image"_s, u"Image.Dimensions"_s,
|
||||||
appendProperty(QStringLiteral("Image"), QStringLiteral("Image.SizeRatio"),
|
tr("Dimensions"), imageDimensionsString);
|
||||||
tr("Aspect Ratio"), imageRatioString);
|
appendProperty(u"Image"_s, u"Image.SizeRatio"_s,
|
||||||
|
tr("Aspect ratio"), imageRatioString);
|
||||||
|
}
|
||||||
|
if (imgReader.supportsAnimation() && imgReader.imageCount() > 1) {
|
||||||
|
appendProperty(u"Image"_s, u"Image.FrameCount"_s,
|
||||||
|
tr("Frame count"), QString::number(imgReader.imageCount()));
|
||||||
|
}
|
||||||
|
|
||||||
appendProperty(QStringLiteral("File"), QStringLiteral("File.Name"),
|
appendProperty(u"File"_s, u"File.Name"_s,
|
||||||
tr("Name"), fileInfo.fileName());
|
tr("Name"), fileInfo.fileName());
|
||||||
appendProperty(QStringLiteral("File"), QStringLiteral("File.ItemType"),
|
appendProperty(u"File"_s, u"File.ItemType"_s,
|
||||||
tr("Item type"), itemTypeString);
|
tr("Item type"), itemTypeString);
|
||||||
appendProperty(QStringLiteral("File"), QStringLiteral("File.Path"),
|
appendProperty(u"File"_s, u"File.Path"_s,
|
||||||
tr("Folder path"), fileInfo.path());
|
tr("Folder path"), QDir::toNativeSeparators(fileInfo.path()));
|
||||||
appendProperty(QStringLiteral("File"), QStringLiteral("File.Size"),
|
appendProperty(u"File"_s, u"File.Size"_s,
|
||||||
tr("Size"), sizeString);
|
tr("Size"), sizeString);
|
||||||
appendProperty(QStringLiteral("File"), QStringLiteral("File.CreatedTime"),
|
appendProperty(u"File"_s, u"File.CreatedTime"_s,
|
||||||
tr("Date Created"), birthTimeString);
|
tr("Date created"), birthTimeString);
|
||||||
appendProperty(QStringLiteral("File"), QStringLiteral("File.LastModified"),
|
appendProperty(u"File"_s, u"File.LastModified"_s,
|
||||||
tr("Date Modified"), lastModifiedTimeString);
|
tr("Date modified"), lastModifiedTimeString);
|
||||||
|
|
||||||
Exiv2Wrapper wrapper;
|
Exiv2Wrapper wrapper;
|
||||||
if (wrapper.load(imageFilePath)) {
|
if (wrapper.load(imageFilePath)) {
|
||||||
wrapper.cacheSections();
|
wrapper.cacheSections();
|
||||||
|
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Description"),
|
appendExivPropertyIfExist(wrapper, u"Description"_s,
|
||||||
QStringLiteral("Exif.Image.Rating"), tr("Rating"));
|
u"Xmp.dc.title"_s, tr("Title"), true);
|
||||||
appendPropertyIfNotEmpty(QStringLiteral("Description"), QStringLiteral("Description.Comments"),
|
appendExivPropertyIfExist(wrapper, u"Description"_s,
|
||||||
|
u"Exif.Image.ImageDescription"_s, tr("Subject"), true);
|
||||||
|
appendExivPropertyIfExist(wrapper, u"Description"_s,
|
||||||
|
u"Exif.Image.Rating"_s, tr("Rating"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"Description"_s,
|
||||||
|
u"Xmp.dc.subject"_s, tr("Tags"));
|
||||||
|
appendPropertyIfNotEmpty(u"Description"_s, u"Description.Comments"_s,
|
||||||
tr("Comments"), wrapper.comment());
|
tr("Comments"), wrapper.comment());
|
||||||
|
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"),
|
appendExivPropertyIfExist(wrapper, u"Origin"_s,
|
||||||
QStringLiteral("Exif.Image.Artist"), tr("Authors"));
|
u"Exif.Image.Artist"_s, tr("Authors"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"),
|
appendExivPropertyIfExist(wrapper, u"Origin"_s,
|
||||||
QStringLiteral("Exif.Photo.DateTimeOriginal"), tr("Date taken"));
|
u"Exif.Photo.DateTimeOriginal"_s, tr("Date taken"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"),
|
// FIXME: We may fetch the same type of metadata from different metadata collection.
|
||||||
QStringLiteral("Exif.Image.Software"), tr("Program name"));
|
// Current implementation is not pretty and may need to do a rework...
|
||||||
|
// appendExivPropertyIfExist(wrapper, QStringLiteral("Origin"),
|
||||||
|
// QStringLiteral("Xmp.xmp.CreatorTool"), tr("Program name"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"Origin"_s,
|
||||||
|
u"Exif.Image.Software"_s, tr("Program name"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"Origin"_s,
|
||||||
|
u"Exif.Image.Copyright"_s, tr("Copyright"));
|
||||||
|
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Image"),
|
appendExivPropertyIfExist(wrapper, u"Image"_s,
|
||||||
QStringLiteral("Exif.Image.XResolution"), tr("Horizontal resolution"));
|
u"Exif.Image.XResolution"_s, tr("Horizontal resolution"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Image"),
|
appendExivPropertyIfExist(wrapper, u"Image"_s,
|
||||||
QStringLiteral("Exif.Image.YResolution"), tr("Vertical resolution"));
|
u"Exif.Image.YResolution"_s, tr("Vertical resolution"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Image"),
|
appendExivPropertyIfExist(wrapper, u"Image"_s,
|
||||||
QStringLiteral("Exif.Image.ResolutionUnit"), tr("Resolution unit"));
|
u"Exif.Image.ResolutionUnit"_s, tr("Resolution unit"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Image"),
|
appendExivPropertyIfExist(wrapper, u"Image"_s,
|
||||||
QStringLiteral("Exif.Photo.ColorSpace"), tr("Colour representation"));
|
u"Exif.Photo.ColorSpace"_s, tr("Colour representation"));
|
||||||
|
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"),
|
appendExivPropertyIfExist(wrapper, u"Camera"_s,
|
||||||
QStringLiteral("Exif.Image.Make"), tr("Camera maker"));
|
u"Exif.Image.Make"_s, tr("Camera maker"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"),
|
appendExivPropertyIfExist(wrapper, u"Camera"_s,
|
||||||
QStringLiteral("Exif.Image.Model"), tr("Camera model"));
|
u"Exif.Image.Model"_s, tr("Camera model"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"),
|
appendExivPropertyIfExist(wrapper, u"Camera"_s,
|
||||||
QStringLiteral("Exif.Photo.FNumber"), tr("F-stop"));
|
u"Exif.Photo.FNumber"_s, tr("F-stop"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"),
|
appendExivPropertyIfExist(wrapper, u"Camera"_s,
|
||||||
QStringLiteral("Exif.Photo.ExposureTime"), tr("Exposure time"));
|
u"Exif.Photo.ExposureTime"_s, tr("Exposure time"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"),
|
appendExivPropertyIfExist(wrapper, u"Camera"_s,
|
||||||
QStringLiteral("Exif.Photo.ISOSpeedRatings"), tr("ISO speed"));
|
u"Exif.Photo.ISOSpeedRatings"_s, tr("ISO speed"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"),
|
appendExivPropertyIfExist(wrapper, u"Camera"_s,
|
||||||
QStringLiteral("Exif.Photo.ExposureBiasValue"), tr("Exposure bias"));
|
u"Exif.Photo.ExposureBiasValue"_s, tr("Exposure bias"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"),
|
appendExivPropertyIfExist(wrapper, u"Camera"_s,
|
||||||
QStringLiteral("Exif.Photo.FocalLength"), tr("Focal length"));
|
u"Exif.Photo.FocalLength"_s, tr("Focal length"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"),
|
appendExivPropertyIfExist(wrapper, u"Camera"_s,
|
||||||
QStringLiteral("Exif.Photo.MaxApertureValue"), tr("Max aperture"));
|
u"Exif.Photo.MaxApertureValue"_s, tr("Max aperture"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"),
|
appendExivPropertyIfExist(wrapper, u"Camera"_s,
|
||||||
QStringLiteral("Exif.Photo.MeteringMode"), tr("Metering mode"));
|
u"Exif.Photo.MeteringMode"_s, tr("Metering mode"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"),
|
appendExivPropertyIfExist(wrapper, u"Camera"_s,
|
||||||
QStringLiteral("Exif.Photo.Flash"), tr("Flash mode"));
|
u"Exif.Photo.SubjectDistance"_s, tr("Subject distance"));
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("Camera"),
|
appendExivPropertyIfExist(wrapper, u"Camera"_s,
|
||||||
QStringLiteral("Exif.Photo.FocalLengthIn35mmFilm"), tr("35mm focal length"));
|
u"Exif.Photo.Flash"_s, tr("Flash mode"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"Camera"_s,
|
||||||
|
u"Exif.Photo.FocalLengthIn35mmFilm"_s, tr("35mm focal length"));
|
||||||
|
|
||||||
|
appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
|
||||||
|
u"Exif.Photo.LensModel"_s, tr("Lens model"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
|
||||||
|
u"Exif.Photo.Contrast"_s, tr("Contrast"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
|
||||||
|
u"Exif.Photo.BrightnessValue"_s, tr("Brightness"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
|
||||||
|
u"Exif.Photo.ExposureProgram"_s, tr("Exposure program"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
|
||||||
|
u"Exif.Photo.Saturation"_s, tr("Saturation"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
|
||||||
|
u"Exif.Photo.Sharpness"_s, tr("Sharpness"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
|
||||||
|
u"Exif.Photo.WhiteBalance"_s, tr("White balance"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
|
||||||
|
u"Exif.Photo.DigitalZoomRatio"_s, tr("Digital zoom"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"AdvancedPhoto"_s,
|
||||||
|
u"Exif.Photo.ExifVersion"_s, tr("EXIF version"));
|
||||||
|
|
||||||
|
appendExivPropertyIfExist(wrapper, u"GPS"_s,
|
||||||
|
u"Exif.GPSInfo.GPSLatitudeRef"_s, tr("Latitude reference"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"GPS"_s,
|
||||||
|
u"Exif.GPSInfo.GPSLatitude"_s, tr("Latitude"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"GPS"_s,
|
||||||
|
u"Exif.GPSInfo.GPSLongitudeRef"_s, tr("Longitude reference"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"GPS"_s,
|
||||||
|
u"Exif.GPSInfo.GPSLongitude"_s, tr("Longitude"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"GPS"_s,
|
||||||
|
u"Exif.GPSInfo.GPSAltitudeRef"_s, tr("Altitude reference"));
|
||||||
|
appendExivPropertyIfExist(wrapper, u"GPS"_s,
|
||||||
|
u"Exif.GPSInfo.GPSAltitude"_s, tr("Altitude"));
|
||||||
|
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"),
|
|
||||||
QStringLiteral("Exif.Photo.LensModel"), tr("Lens model"));
|
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"),
|
|
||||||
QStringLiteral("Exif.Photo.BrightnessValue"), tr("Brightness"));
|
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"),
|
|
||||||
QStringLiteral("Exif.Photo.ExposureProgram"), tr("Exposure program"));
|
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"),
|
|
||||||
QStringLiteral("Exif.Photo.Saturation"), tr("Saturation"));
|
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"),
|
|
||||||
QStringLiteral("Exif.Photo.Sharpness"), tr("Sharpness"));
|
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"),
|
|
||||||
QStringLiteral("Exif.Photo.WhiteBalance"), tr("White balance"));
|
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"),
|
|
||||||
QStringLiteral("Exif.Photo.DigitalZoomRatio"), tr("Digital zoom"));
|
|
||||||
appendExivPropertyIfExist(wrapper, QStringLiteral("AdvancedPhoto"),
|
|
||||||
QStringLiteral("Exif.Photo.ExifVersion"), tr("EXIF version"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,14 +194,14 @@ QString MetadataModel::imageSizeRatio(const QSize &size)
|
|||||||
return tr("%1 : %2").arg(QString::number(size.width() / gcd), QString::number(size.height() / gcd));
|
return tr("%1 : %2").arg(QString::number(size.width() / gcd), QString::number(size.height() / gcd));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MetadataModel::appendSection(const QString §ionKey, const QString §ionDisplayName)
|
bool MetadataModel::appendSection(const QString §ionKey, QStringView sectionDisplayName)
|
||||||
{
|
{
|
||||||
if (m_sections.contains(sectionKey)) {
|
if (m_sections.contains(sectionKey)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sections.append(sectionKey);
|
m_sections.append(sectionKey);
|
||||||
m_sectionProperties[sectionKey] = qMakePair<QString, QList<QString> >(sectionDisplayName, {});
|
m_sectionProperties[sectionKey] = qMakePair<QString, QList<QString> >(sectionDisplayName.toString(), {});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -172,7 +213,7 @@ bool MetadataModel::appendPropertyIfNotEmpty(const QString §ionKey, const QS
|
|||||||
return appendProperty(sectionKey, propertyKey, propertyDisplayName, propertyValue);
|
return appendProperty(sectionKey, propertyKey, propertyDisplayName, propertyValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MetadataModel::appendProperty(const QString §ionKey, const QString &propertyKey, const QString &propertyDisplayName, const QString &propertyValue)
|
bool MetadataModel::appendProperty(const QString §ionKey, const QString &propertyKey, QStringView propertyDisplayName, QStringView propertyValue)
|
||||||
{
|
{
|
||||||
if (!m_sections.contains(sectionKey)) {
|
if (!m_sections.contains(sectionKey)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -183,28 +224,18 @@ bool MetadataModel::appendProperty(const QString §ionKey, const QString &pro
|
|||||||
propertyList.append(propertyKey);
|
propertyList.append(propertyKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_properties[propertyKey] = qMakePair<QString, QString>(propertyDisplayName, propertyValue);
|
m_properties[propertyKey] = qMakePair<QString, QString>(propertyDisplayName.toString(), propertyValue.toString());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MetadataModel::updateProperty(const QString &propertyKey, const QString &propertyValue)
|
bool MetadataModel::appendExivPropertyIfExist(const Exiv2Wrapper &wrapper, const QString §ionKey, const QString &exiv2propertyKey, const QString &propertyDisplayName, bool isXmpString)
|
||||||
{
|
|
||||||
if (m_properties.contains(propertyKey)) {
|
|
||||||
m_properties[propertyKey].second = propertyValue;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MetadataModel::appendExivPropertyIfExist(const Exiv2Wrapper &wrapper, const QString §ionKey, const QString &exiv2propertyKey, const QString &propertyDisplayName)
|
|
||||||
{
|
{
|
||||||
const QString & value = wrapper.value(exiv2propertyKey);
|
const QString & value = wrapper.value(exiv2propertyKey);
|
||||||
if (!value.isEmpty()) {
|
if (!value.isEmpty()) {
|
||||||
appendProperty(sectionKey, exiv2propertyKey,
|
appendProperty(sectionKey, exiv2propertyKey,
|
||||||
propertyDisplayName.isEmpty() ? wrapper.label(exiv2propertyKey) : propertyDisplayName,
|
propertyDisplayName.isEmpty() ? wrapper.label(exiv2propertyKey) : propertyDisplayName,
|
||||||
value);
|
isXmpString ? Exiv2Wrapper::XmpValue(value) : value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#ifndef METADATAMODEL_H
|
#ifndef METADATAMODEL_H
|
||||||
#define METADATAMODEL_H
|
#define METADATAMODEL_H
|
||||||
|
|
||||||
@@ -15,14 +19,14 @@ public:
|
|||||||
void setFile(const QString & imageFilePath);
|
void setFile(const QString & imageFilePath);
|
||||||
static QString imageSize(const QSize &size);
|
static QString imageSize(const QSize &size);
|
||||||
static QString imageSizeRatio(const QSize &size);
|
static QString imageSizeRatio(const QSize &size);
|
||||||
bool appendSection(const QString & sectionKey, const QString & sectionDisplayName);
|
bool appendSection(const QString & sectionKey, QStringView sectionDisplayName);
|
||||||
bool appendPropertyIfNotEmpty(const QString & sectionKey, const QString & propertyKey,
|
bool appendPropertyIfNotEmpty(const QString & sectionKey, const QString & propertyKey,
|
||||||
const QString & propertyDisplayName, const QString & propertyValue = QString());
|
const QString & propertyDisplayName, const QString & propertyValue = QString());
|
||||||
bool appendProperty(const QString & sectionKey, const QString & propertyKey,
|
bool appendProperty(const QString & sectionKey, const QString & propertyKey,
|
||||||
const QString & propertyDisplayName, const QString & propertyValue = QString());
|
QStringView propertyDisplayName, QStringView propertyValue = QString());
|
||||||
bool updateProperty(const QString & propertyKey, const QString & propertyValue);
|
|
||||||
bool appendExivPropertyIfExist(const Exiv2Wrapper & wrapper, const QString & sectionKey,
|
bool appendExivPropertyIfExist(const Exiv2Wrapper & wrapper, const QString & sectionKey,
|
||||||
const QString & exiv2propertyKey, const QString & propertyDisplayName = QString());
|
const QString & exiv2propertyKey, const QString & propertyDisplayName = QString(),
|
||||||
|
bool isXmpString = false);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum RowType : quintptr {
|
enum RowType : quintptr {
|
||||||
|
|||||||
@@ -1,20 +1,26 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#include "navigatorview.h"
|
#include "navigatorview.h"
|
||||||
|
|
||||||
#include "graphicsview.h"
|
#include "graphicsview.h"
|
||||||
#include "opacityhelper.h"
|
|
||||||
|
|
||||||
|
#include <QStyleHints>
|
||||||
|
#include <QOperatingSystemVersion>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
NavigatorView::NavigatorView(QWidget *parent)
|
NavigatorView::NavigatorView(QWidget *parent)
|
||||||
: QGraphicsView (parent)
|
: QGraphicsView (parent)
|
||||||
, m_viewportRegion(this->rect())
|
, m_viewportRegion(this->rect())
|
||||||
, m_opacityHelper(new OpacityHelper(this))
|
|
||||||
{
|
{
|
||||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
setStyleSheet("background-color: rgba(0, 0, 0, 120);"
|
|
||||||
"border-radius: 3px;");
|
updateStyle(qGuiApp->styleHints()->colorScheme());
|
||||||
|
connect(qGuiApp->styleHints(), &QStyleHints::colorSchemeChanged, this, &NavigatorView::updateStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// doesn't take or manage its ownership
|
// doesn't take or manage its ownership
|
||||||
@@ -23,15 +29,48 @@ void NavigatorView::setMainView(GraphicsView *mainView)
|
|||||||
m_mainView = mainView;
|
m_mainView = mainView;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigatorView::setOpacity(qreal opacity, bool animated)
|
|
||||||
{
|
|
||||||
m_opacityHelper->setOpacity(opacity, animated);
|
|
||||||
}
|
|
||||||
|
|
||||||
void NavigatorView::updateMainViewportRegion()
|
void NavigatorView::updateMainViewportRegion()
|
||||||
{
|
{
|
||||||
if (m_mainView != nullptr) {
|
// Use QTimer::singleShot with lambda to delay the update
|
||||||
m_viewportRegion = mapFromScene(m_mainView->mapToScene(m_mainView->rect()));
|
// This ensures all geometry updates are complete before calculating viewport region
|
||||||
|
QTimer::singleShot(0, [this]() {
|
||||||
|
if (m_mainView != nullptr) {
|
||||||
|
m_viewportRegion = mapFromScene(m_mainView->mapToScene(m_mainView->rect()));
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void NavigatorView::updateStyle(Qt::ColorScheme colorScheme) {
|
||||||
|
// YYC MARK:
|
||||||
|
// If we are using Windows 10 and lower system or Qt which do not support "Windows 11"
|
||||||
|
// theme (lower than Qt 6.7), we should only support light mode.
|
||||||
|
// Because Qt's dark-mode-aware "Windows 11" theme is only well-supported on Windows 11.
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
|
||||||
|
colorScheme = Qt::ColorScheme::Light;
|
||||||
|
#else
|
||||||
|
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows11) {
|
||||||
|
colorScheme = Qt::ColorScheme::Light;
|
||||||
|
}
|
||||||
|
#endif // QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
|
||||||
|
#endif // defined(Q_OS_WIN)
|
||||||
|
|
||||||
|
switch (colorScheme) {
|
||||||
|
case Qt::ColorScheme::Dark:
|
||||||
|
setStyleSheet(R"#(
|
||||||
|
border-style: none;
|
||||||
|
background-color: rgba(255, 255, 255, 70);
|
||||||
|
)#");
|
||||||
|
break;
|
||||||
|
case Qt::ColorScheme::Light:
|
||||||
|
case Qt::ColorScheme::Unknown:
|
||||||
|
default:
|
||||||
|
setStyleSheet(R"#(
|
||||||
|
border-style: none;
|
||||||
|
background-color: rgba(0, 0, 0, 70);
|
||||||
|
)#");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,7 +83,7 @@ void NavigatorView::mousePressEvent(QMouseEvent *event)
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
return QGraphicsView::mousePressEvent(event);
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigatorView::mouseMoveEvent(QMouseEvent *event)
|
void NavigatorView::mouseMoveEvent(QMouseEvent *event)
|
||||||
@@ -52,16 +91,17 @@ void NavigatorView::mouseMoveEvent(QMouseEvent *event)
|
|||||||
if (m_mouseDown && m_mainView) {
|
if (m_mouseDown && m_mainView) {
|
||||||
m_mainView->centerOn(mapToScene(event->pos()));
|
m_mainView->centerOn(mapToScene(event->pos()));
|
||||||
update();
|
update();
|
||||||
|
event->accept();
|
||||||
|
} else {
|
||||||
|
event->ignore();
|
||||||
}
|
}
|
||||||
|
|
||||||
return QGraphicsView::mouseMoveEvent(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigatorView::mouseReleaseEvent(QMouseEvent *event)
|
void NavigatorView::mouseReleaseEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
m_mouseDown = false;
|
m_mouseDown = false;
|
||||||
|
|
||||||
return QGraphicsView::mouseReleaseEvent(event);
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigatorView::wheelEvent(QWheelEvent *event)
|
void NavigatorView::wheelEvent(QWheelEvent *event)
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#ifndef NAVIGATORVIEW_H
|
#ifndef NAVIGATORVIEW_H
|
||||||
#define NAVIGATORVIEW_H
|
#define NAVIGATORVIEW_H
|
||||||
|
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
|
|
||||||
class OpacityHelper;
|
|
||||||
class GraphicsView;
|
class GraphicsView;
|
||||||
class NavigatorView : public QGraphicsView
|
class NavigatorView : public QGraphicsView
|
||||||
{
|
{
|
||||||
@@ -12,11 +15,13 @@ public:
|
|||||||
NavigatorView(QWidget *parent = nullptr);
|
NavigatorView(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void setMainView(GraphicsView *mainView);
|
void setMainView(GraphicsView *mainView);
|
||||||
void setOpacity(qreal opacity, bool animated = true);
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void updateMainViewportRegion();
|
void updateMainViewportRegion();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void updateStyle(Qt::ColorScheme colorScheme);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void mousePressEvent(QMouseEvent * event) override;
|
void mousePressEvent(QMouseEvent * event) override;
|
||||||
void mouseMoveEvent(QMouseEvent * event) override;
|
void mouseMoveEvent(QMouseEvent * event) override;
|
||||||
@@ -28,7 +33,6 @@ private:
|
|||||||
bool m_mouseDown = false;
|
bool m_mouseDown = false;
|
||||||
QPolygon m_viewportRegion;
|
QPolygon m_viewportRegion;
|
||||||
QGraphicsView *m_mainView = nullptr;
|
QGraphicsView *m_mainView = nullptr;
|
||||||
OpacityHelper *m_opacityHelper = nullptr;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NAVIGATORVIEW_H
|
#endif // NAVIGATORVIEW_H
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
#include "opacityhelper.h"
|
|
||||||
|
|
||||||
#include <QGraphicsOpacityEffect>
|
|
||||||
#include <QPropertyAnimation>
|
|
||||||
|
|
||||||
OpacityHelper::OpacityHelper(QWidget *parent)
|
|
||||||
: QObject(parent)
|
|
||||||
, m_opacityFx(new QGraphicsOpacityEffect(parent))
|
|
||||||
, m_opacityAnimation(new QPropertyAnimation(m_opacityFx, "opacity"))
|
|
||||||
{
|
|
||||||
parent->setGraphicsEffect(m_opacityFx);
|
|
||||||
|
|
||||||
m_opacityAnimation->setDuration(300);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpacityHelper::setOpacity(qreal opacity, bool animated)
|
|
||||||
{
|
|
||||||
if (!animated) {
|
|
||||||
m_opacityFx->setOpacity(opacity);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_opacityAnimation->stop();
|
|
||||||
m_opacityAnimation->setStartValue(m_opacityFx->opacity());
|
|
||||||
m_opacityAnimation->setEndValue(opacity);
|
|
||||||
m_opacityAnimation->start();
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#ifndef OPACITYHELPER_H
|
|
||||||
#define OPACITYHELPER_H
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
class QGraphicsOpacityEffect;
|
|
||||||
class QPropertyAnimation;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
class OpacityHelper : QObject
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
OpacityHelper(QWidget * parent);
|
|
||||||
|
|
||||||
void setOpacity(qreal opacity, bool animated = true);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
QGraphicsOpacityEffect * m_opacityFx;
|
|
||||||
QPropertyAnimation * m_opacityAnimation;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // OPACITYHELPER_H
|
|
||||||
@@ -0,0 +1,295 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#include "playlistmanager.h"
|
||||||
|
#include "playlistscout.h"
|
||||||
|
|
||||||
|
#include <QCollator>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QFileInfo>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
|
PlaylistManager::PlaylistManager(QObject *parent)
|
||||||
|
: QObject(parent)
|
||||||
|
, m_currentIndex(std::nullopt)
|
||||||
|
, m_playlist()
|
||||||
|
, m_allowedSuffixes()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
PlaylistManager::~PlaylistManager()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// region: Allowed Suffixes Operations
|
||||||
|
|
||||||
|
const QStringList& PlaylistManager::allowedSuffixes() const {
|
||||||
|
return m_allowedSuffixes;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlaylistManager::setAllowedSuffixes(const QStringList& nameFilters) {
|
||||||
|
m_allowedSuffixes = nameFilters;
|
||||||
|
emit allowedSuffixesChanged(m_allowedSuffixes);
|
||||||
|
}
|
||||||
|
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region: Playlist Loader and Reset
|
||||||
|
|
||||||
|
bool PlaylistManager::loadPlaylist(const QStringList& files) {
|
||||||
|
// Convert string list to url list first
|
||||||
|
QList<QUrl> urls;
|
||||||
|
for (const QString & file : std::as_const(files)) {
|
||||||
|
urls.append(urlFromString(file));
|
||||||
|
}
|
||||||
|
|
||||||
|
return loadPlaylist(urls);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlaylistManager::loadPlaylist(const QList<QUrl>& urls) {
|
||||||
|
// Check its count, and check M3U8 playlist for single file case.
|
||||||
|
if (urls.isEmpty()) {
|
||||||
|
clearPlaylist();
|
||||||
|
return true;
|
||||||
|
} else if (urls.count() == 1) {
|
||||||
|
const QUrl& firstUrl = urls.first();
|
||||||
|
const QString lowerCaseUrlPath(firstUrl.path().toLower());
|
||||||
|
if (lowerCaseUrlPath.endsWith(".m3u8") || lowerCaseUrlPath.endsWith(".m3u")) {
|
||||||
|
return loadM3U8Playlist(firstUrl);
|
||||||
|
} else {
|
||||||
|
return loadSingleFilePlaylist(firstUrl);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return loadMultipleFilesPlaylist(std::move(urls));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlaylistManager::loadSingleFilePlaylist(const QUrl& url) {
|
||||||
|
// Check URL at first
|
||||||
|
if (!checkUrl(url))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Scout playlist by given file
|
||||||
|
auto scoutResult = PlaylistScout::scout(url, m_allowedSuffixes);
|
||||||
|
if (!scoutResult.has_value()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup playlist with index
|
||||||
|
setPlaylist(std::move(scoutResult->playlist), scoutResult->indexHint);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlaylistManager::loadMultipleFilesPlaylist(const QList<QUrl>&& urls) {
|
||||||
|
// Check all of them are valid
|
||||||
|
for (const auto& url : std::as_const(urls)) {
|
||||||
|
if (!checkUrl(url)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set playlist and return
|
||||||
|
setPlaylist(std::move(urls));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlaylistManager::loadM3U8Playlist(const QUrl& url) {
|
||||||
|
// Check URL at first
|
||||||
|
if (!checkUrl(url))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
QList<QUrl> urls;
|
||||||
|
QFile file(url.toLocalFile());
|
||||||
|
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
|
while (!file.atEnd()) {
|
||||||
|
QString line = file.readLine();
|
||||||
|
if (line.startsWith('#')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
QFileInfo fileInfo(file);
|
||||||
|
QUrl item = QUrl::fromUserInput(line, fileInfo.absolutePath());
|
||||||
|
if (!checkUrl(item)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
urls.append(item);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
setPlaylist(std::move(urls));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlaylistManager::setPlaylist(const QList<QUrl>&& urls, std::optional<qsizetype> indexHint) {
|
||||||
|
// Setup playlist
|
||||||
|
m_playlist = std::move(urls);
|
||||||
|
|
||||||
|
// Set index with hint
|
||||||
|
if (indexHint.has_value()) {
|
||||||
|
m_currentIndex = *indexHint;
|
||||||
|
}
|
||||||
|
sanitizeIndex();
|
||||||
|
|
||||||
|
// Raise signal
|
||||||
|
emit playlistChanged(totalCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlaylistManager::clearPlaylist() {
|
||||||
|
m_playlist.clear();
|
||||||
|
sanitizeIndex();
|
||||||
|
emit playlistChanged(this->totalCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region: Playlist Operations
|
||||||
|
|
||||||
|
void PlaylistManager::appendToPlaylist(const QString &file)
|
||||||
|
{
|
||||||
|
return appendToPlaylist(urlFromString(file));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlaylistManager::appendToPlaylist(const QUrl &url)
|
||||||
|
{
|
||||||
|
m_playlist.append(url);
|
||||||
|
sanitizeIndex();
|
||||||
|
emit playlistChanged(totalCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlaylistManager::insertIntoPlaylist(qsizetype index, const QString &file)
|
||||||
|
{
|
||||||
|
return insertIntoPlaylist(index, urlFromString(file));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlaylistManager::insertIntoPlaylist(qsizetype index, const QUrl &url)
|
||||||
|
{
|
||||||
|
if (index < 0 || index > totalCount()) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
m_playlist.insert(index, url);
|
||||||
|
sanitizeIndex();
|
||||||
|
emit playlistChanged(totalCount());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlaylistManager::removeFromPlaylist(qsizetype index)
|
||||||
|
{
|
||||||
|
if (index < 0 || index >= totalCount()) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
m_playlist.removeAt(index);
|
||||||
|
sanitizeIndex();
|
||||||
|
emit playlistChanged(totalCount());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region: Index Operations
|
||||||
|
|
||||||
|
qsizetype PlaylistManager::totalCount() const
|
||||||
|
{
|
||||||
|
return m_playlist.count();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::optional<qsizetype> PlaylistManager::previousIndex() const
|
||||||
|
{
|
||||||
|
if (!m_currentIndex.has_value() || totalCount() <= 0) return std::nullopt;
|
||||||
|
return (isFirstIndex() ? totalCount() - 1 : *m_currentIndex - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::optional<qsizetype> PlaylistManager::nextIndex() const
|
||||||
|
{
|
||||||
|
if (!m_currentIndex.has_value() || totalCount() <= 0) return std::nullopt;
|
||||||
|
return (isLastIndex() ? 0 : *m_currentIndex + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlaylistManager::isFirstIndex() const
|
||||||
|
{
|
||||||
|
return m_currentIndex.has_value() && *m_currentIndex == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlaylistManager::isLastIndex() const
|
||||||
|
{
|
||||||
|
return m_currentIndex.has_value() && *m_currentIndex + 1 == totalCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::optional<qsizetype> PlaylistManager::currentIndex() const
|
||||||
|
{
|
||||||
|
return m_currentIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlaylistManager::setCurrentIndex(qsizetype index)
|
||||||
|
{
|
||||||
|
if (!m_currentIndex.has_value()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (index < 0 || index >= totalCount()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (*m_currentIndex == index) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_currentIndex = index;
|
||||||
|
emit currentIndexChanged(index);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
QUrl PlaylistManager::urlByIndex(qsizetype index) const
|
||||||
|
{
|
||||||
|
return m_playlist.value(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString PlaylistManager::localFileByIndex(qsizetype index) const
|
||||||
|
{
|
||||||
|
return urlByIndex(index).toLocalFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
// endregion
|
||||||
|
|
||||||
|
// region: Misc
|
||||||
|
|
||||||
|
void PlaylistManager::sanitizeIndex()
|
||||||
|
{
|
||||||
|
auto cnt = totalCount();
|
||||||
|
if (cnt == 0) {
|
||||||
|
// If playlist is empty, current index should be invalid.
|
||||||
|
m_currentIndex = std::nullopt;
|
||||||
|
} else {
|
||||||
|
if (m_currentIndex.has_value()) {
|
||||||
|
// Clamp current index in playlist range.
|
||||||
|
// If it is already in range, not change was done.
|
||||||
|
auto currentIndex = *m_currentIndex;
|
||||||
|
if (currentIndex < 0) {
|
||||||
|
m_currentIndex = 0;
|
||||||
|
} else if (currentIndex >= cnt) {
|
||||||
|
m_currentIndex = cnt - 1;
|
||||||
|
} else {
|
||||||
|
; // No change.
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// If there is no set value for current index,
|
||||||
|
// set it at the beginning of playlist.
|
||||||
|
m_currentIndex = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PlaylistManager::checkUrl(const QUrl& url)
|
||||||
|
{
|
||||||
|
return url.isValid() && url.isLocalFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
QUrl PlaylistManager::urlFromString(const QString& file)
|
||||||
|
{
|
||||||
|
return QUrl::fromLocalFile(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
// endregion
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QUrl>
|
||||||
|
#include <QObject>
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
|
/// The manager of playlist.
|
||||||
|
class PlaylistManager : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
/// Constructs a PlaylistManager with an optional parent QObject.
|
||||||
|
explicit PlaylistManager(QObject* parent = nullptr);
|
||||||
|
/// Destructor.
|
||||||
|
~PlaylistManager();
|
||||||
|
|
||||||
|
/// Get the allowed file suffixes of this playlist.
|
||||||
|
/// @return The current list of allowed suffixes.
|
||||||
|
const QStringList& allowedSuffixes() const;
|
||||||
|
/// Set the allowed file suffixes of this playlist.
|
||||||
|
/// @remark This only works for "load the whole directory by one file" case.
|
||||||
|
/// @param[in] nameFilters The new list of allowed suffixes.
|
||||||
|
void setAllowedSuffixes(const QStringList& nameFilters);
|
||||||
|
|
||||||
|
/// Load user specified files as playlist.
|
||||||
|
/// @remark The wrapper for another overload.
|
||||||
|
/// @return True for successful load, otherwise false.
|
||||||
|
bool loadPlaylist(const QStringList& files);
|
||||||
|
/// Load user specified URLs as playlist.
|
||||||
|
/// @remark This function automatically dispatch these files into correct sub-load functions.
|
||||||
|
/// @return True for successful load, otherwise false.
|
||||||
|
bool loadPlaylist(const QList<QUrl>& urls);
|
||||||
|
/// Clear the entire playlist and reset current index.
|
||||||
|
void clearPlaylist();
|
||||||
|
|
||||||
|
/// Append a local file path to the playlist.
|
||||||
|
void appendToPlaylist(const QString& file);
|
||||||
|
/// Append a URL to the playlist.
|
||||||
|
void appendToPlaylist(const QUrl& url);
|
||||||
|
/// Insert a local file path at the given index.
|
||||||
|
/// @return True if inserted successfully, false if index is out of range.
|
||||||
|
bool insertIntoPlaylist(qsizetype index, const QString& file);
|
||||||
|
/// Insert a URL at the given index.
|
||||||
|
/// @return True if inserted successfully, false if index is out of range.
|
||||||
|
bool insertIntoPlaylist(qsizetype index, const QUrl& url);
|
||||||
|
/// Remove the entry at the given index.
|
||||||
|
/// @return True if removed successfully, false if index is out of range.
|
||||||
|
bool removeFromPlaylist(qsizetype index);
|
||||||
|
|
||||||
|
/// Returns the total number of items in the playlist.
|
||||||
|
/// @return Total count of entries in the playlist.
|
||||||
|
qsizetype totalCount() const;
|
||||||
|
/// Try fetching previous index.
|
||||||
|
/// @details This previous index is gallery-loop-aware.
|
||||||
|
/// @return std::nullopt if playlist is empty, otherwise the previous index considering gallery loop.
|
||||||
|
std::optional<qsizetype> previousIndex() const;
|
||||||
|
/// Try fetching next index.
|
||||||
|
/// @details This next index is gallery-loop-aware.
|
||||||
|
/// @return std::nullopt if playlist is empty, otherwise the next index considering gallery loop.
|
||||||
|
std::optional<qsizetype> nextIndex() const;
|
||||||
|
/// Check whether current index is the first index.
|
||||||
|
/// @return False if current index is not the first index or playlist is empty, otherwise true.
|
||||||
|
bool isFirstIndex() const;
|
||||||
|
/// Check whether current index is the last index.
|
||||||
|
/// @return False if current index is not the last index or playlist is empty, otherwise true.
|
||||||
|
bool isLastIndex() const;
|
||||||
|
/// Returns the current index.
|
||||||
|
/// @return std::nullopt if the playlist is empty, otherwise the current index.
|
||||||
|
std::optional<qsizetype> currentIndex() const;
|
||||||
|
/// Set the current index.
|
||||||
|
/// @remark Index only can be set when playlist is not empty.
|
||||||
|
/// @return True if successful set, including "not changed" set, otherwise false.
|
||||||
|
/// This return value only indicates whether we can set index and given index is valid for setting.
|
||||||
|
/// If "no changed" set occurs, this function returns true, but doesn't raise current index changed signal.
|
||||||
|
bool setCurrentIndex(qsizetype index);
|
||||||
|
/// Returns the URL at the given index.
|
||||||
|
/// @return The URL if index is valid.
|
||||||
|
/// This class guarantee that this QUrl is pointing to a local file.
|
||||||
|
QUrl urlByIndex(qsizetype index) const;
|
||||||
|
/// Returns the local file path at the given index.
|
||||||
|
/// @return The local file path if index is valid.
|
||||||
|
/// This class guarantee that local file path always is valid.
|
||||||
|
QString localFileByIndex(qsizetype index) const;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void allowedSuffixesChanged(const QStringList& suffixes);
|
||||||
|
/// Raised when index was changed bu setter.
|
||||||
|
/// The argument holds the new current index.
|
||||||
|
/// Please note that this signal will NOT be raised by the whole playlist change caused index change.
|
||||||
|
void currentIndexChanged(qsizetype index);
|
||||||
|
/// The whole playlist was changed, involving loading, editing and deleting some or full entries.
|
||||||
|
/// The argument holds the total count of new play list.
|
||||||
|
void playlistChanged(qsizetype count);
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// The fundamental playlist setter.
|
||||||
|
/// @details All playlist load functions will call this function to set playlist at last.
|
||||||
|
/// @param[in] urls ALl urls in this list should be checked by checkUrl() function.
|
||||||
|
/// @param[in] indexHint Try to set current index to this index if possible.
|
||||||
|
void setPlaylist(const QList<QUrl>&& urls, std::optional<qsizetype> indexHint = std::nullopt);
|
||||||
|
/// Load playlist from a single file.
|
||||||
|
/// @details This function scans the same directory for siblings matching allowed suffixes, sorted naturally.
|
||||||
|
/// @return True if the playlist was loaded successfully, false otherwise.
|
||||||
|
bool loadSingleFilePlaylist(const QUrl& url);
|
||||||
|
/// Load playlist from multiple URLs directly.
|
||||||
|
/// @return True if all URLs are valid, false otherwise.
|
||||||
|
bool loadMultipleFilesPlaylist(const QList<QUrl>&& urls);
|
||||||
|
/// Load playlist from an M3U/M3U8 playlist file.
|
||||||
|
/// @return True if loaded successfully, false otherwise.
|
||||||
|
bool loadM3U8Playlist(const QUrl& url);
|
||||||
|
|
||||||
|
/// Make sure that current index is valid.
|
||||||
|
/// @details This function usually is used by those functions manipulating playlist.
|
||||||
|
void sanitizeIndex();
|
||||||
|
|
||||||
|
/// Check whether given QUrl is proper to be put into playlist.
|
||||||
|
/// @details Only the url pointing to local file can be put into playlist.
|
||||||
|
static bool checkUrl(const QUrl& url);
|
||||||
|
/// Convert a string to local file into a QUrl.
|
||||||
|
/// @param[in] file The string pointing to local file.
|
||||||
|
static QUrl urlFromString(const QString& file);
|
||||||
|
|
||||||
|
std::optional<qsizetype> m_currentIndex;
|
||||||
|
QList<QUrl> m_playlist;
|
||||||
|
QStringList m_allowedSuffixes;
|
||||||
|
};
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2026 yyc12345 <yyc12321@outlook.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#include "playlistscout.h"
|
||||||
|
|
||||||
|
#include "playlistscouts/qtscout.h"
|
||||||
|
#include "playlistscouts/explorerscout.h"
|
||||||
|
|
||||||
|
std::optional<PlaylistScout::ScoutResult> PlaylistScout::scout(
|
||||||
|
const QUrl &url, const QStringList &allowedSuffixes) {
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
// In Windows, Qt approach can not aware Windows Explorer custom sort order.
|
||||||
|
// So we need to try using Win32 functions for fetching it at first.
|
||||||
|
if (auto rv = PlaylistScout::Explorer::scout(url, allowedSuffixes); rv.has_value()) {
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
#endif // Q_OS_WIN
|
||||||
|
|
||||||
|
// TODO: We may add macOS Finder, KDE Dolphin and etc supports in future.
|
||||||
|
|
||||||
|
// Qt way is the last fallback.
|
||||||
|
return PlaylistScout::Qt::scout(url, allowedSuffixes);
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2026 yyc12345 <yyc12321@outlook.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QUrl>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QList>
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
|
namespace PlaylistScout {
|
||||||
|
/// The result of scout
|
||||||
|
struct ScoutResult {
|
||||||
|
/// The final fetched playlist (it can be empty).
|
||||||
|
/// Each item must be a QUrl pointing to a local file.
|
||||||
|
QList<QUrl> playlist;
|
||||||
|
/// The index of given file located in playlist.
|
||||||
|
/// Nullopt if it is not presented in playlist.
|
||||||
|
std::optional<qsizetype> indexHint;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// @brief Scout available image files in given file's parent dir with given allowed suffixes.
|
||||||
|
/// @param[in] url The path to file whose parent dir is our target dir for finding image files.
|
||||||
|
/// @param[in] allowedSuffixes
|
||||||
|
/// Each items in this list is a wildcard pattern for matching allowed file name, like \c *.png .
|
||||||
|
/// The fetched item will be preserved if its name matching any of them.
|
||||||
|
/// If this list is empty, there is no restrictions for finding files.
|
||||||
|
/// @return Scout result if success, otherwise nullopt.
|
||||||
|
std::optional<ScoutResult> scout(const QUrl &url, const QStringList &allowedSuffixes);
|
||||||
|
}
|
||||||
@@ -0,0 +1,332 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2026 yyc12345 <yyc12321@outlook.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#include "explorerscout.h"
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
|
||||||
|
#include <QDir>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QFileInfo>
|
||||||
|
#include <QRegularExpression>
|
||||||
|
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
|
#include <exdisp.h> // IShellWindows, CLSID_ShellWindows
|
||||||
|
#include <servprov.h> // IServiceProvider
|
||||||
|
#include <shlguid.h> // SID_STopLevelBrowser
|
||||||
|
#include <shlobj.h>
|
||||||
|
|
||||||
|
// YYC MARK:
|
||||||
|
// We use custom RAII wrappers instead of existing COM smart pointers because the
|
||||||
|
// project may be built with MinGW, which does not have good compatibility with
|
||||||
|
// CComPtr and Microsoft's WRL ComPtr (<wrl/client.h>).
|
||||||
|
// Furthermore, PIDLs are not COM objects (they are freed via ILFree, not Release),
|
||||||
|
// so no standard smart pointer covers them regardless of compiler.
|
||||||
|
|
||||||
|
/// RAII wrapper for COM initialization (CoInitialize / CoUninitialize).
|
||||||
|
/// Must be declared before any COM objects (e.g., ComPtr, UniquePidl) so that
|
||||||
|
/// CoUninitialize runs after all COM objects are released during scope exit.
|
||||||
|
class ComGuard {
|
||||||
|
public:
|
||||||
|
ComGuard() : m_hr(CoInitialize(nullptr)) {}
|
||||||
|
~ComGuard() { if (SUCCEEDED(m_hr)) CoUninitialize(); }
|
||||||
|
ComGuard(const ComGuard&) = delete;
|
||||||
|
ComGuard& operator=(const ComGuard&) = delete;
|
||||||
|
|
||||||
|
bool IsInitialized() const { return SUCCEEDED(m_hr); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
HRESULT m_hr;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// RAII wrapper for COM interface pointers.
|
||||||
|
template <typename T>
|
||||||
|
class ComPtr {
|
||||||
|
public:
|
||||||
|
ComPtr() = default;
|
||||||
|
ComPtr(std::nullptr_t) {}
|
||||||
|
~ComPtr() { Reset(); }
|
||||||
|
ComPtr(const ComPtr&) = delete;
|
||||||
|
ComPtr& operator=(const ComPtr&) = delete;
|
||||||
|
ComPtr(ComPtr&& other) noexcept : m_ptr(other.m_ptr) { other.m_ptr = nullptr; }
|
||||||
|
ComPtr& operator=(ComPtr&& other) noexcept {
|
||||||
|
if (this != &other) {
|
||||||
|
Reset();
|
||||||
|
m_ptr = other.m_ptr;
|
||||||
|
other.m_ptr = nullptr;
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
T* operator->() const { return m_ptr; }
|
||||||
|
T* Get() const { return m_ptr; }
|
||||||
|
T** GetAddressOf() { return &m_ptr; }
|
||||||
|
explicit operator bool() const { return m_ptr != nullptr; }
|
||||||
|
void Reset() { if (m_ptr) { m_ptr->Release(); m_ptr = nullptr; } }
|
||||||
|
|
||||||
|
private:
|
||||||
|
T* m_ptr = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// RAII wrapper for PIDL (Item ID List).
|
||||||
|
class UniquePidl {
|
||||||
|
public:
|
||||||
|
UniquePidl() = default;
|
||||||
|
explicit UniquePidl(LPITEMIDLIST pidl) : m_pidl(pidl) {}
|
||||||
|
~UniquePidl() { Reset(); }
|
||||||
|
UniquePidl(const UniquePidl&) = delete;
|
||||||
|
UniquePidl& operator=(const UniquePidl&) = delete;
|
||||||
|
UniquePidl(UniquePidl&& other) noexcept : m_pidl(other.m_pidl) { other.m_pidl = nullptr; }
|
||||||
|
UniquePidl& operator=(UniquePidl&& other) noexcept {
|
||||||
|
if (this != &other) {
|
||||||
|
Reset();
|
||||||
|
m_pidl = other.m_pidl;
|
||||||
|
other.m_pidl = nullptr;
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
LPCITEMIDLIST Get() const { return m_pidl; }
|
||||||
|
LPITEMIDLIST* GetAddressOf() { return &m_pidl; }
|
||||||
|
explicit operator bool() const { return m_pidl != nullptr; }
|
||||||
|
void Reset() { if (m_pidl) { ILFree(m_pidl); m_pidl = nullptr; } }
|
||||||
|
|
||||||
|
private:
|
||||||
|
LPITEMIDLIST m_pidl = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Outputs a diagnostic warning for debugging Windows Explorer integration failures.
|
||||||
|
static void ReportError(const QString& detail)
|
||||||
|
{
|
||||||
|
qWarning("Windows Explorer file list fetch error: %s",
|
||||||
|
qPrintable(detail));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Normalizes a Windows directory path for case-insensitive comparison:
|
||||||
|
/// converts to native separators, lowercases, and ensures a trailing backslash.
|
||||||
|
static QString NormalizePath(const QString& path)
|
||||||
|
{
|
||||||
|
QString result = QDir::toNativeSeparators(path).toLower();
|
||||||
|
if (!result.endsWith(QChar('\\'))) {
|
||||||
|
result += QChar('\\');
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Checks whether the Explorer window represented by the given IDispatch is
|
||||||
|
/// displaying the target folder. Returns its IFolderView2 on match, or null.
|
||||||
|
static ComPtr<IFolderView2> TryMatchWindow(IDispatch* dispatch, const QString& normalizedTarget)
|
||||||
|
{
|
||||||
|
// Navigate: IDispatch -> IServiceProvider -> IShellBrowser.
|
||||||
|
ComPtr<IServiceProvider> serviceProvider;
|
||||||
|
if (FAILED(dispatch->QueryInterface(IID_PPV_ARGS(serviceProvider.GetAddressOf())))) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
ComPtr<IShellBrowser> shellBrowser;
|
||||||
|
if (FAILED(serviceProvider->QueryService(SID_STopLevelBrowser,
|
||||||
|
IID_PPV_ARGS(shellBrowser.GetAddressOf())))) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// IShellBrowser -> active IShellView.
|
||||||
|
ComPtr<IShellView> shellView;
|
||||||
|
if (FAILED(shellBrowser->QueryActiveShellView(shellView.GetAddressOf()))) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retrieve the folder's path via IPersistIDList.
|
||||||
|
ComPtr<IPersistIDList> persistIdList;
|
||||||
|
if (FAILED(shellView->QueryInterface(IID_PPV_ARGS(persistIdList.GetAddressOf())))) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
UniquePidl folderPidl;
|
||||||
|
if (FAILED(persistIdList->GetIDList(folderPidl.GetAddressOf()))) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
PWSTR pathStr = nullptr;
|
||||||
|
if (FAILED(SHGetNameFromIDList(folderPidl.Get(), SIGDN_DESKTOPABSOLUTEPARSING, &pathStr))) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString windowPath = NormalizePath(QString::fromWCharArray(pathStr));
|
||||||
|
CoTaskMemFree(pathStr);
|
||||||
|
|
||||||
|
if (windowPath != normalizedTarget) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Path matches — query IFolderView2 from the ShellView.
|
||||||
|
ComPtr<IFolderView2> folderView2;
|
||||||
|
if (FAILED(shellView->QueryInterface(IID_PPV_ARGS(folderView2.GetAddressOf())))) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
return folderView2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Tries to find a live Explorer window that is currently displaying the given
|
||||||
|
/// folder path. Returns the IFolderView2 from that window, or an empty ComPtr.
|
||||||
|
///
|
||||||
|
/// Explorer's sort order is stored only in the running Explorer process's memory.
|
||||||
|
/// Creating a new shell view via IShellFolder::CreateViewObject yields a default
|
||||||
|
/// sort (always by name), so we must find the actual live IFolderView2 instead.
|
||||||
|
///
|
||||||
|
/// Reference:
|
||||||
|
/// - https://www.stephenli.ca/getting-windows-explorers-current-directory-sort-order
|
||||||
|
/// - https://github.com/d2phap/ImageGlass/blob/75a296287f338edcf409eee3917531b25ff5d927/v9/Components/ImageGlass.Base/FileSystem/FileFinder.cs
|
||||||
|
/// - NuGet Package: D2Phap.EggShell
|
||||||
|
static ComPtr<IFolderView2> FindLiveFolderView(const QString& targetFolderPath)
|
||||||
|
{
|
||||||
|
// Create the Shell windows collection (all open Explorer windows).
|
||||||
|
ComPtr<IShellWindows> shellWindows;
|
||||||
|
if (FAILED(CoCreateInstance(CLSID_ShellWindows, nullptr, CLSCTX_ALL,
|
||||||
|
IID_PPV_ARGS(shellWindows.GetAddressOf())))) {
|
||||||
|
ReportError("Failed to create IShellWindows instance");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString normalizedTarget = NormalizePath(targetFolderPath);
|
||||||
|
|
||||||
|
// 1. Try the Desktop window first — it may contain the file the user opened.
|
||||||
|
{
|
||||||
|
VARIANT varLoc;
|
||||||
|
VariantInit(&varLoc);
|
||||||
|
varLoc.vt = VT_I4;
|
||||||
|
varLoc.lVal = 0;
|
||||||
|
|
||||||
|
VARIANT varLocRoot;
|
||||||
|
VariantInit(&varLocRoot);
|
||||||
|
|
||||||
|
long desktopHwnd = 0;
|
||||||
|
ComPtr<IDispatch> desktopDispatch;
|
||||||
|
HRESULT findHr = shellWindows->FindWindowSW(
|
||||||
|
&varLoc, &varLocRoot, SWC_DESKTOP,
|
||||||
|
&desktopHwnd, SWFO_NEEDDISPATCH,
|
||||||
|
desktopDispatch.GetAddressOf());
|
||||||
|
|
||||||
|
VariantClear(&varLoc);
|
||||||
|
VariantClear(&varLocRoot);
|
||||||
|
|
||||||
|
if (SUCCEEDED(findHr) && desktopDispatch) {
|
||||||
|
ComPtr<IFolderView2> result = TryMatchWindow(desktopDispatch.Get(), normalizedTarget);
|
||||||
|
if (result) return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Iterate regular Explorer windows.
|
||||||
|
LONG count = 0;
|
||||||
|
shellWindows->get_Count(&count);
|
||||||
|
|
||||||
|
for (LONG i = 0; i < count; i++) {
|
||||||
|
VARIANT varIndex;
|
||||||
|
VariantInit(&varIndex);
|
||||||
|
varIndex.vt = VT_I4;
|
||||||
|
varIndex.lVal = i;
|
||||||
|
|
||||||
|
ComPtr<IDispatch> dispatch;
|
||||||
|
HRESULT itemHr = shellWindows->Item(varIndex, dispatch.GetAddressOf());
|
||||||
|
VariantClear(&varIndex);
|
||||||
|
|
||||||
|
if (FAILED(itemHr) || !dispatch) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ComPtr<IFolderView2> result = TryMatchWindow(dispatch.Get(), normalizedTarget);
|
||||||
|
if (result) return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::optional<PlaylistScout::ScoutResult> PlaylistScout::Explorer::scout(
|
||||||
|
const QUrl &url, const QStringList &allowedSuffixes) {
|
||||||
|
PlaylistScout::ScoutResult rv;
|
||||||
|
|
||||||
|
QFileInfo info(url.toLocalFile());
|
||||||
|
QString folderPath = info.path();
|
||||||
|
QString currentFileName = info.fileName();
|
||||||
|
|
||||||
|
// Pre-compile wildcard suffix filters into regular expressions for performance.
|
||||||
|
QList<QRegularExpression> nameRegexps;
|
||||||
|
for (const QString &pattern : allowedSuffixes) {
|
||||||
|
nameRegexps.append(QRegularExpression(
|
||||||
|
QRegularExpression::wildcardToRegularExpression(pattern),
|
||||||
|
QRegularExpression::CaseInsensitiveOption));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize COM. The ComGuard must be declared before any COM objects
|
||||||
|
// below so that CoUninitialize runs after all of them are released.
|
||||||
|
ComGuard comGuard;
|
||||||
|
if (!comGuard.IsInitialized()) {
|
||||||
|
ReportError("COM initialization failed");
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find a live Explorer window that is currently displaying the target folder.
|
||||||
|
ComPtr<IFolderView2> folderView2 = FindLiveFolderView(folderPath);
|
||||||
|
if (!folderView2) {
|
||||||
|
ReportError("No open Explorer window matches the folder: " + folderPath);
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get items already sorted in Explorer's view order, as an IShellItemArray.
|
||||||
|
// SVGIO_ALLVIEW returns all items; SVGIO_FLAG_VIEWORDER respects the view's sort.
|
||||||
|
ComPtr<IShellItemArray> itemArray;
|
||||||
|
if (FAILED(folderView2->Items(SVGIO_ALLVIEW | SVGIO_FLAG_VIEWORDER,
|
||||||
|
IID_PPV_ARGS(itemArray.GetAddressOf())))) {
|
||||||
|
ReportError("IFolderView2::Items(SVGIO_ALLVIEW | SVGIO_FLAG_VIEWORDER) failed");
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD itemCount = 0;
|
||||||
|
itemArray->GetCount(&itemCount);
|
||||||
|
|
||||||
|
// Enumerate sorted items, filter by pattern, and build the playlist.
|
||||||
|
for (DWORD i = 0; i < itemCount; i++) {
|
||||||
|
ComPtr<IShellItem> shellItem;
|
||||||
|
if (FAILED(itemArray->GetItemAt(i, shellItem.GetAddressOf()))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the full parsing path of the item.
|
||||||
|
PWSTR pathStr = nullptr;
|
||||||
|
if (FAILED(shellItem->GetDisplayName(SIGDN_DESKTOPABSOLUTEPARSING, &pathStr)) || !pathStr) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
QString filePath = QString::fromWCharArray(pathStr);
|
||||||
|
CoTaskMemFree(pathStr);
|
||||||
|
|
||||||
|
// Skip directories — the view may include folders alongside files.
|
||||||
|
QFileInfo fileInfo(filePath);
|
||||||
|
if (!fileInfo.isFile()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString fileName = fileInfo.fileName();
|
||||||
|
|
||||||
|
// Match against compiled wildcard patterns.
|
||||||
|
bool matches = nameRegexps.isEmpty();
|
||||||
|
for (const QRegularExpression &re : std::as_const(nameRegexps)) {
|
||||||
|
if (re.match(fileName).hasMatch()) {
|
||||||
|
matches = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!matches) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
rv.playlist.append(QUrl::fromLocalFile(filePath));
|
||||||
|
if (fileName == currentFileName) {
|
||||||
|
rv.indexHint = rv.playlist.size() - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // Q_OS_WIN
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2026 yyc12345 <yyc12321@outlook.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "../playlistscout.h"
|
||||||
|
#include <QtSystemDetection>
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
|
||||||
|
namespace PlaylistScout::Explorer {
|
||||||
|
std::optional<ScoutResult> scout(const QUrl &url, const QStringList &allowedSuffixes);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // Q_OS_WIN
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2025 Gary Wang <git@blumia.net>
|
||||||
|
// SPDX-FileCopyrightText: 2026 yyc12345 <yyc12321@outlook.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#include "qtscout.h"
|
||||||
|
|
||||||
|
#include <QFileInfo>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QCollator>
|
||||||
|
|
||||||
|
std::optional<PlaylistScout::ScoutResult> PlaylistScout::Qt::scout(
|
||||||
|
const QUrl &url, const QStringList &allowedSuffixes) {
|
||||||
|
PlaylistScout::ScoutResult rv;
|
||||||
|
|
||||||
|
QFileInfo info(url.toLocalFile());
|
||||||
|
QDir dir(info.path());
|
||||||
|
QString currentFileName = info.fileName();
|
||||||
|
|
||||||
|
QStringList entryList = dir.entryList(
|
||||||
|
allowedSuffixes, QDir::Files | QDir::NoSymLinks, QDir::NoSort);
|
||||||
|
|
||||||
|
QCollator collator;
|
||||||
|
collator.setNumericMode(true);
|
||||||
|
|
||||||
|
std::sort(entryList.begin(), entryList.end(), collator);
|
||||||
|
|
||||||
|
for (qsizetype i = 0; i < entryList.count(); i++) {
|
||||||
|
const QString &fileName = entryList.at(i);
|
||||||
|
const QString &oneEntry = dir.absoluteFilePath(fileName);
|
||||||
|
const QUrl &url = QUrl::fromLocalFile(oneEntry);
|
||||||
|
|
||||||
|
rv.playlist.append(url);
|
||||||
|
if (fileName == currentFileName) {
|
||||||
|
rv.indexHint = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2026 yyc12345 <yyc12321@outlook.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "../playlistscout.h"
|
||||||
|
|
||||||
|
namespace PlaylistScout::Qt {
|
||||||
|
std::optional<ScoutResult> scout(const QUrl &url, const QStringList &allowedSuffixes);
|
||||||
|
}
|
||||||
@@ -1,86 +1,174 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QAction>
|
||||||
Settings *Settings::m_settings_instance = nullptr;
|
#include <QWidget>
|
||||||
|
#include <QKeySequence>
|
||||||
|
#include <QMetaEnum>
|
||||||
|
|
||||||
Settings *Settings::instance()
|
Settings *Settings::instance()
|
||||||
{
|
{
|
||||||
if (!m_settings_instance) {
|
// SAFETY:
|
||||||
m_settings_instance = new Settings;
|
// This is a global singleton and it is leaked by design.
|
||||||
|
static Settings* INSTANCE = new Settings(nullptr);
|
||||||
|
return INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace QEnumHelper
|
||||||
|
{
|
||||||
|
template <typename E>
|
||||||
|
E fromString(const QString &text, const E defaultValue)
|
||||||
|
{
|
||||||
|
bool ok;
|
||||||
|
E result = static_cast<E>(QMetaEnum::fromType<E>().keyToValue(text.toUtf8(), &ok));
|
||||||
|
if (!ok) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_settings_instance;
|
template <typename E>
|
||||||
|
QString toString(E value)
|
||||||
|
{
|
||||||
|
const int intValue = static_cast<int>(value);
|
||||||
|
return QString::fromUtf8(QMetaEnum::fromType<E>().valueToKey(intValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Settings::stayOnTop()
|
bool Settings::showNavigatorView() const
|
||||||
{
|
{
|
||||||
return m_qsettings->value("stay_on_top", true).toBool();
|
return m_qsettings->value("show_navigator_view", true).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
DoubleClickBehavior Settings::doubleClickBehavior()
|
bool Settings::useLightCheckerboard() const
|
||||||
{
|
{
|
||||||
QString result = m_qsettings->value("double_click_behavior", "close").toString().toLower();
|
return m_qsettings->value("use_light_checkerboard", false).toBool();
|
||||||
|
|
||||||
return stringToDoubleClickBehavior(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setStayOnTop(bool on)
|
bool Settings::loopGallery() const
|
||||||
{
|
{
|
||||||
m_qsettings->setValue("stay_on_top", on);
|
return m_qsettings->value("loop_gallery", true).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Settings::svgTiny12Only() const
|
||||||
|
{
|
||||||
|
// Qt 6.7.0's SVG support is terrible caused by huge memory usage, see QTBUG-124287
|
||||||
|
// Qt 6.7.1's is somewhat better, memory issue seems fixed, but still laggy when zoom in, see QTBUG-126771.
|
||||||
|
// Qt 6.9.3 and Qt 6.10.1 seems no longer have the laggy issue, so let's make the default value different
|
||||||
|
// based on Qt version.
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 3)
|
||||||
|
return m_qsettings->value("svg_tiny12_only", true).toBool();
|
||||||
|
#else
|
||||||
|
return m_qsettings->value("svg_tiny12_only", false).toBool();
|
||||||
|
#endif // QT_VERSION < QT_VERSION_CHECK(6, 9, 3)
|
||||||
|
}
|
||||||
|
|
||||||
|
Settings::MouseWheelBehavior Settings::mouseWheelBehavior() const
|
||||||
|
{
|
||||||
|
QString result = m_qsettings->value("mouse_wheel_behavior", "").toString();
|
||||||
|
return QEnumHelper::fromString<MouseWheelBehavior>(result, MouseWheelBehavior::Zoom);
|
||||||
|
}
|
||||||
|
|
||||||
|
Settings::WindowSizeBehavior Settings::initWindowSizeBehavior() const
|
||||||
|
{
|
||||||
|
QString result = m_qsettings->value("init_window_size_behavior", "").toString();
|
||||||
|
return QEnumHelper::fromString<WindowSizeBehavior>(result, WindowSizeBehavior::Windowed);
|
||||||
|
}
|
||||||
|
|
||||||
|
Qt::HighDpiScaleFactorRoundingPolicy Settings::hiDpiScaleFactorBehavior() const
|
||||||
|
{
|
||||||
|
QString result = m_qsettings->value("hidpi_scale_factor_behavior", "").toString();
|
||||||
|
return QEnumHelper::fromString<Qt::HighDpiScaleFactorRoundingPolicy>(result, Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Settings::setShowNavigatorView(bool on)
|
||||||
|
{
|
||||||
|
m_qsettings->setValue("show_navigator_view", on);
|
||||||
m_qsettings->sync();
|
m_qsettings->sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Settings::setDoubleClickBehavior(DoubleClickBehavior dcb)
|
void Settings::setUseLightCheckerboard(bool light)
|
||||||
{
|
{
|
||||||
m_qsettings->setValue("double_click_behavior", doubleClickBehaviorToString(dcb));
|
m_qsettings->setValue("use_light_checkerboard", light);
|
||||||
m_qsettings->sync();
|
m_qsettings->sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Settings::doubleClickBehaviorToString(DoubleClickBehavior dcb)
|
void Settings::setLoopGallery(bool on)
|
||||||
{
|
{
|
||||||
static QMap<DoubleClickBehavior, QString> _map {
|
m_qsettings->setValue("loop_gallery", on);
|
||||||
{ActionCloseWindow, "close"},
|
m_qsettings->sync();
|
||||||
{ActionMaximizeWindow, "maximize"},
|
|
||||||
{ActionDoNothing, "ignore"}
|
|
||||||
};
|
|
||||||
|
|
||||||
return _map.value(dcb, "close");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DoubleClickBehavior Settings::stringToDoubleClickBehavior(QString str)
|
void Settings::setSvgTiny12Only(bool on)
|
||||||
{
|
{
|
||||||
static QMap<QString, DoubleClickBehavior> _map {
|
m_qsettings->setValue("svg_tiny12_only", on);
|
||||||
{"close", ActionCloseWindow},
|
m_qsettings->sync();
|
||||||
{"maximize", ActionMaximizeWindow},
|
|
||||||
{"ignore", ActionDoNothing}
|
|
||||||
};
|
|
||||||
|
|
||||||
return _map.value(str, ActionCloseWindow);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings::Settings()
|
void Settings::setMouseWheelBehavior(MouseWheelBehavior mwb)
|
||||||
: QObject(qApp)
|
{
|
||||||
|
m_qsettings->setValue("mouse_wheel_behavior", QEnumHelper::toString(mwb));
|
||||||
|
m_qsettings->sync();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Settings::setInitWindowSizeBehavior(WindowSizeBehavior wsb)
|
||||||
|
{
|
||||||
|
m_qsettings->setValue("init_window_size_behavior", QEnumHelper::toString(wsb));
|
||||||
|
m_qsettings->sync();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Settings::setHiDpiScaleFactorBehavior(Qt::HighDpiScaleFactorRoundingPolicy hidpi)
|
||||||
|
{
|
||||||
|
m_qsettings->setValue("hidpi_scale_factor_behavior", QEnumHelper::toString(hidpi));
|
||||||
|
m_qsettings->sync();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(FLAG_PORTABLE_MODE_SUPPORT) && defined(Q_OS_WIN)
|
||||||
|
#include <windows.h>
|
||||||
|
// QCoreApplication::applicationDirPath() parses the "applicationDirPath" from arg0, which...
|
||||||
|
// 1. rely on a QApplication object instance
|
||||||
|
// but we need to call QGuiApplication::setHighDpiScaleFactorRoundingPolicy() before QApplication get created
|
||||||
|
// 2. arg0 is NOT garanteed to be the path of execution
|
||||||
|
// see also: https://stackoverflow.com/questions/383973/is-args0-guaranteed-to-be-the-path-of-execution
|
||||||
|
// This function is here mainly for #1.
|
||||||
|
QString getApplicationDirPath()
|
||||||
|
{
|
||||||
|
WCHAR buffer[MAX_PATH];
|
||||||
|
GetModuleFileNameW(NULL, buffer, MAX_PATH);
|
||||||
|
QString appPath = QString::fromWCharArray(buffer);
|
||||||
|
|
||||||
|
return appPath.left(appPath.lastIndexOf('\\'));
|
||||||
|
}
|
||||||
|
#endif // defined(FLAG_PORTABLE_MODE_SUPPORT) && defined(Q_OS_WIN)
|
||||||
|
|
||||||
|
Settings::Settings(QObject *parent)
|
||||||
|
: QObject(parent)
|
||||||
{
|
{
|
||||||
QString configPath;
|
QString configPath;
|
||||||
|
|
||||||
#ifdef FLAG_PORTABLE_MODE_SUPPORT
|
#if defined(FLAG_PORTABLE_MODE_SUPPORT) && defined(Q_OS_WIN)
|
||||||
QString portableConfigDirPath = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath("data");
|
QString portableConfigDirPath = QDir(getApplicationDirPath()).absoluteFilePath("data");
|
||||||
QFileInfo portableConfigDirInfo(portableConfigDirPath);
|
QFileInfo portableConfigDirInfo(portableConfigDirPath);
|
||||||
if (portableConfigDirInfo.exists() && portableConfigDirInfo.isDir() && portableConfigDirInfo.isWritable()) {
|
if (portableConfigDirInfo.exists() && portableConfigDirInfo.isDir() && portableConfigDirInfo.isWritable()) {
|
||||||
// we can use it.
|
// we can use it.
|
||||||
configPath = portableConfigDirPath;
|
configPath = portableConfigDirPath;
|
||||||
}
|
}
|
||||||
#endif // FLAG_PORTABLE_MODE_SUPPORT
|
#endif // defined(FLAG_PORTABLE_MODE_SUPPORT) && defined(Q_OS_WIN)
|
||||||
|
|
||||||
// %LOCALAPPDATA% under Windows.
|
|
||||||
if (configPath.isEmpty()) {
|
if (configPath.isEmpty()) {
|
||||||
configPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
|
// Should be %LOCALAPPDATA%\<APPNAME> under Windows, ~/.config/<APPNAME> under Linux.
|
||||||
|
configPath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_qsettings = new QSettings(QDir(configPath).absoluteFilePath("config.ini"), QSettings::IniFormat, this);
|
m_qsettings = new QSettings(QDir(configPath).absoluteFilePath("config.ini"), QSettings::IniFormat, this);
|
||||||
|
|
||||||
|
qRegisterMetaType<QList<QKeySequence>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +1,48 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
enum DoubleClickBehavior {
|
|
||||||
ActionDoNothing,
|
|
||||||
ActionCloseWindow,
|
|
||||||
ActionMaximizeWindow,
|
|
||||||
|
|
||||||
ActionStart = ActionDoNothing,
|
|
||||||
ActionEnd = ActionMaximizeWindow
|
|
||||||
};
|
|
||||||
|
|
||||||
class Settings : public QObject
|
class Settings : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
enum MouseWheelBehavior {
|
||||||
|
Zoom,
|
||||||
|
Switch,
|
||||||
|
};
|
||||||
|
Q_ENUM(MouseWheelBehavior)
|
||||||
|
|
||||||
|
enum WindowSizeBehavior {
|
||||||
|
Maximized,
|
||||||
|
Windowed,
|
||||||
|
};
|
||||||
|
Q_ENUM(WindowSizeBehavior)
|
||||||
|
|
||||||
static Settings *instance();
|
static Settings *instance();
|
||||||
|
|
||||||
bool stayOnTop();
|
bool showNavigatorView() const;
|
||||||
DoubleClickBehavior doubleClickBehavior();
|
bool useLightCheckerboard() const;
|
||||||
|
bool loopGallery() const;
|
||||||
|
bool svgTiny12Only() const;
|
||||||
|
MouseWheelBehavior mouseWheelBehavior() const;
|
||||||
|
WindowSizeBehavior initWindowSizeBehavior() const;
|
||||||
|
Qt::HighDpiScaleFactorRoundingPolicy hiDpiScaleFactorBehavior() const;
|
||||||
|
|
||||||
void setStayOnTop(bool on);
|
void setShowNavigatorView(bool on);
|
||||||
void setDoubleClickBehavior(DoubleClickBehavior dcb);
|
void setUseLightCheckerboard(bool light);
|
||||||
|
void setLoopGallery(bool on);
|
||||||
static QString doubleClickBehaviorToString(DoubleClickBehavior dcb);
|
void setSvgTiny12Only(bool on);
|
||||||
static DoubleClickBehavior stringToDoubleClickBehavior(QString str);
|
void setMouseWheelBehavior(MouseWheelBehavior mwb);
|
||||||
|
void setInitWindowSizeBehavior(WindowSizeBehavior wsb);
|
||||||
|
void setHiDpiScaleFactorBehavior(Qt::HighDpiScaleFactorRoundingPolicy hidpi);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Settings();
|
Settings(QObject *parent = nullptr);
|
||||||
|
|
||||||
static Settings *m_settings_instance;
|
|
||||||
|
|
||||||
QSettings *m_qsettings;
|
QSettings *m_qsettings;
|
||||||
|
|
||||||
@@ -38,4 +50,3 @@ signals:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,53 +1,145 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#include "settingsdialog.h"
|
#include "settingsdialog.h"
|
||||||
|
#include "ui_settingsdialog.h"
|
||||||
|
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
#include <QCheckBox>
|
#include <QApplication>
|
||||||
#include <QComboBox>
|
#include <QTimer>
|
||||||
#include <QFormLayout>
|
|
||||||
#include <QStringListModel>
|
#include <QStringListModel>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
SettingsDialog::SettingsDialog(QWidget *parent)
|
template <typename E, typename = std::enable_if_t<std::is_enum_v<E>>>
|
||||||
: QDialog(parent)
|
class EnumComboBoxTransformer {
|
||||||
, m_stayOnTop(new QCheckBox)
|
public:
|
||||||
, m_doubleClickBehavior(new QComboBox)
|
using Pair = QPair<E, QString>;
|
||||||
{
|
using Pairs = QList<QPair<E, QString>>;
|
||||||
this->setWindowTitle(tr("Settings"));
|
|
||||||
|
|
||||||
QFormLayout * settingsForm = new QFormLayout(this);
|
EnumComboBoxTransformer(Pairs &&pairs) : pairs(std::move(pairs)) {}
|
||||||
|
~EnumComboBoxTransformer() = default;
|
||||||
|
Q_DISABLE_COPY_MOVE(EnumComboBoxTransformer)
|
||||||
|
|
||||||
static QMap<DoubleClickBehavior, QString> _map {
|
/// Build Qt model used for QComboBox
|
||||||
{ ActionDoNothing, tr("Do nothing") },
|
QStringListModel* buildComboBoxModel(QObject *parent = nullptr) const {
|
||||||
{ ActionCloseWindow, tr("Close the window") },
|
QStringList dropDownEntries;
|
||||||
{ ActionMaximizeWindow, tr("Toggle maximize") }
|
for (const auto& pair : std::as_const(this->pairs)) {
|
||||||
};
|
dropDownEntries.append(pair.second);
|
||||||
|
}
|
||||||
QStringList dropDown;
|
return new QStringListModel(dropDownEntries, parent);
|
||||||
for (int dcb = ActionStart; dcb <= ActionEnd; dcb++) {
|
}
|
||||||
dropDown.append(_map.value(static_cast<DoubleClickBehavior>(dcb)));
|
/// Convert QComboBox index to enum value.
|
||||||
|
E to_value(int index) const {
|
||||||
|
return this->pairs.at(static_cast<qsizetype>(index)).first;
|
||||||
|
}
|
||||||
|
/// Convert enum value to QComboBox index.
|
||||||
|
int to_index(E value) const {
|
||||||
|
for (qsizetype i = 0; i < pairs.size(); ++i) {
|
||||||
|
if (pairs.at(i).first == value) {
|
||||||
|
return static_cast<int>(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Value not found
|
||||||
|
throw std::invalid_argument("invalid enum value for finding index");
|
||||||
}
|
}
|
||||||
|
|
||||||
settingsForm->addRow(tr("Stay on top when start-up"), m_stayOnTop);
|
private:
|
||||||
settingsForm->addRow(tr("Double-click behavior"), m_doubleClickBehavior);
|
Pairs pairs;
|
||||||
|
};
|
||||||
|
|
||||||
m_stayOnTop->setChecked(Settings::instance()->stayOnTop());
|
static EnumComboBoxTransformer<Settings::MouseWheelBehavior, QString> MW_OPTIONS {
|
||||||
m_doubleClickBehavior->setModel(new QStringListModel(dropDown));
|
{
|
||||||
DoubleClickBehavior dcb = Settings::instance()->doubleClickBehavior();
|
{ Settings::MouseWheelBehavior::Zoom, QCoreApplication::translate("SettingsDialog", "Zoom in and out") },
|
||||||
m_doubleClickBehavior->setCurrentIndex(static_cast<int>(dcb));
|
{ Settings::MouseWheelBehavior::Switch, QCoreApplication::translate("SettingsDialog", "View next or previous item") }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
connect(m_stayOnTop, &QCheckBox::stateChanged, this, [ = ](int state){
|
static EnumComboBoxTransformer<Settings::WindowSizeBehavior, QString> IWS_OPTIONS {
|
||||||
Settings::instance()->setStayOnTop(state == Qt::Checked);
|
{
|
||||||
});
|
{ Settings::WindowSizeBehavior::Maximized, QCoreApplication::translate("SettingsDialog", "Maximized") },
|
||||||
|
{ Settings::WindowSizeBehavior::Windowed, QCoreApplication::translate("SettingsDialog", "Windowed") }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
connect(m_doubleClickBehavior, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [ = ](int index){
|
static EnumComboBoxTransformer<Qt::HighDpiScaleFactorRoundingPolicy, QString> HIDPI_OPTIONS {
|
||||||
Settings::instance()->setDoubleClickBehavior(static_cast<DoubleClickBehavior>(index));
|
{
|
||||||
});
|
{ Qt::HighDpiScaleFactorRoundingPolicy::Round, QCoreApplication::translate("SettingsDialog", "Round (Integer scaling)", "This option means round up for .5 and above") },
|
||||||
|
{ Qt::HighDpiScaleFactorRoundingPolicy::Ceil, QCoreApplication::translate("SettingsDialog", "Ceil (Integer scaling)", "This option means always round up") },
|
||||||
|
{ Qt::HighDpiScaleFactorRoundingPolicy::Floor, QCoreApplication::translate("SettingsDialog", "Floor (Integer scaling)", "This option means always round down") },
|
||||||
|
{ Qt::HighDpiScaleFactorRoundingPolicy::PassThrough, QCoreApplication::translate("SettingsDialog", "Follow system (Fractional scaling)", "This option means don't round") }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
this->setMinimumSize(300, 61); // not sure why it complain "Unable to set geometry"
|
SettingsDialog::SettingsDialog(QWidget *parent)
|
||||||
|
: QDialog(parent), ui(new QT_PREPEND_NAMESPACE(Ui::SettingsDialog))
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||||
|
|
||||||
|
auto* settings = Settings::instance();
|
||||||
|
ui->m_showNavigatorView->setChecked(Settings::instance()->showNavigatorView());
|
||||||
|
ui->m_useLightCheckerboard->setChecked(settings->useLightCheckerboard());
|
||||||
|
ui->m_loopGallery->setChecked(settings->loopGallery());
|
||||||
|
ui->m_svgTiny12Only->setChecked(settings->svgTiny12Only());
|
||||||
|
ui->m_mouseWheelBehavior->setModel(MW_OPTIONS.buildComboBoxModel(this));
|
||||||
|
Settings::MouseWheelBehavior mwb = settings->mouseWheelBehavior();
|
||||||
|
ui->m_mouseWheelBehavior->setCurrentIndex(MW_OPTIONS.to_index(mwb));
|
||||||
|
ui->m_initWindowSizeBehavior->setModel(IWS_OPTIONS.buildComboBoxModel(this));
|
||||||
|
Settings::WindowSizeBehavior iwsb = settings->initWindowSizeBehavior();
|
||||||
|
ui->m_initWindowSizeBehavior->setCurrentIndex(IWS_OPTIONS.to_index(iwsb));
|
||||||
|
ui->m_hiDpiRoundingPolicyBehavior->setModel(HIDPI_OPTIONS.buildComboBoxModel(this));
|
||||||
|
Qt::HighDpiScaleFactorRoundingPolicy hidpi = settings->hiDpiScaleFactorBehavior();
|
||||||
|
ui->m_hiDpiRoundingPolicyBehavior->setCurrentIndex(HIDPI_OPTIONS.to_index(hidpi));
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
|
||||||
|
# define QCHECKBOX_CHECKSTATECHANGED QCheckBox::checkStateChanged
|
||||||
|
# define QT_CHECKSTATE Qt::CheckState
|
||||||
|
#else
|
||||||
|
# define QCHECKBOX_CHECKSTATECHANGED QCheckBox::stateChanged
|
||||||
|
# define QT_CHECKSTATE int
|
||||||
|
#endif // QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
|
||||||
|
|
||||||
|
connect(ui->m_showNavigatorView, &QCHECKBOX_CHECKSTATECHANGED, this, [ = ](QT_CHECKSTATE state){
|
||||||
|
Settings::instance()->setShowNavigatorView(state == Qt::Checked);
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->m_useLightCheckerboard, &QCHECKBOX_CHECKSTATECHANGED, this, [ = ](QT_CHECKSTATE state){
|
||||||
|
Settings::instance()->setUseLightCheckerboard(state == Qt::Checked);
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->m_loopGallery, &QCHECKBOX_CHECKSTATECHANGED, this, [ = ](QT_CHECKSTATE state){
|
||||||
|
Settings::instance()->setLoopGallery(state == Qt::Checked);
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->m_svgTiny12Only, &QCHECKBOX_CHECKSTATECHANGED, this, [ = ](QT_CHECKSTATE state){
|
||||||
|
Settings::instance()->setSvgTiny12Only(state == Qt::Checked);
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->m_mouseWheelBehavior, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [ = ](int index){
|
||||||
|
Settings::instance()->setMouseWheelBehavior(MW_OPTIONS.to_value(index));
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->m_initWindowSizeBehavior, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [ = ](int index){
|
||||||
|
Settings::instance()->setInitWindowSizeBehavior(IWS_OPTIONS.to_value(index));
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(ui->m_hiDpiRoundingPolicyBehavior, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [ = ](int index){
|
||||||
|
Settings::instance()->setHiDpiScaleFactorBehavior(HIDPI_OPTIONS.to_value(index));
|
||||||
|
});
|
||||||
|
|
||||||
|
// YYC MARK:
|
||||||
|
// Use adjustSize() to make sure all ComboBox are expanded by its items.
|
||||||
|
// Because items are added after inserting them into layout.
|
||||||
|
// It is inviable to call this function in ctor because this relys on Qt event system.
|
||||||
|
// It only can be done by QTimer::singleShot().
|
||||||
|
QTimer::singleShot(0, this, [this](){
|
||||||
|
this->adjustSize();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsDialog::~SettingsDialog()
|
SettingsDialog::~SettingsDialog()
|
||||||
{
|
{
|
||||||
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
#ifndef SETTINGSDIALOG_H
|
#ifndef SETTINGSDIALOG_H
|
||||||
#define SETTINGSDIALOG_H
|
#define SETTINGSDIALOG_H
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
class QCheckBox;
|
QT_BEGIN_NAMESPACE
|
||||||
class QComboBox;
|
namespace Ui {
|
||||||
|
class SettingsDialog;
|
||||||
|
}
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
class SettingsDialog : public QDialog
|
class SettingsDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -13,13 +20,8 @@ public:
|
|||||||
explicit SettingsDialog(QWidget *parent = nullptr);
|
explicit SettingsDialog(QWidget *parent = nullptr);
|
||||||
~SettingsDialog();
|
~SettingsDialog();
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QCheckBox * m_stayOnTop = nullptr;
|
QT_PREPEND_NAMESPACE(Ui::SettingsDialog) *ui;
|
||||||
QComboBox * m_doubleClickBehavior = nullptr;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SETTINGSDIALOG_H
|
#endif // SETTINGSDIALOG_H
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>SettingsDialog</class>
|
||||||
|
<widget class="QDialog" name="SettingsDialog">
|
||||||
|
<property name="windowModality">
|
||||||
|
<enum>Qt::NonModal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Settings</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="mainLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTabWidget" name="settingsTabs">
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="optionsTab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Options</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QFormLayout" name="settingsForm">
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="m_showNavigatorView">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show navigation view</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="m_useLightCheckerboard">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use light-color checkerboard</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="m_loopGallery">
|
||||||
|
<property name="text">
|
||||||
|
<string>Loop the loaded gallery</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="m_svgTiny12Only">
|
||||||
|
<property name="text">
|
||||||
|
<string>Limit SVG support to SVG Tiny 1.2</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="m_mouseWheelBehaviorLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Mouse wheel behavior</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QComboBox" name="m_mouseWheelBehavior"/>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="m_initWindowSizeBehaviorLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Default window size</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QComboBox" name="m_initWindowSizeBehavior"/>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QLabel" name="m_hiDpiRoundingPolicyBehaviorLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>HiDPI scale factor rounding policy</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1">
|
||||||
|
<widget class="QComboBox" name="m_hiDpiRoundingPolicyBehavior"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
#include "toolbutton.h"
|
|
||||||
|
|
||||||
#include "opacityhelper.h"
|
|
||||||
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QGraphicsOpacityEffect>
|
|
||||||
#include <QPropertyAnimation>
|
|
||||||
|
|
||||||
ToolButton::ToolButton(bool hoverColor, QWidget *parent)
|
|
||||||
: QPushButton(parent)
|
|
||||||
, m_opacityHelper(new OpacityHelper(this))
|
|
||||||
{
|
|
||||||
setFlat(true);
|
|
||||||
QString qss = "QPushButton {"
|
|
||||||
"background: transparent;"
|
|
||||||
"}";
|
|
||||||
if (hoverColor) {
|
|
||||||
qss += "QPushButton:hover {"
|
|
||||||
"background: red;"
|
|
||||||
"}";
|
|
||||||
}
|
|
||||||
setStyleSheet(qss);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ToolButton::setOpacity(qreal opacity, bool animated)
|
|
||||||
{
|
|
||||||
m_opacityHelper->setOpacity(opacity, animated);
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#ifndef TOOLBUTTON_H
|
|
||||||
#define TOOLBUTTON_H
|
|
||||||
|
|
||||||
#include <QPushButton>
|
|
||||||
|
|
||||||
class OpacityHelper;
|
|
||||||
class ToolButton : public QPushButton
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
ToolButton(bool hoverColor = false, QWidget * parent = nullptr);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void setOpacity(qreal opacity, bool animated = true);
|
|
||||||
|
|
||||||
private:
|
|
||||||
OpacityHelper * m_opacityHelper;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // TOOLBUTTON_H
|
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
image:
|
|
||||||
- Visual Studio 2019
|
|
||||||
environment:
|
|
||||||
CMAKE_INSTALL_ROOT: C:\projects\cmake
|
|
||||||
ZLIB_ROOT: C:\projects\zlib
|
|
||||||
LIBEXPAT: C:\projects\libexpat
|
|
||||||
LIBAVIF: C:\projects\libavif
|
|
||||||
LIBEXIV2: C:\projects\exiv2
|
|
||||||
matrix:
|
|
||||||
- build_name: mingw81_32_qt5_15_2
|
|
||||||
QTPATH: C:\Qt\5.15.2\mingw81_32
|
|
||||||
MINGW32: C:\Qt\Tools\mingw810_32
|
|
||||||
|
|
||||||
install:
|
|
||||||
- mkdir %CMAKE_INSTALL_ROOT%
|
|
||||||
- mkdir %ZLIB_ROOT%
|
|
||||||
- mkdir %LIBEXPAT%
|
|
||||||
- mkdir %LIBAVIF%
|
|
||||||
- mkdir %LIBEXIV2%
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
|
||||||
- git submodule update --init --recursive
|
|
||||||
- set PATH=%PATH%;%CMAKE_INSTALL_ROOT%;%QTPATH%\bin;%MINGW32%\bin
|
|
||||||
- set CC=%MINGW32%\bin\gcc.exe
|
|
||||||
- set CXX=%MINGW32%\bin\g++.exe
|
|
||||||
|
|
||||||
build_script:
|
|
||||||
# prepare
|
|
||||||
- mkdir 3rdparty
|
|
||||||
- cinst ninja
|
|
||||||
# install ECM so we can build KImageFormats
|
|
||||||
- cd 3rdparty
|
|
||||||
- git clone -q https://invent.kde.org/frameworks/extra-cmake-modules.git
|
|
||||||
- cd extra-cmake-modules
|
|
||||||
- cmake -G "Ninja" . -DCMAKE_INSTALL_PREFIX=%CMAKE_INSTALL_ROOT% -DBUILD_TESTING=OFF
|
|
||||||
- cmake --build .
|
|
||||||
- cmake --build . --target install
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
|
||||||
# download and install zlib for KArchive
|
|
||||||
- cd %ZLIB_ROOT%
|
|
||||||
- curl -fsSL -o zlib128-dll.zip http://zlib.net/zlib128-dll.zip
|
|
||||||
- 7z x zlib128-dll.zip
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
|
||||||
# install AOM for libavif AV1 decoding support...
|
|
||||||
- cd 3rdparty
|
|
||||||
- git clone -b v2.0.1 --depth 1 https://aomedia.googlesource.com/aom
|
|
||||||
- cd aom
|
|
||||||
- mkdir build.libavif
|
|
||||||
- cd build.libavif
|
|
||||||
- cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%CMAKE_INSTALL_ROOT% -DCMAKE_CXX_FLAGS_RELEASE="-s" -DENABLE_DOCS=OFF -DBUILD_SHARED_LIBS=ON -DAOM_TARGET_CPU=generic -DENABLE_TESTS=OFF -DENABLE_TESTDATA=OFF -DENABLE_TOOLS=OFF -DENABLE_EXAMPLES=0
|
|
||||||
- cmake --build . --config Release
|
|
||||||
- cmake --build . --config Release --target install
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
|
||||||
# install libavif for avif format support of KImageFormats
|
|
||||||
- cd %LIBAVIF%
|
|
||||||
- curl -fsSL -o libavif-v0_8_4.zip https://github.com/AOMediaCodec/libavif/archive/v0.8.4.zip
|
|
||||||
- 7z x libavif-v0_8_4.zip -y
|
|
||||||
- cd libavif-0.8.4
|
|
||||||
- mkdir build
|
|
||||||
- cd build
|
|
||||||
- cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%CMAKE_INSTALL_ROOT% -DCMAKE_CXX_FLAGS_RELEASE="-s" -DAVIF_CODEC_AOM=ON
|
|
||||||
- cmake --build . --config Release
|
|
||||||
- cmake --build . --config Release --target install
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
|
||||||
# install KArchive for kra format support of KImageFormats
|
|
||||||
- cd 3rdparty
|
|
||||||
- git clone -q https://invent.kde.org/frameworks/karchive.git
|
|
||||||
- cd karchive
|
|
||||||
- mkdir build
|
|
||||||
- cd build
|
|
||||||
- cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%CMAKE_INSTALL_ROOT% -DCMAKE_CXX_FLAGS_RELEASE="-s" -DZLIB_ROOT=%ZLIB_ROOT%
|
|
||||||
- cmake --build . --config Release
|
|
||||||
- cmake --build . --config Release --target install
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
|
||||||
# build libexpat for libexiv2
|
|
||||||
- cd %LIBEXPAT%
|
|
||||||
- curl -fsSL -o R_2_2_10.zip https://github.com/libexpat/libexpat/archive/R_2_2_10.zip
|
|
||||||
- 7z x R_2_2_10.zip -y
|
|
||||||
- cd libexpat-R_2_2_10/expat/
|
|
||||||
- cmake -G "Ninja" . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%CMAKE_INSTALL_ROOT% -DCMAKE_CXX_FLAGS_RELEASE="-s" -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF
|
|
||||||
- cmake --build . --target install
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
|
||||||
# build libexiv2
|
|
||||||
- cd %LIBEXIV2%
|
|
||||||
- curl -fsSL -o v0.27.3.zip https://github.com/Exiv2/exiv2/archive/v0.27.3.zip
|
|
||||||
- 7z x v0.27.3.zip -y
|
|
||||||
- cd exiv2-0.27.3
|
|
||||||
- cmake -G "Ninja" . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%CMAKE_INSTALL_ROOT% -DEXIV2_BUILD_SAMPLES=OFF -DEXIV2_ENABLE_WIN_UNICODE=ON -DCMAKE_CXX_FLAGS_RELEASE="-s" -DZLIB_ROOT=%ZLIB_ROOT%
|
|
||||||
- cmake --build . --target install
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
|
||||||
# install KImageFormats
|
|
||||||
- cd 3rdparty
|
|
||||||
- git clone -q https://invent.kde.org/frameworks/kimageformats.git
|
|
||||||
- cd kimageformats
|
|
||||||
- mkdir build
|
|
||||||
- cd build
|
|
||||||
- cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE="-s" -DQT_PLUGIN_INSTALL_DIR=%QTPATH%\plugins
|
|
||||||
- cmake --build . --config Release
|
|
||||||
- cmake --build . --config Release --target install
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
|
||||||
# finally...
|
|
||||||
- mkdir build
|
|
||||||
- cd build
|
|
||||||
- cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS_RELEASE="-s" -DCMAKE_MAKE_PROGRAM=mingw32-make -DCMAKE_INSTALL_PREFIX='%cd%'
|
|
||||||
- mingw32-make
|
|
||||||
- mingw32-make install
|
|
||||||
# fixme: I don't know how to NOT make the binary installed to the ./bin/ folder...
|
|
||||||
- cd bin
|
|
||||||
- copy %APPVEYOR_BUILD_FOLDER%\LICENSE .
|
|
||||||
- copy %CMAKE_INSTALL_ROOT%\lib\libaom.dll
|
|
||||||
- copy %CMAKE_INSTALL_ROOT%\bin\libexpat.dll
|
|
||||||
- copy %CMAKE_INSTALL_ROOT%\bin\libexiv2.dll
|
|
||||||
- copy %CMAKE_INSTALL_ROOT%\bin\libavif.dll
|
|
||||||
- copy %ZLIB_ROOT%\zlib1.dll .
|
|
||||||
- copy C:\projects\cmake\bin\libKF5Archive.dll .
|
|
||||||
- windeployqt --verbose=2 --no-quick-import --no-translations --no-opengl-sw --no-angle --no-system-d3d-compiler .\ppic.exe
|
|
||||||
# copy 3rdparty licenses for the libs we vendored for windows...
|
|
||||||
- mkdir licenses
|
|
||||||
- cd licenses
|
|
||||||
- copy %APPVEYOR_BUILD_FOLDER%\3rdparty\aom\LICENSE License.aom.txt
|
|
||||||
- copy %APPVEYOR_BUILD_FOLDER%\3rdparty\karchive\LICENSES\LGPL-2.0-or-later.txt License.KArchive.txt
|
|
||||||
- copy %APPVEYOR_BUILD_FOLDER%\3rdparty\kimageformats\LICENSES\LGPL-2.1-or-later.txt License.kimageformats.txt
|
|
||||||
- copy %LIBEXPAT%\libexpat-R_2_2_10\expat\COPYING License.expat.txt
|
|
||||||
- copy %LIBAVIF%\libavif-0.8.4\LICENSE License.libavif.txt
|
|
||||||
- copy %LIBEXIV2%\exiv2-0.27.3\COPYING License.exiv2.txt
|
|
||||||
# TODO: Qt, zlib
|
|
||||||
- cd ..
|
|
||||||
# for debug..
|
|
||||||
- tree /f
|
|
||||||
|
|
||||||
artifacts:
|
|
||||||
- path: build\bin
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<center>
|
||||||
|
<p>
|
||||||
|
<img width='128' height='128' src=':/icons/app-icon.png'/>
|
||||||
|
<br/>
|
||||||
|
<!-- Application name -->
|
||||||
|
<span>%1</span>
|
||||||
|
<br/>
|
||||||
|
<!-- Version info -->
|
||||||
|
<span>%2</span>
|
||||||
|
</p>
|
||||||
|
<hr/>
|
||||||
|
<p>
|
||||||
|
<!-- Upstream author and fork author -->
|
||||||
|
<span>%3</span><span>: </span><a href='https://github.com/BLumia'>@BLumia</a>
|
||||||
|
<br/>
|
||||||
|
<span>%4</span><span>: </span><a href='https://github.com/yyc12345'>@yyc12345</a>
|
||||||
|
<br/>
|
||||||
|
<!-- Icon author -->
|
||||||
|
<span>%5</span><span>: </span><a href='https://github.com/Lovelyblack'>@Lovelyblack</a>
|
||||||
|
</p>
|
||||||
|
<hr/>
|
||||||
|
<p>
|
||||||
|
<!-- Built Qt version info -->
|
||||||
|
<span>%6</span>
|
||||||
|
<br/>
|
||||||
|
<!-- Source code -->
|
||||||
|
<span>%7</span><span>: </span><a href='https://github.com/BLumia/pineapple-pictures'>GitHub</a>
|
||||||
|
</p>
|
||||||
|
</center>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<!-- General help -->
|
||||||
|
<h1 align='center'>%1</h1>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<span>%2</span>
|
||||||
|
<ul>
|
||||||
|
<li>%3</li>
|
||||||
|
<li>%4</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>%5</li>
|
||||||
|
<li>%6</li>
|
||||||
|
</ul>
|
||||||
|
<hr/>
|
||||||
|
<!-- Context menu option help -->
|
||||||
|
<h1 align='center'>%7</h1>
|
||||||
|
<!-- Context menu option list -->
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<b>%8</b><span>:</span>
|
||||||
|
<br/>
|
||||||
|
<span>%9</span>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<b>%10</b><span>:</span>
|
||||||
|
<br/>
|
||||||
|
<span>%11</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<!-- License -->
|
||||||
|
<h1 align='center'><b>%1</b></h1>
|
||||||
|
<p>%2</p>
|
||||||
|
<hr/>
|
||||||
|
<!-- VErbatime license -->
|
||||||
|
<h1 align='center'><b>%3</b></h1>
|
||||||
|
<pre>
|
||||||
|
Expat/MIT License
|
||||||
|
|
||||||
|
Copyright © 2026 BLumia
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
</pre>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<!-- Contributor title -->
|
||||||
|
<h1 align='center'>%1</h1>
|
||||||
|
<!-- Contributor list -->
|
||||||
|
<a href='https://github.com/BLumia/pineapple-pictures/graphs/contributors'>%2</a>
|
||||||
|
<!-- The message to thank these contributors -->
|
||||||
|
<p>%3</p>
|
||||||
|
|
||||||
|
<!-- Translator title -->
|
||||||
|
<h1 align='center'>%4</h1>
|
||||||
|
<!-- The message to thank these translators -->
|
||||||
|
<p>%5</p>
|
||||||
|
<ul>
|
||||||
|
<li><u>Catalan</u>: Toni Estévez</li>
|
||||||
|
<li><u>Chinese (Simplified)</u>: Percy Hong</li>
|
||||||
|
<li><u>Dutch</u>: Heimen Stoffels</li>
|
||||||
|
<li><u>French</u>: J. Lavoie, K. Herbert, Maxime Leroy</li>
|
||||||
|
<li><u>German</u>: K. Herbert, J. Lavoie, sal0max</li>
|
||||||
|
<li><u>Indonesian</u>: liimee, Reza Almanda</li>
|
||||||
|
<li><u>Italian</u>: albanobattistella</li>
|
||||||
|
<li><u>Japanese</u>: Black Cat, mmahhi, Percy Hong</li>
|
||||||
|
<li><u>Korean</u>: VenusGirl</li>
|
||||||
|
<li><u>Norwegian Bokmål</u>: Allan Nordhøy, ovl-1</li>
|
||||||
|
<li><u>Punjabi (Pakistan)</u>: bgo-eiu</li>
|
||||||
|
<li><u>Russian</u>: Sergey Shornikov, Artem, Andrey</li>
|
||||||
|
<li><u>Sinhala</u>: HelaBasa</li>
|
||||||
|
<li><u>Slovenian</u>: Andrej Poženel - SDT</li>
|
||||||
|
<li><u>Spanish</u>: Toni Estévez, Génesis Toxical, William(ѕ)ⁿ, gallegonovato</li>
|
||||||
|
<li><u>Tamil</u>: தமிழ்நேரம் (TamilNeram)</li>
|
||||||
|
<li><u>Turkish</u>: E-Akcaer, Oğuz Ersen, Sabri Ünal</li>
|
||||||
|
<li><u>Ukrainian</u>: Dan, volkov, Сергій</li>
|
||||||
|
<li><u>Vietnamese</u>: Loc Huynh</li>
|
||||||
|
</ul>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<!-- Title -->
|
||||||
|
<h1 align='center'><b>%1</b></h1>
|
||||||
|
<!-- List intro message -->
|
||||||
|
<p>%2</p>
|
||||||
|
<p>%3</p>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href='https://www.qt.io/'>Qt</a><span>: </span>
|
||||||
|
<span>GPLv2 + GPLv3 + LGPLv2.1 + LGPLv3</span>
|
||||||
|
</li>
|
||||||
|
<li style="display: none;">
|
||||||
|
<a href='https://www.exiv2.org/'>Exiv2</a><span>: </span>
|
||||||
|
<span>GPLv2</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
Before Width: | Height: | Size: 212 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
@@ -1,79 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="75"
|
|
||||||
height="75"
|
|
||||||
viewBox="0 0 19.84375 19.843751"
|
|
||||||
version="1.1"
|
|
||||||
id="svg8"
|
|
||||||
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
|
||||||
sodipodi:docname="go-next.svg">
|
|
||||||
<defs
|
|
||||||
id="defs2" />
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#282929"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:pageopacity="0.76862745"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="16.000001"
|
|
||||||
inkscape:cx="35.333099"
|
|
||||||
inkscape:cy="37.582065"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
inkscape:document-rotation="0"
|
|
||||||
showgrid="false"
|
|
||||||
units="px"
|
|
||||||
inkscape:pagecheckerboard="false"
|
|
||||||
showguides="true"
|
|
||||||
inkscape:guide-bbox="true"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:window-height="1001"
|
|
||||||
inkscape:window-x="-9"
|
|
||||||
inkscape:window-y="-9"
|
|
||||||
inkscape:window-maximized="1">
|
|
||||||
<sodipodi:guide
|
|
||||||
position="11.453565,9.9198082"
|
|
||||||
orientation="0,-1"
|
|
||||||
id="guide857" />
|
|
||||||
<sodipodi:guide
|
|
||||||
position="9.9229088,19.564698"
|
|
||||||
orientation="1,0"
|
|
||||||
id="guide837" />
|
|
||||||
</sodipodi:namedview>
|
|
||||||
<metadata
|
|
||||||
id="metadata5">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title />
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="图层 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1">
|
|
||||||
<ellipse
|
|
||||||
style="opacity:1;fill:#000000;fill-opacity:0.15678;stroke:#ffffff;stroke-width:0.396875;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path849"
|
|
||||||
cx="9.9368067"
|
|
||||||
cy="9.915391"
|
|
||||||
rx="8.6764698"
|
|
||||||
ry="8.9158831" />
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.396875;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="M 8.3550725,6.9255115 11.353504,9.9239423 8.3550725,12.91402"
|
|
||||||
id="path867" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
@@ -1,79 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
sodipodi:docname="go-previous.svg"
|
|
||||||
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
|
||||||
id="svg8"
|
|
||||||
version="1.1"
|
|
||||||
viewBox="0 0 19.84375 19.843751"
|
|
||||||
height="75"
|
|
||||||
width="75">
|
|
||||||
<defs
|
|
||||||
id="defs2" />
|
|
||||||
<sodipodi:namedview
|
|
||||||
inkscape:window-maximized="1"
|
|
||||||
inkscape:window-y="-9"
|
|
||||||
inkscape:window-x="-9"
|
|
||||||
inkscape:window-height="1001"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:guide-bbox="true"
|
|
||||||
showguides="true"
|
|
||||||
inkscape:pagecheckerboard="false"
|
|
||||||
units="px"
|
|
||||||
showgrid="false"
|
|
||||||
inkscape:document-rotation="0"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
inkscape:cy="45.995918"
|
|
||||||
inkscape:cx="29.794477"
|
|
||||||
inkscape:zoom="11.313709"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:pageopacity="0.76862745"
|
|
||||||
borderopacity="1.0"
|
|
||||||
bordercolor="#666666"
|
|
||||||
pagecolor="#282929"
|
|
||||||
id="base">
|
|
||||||
<sodipodi:guide
|
|
||||||
id="guide857"
|
|
||||||
orientation="0,-1"
|
|
||||||
position="11.453565,9.9198082" />
|
|
||||||
<sodipodi:guide
|
|
||||||
id="guide837"
|
|
||||||
orientation="1,0"
|
|
||||||
position="9.9229088,19.564698" />
|
|
||||||
</sodipodi:namedview>
|
|
||||||
<metadata
|
|
||||||
id="metadata5">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title></dc:title>
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
id="layer1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
inkscape:label="图层 1">
|
|
||||||
<ellipse
|
|
||||||
ry="8.9158831"
|
|
||||||
rx="8.6764698"
|
|
||||||
cy="9.915391"
|
|
||||||
cx="9.9368067"
|
|
||||||
id="path849"
|
|
||||||
style="opacity:1;fill:#000000;fill-opacity:0.15678;stroke:#ffffff;stroke-width:0.396875;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
|
||||||
<path
|
|
||||||
id="path867"
|
|
||||||
d="M 11.494016,6.9255115 8.4955849,9.9239423 11.494016,12.91402"
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.396875;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
@@ -1,70 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="32"
|
|
||||||
height="32"
|
|
||||||
viewBox="0 0 8.4666665 8.4666669"
|
|
||||||
version="1.1"
|
|
||||||
id="svg8"
|
|
||||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
|
||||||
sodipodi:docname="object-rorate-right.svg">
|
|
||||||
<defs
|
|
||||||
id="defs2" />
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#000000"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:pageopacity="0.69803922"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="22.4"
|
|
||||||
inkscape:cx="13.471207"
|
|
||||||
inkscape:cy="14.931415"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
showgrid="false"
|
|
||||||
units="px"
|
|
||||||
inkscape:pagecheckerboard="true"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:window-height="1001"
|
|
||||||
inkscape:window-x="-9"
|
|
||||||
inkscape:window-y="-9"
|
|
||||||
inkscape:window-maximized="1" />
|
|
||||||
<metadata
|
|
||||||
id="metadata5">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title></dc:title>
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="Layer 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1"
|
|
||||||
transform="translate(0,-288.5333)">
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
||||||
d="m 6.2474252,294.57784 c -1.6704347,1.43657 -3.1237125,0.51783 -3.1237125,0.51783 -0.650925,-0.38244 -0.9769945,-1.03846 -1.0690781,-1.42823 -0.032148,-0.5952 -0.1092884,-1.34357 0.3591432,-1.95439 0.5186761,-0.51984 0.9614825,-0.84964 1.4783346,-0.9271 l 1.302939,-0.0167"
|
|
||||||
id="path21"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
sodipodi:nodetypes="cccccc" />
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
||||||
d="m 4.5352297,289.82545 c 0.6598217,0.9438 0.6598217,0.9438 0.6598217,0.9438 l -0.626413,0.94379 -0.033409,0.0334"
|
|
||||||
id="path25"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
@@ -1,87 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="32"
|
|
||||||
height="32"
|
|
||||||
viewBox="0 0 8.4666665 8.4666669"
|
|
||||||
version="1.1"
|
|
||||||
id="svg8"
|
|
||||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
|
||||||
sodipodi:docname="view-background-checkerboard.svg">
|
|
||||||
<defs
|
|
||||||
id="defs2" />
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#000000"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:pageopacity="0.69803922"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="44.8"
|
|
||||||
inkscape:cx="14.891202"
|
|
||||||
inkscape:cy="11.596232"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
showgrid="false"
|
|
||||||
units="px"
|
|
||||||
inkscape:pagecheckerboard="true"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:window-height="1001"
|
|
||||||
inkscape:window-x="-9"
|
|
||||||
inkscape:window-y="-9"
|
|
||||||
inkscape:window-maximized="1" />
|
|
||||||
<metadata
|
|
||||||
id="metadata5">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title />
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="Layer 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1"
|
|
||||||
transform="translate(0,-288.5333)">
|
|
||||||
<rect
|
|
||||||
style="fill:#ffffff;fill-opacity:0.87058824;stroke:none;stroke-width:0.37041664;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="rect814"
|
|
||||||
width="2.7434142"
|
|
||||||
height="2.9153748"
|
|
||||||
x="1.5945871"
|
|
||||||
y="289.86566" />
|
|
||||||
<rect
|
|
||||||
style="fill:#ffffff;fill-opacity:0.87058824;stroke:none;stroke-width:0.37041664;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="rect814-4"
|
|
||||||
width="2.6871748"
|
|
||||||
height="2.9440556"
|
|
||||||
x="4.3380013"
|
|
||||||
y="292.78696" />
|
|
||||||
<rect
|
|
||||||
style="fill:#ffffff;fill-opacity:0.07843137;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="rect814-2"
|
|
||||||
width="2.7455406"
|
|
||||||
height="2.9440758"
|
|
||||||
x="1.5924606"
|
|
||||||
y="292.78696" />
|
|
||||||
<rect
|
|
||||||
style="fill:#ffffff;fill-opacity:0.07843137;stroke:#ffffff;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="rect814-2-6"
|
|
||||||
width="2.6982937"
|
|
||||||
height="2.9440918"
|
|
||||||
x="4.3380013"
|
|
||||||
y="289.83694" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.7 KiB |
@@ -1,86 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="32"
|
|
||||||
height="32"
|
|
||||||
viewBox="0 0 8.4666665 8.4666669"
|
|
||||||
version="1.1"
|
|
||||||
id="svg8"
|
|
||||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
|
||||||
sodipodi:docname="view-fullscreen-a.svg">
|
|
||||||
<defs
|
|
||||||
id="defs2" />
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#000000"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:pageopacity="0.69803922"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="22.4"
|
|
||||||
inkscape:cx="6.127457"
|
|
||||||
inkscape:cy="14.931415"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
showgrid="false"
|
|
||||||
units="px"
|
|
||||||
inkscape:pagecheckerboard="true"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:window-height="1001"
|
|
||||||
inkscape:window-x="-9"
|
|
||||||
inkscape:window-y="-9"
|
|
||||||
inkscape:window-maximized="1" />
|
|
||||||
<metadata
|
|
||||||
id="metadata5">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title />
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="Layer 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1"
|
|
||||||
transform="translate(0,-288.5333)">
|
|
||||||
<rect
|
|
||||||
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.37041667;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="rect835"
|
|
||||||
width="2.4214098"
|
|
||||||
height="1.8308237"
|
|
||||||
x="3.0710566"
|
|
||||||
y="291.59018" />
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
||||||
d="M 1.630022,292.00359 1.615848,290.14918 H 3.6380209"
|
|
||||||
id="path837"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.26531255px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
||||||
d="m 6.9097992,291.96816 0.014252,-1.85441 -2.0333353,0"
|
|
||||||
id="path837-6"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
||||||
d="m 6.9306311,293.21954 0.014174,1.85441 H 4.9226322"
|
|
||||||
id="path837-9"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.26531255px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
||||||
d="m 1.6393869,293.16031 -0.014252,1.85441 h 2.0333353"
|
|
||||||
id="path837-6-4"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.9 KiB |
@@ -1,71 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="32"
|
|
||||||
height="32"
|
|
||||||
viewBox="0 0 8.4666665 8.4666669"
|
|
||||||
version="1.1"
|
|
||||||
id="svg8"
|
|
||||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
|
||||||
sodipodi:docname="window-close.svg">
|
|
||||||
<defs
|
|
||||||
id="defs2" />
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#000000"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:pageopacity="0.69803922"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="22.627417"
|
|
||||||
inkscape:cx="19.29838"
|
|
||||||
inkscape:cy="15.79404"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
showgrid="false"
|
|
||||||
units="px"
|
|
||||||
inkscape:pagecheckerboard="true"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:window-height="1001"
|
|
||||||
inkscape:window-x="-9"
|
|
||||||
inkscape:window-y="-9"
|
|
||||||
inkscape:window-maximized="1" />
|
|
||||||
<metadata
|
|
||||||
id="metadata5">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title />
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="Layer 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1"
|
|
||||||
transform="translate(0,-288.5333)">
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.396875;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
|
||||||
d="m 2.100237,290.55098 4.3234589,4.22265"
|
|
||||||
id="path817"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
sodipodi:nodetypes="cc" />
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.396875;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
|
|
||||||
d="m 2.099406,294.78651 4.3414732,-4.24185"
|
|
||||||
id="path819"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
sodipodi:nodetypes="cc" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
@@ -1,81 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="32"
|
|
||||||
height="32"
|
|
||||||
viewBox="0 0 8.4666665 8.4666669"
|
|
||||||
version="1.1"
|
|
||||||
id="svg8"
|
|
||||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
|
||||||
sodipodi:docname="zoom-in-a.svg">
|
|
||||||
<defs
|
|
||||||
id="defs2" />
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#000000"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:pageopacity="0.69803922"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="16"
|
|
||||||
inkscape:cx="17.492176"
|
|
||||||
inkscape:cy="13.486663"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
showgrid="false"
|
|
||||||
units="px"
|
|
||||||
inkscape:pagecheckerboard="true"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:window-height="1001"
|
|
||||||
inkscape:window-x="-9"
|
|
||||||
inkscape:window-y="-9"
|
|
||||||
inkscape:window-maximized="1" />
|
|
||||||
<metadata
|
|
||||||
id="metadata5">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title />
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="Layer 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1"
|
|
||||||
transform="translate(0,-288.5333)">
|
|
||||||
<circle
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.26458332;stroke-opacity:1"
|
|
||||||
id="path825"
|
|
||||||
cx="3.8955173"
|
|
||||||
cy="292.02957"
|
|
||||||
r="1.9725631" />
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
||||||
d="M 2.8678944,292.07683 H 4.9703868"
|
|
||||||
id="path827"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
||||||
d="m 3.9309524,290.90746 0.035435,2.29149"
|
|
||||||
id="path829"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.5291667;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 5.2066218,293.63598 1.3465403,1.42922 v 0"
|
|
||||||
id="path831"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
sodipodi:nodetypes="ccc" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.6 KiB |
@@ -1,71 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="32"
|
|
||||||
height="32"
|
|
||||||
viewBox="0 0 8.4666665 8.4666669"
|
|
||||||
version="1.1"
|
|
||||||
id="svg8"
|
|
||||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
|
||||||
sodipodi:docname="zoom-original-a.svg">
|
|
||||||
<defs
|
|
||||||
id="defs2" />
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#000000"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:pageopacity="0.69803922"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="15.839192"
|
|
||||||
inkscape:cx="22.610899"
|
|
||||||
inkscape:cy="17.020554"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
showgrid="false"
|
|
||||||
units="px"
|
|
||||||
inkscape:pagecheckerboard="true"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:window-height="1001"
|
|
||||||
inkscape:window-x="-9"
|
|
||||||
inkscape:window-y="-9"
|
|
||||||
inkscape:window-maximized="1" />
|
|
||||||
<metadata
|
|
||||||
id="metadata5">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title />
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="Layer 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1"
|
|
||||||
transform="translate(0,-288.5333)">
|
|
||||||
<text
|
|
||||||
xml:space="preserve"
|
|
||||||
style="font-style:normal;font-weight:normal;font-size:10.30979729px;line-height:6.44362354px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.25774494;"
|
|
||||||
x="1.0365982"
|
|
||||||
y="259.85211"
|
|
||||||
id="text819"
|
|
||||||
transform="scale(0.88039913,1.1358485)"><tspan
|
|
||||||
sodipodi:role="line"
|
|
||||||
id="tspan817"
|
|
||||||
x="1.0365982"
|
|
||||||
y="259.85211"
|
|
||||||
style="font-size:5.84221935px;stroke-width:0.25774494;fill:#ffffff;fill-opacity:1;">1:1</tspan></text>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
@@ -1,76 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
width="32"
|
|
||||||
height="32"
|
|
||||||
viewBox="0 0 8.4666665 8.4666669"
|
|
||||||
version="1.1"
|
|
||||||
id="svg8"
|
|
||||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
|
||||||
sodipodi:docname="zoom-out-a.svg">
|
|
||||||
<defs
|
|
||||||
id="defs2" />
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="base"
|
|
||||||
pagecolor="#000000"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1.0"
|
|
||||||
inkscape:pageopacity="0.69803922"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:zoom="16"
|
|
||||||
inkscape:cx="17.492176"
|
|
||||||
inkscape:cy="13.486663"
|
|
||||||
inkscape:document-units="px"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
showgrid="false"
|
|
||||||
units="px"
|
|
||||||
inkscape:pagecheckerboard="true"
|
|
||||||
inkscape:window-width="1920"
|
|
||||||
inkscape:window-height="1001"
|
|
||||||
inkscape:window-x="-9"
|
|
||||||
inkscape:window-y="-9"
|
|
||||||
inkscape:window-maximized="1" />
|
|
||||||
<metadata
|
|
||||||
id="metadata5">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title></dc:title>
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
inkscape:label="Layer 1"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1"
|
|
||||||
transform="translate(0,-288.5333)">
|
|
||||||
<circle
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.26458332;stroke-opacity:1"
|
|
||||||
id="path825"
|
|
||||||
cx="3.8955173"
|
|
||||||
cy="292.02957"
|
|
||||||
r="1.9725631" />
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
||||||
d="M 2.8678944,292.07683 H 4.9703868"
|
|
||||||
id="path827"
|
|
||||||
inkscape:connector-curvature="0" />
|
|
||||||
<path
|
|
||||||
style="fill:none;stroke:#ffffff;stroke-width:0.5291667;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 5.2066218,293.63598 1.3465403,1.42922 v 0"
|
|
||||||
id="path831"
|
|
||||||
inkscape:connector-curvature="0"
|
|
||||||
sodipodi:nodetypes="ccc" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -1,17 +0,0 @@
|
|||||||
IDI_ICON1 ICON DISCARDABLE "icons/app-icon.ico"
|
|
||||||
1 VERSIONINFO
|
|
||||||
BEGIN
|
|
||||||
BLOCK "StringFileInfo"
|
|
||||||
BEGIN
|
|
||||||
BLOCK "040904E4"
|
|
||||||
BEGIN
|
|
||||||
VALUE "FileDescription", "Pineapple Pictures - Image Viewer"
|
|
||||||
VALUE "LegalCopyright", "MIT/Expat License - Copyright (C) 2020 Gary Wang"
|
|
||||||
VALUE "ProductName", "Pineapple Pictures"
|
|
||||||
END
|
|
||||||
END
|
|
||||||
BLOCK "VarFileInfo"
|
|
||||||
BEGIN
|
|
||||||
VALUE "Translation", 0x409, 1200
|
|
||||||
END
|
|
||||||
END
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<ul>
|
|
||||||
<li><u>French</u>: J. Lavoie, K. Herbert</li>
|
|
||||||
<li><u>German</u>: K. Herbert, J. Lavoie</li>
|
|
||||||
<li><u>Norwegian Bokmål</u>: Allan Nordhøy</li>
|
|
||||||
<li><u>Russian</u>: Artem</li>
|
|
||||||
</ul>
|
|
||||||
@@ -1,15 +1,23 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>icons/zoom-in.svg</file>
|
<!-- In-app icon resources -->
|
||||||
<file>icons/zoom-out.svg</file>
|
<file>icons/app-icon.png</file>
|
||||||
<file>icons/view-fullscreen.svg</file>
|
<file>icons/image-info.png</file>
|
||||||
<file>icons/zoom-original.svg</file>
|
<file>icons/fit-to-screen.png</file>
|
||||||
<file>icons/object-rotate-right.svg</file>
|
<file>icons/fit-to-size.png</file>
|
||||||
<file>icons/view-background-checkerboard.svg</file>
|
<file>icons/zoom-in.png</file>
|
||||||
<file>icons/app-icon.svg</file>
|
<file>icons/zoom-out.png</file>
|
||||||
<file>icons/window-close.svg</file>
|
<file>icons/rotate-left.png</file>
|
||||||
<file>icons/go-next.svg</file>
|
<file>icons/rotate-right.png</file>
|
||||||
<file>icons/go-previous.svg</file>
|
<file>icons/go-next.png</file>
|
||||||
<file>plain/translators.html</file>
|
<file>icons/go-previous.png</file>
|
||||||
|
<file>icons/flip-horizontal.png</file>
|
||||||
|
<file>icons/flip-vertical.png</file>
|
||||||
|
<!-- HTML resources -->
|
||||||
|
<file>htmls/help.html</file>
|
||||||
|
<file>htmls/about.html</file>
|
||||||
|
<file>htmls/special-thanks.html</file>
|
||||||
|
<file>htmls/license.html</file>
|
||||||
|
<file>htmls/third-party-libs.html</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -1,96 +0,0 @@
|
|||||||
#.rst:
|
|
||||||
# FindLibExiv2
|
|
||||||
# ------------
|
|
||||||
#
|
|
||||||
# Try to find the Exiv2 library.
|
|
||||||
#
|
|
||||||
# This will define the following variables:
|
|
||||||
#
|
|
||||||
# ``LibExiv2_FOUND``
|
|
||||||
# True if (the requested version of) Exiv2 is available
|
|
||||||
#
|
|
||||||
# ``LibExiv2_VERSION``
|
|
||||||
# The version of Exiv2
|
|
||||||
#
|
|
||||||
# ``LibExiv2_INCLUDE_DIRS``
|
|
||||||
# The include dirs of Exiv2 for use with target_include_directories()
|
|
||||||
#
|
|
||||||
# ``LibExiv2_LIBRARIES``
|
|
||||||
# The Exiv2 library for use with target_link_libraries().
|
|
||||||
# This can be passed to target_link_libraries() instead of
|
|
||||||
# the ``LibExiv2::LibExiv2`` target
|
|
||||||
#
|
|
||||||
# If ``LibExiv2_FOUND`` is TRUE, it will also define the following imported
|
|
||||||
# target:
|
|
||||||
#
|
|
||||||
# ``LibExiv2::LibExiv2``
|
|
||||||
# The Exiv2 library
|
|
||||||
#
|
|
||||||
# In general we recommend using the imported target, as it is easier to use.
|
|
||||||
# Bear in mind, however, that if the target is in the link interface of an
|
|
||||||
# exported library, it must be made available by the package config file.
|
|
||||||
#
|
|
||||||
# Since 5.53.0.
|
|
||||||
#
|
|
||||||
#=============================================================================
|
|
||||||
# SPDX-FileCopyrightText: 2018 Christophe Giboudeaux <christophe@krop.fr>
|
|
||||||
# SPDX-FileCopyrightText: 2010 Alexander Neundorf <neundorf@kde.org>
|
|
||||||
# SPDX-FileCopyrightText: 2008 Gilles Caulier <caulier.gilles@gmail.com>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
find_package(PkgConfig QUIET)
|
|
||||||
pkg_check_modules(PC_EXIV2 QUIET exiv2)
|
|
||||||
|
|
||||||
find_path(LibExiv2_INCLUDE_DIRS NAMES exiv2/exif.hpp
|
|
||||||
HINTS ${PC_EXIV2_INCLUDEDIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(LibExiv2_LIBRARIES NAMES exiv2 libexiv2
|
|
||||||
HINTS ${PC_EXIV2_LIBRARY_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
set(LibExiv2_VERSION ${PC_EXIV2_VERSION})
|
|
||||||
|
|
||||||
if(NOT LibExiv2_VERSION AND DEFINED LibExiv2_INCLUDE_DIRS)
|
|
||||||
# With exiv >= 0.27, the version #defines are in exv_conf.h instead of version.hpp
|
|
||||||
foreach(_exiv2_version_file "version.hpp" "exv_conf.h")
|
|
||||||
if(EXISTS "${LibExiv2_INCLUDE_DIRS}/exiv2/${_exiv2_version_file}")
|
|
||||||
file(READ "${LibExiv2_INCLUDE_DIRS}/exiv2/${_exiv2_version_file}" _exiv_version_file_content)
|
|
||||||
string(REGEX MATCH "#define EXIV2_MAJOR_VERSION[ ]+\\([0-9]+\\)" EXIV2_MAJOR_VERSION_MATCH ${_exiv_version_file_content})
|
|
||||||
string(REGEX MATCH "#define EXIV2_MINOR_VERSION[ ]+\\([0-9]+\\)" EXIV2_MINOR_VERSION_MATCH ${_exiv_version_file_content})
|
|
||||||
string(REGEX MATCH "#define EXIV2_PATCH_VERSION[ ]+\\([0-9]+\\)" EXIV2_PATCH_VERSION_MATCH ${_exiv_version_file_content})
|
|
||||||
if(EXIV2_MAJOR_VERSION_MATCH)
|
|
||||||
string(REGEX REPLACE ".*_MAJOR_VERSION[ ]+\\((.*)\\)" "\\1" EXIV2_MAJOR_VERSION ${EXIV2_MAJOR_VERSION_MATCH})
|
|
||||||
string(REGEX REPLACE ".*_MINOR_VERSION[ ]+\\((.*)\\)" "\\1" EXIV2_MINOR_VERSION ${EXIV2_MINOR_VERSION_MATCH})
|
|
||||||
string(REGEX REPLACE ".*_PATCH_VERSION[ ]+\\((.*)\\)" "\\1" EXIV2_PATCH_VERSION ${EXIV2_PATCH_VERSION_MATCH})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
set(LibExiv2_VERSION "${EXIV2_MAJOR_VERSION}.${EXIV2_MINOR_VERSION}.${EXIV2_PATCH_VERSION}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
find_package_handle_standard_args(LibExiv2
|
|
||||||
FOUND_VAR LibExiv2_FOUND
|
|
||||||
REQUIRED_VARS LibExiv2_LIBRARIES LibExiv2_INCLUDE_DIRS
|
|
||||||
VERSION_VAR LibExiv2_VERSION
|
|
||||||
)
|
|
||||||
|
|
||||||
mark_as_advanced(LibExiv2_INCLUDE_DIRS LibExiv2_LIBRARIES)
|
|
||||||
|
|
||||||
if(LibExiv2_FOUND AND NOT TARGET LibExiv2::LibExiv2)
|
|
||||||
add_library(LibExiv2::LibExiv2 UNKNOWN IMPORTED)
|
|
||||||
set_target_properties(LibExiv2::LibExiv2 PROPERTIES
|
|
||||||
IMPORTED_LOCATION "${LibExiv2_LIBRARIES}"
|
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${LibExiv2_INCLUDE_DIRS}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(FeatureSummary)
|
|
||||||
set_package_properties(LibExiv2 PROPERTIES
|
|
||||||
URL "https://www.exiv2.org"
|
|
||||||
DESCRIPTION "Image metadata support"
|
|
||||||
)
|
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>English</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||||
|
<key>CFBundleGetInfoString</key>
|
||||||
|
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleLongVersionString</key>
|
||||||
|
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||||
|
<key>CSResourcesFileMapped</key>
|
||||||
|
<true/>
|
||||||
|
<key>NSHumanReadableCopyright</key>
|
||||||
|
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||||
|
<!-- FIXME: this list can't be automatically generated by Qt's CMake API, don't know why. -->
|
||||||
|
<key>CFBundleLocalizations</key>
|
||||||
|
<array>
|
||||||
|
<string>en</string>
|
||||||
|
<string>ca</string>
|
||||||
|
<string>de</string>
|
||||||
|
<string>es</string>
|
||||||
|
<string>fr</string>
|
||||||
|
<string>id</string>
|
||||||
|
<string>it</string>
|
||||||
|
<string>ja</string>
|
||||||
|
<string>ko</string>
|
||||||
|
<string>nb_NO</string>
|
||||||
|
<string>nl</string>
|
||||||
|
<string>pa_PK</string>
|
||||||
|
<string>ru</string>
|
||||||
|
<string>si</string>
|
||||||
|
<string>ta</string>
|
||||||
|
<string>tr</string>
|
||||||
|
<string>uk</string>
|
||||||
|
<string>zh_CN</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleDocumentTypes</key>
|
||||||
|
<array>
|
||||||
|
<!-- JPEG -->
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeName</key>
|
||||||
|
<string>JPEG Image</string>
|
||||||
|
<key>CFBundleTypeExtensions</key>
|
||||||
|
<array>
|
||||||
|
<string>jpg</string>
|
||||||
|
<string>jpeg</string>
|
||||||
|
<string>jfif</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeMIMETypes</key>
|
||||||
|
<array>
|
||||||
|
<string>image/jpeg</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
</dict>
|
||||||
|
<!-- PNG -->
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeName</key>
|
||||||
|
<string>PNG Image</string>
|
||||||
|
<key>CFBundleTypeExtensions</key>
|
||||||
|
<array>
|
||||||
|
<string>png</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeMIMETypes</key>
|
||||||
|
<array>
|
||||||
|
<string>image/png</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
</dict>
|
||||||
|
<!-- WebP -->
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeName</key>
|
||||||
|
<string>WebP Image</string>
|
||||||
|
<key>CFBundleTypeExtensions</key>
|
||||||
|
<array>
|
||||||
|
<string>webp</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeMIMETypes</key>
|
||||||
|
<array>
|
||||||
|
<string>image/webp</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
</dict>
|
||||||
|
<!-- GIF -->
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeName</key>
|
||||||
|
<string>GIF Image</string>
|
||||||
|
<key>CFBundleTypeExtensions</key>
|
||||||
|
<array>
|
||||||
|
<string>gif</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeMIMETypes</key>
|
||||||
|
<array>
|
||||||
|
<string>image/gif</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
</dict>
|
||||||
|
<!-- SVG -->
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeName</key>
|
||||||
|
<string>SVG Image</string>
|
||||||
|
<key>CFBundleTypeExtensions</key>
|
||||||
|
<array>
|
||||||
|
<string>svg</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeMIMETypes</key>
|
||||||
|
<array>
|
||||||
|
<string>image/svg+xml</string>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<component type="desktop-application">
|
|
||||||
<id>net.blumia.pineapple-pictures</id>
|
|
||||||
<metadata_license>CC0-1.0</metadata_license>
|
|
||||||
<project_license>MIT</project_license>
|
|
||||||
<name>Pineapple Pictures</name>
|
|
||||||
<name xml:lang="zh-CN">菠萝看图</name>
|
|
||||||
<summary>Image Viewer</summary>
|
|
||||||
<summary xml:lang="zh-CN">图像查看器</summary>
|
|
||||||
<description>
|
|
||||||
<p>Pineapple Pictures is a lightweight and easy to use image viewer, comes with a handy navigation thumbnail when zoom-in, and doesn't contains any image management support.</p>
|
|
||||||
<p xml:lang="zh-CN">菠萝看图是一个轻量级易用的图像查看器,在图片放大时提供了方便的鸟瞰导航功能,且不包含任何图片管理功能。</p>
|
|
||||||
</description>
|
|
||||||
<url type="homepage">https://github.com/BLumia/pineapple-pictures</url>
|
|
||||||
<url type="bugtracker">https://github.com/BLumia/pineapple-pictures/issues</url>
|
|
||||||
<provides>
|
|
||||||
<binary>ppic</binary>
|
|
||||||
</provides>
|
|
||||||
</component>
|
|
||||||
@@ -0,0 +1,430 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<component type="desktop-application">
|
||||||
|
<id>net.blumia.pineapple-pictures</id>
|
||||||
|
<name>Pineapple Pictures</name>
|
||||||
|
<name xml:lang="es">Pineapple Pictures</name>
|
||||||
|
<name xml:lang="ja">Pineapple Pictures</name>
|
||||||
|
<name xml:lang="ko">Pineapple Pictures</name>
|
||||||
|
<name xml:lang="nl">Pineapple Afbeeldingen</name>
|
||||||
|
<name xml:lang="ru">Pineapple Pictures</name>
|
||||||
|
<name xml:lang="sl">Pineapple Slike</name>
|
||||||
|
<name xml:lang="ta">அன்னாசி படங்கள்</name>
|
||||||
|
<name xml:lang="tr">Pineapple Resimler</name>
|
||||||
|
<name xml:lang="uk">Pineapple Pictures</name>
|
||||||
|
<name xml:lang="vi">Pineapple Pictures</name>
|
||||||
|
<name xml:lang="zh-CN">菠萝看图</name>
|
||||||
|
<summary>Image Viewer</summary>
|
||||||
|
<summary xml:lang="es">Visor de imágenes</summary>
|
||||||
|
<summary xml:lang="ja">画像ビューアー</summary>
|
||||||
|
<summary xml:lang="ko">이미지 뷰어</summary>
|
||||||
|
<summary xml:lang="nl">Afbeeldingsweergave</summary>
|
||||||
|
<summary xml:lang="ru">Просмотр изображений</summary>
|
||||||
|
<summary xml:lang="sl">Pregledovalnik slik</summary>
|
||||||
|
<summary xml:lang="ta">பட பார்வையாளர்</summary>
|
||||||
|
<summary xml:lang="tr">Resim Görüntüleyici</summary>
|
||||||
|
<summary xml:lang="uk">Переглядач зображень</summary>
|
||||||
|
<summary xml:lang="vi">Trình xem ảnh</summary>
|
||||||
|
<summary xml:lang="zh-CN">图像查看器</summary>
|
||||||
|
<metadata_license>CC0-1.0</metadata_license>
|
||||||
|
<project_license>MIT</project_license>
|
||||||
|
<description>
|
||||||
|
<p>Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support.</p>
|
||||||
|
<p xml:lang="es">Pineapple Pictures es un visor de imágenes ligero y fácil de usar que viene con una práctica miniatura de navegación al hacer zoom, y no contiene ningún soporte de gestión de imágenes.</p>
|
||||||
|
<p xml:lang="ja">Pineapple Picturesは、ズームイン時に便利なナビゲーションサムネイルを備えた軽量で使いやすい画像ビューアです。画像管理のサポートは含まれていません。</p>
|
||||||
|
<p xml:lang="ko">Pineapple Pictures는 가볍고 사용하기 쉬운 이미지 뷰어로, 확대 시 편리한 내비게이션 썸네일과 함께 제공되며 이미지 관리 지원이 포함되어 있지 않습니다.</p>
|
||||||
|
<p xml:lang="nl">Pineapple Afbeeldingen is een licht en eenvoudig te gebruiken afbeeldingsweergaveprogramma met miniatuurnavigatie na inzoomen. Het programma heeft echter geen fotobeheermogelijkheid.</p>
|
||||||
|
<p xml:lang="ru">Pineapple Pictures - это легкий и простой в использовании просмотрщик изображений, оснащенный удобной навигацией по миниатюрам при увеличении масштаба и не содержащий никакой поддержки управления изображениями.</p>
|
||||||
|
<p xml:lang="sl">Pineapple Pictures je lahek in enostaven pregledovalnik slik, ki ima pri povečavi priročno sličico za navigacijo in ne vsebuje nobene podpore za upravljanje slik.</p>
|
||||||
|
<p xml:lang="ta">அன்னாசி படங்கள் ஒரு இலகுரக மற்றும் பயன்படுத்த எளிதான பட பார்வையாளராகும், இது பெரிதாக்கும்போது ஒரு எளிமையான வழிசெலுத்தல் சிறுபடத்துடன் வருகிறது, மேலும் எந்த பட மேலாண்மை ஆதரவையும் கொண்டிருக்கவில்லை.</p>
|
||||||
|
<p xml:lang="uk">Pineapple Pictures – це легкий і простий у використанні переглядач зображень, який постачається зі зручною навігаційною мініатюрою при збільшенні масштабу і не містить жодної підтримки керування зображеннями.</p>
|
||||||
|
<p xml:lang="vi">Pineapple Pictures là trình xem hình ảnh nhẹ và dễ sử dụng, đi kèm với hình thu nhỏ điều hướng tiện dụng khi phóng to và không chứa bất kỳ hỗ trợ quản lý hình ảnh nào.</p>
|
||||||
|
<p xml:lang="zh-CN">菠萝看图是一个轻量级易用的图像查看器,在图片放大时提供了方便的鸟瞰导航功能,且不包含任何图片管理功能。</p>
|
||||||
|
</description>
|
||||||
|
<developer id="net.blumia">
|
||||||
|
<name>Gary (BLumia) Wang et al.</name>
|
||||||
|
<name xml:lang="ja">Gary (BLumia) Wang など</name>
|
||||||
|
<name xml:lang="nl">Gary (BLumia) Wang e.a.</name>
|
||||||
|
<name xml:lang="ru">Gary (BLumia) Wang et al.</name>
|
||||||
|
<name xml:lang="uk">Gary (BLumia) Wang.</name>
|
||||||
|
<name xml:lang="zh-CN">Gary (BLumia) Wang 等人</name>
|
||||||
|
</developer>
|
||||||
|
<launchable type="desktop-id">net.blumia.pineapple-pictures.desktop</launchable>
|
||||||
|
<url type="homepage">https://github.com/BLumia/pineapple-pictures</url>
|
||||||
|
<url type="bugtracker">https://github.com/BLumia/pineapple-pictures/issues</url>
|
||||||
|
<url type="donation">https://ko-fi.com/blumia</url>
|
||||||
|
<url type="translate">https://hosted.weblate.org/projects/pineapple-pictures/</url>
|
||||||
|
<url type="vcs-browser">https://github.com/BLumia/pineapple-pictures</url>
|
||||||
|
<provides>
|
||||||
|
<binary>ppic</binary>
|
||||||
|
</provides>
|
||||||
|
<screenshots>
|
||||||
|
<screenshot type="default">
|
||||||
|
<caption>Main window when an image file is loaded</caption>
|
||||||
|
<caption xml:lang="es">Ventana principal cuando se carga un archivo de imagen</caption>
|
||||||
|
<caption xml:lang="ja">画像ファイル読み込み時のメインウィンドウ</caption>
|
||||||
|
<caption xml:lang="ko">이미지 파일이 로드될 때 기본 창</caption>
|
||||||
|
<caption xml:lang="nl">Hoofdvenster na het laden van een afbeelding</caption>
|
||||||
|
<caption xml:lang="ru">Основное окно после загрузки файла изображения</caption>
|
||||||
|
<caption xml:lang="sl">Glavno okno ob nalaganju slikovne datoteke</caption>
|
||||||
|
<caption xml:lang="ta">ஒரு படக் கோப்பு ஏற்றப்படும் போது முதன்மையான சாளரம்</caption>
|
||||||
|
<caption xml:lang="uk">Головне вікно після завантаження файлу зображення</caption>
|
||||||
|
<caption xml:lang="vi">Cửa sổ chính khi tải tệp hình ảnh</caption>
|
||||||
|
<caption xml:lang="zh-CN">加载图片后的主窗口</caption>
|
||||||
|
<image type="source" width="1503" height="640">https://pineapple-pictures.sourceforge.io/ppic-gui-static.png</image>
|
||||||
|
</screenshot>
|
||||||
|
<screenshot>
|
||||||
|
<caption>Zooming in a raster image</caption>
|
||||||
|
<caption xml:lang="es">Ampliar una imagen rasterizada</caption>
|
||||||
|
<caption xml:lang="ja">ラスター画像の拡大</caption>
|
||||||
|
<caption xml:lang="ko">래스터 이미지 확대하기</caption>
|
||||||
|
<caption xml:lang="nl">Inzoomen op een roosterafbeelding</caption>
|
||||||
|
<caption xml:lang="ru">Масштабирование растрового изображения</caption>
|
||||||
|
<caption xml:lang="sl">Povečevanje rastrske slike</caption>
|
||||||
|
<caption xml:lang="ta">ராச்டர் படத்தில் பெரிதாக்குதல்</caption>
|
||||||
|
<caption xml:lang="uk">Масштабування растрового зображення</caption>
|
||||||
|
<caption xml:lang="vi">Phóng to hình ảnh raster</caption>
|
||||||
|
<caption xml:lang="zh-CN">放大浏览位图</caption>
|
||||||
|
<image type="source" width="771" height="553">https://pineapple-pictures.sourceforge.io/ppic-zoom-raster.png</image>
|
||||||
|
</screenshot>
|
||||||
|
<screenshot>
|
||||||
|
<caption>Zooming in a vector image</caption>
|
||||||
|
<caption xml:lang="es">Ampliar una imagen vectorial</caption>
|
||||||
|
<caption xml:lang="ja">ベクター画像の拡大</caption>
|
||||||
|
<caption xml:lang="ko">벡터 이미지 확대하기</caption>
|
||||||
|
<caption xml:lang="nl">Inzoomen op een vectorafbeelding</caption>
|
||||||
|
<caption xml:lang="ru">Масштабирование векторного изображения</caption>
|
||||||
|
<caption xml:lang="sl">Povečevanje vektorske slike</caption>
|
||||||
|
<caption xml:lang="ta">ஒரு திசையன் படத்தில் பெரிதாக்குதல்</caption>
|
||||||
|
<caption xml:lang="uk">Масштабування векторного зображення</caption>
|
||||||
|
<caption xml:lang="vi">Phóng to hình ảnh vector</caption>
|
||||||
|
<caption xml:lang="zh-CN">放大浏览矢量图</caption>
|
||||||
|
<image type="source" width="771" height="553">https://pineapple-pictures.sourceforge.io/ppic-zoom-svg.png</image>
|
||||||
|
</screenshot>
|
||||||
|
</screenshots>
|
||||||
|
<releases>
|
||||||
|
<release type="stable" version="1.6.0" date="2026-08-22T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following features:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Allow dragging window from titlebar to move window when maximized</li>
|
||||||
|
<li>Add an option to show/hide bird-eye view</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release fixes the following bugs:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Maximize the window when the image size matches the screen size</li>
|
||||||
|
<li>Fix window might stuck when drag move on some ill-formed window manager</li>
|
||||||
|
<li>Make titlebar respect RTL layout</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release includes the following changes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Update translations</li>
|
||||||
|
<li>Update Qt version to 6.11.2 for Windows and macOS pre-built binaries</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>Tech-Tac, Heimen Stoffels (vistaus), VenusGirl, Oğuz Ersen</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="1.5.0" date="2026-07-04T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following features:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Introduced an optional titlebar that display file name and allows drag and double-click to move and toggle maximize state</li>
|
||||||
|
<li>Windows: Now the application will use the system's built-in animation for open window animation</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release fixes the following bug:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Show empty url list should also reset window title to blank</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release includes the following changes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Update translations</li>
|
||||||
|
<li>Add vcs-browser link to AppStream metadata</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>Heimen Stoffels (vistaus), VenusGirl (VenusGirl)</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="1.4.1" date="2026-04-05T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release includes the following changes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Update translations</li>
|
||||||
|
<li>Update Qt version to 6.10.3 for Windows and macOS pre-built binaries</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>Heimen Stoffels (vistaus), Loc Huynh (hthienloc)</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="1.4.0" date="2026-02-11T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following features:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Action to save image as new file with different format</li>
|
||||||
|
<li>Add Vietnamese and Slovenian translation</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release includes the following changes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Update copyright year to 2026</li>
|
||||||
|
<li>Update translations</li>
|
||||||
|
<li>Update Qt version to 6.10.2 for Windows and macOS pre-built binaries</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>Loc Huynh, Sabri Ünal, VenusGirl, Andrej Poženel, Andrey</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="1.3.0" date="2025-12-20T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following features:</p>
|
||||||
|
<ul>
|
||||||
|
<li>New option to limit SVG support to SVG Tiny 1.2 standard</li>
|
||||||
|
<li>Windows: ship tools and configurations that help user associate image files to this program</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release fixes the following bugs:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Fix window not appear at the screen that the mouse cursor is at</li>
|
||||||
|
<li>Fix Windows prebuilt binary having AVIF plugin included but not actually support it</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release includes the following changes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>CPack DEB: will now recommend "kimageformat6-plugins" instead of the KF5 version</li>
|
||||||
|
<li>Update translations</li>
|
||||||
|
<li>Update exiv2 version for Windows binary build</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>VenusGirl, Andrey</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="1.2.1" date="2025-11-22T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release fixes the following bug:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Fix incorrect color when display some CMYK images.</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release includes the following changes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Now use Qt 6.10.1 for pre-built binary</li>
|
||||||
|
<li>Update README description and AppStream metainfo</li>
|
||||||
|
<li>Update translations</li>
|
||||||
|
<li>Update libavif, AOM and expat version for Windows binary build</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>albanobattistella</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="1.2.0" date="2025-09-21T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following features:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Long image mode that detect extra wide image and auto fit by its thin side</li>
|
||||||
|
<li>Windows: Add product version to binary metadata / resource file</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release includes the following changes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Update translations</li>
|
||||||
|
<li>Update libavif version for Windows binary build</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>Heimen Stoffels, albanobattistella, Sabri Ünal</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="1.1.1" date="2025-08-02T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following feature:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Click dock icon should show window when it's hidden on macOS</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release fixes the following bug:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Ensure "Fit by Width" position the view to the beginning of the image</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release includes the following changes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Update translations</li>
|
||||||
|
<li>Update Exiv2 version for Windows binary build</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>Heimen Stoffels, VenusGirl, தமிழ்நேரம்</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="1.1.0" date="2025-07-06T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following features:</p>
|
||||||
|
<ul>
|
||||||
|
<li>New option to disable built-in close window animation</li>
|
||||||
|
<li>New option to disable gallery looping</li>
|
||||||
|
<li>Support load m3u8 as image gallery playlist</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release includes the following change:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Drop Qt 5 support</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>Heimen Stoffels, albanobattistella, தமிழ்நேரம்</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="1.0.0" date="2025-05-03T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following features:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Support enforces windowed mode on start-up</li>
|
||||||
|
<li>Reload image automatically when current image gets updated</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release fixes the following bug:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Display correct text language on macOS</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release includes the following changes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Use native text for shortcut editor's label</li>
|
||||||
|
<li>Display native commandline message when possible</li>
|
||||||
|
<li>Merge Qt translations into app applications as well</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>Heimen Stoffels, albanobattistella, mmahhi</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="0.9.2" date="2025-03-05T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release fixes the following bug:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Refer to the right exiv2 CMake module so it can be found on Linux</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release includes the following changes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Convert DEP5 to REUSE.toml for better REUSE compliance</li>
|
||||||
|
<li>Update translations</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>Pino Toscano, TamilNeram</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="0.9.1" date="2025-01-25T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following features:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Option to double-click to fullscreen</li>
|
||||||
|
<li>Build-time option to embed translation resources</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release fixes the following bugs:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Fix window size not adjusted when open file on macOS</li>
|
||||||
|
<li>Should center window according to available screen geometry</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release includes the following changes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Change close window bahavior on macOS</li>
|
||||||
|
<li>Update translations</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>albanobattistella, Sabri Ünal</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="0.9.0" date="2024-12-08T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following features:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Support custom shortcuts for existing actions</li>
|
||||||
|
<li>Actions for frame-by-frame animated image playback support</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release includes the following changes:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Initial macOS bundle support</li>
|
||||||
|
<li>bump minimum required CMake version to 3.16</li>
|
||||||
|
<li>Update translations</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>albanobattistella, VenusGirl, gallegonovato, Sabri Ünal</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="0.8.2.1" date="2024-10-27T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release fixes the following bug:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Cannot load translations caused by a change in 0.8.2</li>
|
||||||
|
</ul>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="0.8.2" date="2024-10-26T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following feature:</p>
|
||||||
|
<ul>
|
||||||
|
<li>New option to allow use light-color checkerboard by default</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>albanobattistella, mmahhi, gallegonovato</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="0.8.1" date="2024-08-25T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following feature:</p>
|
||||||
|
<ul>
|
||||||
|
<li>New command line option to list all supported formats</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>albanobattistella, mmahhi, ovl-1, gallegonovato, Oğuz Ersen</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="0.8.0" date="2024-06-29T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following feature:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Support move image file to trash</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>albanobattistella, mmahhi, gallegonovato, Oğuz Ersen</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="0.7.4" date="2024-04-04T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following feature:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Add some icons for corresponding menu actions</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>Reza Almanda, mmahhi, Oğuz Ersen, volkov, Сергій</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="0.7.3" date="2023-10-24T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following feature:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Add "Keep transformation" to menu</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>mmahhi, VenusGirl, albanobattistella, gallegonovato, Heimen Stoffels</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="0.7.2" date="2023-08-27T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following feature:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Add an option in setting dialog to tweak the High-DPI scaling rounding policy (might only works in Qt 6 build)</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release fixes the following bugs:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Remove image size limit for Qt 6 build</li>
|
||||||
|
<li>Fix application icon install location under Linux</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>Heimen Stoffels, Andrey, Dan, gallegonovato, albanobattistella, Sabri Ünal</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
<release type="stable" version="0.7.1" date="2023-07-08T00:00:00Z">
|
||||||
|
<description>
|
||||||
|
<p>This release adds the following features:</p>
|
||||||
|
<ul>
|
||||||
|
<li>TIF and TIFF format files in the same folder will now be automatically added to the gallery</li>
|
||||||
|
<li>Built-in window resizing now also supports Linux desktop. (macOS might also works as well)</li>
|
||||||
|
</ul>
|
||||||
|
<p>This release fixes the following bugs:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Settings dialog will automatedly use a suitable size instead of a hard-coded one</li>
|
||||||
|
<li>Fix default configuration file location under Linux. (was `~/.config/config.ini`, now it's `~/.config/Pineapple Pictures/config.ini`)</li>
|
||||||
|
</ul>
|
||||||
|
<p>With contributions from:</p>
|
||||||
|
<p>yyc12345</p>
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
|
</releases>
|
||||||
|
<content_rating type="oars-1.1"/>
|
||||||
|
</component>
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: Automatically generated\n"
|
||||||
|
"Language-Team: none\n"
|
||||||
|
"Language: ca\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||||
|
|
||||||
|
#. (itstool) path: component/name
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:7
|
||||||
|
msgid "Pineapple Pictures"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: component/summary
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:9
|
||||||
|
msgid "Image Viewer"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: description/p
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:12
|
||||||
|
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:17
|
||||||
|
msgid "Main window when an image file is loaded"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:22
|
||||||
|
msgid "Zooming in a raster image"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:27
|
||||||
|
msgid "Zooming in a vector image"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: component/developer_name
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:34
|
||||||
|
msgid "Gary (BLumia) Wang et al."
|
||||||
|
msgstr ""
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: Automatically generated\n"
|
||||||
|
"Language-Team: none\n"
|
||||||
|
"Language: de\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||||
|
|
||||||
|
#. (itstool) path: component/name
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:7
|
||||||
|
msgid "Pineapple Pictures"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: component/summary
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:9
|
||||||
|
msgid "Image Viewer"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: description/p
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:12
|
||||||
|
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:17
|
||||||
|
msgid "Main window when an image file is loaded"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:22
|
||||||
|
msgid "Zooming in a raster image"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:27
|
||||||
|
msgid "Zooming in a vector image"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: component/developer_name
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:34
|
||||||
|
msgid "Gary (BLumia) Wang et al."
|
||||||
|
msgstr ""
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
|
||||||
|
"PO-Revision-Date: 2024-04-19 17:07+0000\n"
|
||||||
|
"Last-Translator: gallegonovato <fran-carro@hotmail.es>\n"
|
||||||
|
"Language-Team: Spanish <https://hosted.weblate.org/projects/pineapple-"
|
||||||
|
"pictures/appstream-metadata/es/>\n"
|
||||||
|
"Language: es\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||||
|
"X-Generator: Weblate 5.5-dev\n"
|
||||||
|
|
||||||
|
#. (itstool) path: component/name
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:7
|
||||||
|
msgid "Pineapple Pictures"
|
||||||
|
msgstr "Pineapple Pictures"
|
||||||
|
|
||||||
|
#. (itstool) path: component/summary
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:9
|
||||||
|
msgid "Image Viewer"
|
||||||
|
msgstr "Visor de imágenes"
|
||||||
|
|
||||||
|
#. (itstool) path: description/p
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:12
|
||||||
|
msgid ""
|
||||||
|
"Pineapple Pictures is a lightweight and easy-to-use image viewer that comes "
|
||||||
|
"with a handy navigation thumbnail when zoom-in, and doesn't contain any "
|
||||||
|
"image management support."
|
||||||
|
msgstr ""
|
||||||
|
"Pineapple Pictures es un visor de imágenes ligero y fácil de usar que viene "
|
||||||
|
"con una práctica miniatura de navegación al hacer zoom, y no contiene ningún "
|
||||||
|
"soporte de gestión de imágenes."
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:17
|
||||||
|
msgid "Main window when an image file is loaded"
|
||||||
|
msgstr "Ventana principal cuando se carga un archivo de imagen"
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:22
|
||||||
|
msgid "Zooming in a raster image"
|
||||||
|
msgstr "Ampliar una imagen rasterizada"
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:27
|
||||||
|
msgid "Zooming in a vector image"
|
||||||
|
msgstr "Ampliar una imagen vectorial"
|
||||||
|
|
||||||
|
#. (itstool) path: component/developer_name
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:34
|
||||||
|
msgid "Gary (BLumia) Wang et al."
|
||||||
|
msgstr "Gary (BLumia) Wang et al."
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: Automatically generated\n"
|
||||||
|
"Language-Team: none\n"
|
||||||
|
"Language: fr\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||||
|
|
||||||
|
#. (itstool) path: component/name
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:7
|
||||||
|
msgid "Pineapple Pictures"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: component/summary
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:9
|
||||||
|
msgid "Image Viewer"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: description/p
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:12
|
||||||
|
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:17
|
||||||
|
msgid "Main window when an image file is loaded"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:22
|
||||||
|
msgid "Zooming in a raster image"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:27
|
||||||
|
msgid "Zooming in a vector image"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: component/developer_name
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:34
|
||||||
|
msgid "Gary (BLumia) Wang et al."
|
||||||
|
msgstr ""
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"POT-Creation-Date: 2023-08-22 18:49中国标准时间\n"
|
||||||
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: Automatically generated\n"
|
||||||
|
"Language-Team: none\n"
|
||||||
|
"Language: id\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
|
|
||||||
|
#. (itstool) path: component/name
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:7
|
||||||
|
msgid "Pineapple Pictures"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: component/summary
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:9
|
||||||
|
msgid "Image Viewer"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: description/p
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:12
|
||||||
|
msgid "Pineapple Pictures is a lightweight and easy-to-use image viewer that comes with a handy navigation thumbnail when zoom-in, and doesn't contain any image management support."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:17
|
||||||
|
msgid "Main window when an image file is loaded"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:22
|
||||||
|
msgid "Zooming in a raster image"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: screenshot/caption
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:27
|
||||||
|
msgid "Zooming in a vector image"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. (itstool) path: component/developer_name
|
||||||
|
#: net.blumia.pineapple-pictures.metainfo.xml:34
|
||||||
|
msgid "Gary (BLumia) Wang et al."
|
||||||
|
msgstr ""
|
||||||