Compare commits
552 Commits
v1.0.2.0
...
v1.0.128.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
baab2bcc7a | ||
|
|
9a3e4adc0c | ||
|
|
8d909da139 | ||
|
|
d97f5fec37 | ||
|
|
9a12b06b7e | ||
|
|
3fca90ca72 | ||
|
|
220e940bbb | ||
|
|
dc627bd1ef | ||
|
|
3c852a9d2f | ||
|
|
ecff788c6c | ||
|
|
c471f128c1 | ||
|
|
4a389d5e33 | ||
|
|
ae1fa1c54d | ||
|
|
738a4a0bec | ||
|
|
37ae278a11 | ||
|
|
45094bde31 | ||
|
|
81b6ebbdf6 | ||
|
|
8cb8a026ad | ||
|
|
4eeaf9aeec | ||
|
|
f7f5e127a0 | ||
|
|
b44a29997b | ||
|
|
f19888223e | ||
|
|
a612e9c6cb | ||
|
|
e6a035f8e1 | ||
|
|
d7c56e6b42 | ||
|
|
54ec48e365 | ||
|
|
35fa2b6b57 | ||
|
|
4926fe55a3 | ||
|
|
008c80c886 | ||
|
|
7b2abfbe15 | ||
|
|
f81a661a0b | ||
|
|
31f6ce704d | ||
|
|
44a1f0a809 | ||
|
|
607cbbe908 | ||
|
|
e237be5d8a | ||
|
|
253336903d | ||
|
|
580c16155a | ||
|
|
8ab483d244 | ||
|
|
6820e59597 | ||
|
|
c7b0d409ad | ||
|
|
6c942657fc | ||
|
|
8288d62af2 | ||
|
|
bd82deb5ae | ||
|
|
5093939bff | ||
|
|
340a41f920 | ||
|
|
3580f2eb0e | ||
|
|
2e792b50b2 | ||
|
|
7a063a1192 | ||
|
|
8485990250 | ||
|
|
fb16874d60 | ||
|
|
87afdf539a | ||
|
|
ce9cb23d6f | ||
|
|
27629a298b | ||
|
|
0d051669fc | ||
|
|
a19a97345c | ||
|
|
8f12c27d2a | ||
|
|
92f2f20957 | ||
|
|
272802214b | ||
|
|
7f8455b14e | ||
|
|
ad421a5541 | ||
|
|
1eb1d2d72b | ||
|
|
252b7e4b25 | ||
|
|
bebcfa7819 | ||
|
|
073ddfcaee | ||
|
|
1775d947f9 | ||
|
|
a5d1831717 | ||
|
|
d4a924accf | ||
|
|
5d65314522 | ||
|
|
0684069e52 | ||
|
|
fea617ff98 | ||
|
|
4b33776340 | ||
|
|
ea73d7ed3b | ||
|
|
b8fd51cbe8 | ||
|
|
004079a7ee | ||
|
|
30d1ccf67f | ||
|
|
a24885c277 | ||
|
|
a207224bbf | ||
|
|
2c80e0815a | ||
|
|
7f65b4addb | ||
|
|
210df4dd61 | ||
|
|
3c82908890 | ||
|
|
597cc1ec9b | ||
|
|
e354e29ec1 | ||
|
|
dd5fb91764 | ||
|
|
041459e564 | ||
|
|
7de813b645 | ||
|
|
838d663834 | ||
|
|
9add190383 | ||
|
|
fa58360884 | ||
|
|
4dd032655c | ||
|
|
80984218ec | ||
|
|
df45026638 | ||
|
|
aafc5c9fb5 | ||
|
|
c5fccfbb63 | ||
|
|
42f03b4291 | ||
|
|
3339bb0d41 | ||
|
|
7d60f29845 | ||
|
|
bd7e93f3e6 | ||
|
|
c37c6ab489 | ||
|
|
125794c44f | ||
|
|
f5bdb3a431 | ||
|
|
e15699bb11 | ||
|
|
780cd302f0 | ||
|
|
345949f536 | ||
|
|
8dd178991a | ||
|
|
834d0bf5cc | ||
|
|
6d6ecb39b6 | ||
|
|
7db7c68acc | ||
|
|
7fea4ac900 | ||
|
|
3783227f43 | ||
|
|
222c1d9aa1 | ||
|
|
4e668c9890 | ||
|
|
a823901b13 | ||
|
|
2f9b3df92c | ||
|
|
5f65021400 | ||
|
|
c28866fdbe | ||
|
|
fc606f9d30 | ||
|
|
e5d33177d4 | ||
|
|
ab029c9da3 | ||
|
|
a28eef85a5 | ||
|
|
9905d7642c | ||
|
|
02341ecc4a | ||
|
|
13802e7d16 | ||
|
|
d25920c697 | ||
|
|
639c4171dd | ||
|
|
95a1d65c50 | ||
|
|
feb4f47db9 | ||
|
|
81f2c4e34a | ||
|
|
48176cce0f | ||
|
|
77d41c4813 | ||
|
|
8d1be745ac | ||
|
|
978702b6ae | ||
|
|
0e1f487ac1 | ||
|
|
3c8775d2cd | ||
|
|
7c39214f2d | ||
|
|
b7952f5eef | ||
|
|
8c0d3667e4 | ||
|
|
e1f900a9e6 | ||
|
|
212c1fbcdd | ||
|
|
2cb04fa1b7 | ||
|
|
8ab3a53a38 | ||
|
|
3b4d5b9668 | ||
|
|
2409165b91 | ||
|
|
fe1eb2882e | ||
|
|
51dd58fc74 | ||
|
|
0f5f663b32 | ||
|
|
4815c32dba | ||
|
|
3f5a0a0d73 | ||
|
|
1b34b28fbe | ||
|
|
fe4d67c1f1 | ||
|
|
1ae00257a1 | ||
|
|
814de1a4a5 | ||
|
|
28b568e7a4 | ||
|
|
786d23b320 | ||
|
|
a394527f80 | ||
|
|
80422376c3 | ||
|
|
5114c83843 | ||
|
|
835e0d34fc | ||
|
|
7ab833a53a | ||
|
|
d348a30237 | ||
|
|
d0b626c508 | ||
|
|
9debdc76f9 | ||
|
|
67a45e90fa | ||
|
|
b4c7655043 | ||
|
|
2adc2aced2 | ||
|
|
e638739638 | ||
|
|
c24213358e | ||
|
|
6e78f849c4 | ||
|
|
80444b69e0 | ||
|
|
78775e9bb3 | ||
|
|
78c81347c8 | ||
|
|
65941323eb | ||
|
|
aee79b9971 | ||
|
|
97df1c1891 | ||
|
|
8a831b17cc | ||
|
|
78076efe40 | ||
|
|
d0346bf422 | ||
|
|
7cb4172e84 | ||
|
|
1f2426f51b | ||
|
|
e122fdabe8 | ||
|
|
97078d966d | ||
|
|
c43b69b4cb | ||
|
|
94b22552e5 | ||
|
|
6deb16f6cb | ||
|
|
e467ab9c73 | ||
|
|
ea038c9c56 | ||
|
|
560250ad30 | ||
|
|
536acc69a5 | ||
|
|
0bbb379912 | ||
|
|
1f4d29e6f2 | ||
|
|
5d1d7476c9 | ||
|
|
e016baefe1 | ||
|
|
70b6194788 | ||
|
|
9f103b0ea3 | ||
|
|
2924140f95 | ||
|
|
3d3f168926 | ||
|
|
63b2285a36 | ||
|
|
780689fa05 | ||
|
|
01384717c4 | ||
|
|
e18d78170a | ||
|
|
023bf77afc | ||
|
|
2877ac2101 | ||
|
|
16d82109bb | ||
|
|
c703f04119 | ||
|
|
998853f9d2 | ||
|
|
f560735da0 | ||
|
|
ab9da73b49 | ||
|
|
dc364edf75 | ||
|
|
7fbc8fbfe7 | ||
|
|
4a00bb2ddf | ||
|
|
7472aa048f | ||
|
|
49b0f7a692 | ||
|
|
4d0602ebef | ||
|
|
626395d93a | ||
|
|
0ab5602569 | ||
|
|
37a7528762 | ||
|
|
3ca391a509 | ||
|
|
f5e542d2f3 | ||
|
|
107bdf8bee | ||
|
|
3e9e56f5cc | ||
|
|
b0fd43ead5 | ||
|
|
81c59495c0 | ||
|
|
7c5f1a804e | ||
|
|
13ee4227f7 | ||
|
|
c1360ac972 | ||
|
|
c72aa8a58f | ||
|
|
9545ed610b | ||
|
|
1c4515acb9 | ||
|
|
92a6fe46de | ||
|
|
2f9fa02214 | ||
|
|
c174363c07 | ||
|
|
8506062c9a | ||
|
|
52711cba1f | ||
|
|
7eda076920 | ||
|
|
282c2f5ac0 | ||
|
|
94e76a6ac9 | ||
|
|
516d388009 | ||
|
|
ad33eed57c | ||
|
|
64bf2dc3d9 | ||
|
|
b86e4a3d12 | ||
|
|
411506b9cd | ||
|
|
f681b43e96 | ||
|
|
133acf5592 | ||
|
|
cbaa81b9bb | ||
|
|
b834be49ce | ||
|
|
8abe6d7f01 | ||
|
|
8a73ba9e6a | ||
|
|
49a090b0c7 | ||
|
|
a47dd67056 | ||
|
|
900ecc9776 | ||
|
|
464742d7c5 | ||
|
|
5f3aad4e99 | ||
|
|
7b6eca6ff6 | ||
|
|
9fcb1ac869 | ||
|
|
74ebda2b6d | ||
|
|
e194dfaa70 | ||
|
|
bfc877f924 | ||
|
|
af55446004 | ||
|
|
faf8acf669 | ||
|
|
5b79a54117 | ||
|
|
4ef55f6ece | ||
|
|
0593f9aa3f | ||
|
|
b09a6494ff | ||
|
|
b043f9acd0 | ||
|
|
7b2ff0cc8f | ||
|
|
7c9ab73a34 | ||
|
|
a08bf91784 | ||
|
|
61906670fd | ||
|
|
430b2f4d28 | ||
|
|
eb05c1ea13 | ||
|
|
9bebf36e6a | ||
|
|
d2b0b6afb1 | ||
|
|
9c2f4fbff9 | ||
|
|
1b69493afd | ||
|
|
c524dc013c | ||
|
|
9ca5939e57 | ||
|
|
860abd4037 | ||
|
|
618415016f | ||
|
|
bfcba1425d | ||
|
|
0dc9ebf18e | ||
|
|
366d396b93 | ||
|
|
35ca28ac7b | ||
|
|
1505933107 | ||
|
|
958227d0f2 | ||
|
|
b1978fec09 | ||
|
|
010040b376 | ||
|
|
35272d8324 | ||
|
|
29a714fe87 | ||
|
|
78edc2b3ce | ||
|
|
932f9d3a4f | ||
|
|
a56a7af08c | ||
|
|
5427c1992f | ||
|
|
64d69f44c3 | ||
|
|
d75fe4b27a | ||
|
|
eac9b3e28a | ||
|
|
d6975ba2d4 | ||
|
|
aae8e1322a | ||
|
|
88aac0eaf0 | ||
|
|
c463d9bc5c | ||
|
|
f305b469f2 | ||
|
|
ea276f3e2e | ||
|
|
15601e6ee4 | ||
|
|
44b14cab17 | ||
|
|
0a97c56c77 | ||
|
|
ac5dc5991f | ||
|
|
d22dc673e8 | ||
|
|
9eb2b83796 | ||
|
|
1cf6226a06 | ||
|
|
bce330a9e0 | ||
|
|
687e286c2e | ||
|
|
fc05035053 | ||
|
|
f45f5ead01 | ||
|
|
0eeea77896 | ||
|
|
78ca7d8435 | ||
|
|
98d2ac404d | ||
|
|
b4b1ffd58e | ||
|
|
2522bd00ab | ||
|
|
0601039fcf | ||
|
|
857b95e525 | ||
|
|
4be855f11a | ||
|
|
9e1018770d | ||
|
|
1235a09d19 | ||
|
|
1647c3a2f1 | ||
|
|
588838acaa | ||
|
|
25c772434c | ||
|
|
2c597a3b37 | ||
|
|
80a44977a6 | ||
|
|
0389fa6a56 | ||
|
|
30ca476d8d | ||
|
|
6439dee5ef | ||
|
|
f6e5a24fe4 | ||
|
|
77aad546bc | ||
|
|
7fdbe664ba | ||
|
|
df76074ce9 | ||
|
|
31939630a3 | ||
|
|
50500626f8 | ||
|
|
fb1f0c8fc7 | ||
|
|
9036b3be5f | ||
|
|
51f840c0ef | ||
|
|
b3a98cdaa2 | ||
|
|
7799a8dd94 | ||
|
|
e84d1faf71 | ||
|
|
66f0fd0f8f | ||
|
|
4f0dbe4836 | ||
|
|
d7a53e360a | ||
|
|
cb76341666 | ||
|
|
537584e557 | ||
|
|
e06a50d8e8 | ||
|
|
01776ed9a8 | ||
|
|
1b7f53c055 | ||
|
|
3233d35a05 | ||
|
|
ee52dafa0b | ||
|
|
03ddf42152 | ||
|
|
bb4ee6bae7 | ||
|
|
cb5a9f8042 | ||
|
|
1d5d3bfa72 | ||
|
|
06379ebaba | ||
|
|
45eb2a1506 | ||
|
|
0e96c35d2d | ||
|
|
152ecc7ff0 | ||
|
|
8b38aa1e33 | ||
|
|
79e6995384 | ||
|
|
1d6e19a718 | ||
|
|
23cb4b11a9 | ||
|
|
11461a615b | ||
|
|
e8f0359fb2 | ||
|
|
eba81e8be3 | ||
|
|
2e0d437b08 | ||
|
|
cbb0b87392 | ||
|
|
3f63043150 | ||
|
|
77f2474562 | ||
|
|
8aa5c392df | ||
|
|
a453f4862d | ||
|
|
0e6702f3c3 | ||
|
|
412cdbdaf4 | ||
|
|
02dbbf983c | ||
|
|
8cf9830644 | ||
|
|
b04dfedf7e | ||
|
|
3d4e3209e6 | ||
|
|
e92130af85 | ||
|
|
de3d6f1695 | ||
|
|
da377838e8 | ||
|
|
67cf6e47c8 | ||
|
|
abf4c3498f | ||
|
|
ff8c85b2d0 | ||
|
|
8cbdb32931 | ||
|
|
757f9f4156 | ||
|
|
c632f4b01a | ||
|
|
a843d0a0e3 | ||
|
|
905df92b05 | ||
|
|
7445299537 | ||
|
|
ba4958f837 | ||
|
|
8ca5245bf5 | ||
|
|
89aa97552a | ||
|
|
aa692e2735 | ||
|
|
c7ee26f284 | ||
|
|
b103e6efd1 | ||
|
|
16cd12e22b | ||
|
|
34bdbc89bc | ||
|
|
b649e9761d | ||
|
|
a9807f4f09 | ||
|
|
def287715d | ||
|
|
966f926112 | ||
|
|
4568293b51 | ||
|
|
10115ab0a8 | ||
|
|
ecefaedcb9 | ||
|
|
b9aae0866d | ||
|
|
afbfcc921e | ||
|
|
8f997ca3d9 | ||
|
|
042d557eb1 | ||
|
|
153679228d | ||
|
|
5a4fe54ac2 | ||
|
|
14e8d88cd1 | ||
|
|
79e726db33 | ||
|
|
d4f1949833 | ||
|
|
6135f996bf | ||
|
|
5b97621af4 | ||
|
|
0f084d04f8 | ||
|
|
bcb114a171 | ||
|
|
7bbe2a3045 | ||
|
|
fab4e8fe22 | ||
|
|
bc4a06577e | ||
|
|
22a790fff0 | ||
|
|
5e3d0cb78f | ||
|
|
59ee2a6fc3 | ||
|
|
fd5e752b43 | ||
|
|
df31d03da7 | ||
|
|
a7ebba4a62 | ||
|
|
6ca1a84a54 | ||
|
|
bab5a827f6 | ||
|
|
3b1e0389aa | ||
|
|
ae05a55d31 | ||
|
|
4b6d417db3 | ||
|
|
86118bac02 | ||
|
|
7bfbec4b01 | ||
|
|
a5d6dd1305 | ||
|
|
68f690e1a7 | ||
|
|
34d7f3f319 | ||
|
|
07b82191d0 | ||
|
|
f8c6060d32 | ||
|
|
bfdb36ff95 | ||
|
|
ce83777c1d | ||
|
|
d709e70fa2 | ||
|
|
8fe4f8fd58 | ||
|
|
b6319e522a | ||
|
|
58d74c1515 | ||
|
|
806f3fdd63 | ||
|
|
90d2055dff | ||
|
|
a29e5c98f8 | ||
|
|
78a6ba8e1f | ||
|
|
352ceca81d | ||
|
|
2f99d44b86 | ||
|
|
03386e72b2 | ||
|
|
54ba0a0c85 | ||
|
|
7bf8b2894d | ||
|
|
875da76e6b | ||
|
|
547ca6d631 | ||
|
|
60fb088bea | ||
|
|
3a89236af0 | ||
|
|
7d16bdbc88 | ||
|
|
812d23a101 | ||
|
|
4381a34191 | ||
|
|
6e21e5636b | ||
|
|
ff65429b16 | ||
|
|
ab03870b6a | ||
|
|
23bafc4d75 | ||
|
|
3bdce0d975 | ||
|
|
454edbeaba | ||
|
|
1e7e63032a | ||
|
|
0eca011054 | ||
|
|
68b7601b0f | ||
|
|
894fe935a5 | ||
|
|
0befdf48dd | ||
|
|
827602766d | ||
|
|
11c3002b77 | ||
|
|
9d193b7b71 | ||
|
|
811cd760d4 | ||
|
|
fe5039db78 | ||
|
|
a42a3cdb88 | ||
|
|
ee003e1764 | ||
|
|
749ab2ca1a | ||
|
|
4bbde71bfa | ||
|
|
7f3fbda237 | ||
|
|
06d2e19ee2 | ||
|
|
cbcb140bec | ||
|
|
bc8fd4de31 | ||
|
|
9e8bc3b7df | ||
|
|
f9070eed5d | ||
|
|
447533db12 | ||
|
|
1fe8675743 | ||
|
|
6775f9af57 | ||
|
|
bf9107754d | ||
|
|
906d8d7d49 | ||
|
|
517e026ca9 | ||
|
|
9535306a92 | ||
|
|
222ac42357 | ||
|
|
703fc26ceb | ||
|
|
52ae59154a | ||
|
|
82f22ac5d1 | ||
|
|
f0f74ba195 | ||
|
|
8e5e35ec23 | ||
|
|
0a63b6d8cd | ||
|
|
8b01e47c8e | ||
|
|
66d8705066 | ||
|
|
aa1f9f071f | ||
|
|
81c2f45f95 | ||
|
|
d5ae75e5a4 | ||
|
|
3ca2b90eff | ||
|
|
d1e48e95b7 | ||
|
|
12b78b374c | ||
|
|
cd857a2807 | ||
|
|
def2c9820a | ||
|
|
63c0577e73 | ||
|
|
e028ec2f0f | ||
|
|
4258ab6957 | ||
|
|
894081b097 | ||
|
|
772f41b236 | ||
|
|
e6db08c593 | ||
|
|
ea4a4ad072 | ||
|
|
b4bd479d3c | ||
|
|
9745b7e558 | ||
|
|
eb666fd8f2 | ||
|
|
2404c54bb6 | ||
|
|
221cd67c39 | ||
|
|
7c311972b5 | ||
|
|
9b42aebb56 | ||
|
|
e96320c9ad | ||
|
|
fdafb96852 | ||
|
|
cf5e4a7e8c | ||
|
|
4b4651bf6e | ||
|
|
a3e7503537 | ||
|
|
30fab426df | ||
|
|
7746a04bd9 | ||
|
|
a437f382cb | ||
|
|
852741bbfc | ||
|
|
7d839c655f | ||
|
|
ba8aad9831 | ||
|
|
2970b5e246 | ||
|
|
80a68b2612 | ||
|
|
088d2fa78b | ||
|
|
a4bc63d352 | ||
|
|
e8c428614a | ||
|
|
4f336282bb | ||
|
|
74daa48536 | ||
|
|
3dc14e52d8 | ||
|
|
1a736c13d5 | ||
|
|
377d68d83c | ||
|
|
f512e686b0 | ||
|
|
004dcbb4f4 | ||
|
|
1bfad8740c | ||
|
|
5b71f44bf3 | ||
|
|
81651abfec |
15
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: [jayfunc]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: # Replace with a single Open Collective username
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||||
|
polar: # Replace with a single Polar username
|
||||||
|
buy_me_a_coffee: founchoo
|
||||||
|
thanks_dev: # Replace with a single thanks.dev username
|
||||||
|
custom: ['https://paypal.me/zhefangpay']
|
||||||
22
.github/ISSUE_TEMPLATE/bug-反馈.md
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
name: Bug 反馈
|
||||||
|
about: 帮助我们改进 BetterLyrics
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**描述问题**
|
||||||
|
|
||||||
|
|
||||||
|
**屏幕截图**
|
||||||
|
|
||||||
|
|
||||||
|
**BetterLyrics 版本**
|
||||||
|
v1.0.XX.0
|
||||||
|
|
||||||
|
**日志**
|
||||||
|
将日志以单文件形式上传到此处。你可以在此处找到日志文件 `%LocalAppData%\Packages\37412.BetterLyrics_rd1g0rsrrtxw8\LocalCache\logs`
|
||||||
|
|
||||||
|
**附加信息**
|
||||||
21
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
|
||||||
|
**BetterLyrics Version**
|
||||||
|
v1.0.XX.0
|
||||||
|
|
||||||
|
**Logs**
|
||||||
|
Upload logs as a file here. You can find logs at `%LocalAppData%\Packages\37412.BetterLyrics_rd1g0rsrrtxw8\LocalCache\logs`
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
13
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
13
.github/ISSUE_TEMPLATE/功能建议.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: 功能建议
|
||||||
|
about: 提供宝贵的功能建议
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**描述你所构想的解决方案**
|
||||||
|
|
||||||
|
|
||||||
|
**附加信息**
|
||||||
18
.github/workflows/issues-translator.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: 'issue-translator'
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
issues:
|
||||||
|
types: [opened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: usthe/issues-translate-action@v2.7
|
||||||
|
with:
|
||||||
|
IS_MODIFY_TITLE: false
|
||||||
|
# not require, default false, . Decide whether to modify the issue title
|
||||||
|
# if true, the robot account @Issues-translate-bot must have modification permissions, invite @Issues-translate-bot to your project or use your custom bot.
|
||||||
|
CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
|
||||||
|
# not require. Customize the translation robot prefix message.
|
||||||
28
.github/workflows/release-to-telegram.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: Notify Telegram on GitHub Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
notify:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Send release info to Telegram
|
||||||
|
env:
|
||||||
|
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
||||||
|
CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
|
||||||
|
THREAD_ID: ${{ secrets.TELEGRAM_THREAD_ID }}
|
||||||
|
RELEASE_URL: ${{ github.event.release.html_url }}
|
||||||
|
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
||||||
|
RELEASE_NAME: ${{ github.event.release.name }}
|
||||||
|
RELEASE_BODY: ${{ github.event.release.body }}
|
||||||
|
run: |
|
||||||
|
TEXT="🚀 *New Release:* ${RELEASE_TAG} - ${RELEASE_NAME}%0A"
|
||||||
|
TEXT+="📝 *Description:*%0A${RELEASE_BODY}%0A"
|
||||||
|
TEXT+="🔗 [View on GitHub](${RELEASE_URL})"
|
||||||
|
|
||||||
|
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
|
||||||
|
-d chat_id="${CHAT_ID}" \
|
||||||
|
-d message_thread_id="${THREAD_ID}" \
|
||||||
|
-d text="${TEXT}"
|
||||||
22
.github/workflows/releases-to-discord.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
name: Notify Discord on GitHub Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
github-releases-to-discord:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: GitHub Releases to Discord
|
||||||
|
uses: SethCohen/github-releases-to-discord@v1
|
||||||
|
with:
|
||||||
|
webhook_url: ${{ secrets.WEBHOOK_URL }}
|
||||||
|
color: "2105893"
|
||||||
|
username: "GitHub"
|
||||||
|
avatar_url: "https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png"
|
||||||
|
content: "||@everyone||"
|
||||||
|
footer_title: "Changelog"
|
||||||
|
reduce_headings: true
|
||||||
5
.gitignore
vendored
@@ -404,4 +404,7 @@ FodyWeavers.xsd
|
|||||||
*.msp
|
*.msp
|
||||||
|
|
||||||
# JetBrains Rider
|
# JetBrains Rider
|
||||||
*.sln.iml
|
*.sln.iml
|
||||||
|
/BetterLyrics.WinUI3/BetterLyrics.WinUI3 (Package)/BetterLyrics.WinUI3 (Package)_TemporaryKey.pfx
|
||||||
|
/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Constants/LastFM.cs
|
||||||
|
/BetterLyrics.WinUI3/BetterLyrics.WinUI3/Constants/Discord.cs
|
||||||
|
|||||||
@@ -37,14 +37,14 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ProjectGuid>6576cd19-ef92-4099-b37d-e2d8ebdb6bf5</ProjectGuid>
|
<ProjectGuid>6576cd19-ef92-4099-b37d-e2d8ebdb6bf5</ProjectGuid>
|
||||||
<TargetPlatformVersion>10.0.26100.0</TargetPlatformVersion>
|
<TargetPlatformVersion>10.0.26100.0</TargetPlatformVersion>
|
||||||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
|
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
|
||||||
<AssetTargetFallback>net8.0-windows$(TargetPlatformVersion);$(AssetTargetFallback)</AssetTargetFallback>
|
<AssetTargetFallback>net10.0-windows$(TargetPlatformVersion);$(AssetTargetFallback)</AssetTargetFallback>
|
||||||
<DefaultLanguage>zh-CN</DefaultLanguage>
|
<DefaultLanguage>zh-CN</DefaultLanguage>
|
||||||
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
|
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
|
||||||
<EntryPointProjectUniqueName>..\BetterLyrics.WinUI3\BetterLyrics.WinUI3.csproj</EntryPointProjectUniqueName>
|
<EntryPointProjectUniqueName>..\BetterLyrics.WinUI3\BetterLyrics.WinUI3.csproj</EntryPointProjectUniqueName>
|
||||||
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
|
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
|
||||||
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
|
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
|
||||||
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
|
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
|
||||||
<GenerateTestArtifacts>True</GenerateTestArtifacts>
|
<GenerateTestArtifacts>True</GenerateTestArtifacts>
|
||||||
<AppxBundlePlatforms>x86|x64</AppxBundlePlatforms>
|
<AppxBundlePlatforms>x86|x64</AppxBundlePlatforms>
|
||||||
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
|
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
|
||||||
@@ -137,13 +137,14 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\BetterLyrics.WinUI3\BetterLyrics.WinUI3.csproj">
|
<ProjectReference Include="..\BetterLyrics.WinUI3\BetterLyrics.WinUI3.csproj">
|
||||||
|
<EnableMsixTooling>true</EnableMsixTooling>
|
||||||
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties>
|
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties>
|
||||||
<PublishProfile>Properties\PublishProfiles\win-$(Platform).pubxml</PublishProfile>
|
<PublishProfile>Properties\PublishProfiles\win-$(Platform).pubxml</PublishProfile>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4188" />
|
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.6901" />
|
||||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250513003" />
|
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.251106002" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
|
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
@@ -5,50 +5,62 @@
|
|||||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||||
|
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
|
||||||
xmlns:uap18="http://schemas.microsoft.com/appx/manifest/uap/windows10/18"
|
xmlns:uap18="http://schemas.microsoft.com/appx/manifest/uap/windows10/18"
|
||||||
IgnorableNamespaces="uap rescap uap18">
|
IgnorableNamespaces="uap rescap uap18">
|
||||||
|
|
||||||
<Identity
|
<Identity
|
||||||
Name="37412.BetterLyrics"
|
Name="37412.BetterLyrics"
|
||||||
Publisher="CN=E1428B0E-DC1D-4EA4-ACB1-4556569D5BA9"
|
Publisher="CN=E1428B0E-DC1D-4EA4-ACB1-4556569D5BA9"
|
||||||
Version="1.0.2.0" />
|
Version="1.0.128.0" />
|
||||||
|
|
||||||
<mp:PhoneIdentity PhoneProductId="ca4a4830-fc19-40d9-b823-53e2bff3d816" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
<mp:PhoneIdentity PhoneProductId="ca4a4830-fc19-40d9-b823-53e2bff3d816" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||||
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<DisplayName>BetterLyrics</DisplayName>
|
<DisplayName>BetterLyrics</DisplayName>
|
||||||
<PublisherDisplayName>founchoo</PublisherDisplayName>
|
<PublisherDisplayName>Zhe Fang</PublisherDisplayName>
|
||||||
<Logo>Images\StoreLogo.png</Logo>
|
<Logo>Images\StoreLogo.png</Logo>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
|
||||||
<Dependencies>
|
<Dependencies>
|
||||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.19041.0" MaxVersionTested="10.0.26100.0" />
|
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.19041.0" MaxVersionTested="10.0.26100.0" />
|
||||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19041.0" MaxVersionTested="10.0.26100.0" />
|
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.19041.0" MaxVersionTested="10.0.26100.0" />
|
||||||
</Dependencies>
|
</Dependencies>
|
||||||
|
|
||||||
<Resources>
|
<Resources>
|
||||||
<Resource Language="en-US"/>
|
<Resource Language="en-US"/>
|
||||||
<Resource Language="zh-CN"/>
|
<Resource Language="zh-CN"/>
|
||||||
<Resource Language="zh-TW"/>
|
<Resource Language="zh-TW"/>
|
||||||
</Resources>
|
<Resource Language="ja-JP"/>
|
||||||
|
<Resource Language="ko-KR"/>
|
||||||
|
</Resources>
|
||||||
|
|
||||||
<Applications>
|
<Applications>
|
||||||
<Application Id="App"
|
<Application Id="App"
|
||||||
Executable="$targetnametoken$.exe"
|
Executable="$targetnametoken$.exe"
|
||||||
EntryPoint="$targetentrypoint$">
|
EntryPoint="$targetentrypoint$">
|
||||||
<uap:VisualElements
|
<uap:VisualElements
|
||||||
DisplayName="BetterLyrics"
|
DisplayName="BetterLyrics"
|
||||||
Description="BetterLyrics.WinUI3 (Package)"
|
Description="BetterLyrics.WinUI3 (Package)"
|
||||||
BackgroundColor="transparent"
|
BackgroundColor="transparent"
|
||||||
Square150x150Logo="Images\Square150x150Logo.png"
|
Square150x150Logo="Images\Square150x150Logo.png"
|
||||||
Square44x44Logo="Images\Square44x44Logo.png">
|
Square44x44Logo="Images\Square44x44Logo.png">
|
||||||
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square71x71Logo="Images\SmallTile.png" Square310x310Logo="Images\LargeTile.png"/>
|
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square71x71Logo="Images\SmallTile.png" Square310x310Logo="Images\LargeTile.png"/>
|
||||||
<uap:SplashScreen Image="Images\SplashScreen.png" />
|
<uap:SplashScreen Image="Images\SplashScreen.png" />
|
||||||
</uap:VisualElements>
|
</uap:VisualElements>
|
||||||
</Application>
|
<Extensions>
|
||||||
</Applications>
|
<uap5:Extension
|
||||||
|
Category="windows.startupTask">
|
||||||
|
<uap5:StartupTask
|
||||||
|
TaskId="AutoStartup"
|
||||||
|
Enabled="false"
|
||||||
|
DisplayName="BetterLyrics" />
|
||||||
|
</uap5:Extension>
|
||||||
|
</Extensions>
|
||||||
|
</Application>
|
||||||
|
</Applications>
|
||||||
|
|
||||||
<Capabilities>
|
<Capabilities>
|
||||||
<rescap:Capability Name="runFullTrust" />
|
<rescap:Capability Name="runFullTrust" />
|
||||||
</Capabilities>
|
</Capabilities>
|
||||||
</Package>
|
</Package>
|
||||||
|
|||||||
@@ -5,13 +5,16 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converter="using:BetterLyrics.WinUI3.Converter"
|
xmlns:converter="using:BetterLyrics.WinUI3.Converter"
|
||||||
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
|
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
|
||||||
xmlns:local="using:BetterLyrics.WinUI3">
|
xmlns:globalization="using:Windows.Globalization"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3"
|
||||||
|
xmlns:media="using:CommunityToolkit.WinUI.Media">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<!-- Merged dictionaries here -->
|
||||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
||||||
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.SettingsControls/SettingsExpander/SettingsExpander.xaml" />
|
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.Segmented/Segmented/Segmented.xaml" />
|
||||||
<!-- Other merged dictionaries here -->
|
<ResourceDictionary Source="ms-appx:///DevWinUI.Controls/Themes/Generic.xaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
<!-- Theme -->
|
<!-- Theme -->
|
||||||
@@ -40,15 +43,41 @@
|
|||||||
<ExponentialEase x:Key="EaseIn" EasingMode="EaseIn" />
|
<ExponentialEase x:Key="EaseIn" EasingMode="EaseIn" />
|
||||||
|
|
||||||
<!-- Converter -->
|
<!-- Converter -->
|
||||||
<converter:ThemeTypeToElementThemeConverter x:Key="ThemeTypeToElementThemeConverter" />
|
<converter:EnumToIntConverter x:Key="EnumToIntConverter" />
|
||||||
<converter:ColorToBrushConverter x:Key="ColorToBrushConverter" />
|
<converter:ColorToBrushConverter x:Key="ColorToBrushConverter" />
|
||||||
|
<converter:MatchedLocalFilesPathToVisibilityConverter x:Key="MatchedLocalFilesPathToVisibilityConverter" />
|
||||||
|
<converter:IntToCornerRadius x:Key="IntToCornerRadius" />
|
||||||
|
<converter:CornerRadiusToDoubleConverter x:Key="CornerRadiusToDoubleConverter" />
|
||||||
|
<converter:LyricsSearchProviderToDisplayNameConverter x:Key="LyricsSearchProviderToDisplayNameConverter" />
|
||||||
|
<converter:TranslationSearchProviderToDisplayNameConverter x:Key="TranslationSearchProviderToDisplayNameConverter" />
|
||||||
|
<converter:AlbumArtSearchProviderToDisplayNameConverter x:Key="AlbumArtSearchProviderToDisplayNameConverter" />
|
||||||
|
<converter:SecondsToFormattedTimeConverter x:Key="SecondsToFormattedTimeConverter" />
|
||||||
|
<converter:MillisecondsToFormattedTimeConverter x:Key="MillisecondsToFormattedTimeConverter" />
|
||||||
|
<converter:FPSToTimeSpanConverter x:Key="FPSToTimeSpanConverter" />
|
||||||
|
<converter:ShortcutToStringConverter x:Key="ShortcutToStringConverter" />
|
||||||
|
<converter:BoolNegationToVisibilityConverter x:Key="BoolNegationToVisibilityConverter" />
|
||||||
|
<converter:BoolToOpacityConverter x:Key="BoolToOpacityConverter" />
|
||||||
|
<converter:BoolToPartialOpacityConverter x:Key="BoolToPartialOpacityConverter" />
|
||||||
|
<converter:BoolNegationToOpacityConverter x:Key="BoolNegationToOpacityConverter" />
|
||||||
|
<converter:RectToMarginConverter x:Key="RectToMarginConverter" />
|
||||||
|
<converter:LanguageCodeToDisplayedNameConverter x:Key="LanguageCodeToDisplayedNameConverter" />
|
||||||
|
<converter:ByteArrayToImageConverter x:Key="ByteArrayToImageConverter" />
|
||||||
|
<converter:DisplayLanguageCodeToIndexConverter x:Key="DisplayLanguageCodeToIndexConverter" />
|
||||||
|
<converter:PathToParentFolderConverter x:Key="PathToParentFolderConverter" />
|
||||||
|
<converter:TrackToLyricsConverter x:Key="TrackToLyricsConverter" />
|
||||||
|
<converter:IntToBoolConverter x:Key="IntToBoolConverter" />
|
||||||
|
<converter:IndexToDisplayConverter x:Key="IndexToDisplayConverter" />
|
||||||
|
<converter:IntToDoubleConverter x:Key="IntToDoubleConverter" />
|
||||||
|
<converter:MillisecondsToSecondsConverter x:Key="MillisecondsToSecondsConverter" />
|
||||||
|
|
||||||
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||||||
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
|
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
|
||||||
<converters:ColorToDisplayNameConverter x:Key="ColorToDisplayNameConverter" />
|
<converters:ColorToDisplayNameConverter x:Key="ColorToDisplayNameConverter" />
|
||||||
|
<converters:CollectionVisibilityConverter x:Key="CollectionVisibilityConverter" />
|
||||||
|
|
||||||
<x:Double x:Key="SettingsCardSpacing">4</x:Double>
|
<x:Double x:Key="SettingsCardSpacing">4</x:Double>
|
||||||
|
|
||||||
<!-- Style (inc. the correct spacing) of a section header -->
|
<!-- Style -->
|
||||||
<Style
|
<Style
|
||||||
x:Key="SettingsSectionHeaderTextBlockStyle"
|
x:Key="SettingsSectionHeaderTextBlockStyle"
|
||||||
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
|
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
|
||||||
@@ -58,34 +87,281 @@
|
|||||||
</Style.Setters>
|
</Style.Setters>
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="TitleBarButtonStyle" TargetType="Button">
|
<Style x:Key="TitleBarButtonStyle" TargetType="Button">
|
||||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
<Setter Property="VerticalAlignment" Value="Top" />
|
||||||
<Setter Property="CornerRadius" Value="4" />
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
<Setter Property="BorderThickness" Value="0" />
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
<Setter Property="Padding" Value="16,0" />
|
<Setter Property="Padding" Value="16,9,16,11" />
|
||||||
|
<Setter Property="Margin" Value="0" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="GhostButtonStyle" TargetType="Button">
|
<Style x:Key="GhostButtonStyle" TargetType="Button">
|
||||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||||
|
<Setter Property="Padding" Value="8" />
|
||||||
<Setter Property="CornerRadius" Value="4" />
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
<Setter Property="BorderThickness" Value="0" />
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="TitleBarToggleButtonStyle" TargetType="ToggleButton">
|
<Style
|
||||||
|
x:Key="TitleBarToggleButtonStyle"
|
||||||
|
BasedOn="{StaticResource ToggleButtonRevealStyle}"
|
||||||
|
TargetType="ToggleButton">
|
||||||
<Setter Property="CornerRadius" Value="4" />
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||||
<Setter Property="BorderThickness" Value="0" />
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
<Setter Property="Padding" Value="16,0" />
|
<Setter Property="Padding" Value="16,9,16,11" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="GhostToggleButtonStyle" TargetType="ToggleButton">
|
<Style x:Key="GhostToggleButtonStyle" TargetType="ToggleButton">
|
||||||
<Setter Property="CornerRadius" Value="4" />
|
<Setter Property="CornerRadius" Value="4" />
|
||||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||||
<Setter Property="BorderThickness" Value="0" />
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
|
<Setter Property="Padding" Value="8" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style x:Key="CardGridStyle" TargetType="Grid">
|
||||||
|
<Setter Property="Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
|
||||||
|
<Setter Property="BorderBrush" Value="{ThemeResource CardStrokeColorDefaultBrush}" />
|
||||||
|
<Setter Property="BorderThickness" Value="1" />
|
||||||
|
<Setter Property="CornerRadius" Value="6" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="GhostSliderStyle" TargetType="Slider">
|
||||||
|
<Setter Property="Background" Value="{ThemeResource ControlStrokeColorOnAccentDefaultBrush}" />
|
||||||
|
<Setter Property="BorderThickness" Value="{ThemeResource SliderBorderThemeThickness}" />
|
||||||
|
<Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimaryBrush}" />
|
||||||
|
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
|
||||||
|
<Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
|
||||||
|
<Setter Property="ManipulationMode" Value="None" />
|
||||||
|
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
|
||||||
|
<Setter Property="FocusVisualMargin" Value="-7,0,-7,0" />
|
||||||
|
<Setter Property="IsFocusEngagementEnabled" Value="True" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="Slider">
|
||||||
|
<Grid Margin="{TemplateBinding Padding}">
|
||||||
|
<Grid.Resources>
|
||||||
|
<Style x:Key="SliderThumbStyle" TargetType="Thumb">
|
||||||
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
|
<Setter Property="Background" Value="{ThemeResource TextFillColorPrimaryBrush}" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="Thumb">
|
||||||
|
<Border
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
CornerRadius="0,1,1,0" />
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</Grid.Resources>
|
||||||
|
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<ContentPresenter
|
||||||
|
x:Name="HeaderContentPresenter"
|
||||||
|
Grid.Row="0"
|
||||||
|
Margin="{ThemeResource SliderTopHeaderMargin}"
|
||||||
|
x:DeferLoadStrategy="Lazy"
|
||||||
|
Content="{TemplateBinding Header}"
|
||||||
|
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||||
|
FontWeight="{ThemeResource SliderHeaderThemeFontWeight}"
|
||||||
|
Foreground="{ThemeResource SliderHeaderForeground}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<Grid
|
||||||
|
x:Name="SliderContainer"
|
||||||
|
Grid.Row="1"
|
||||||
|
Background="{ThemeResource SliderContainerBackground}"
|
||||||
|
Control.IsTemplateFocusTarget="True">
|
||||||
|
<Grid x:Name="HorizontalTemplate" MinHeight="{ThemeResource SliderHorizontalHeight}">
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="{ThemeResource SliderPreContentMargin}" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="{ThemeResource SliderPostContentMargin}" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Rectangle
|
||||||
|
x:Name="HorizontalTrackRect"
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.ColumnSpan="3"
|
||||||
|
Height="2"
|
||||||
|
Fill="{TemplateBinding Background}" />
|
||||||
|
<Rectangle
|
||||||
|
x:Name="HorizontalDecreaseRect"
|
||||||
|
Grid.Row="1"
|
||||||
|
Fill="{TemplateBinding Foreground}" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="TopTickBar"
|
||||||
|
Grid.ColumnSpan="3"
|
||||||
|
Height="{ThemeResource SliderOutsideTickBarThemeHeight}"
|
||||||
|
Margin="0,0,0,4"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
Fill="{ThemeResource SliderTickBarFill}"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="HorizontalInlineTickBar"
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.ColumnSpan="3"
|
||||||
|
Height="2"
|
||||||
|
Fill="{ThemeResource SliderInlineTickBarFill}"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="BottomTickBar"
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.ColumnSpan="3"
|
||||||
|
Height="{ThemeResource SliderOutsideTickBarThemeHeight}"
|
||||||
|
Margin="0,4,0,0"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Fill="{ThemeResource SliderTickBarFill}"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<Thumb
|
||||||
|
x:Name="HorizontalThumb"
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.RowSpan="3"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="2"
|
||||||
|
Height="2"
|
||||||
|
AutomationProperties.AccessibilityView="Raw"
|
||||||
|
DataContext="{TemplateBinding Value}"
|
||||||
|
FocusVisualMargin="-14,-6,-14,-6"
|
||||||
|
Style="{StaticResource SliderThumbStyle}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid
|
||||||
|
x:Name="VerticalTemplate"
|
||||||
|
MinWidth="{ThemeResource SliderVerticalWidth}"
|
||||||
|
Visibility="Collapsed">
|
||||||
|
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="{ThemeResource SliderPreContentMargin}" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="{ThemeResource SliderPostContentMargin}" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Rectangle
|
||||||
|
x:Name="VerticalTrackRect"
|
||||||
|
Grid.RowSpan="3"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="{ThemeResource SliderTrackThemeHeight}"
|
||||||
|
Fill="{TemplateBinding Background}" />
|
||||||
|
<Rectangle
|
||||||
|
x:Name="VerticalDecreaseRect"
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.Column="1"
|
||||||
|
Fill="{TemplateBinding Foreground}" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="LeftTickBar"
|
||||||
|
Grid.RowSpan="3"
|
||||||
|
Width="{ThemeResource SliderOutsideTickBarThemeHeight}"
|
||||||
|
Margin="0,0,4,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Fill="{ThemeResource SliderTickBarFill}"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="VerticalInlineTickBar"
|
||||||
|
Grid.RowSpan="3"
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="{ThemeResource SliderTrackThemeHeight}"
|
||||||
|
Fill="{ThemeResource SliderInlineTickBarFill}"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<TickBar
|
||||||
|
x:Name="RightTickBar"
|
||||||
|
Grid.RowSpan="3"
|
||||||
|
Grid.Column="2"
|
||||||
|
Width="{ThemeResource SliderOutsideTickBarThemeHeight}"
|
||||||
|
Margin="4,0,0,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Fill="{ThemeResource SliderTickBarFill}"
|
||||||
|
Visibility="Collapsed" />
|
||||||
|
<Thumb
|
||||||
|
x:Name="VerticalThumb"
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="3"
|
||||||
|
Width="24"
|
||||||
|
Height="8"
|
||||||
|
AutomationProperties.AccessibilityView="Raw"
|
||||||
|
DataContext="{TemplateBinding Value}"
|
||||||
|
FocusVisualMargin="-6,-14,-6,-14"
|
||||||
|
Style="{StaticResource SliderThumbStyle}" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style
|
||||||
|
x:Key="ListViewStretchedItemContainerStyle"
|
||||||
|
BasedOn="{StaticResource DefaultListViewItemStyle}"
|
||||||
|
TargetType="ListViewItem">
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
||||||
|
<Setter Property="Margin" Value="0" />
|
||||||
|
<Setter Property="Padding" Value="0" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style
|
||||||
|
x:Key="SettingsScrollViewerStyle"
|
||||||
|
BasedOn="{StaticResource DefaultScrollViewerStyle}"
|
||||||
|
TargetType="ScrollViewer">
|
||||||
|
<Setter Property="Padding" Value="36,0" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="SettingsGridStyle" TargetType="Grid">
|
||||||
|
<Setter Property="Padding" Value="0,0,0,36" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style
|
||||||
|
x:Key="FlyoutPageStyle"
|
||||||
|
BasedOn="{StaticResource DefaultFlyoutPresenterStyle}"
|
||||||
|
TargetType="FlyoutPresenter">
|
||||||
|
<Setter Property="Opacity" Value="0.9" />
|
||||||
|
<Setter Property="MinWidth" Value="850" />
|
||||||
|
<Setter Property="Padding" Value="0" />
|
||||||
|
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled" />
|
||||||
|
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
|
||||||
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style
|
||||||
|
x:Key="FlyoutGhostStyle"
|
||||||
|
BasedOn="{StaticResource DefaultFlyoutPresenterStyle}"
|
||||||
|
TargetType="FlyoutPresenter">
|
||||||
|
<Setter Property="Padding" Value="0" />
|
||||||
|
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Disabled" />
|
||||||
|
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled" />
|
||||||
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<StaticResource x:Key="ToggleButtonBackgroundChecked" ResourceKey="TextFillColorPrimaryBrush" />
|
||||||
|
<StaticResource x:Key="ToggleButtonBackgroundCheckedPointerOver" ResourceKey="TextFillColorPrimaryBrush" />
|
||||||
|
<StaticResource x:Key="ToggleButtonBackgroundCheckedPressed" ResourceKey="TextFillColorPrimaryBrush" />
|
||||||
|
|
||||||
<!-- Dimensions -->
|
<!-- Dimensions -->
|
||||||
|
|
||||||
|
<!-- Fonts -->
|
||||||
|
<FontFamily x:Key="IconFontFamily">ms-appx:///Assets/Segoe Fluent Icons.ttf#Segoe Fluent Icons</FontFamily>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|
||||||
</Application>
|
</Application>
|
||||||
|
|||||||
@@ -1,70 +1,86 @@
|
|||||||
using System;
|
// 2025/6/23 by Zhe Fang
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using BetterLyrics.WinUI3.Helper;
|
||||||
using System.Text;
|
using BetterLyrics.WinUI3.Hooks;
|
||||||
using BetterLyrics.WinUI3.Models;
|
using BetterLyrics.WinUI3.Services.AlbumArtSearchService;
|
||||||
using BetterLyrics.WinUI3.Services.Database;
|
using BetterLyrics.WinUI3.Services.DiscordService;
|
||||||
using BetterLyrics.WinUI3.Services.Settings;
|
using BetterLyrics.WinUI3.Services.LastFMService;
|
||||||
|
using BetterLyrics.WinUI3.Services.LibWatcherService;
|
||||||
|
using BetterLyrics.WinUI3.Services.LiveStatesService;
|
||||||
|
using BetterLyrics.WinUI3.Services.LyricsSearchService;
|
||||||
|
using BetterLyrics.WinUI3.Services.MediaSessionsService;
|
||||||
|
using BetterLyrics.WinUI3.Services.ResourceService;
|
||||||
|
using BetterLyrics.WinUI3.Services.SettingsService;
|
||||||
|
using BetterLyrics.WinUI3.Services.TranslateService;
|
||||||
using BetterLyrics.WinUI3.ViewModels;
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using BetterLyrics.WinUI3.ViewModels.LyricsRendererViewModel;
|
||||||
using BetterLyrics.WinUI3.Views;
|
using BetterLyrics.WinUI3.Views;
|
||||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.UI.Dispatching;
|
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.Windows.ApplicationModel.Resources;
|
using Microsoft.Windows.ApplicationModel.Resources;
|
||||||
using Microsoft.Windows.AppLifecycle;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using Serilog.Core;
|
using System;
|
||||||
using Windows.ApplicationModel.Core;
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
// To learn more about WinUI, the WinUI project structure,
|
using System.Threading.Tasks;
|
||||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
using Vanara.PInvoke;
|
||||||
|
|
||||||
namespace BetterLyrics.WinUI3
|
namespace BetterLyrics.WinUI3
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Provides application-specific behavior to supplement the default Application class.
|
|
||||||
/// </summary>
|
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
|
|
||||||
private readonly ILogger<App> _logger;
|
private readonly ILogger<App> _logger;
|
||||||
|
|
||||||
public static new App Current => (App)Application.Current;
|
public static new App Current => (App)Application.Current;
|
||||||
public BaseWindow? MainWindow { get; private set; }
|
|
||||||
public BaseWindow? SettingsWindow { get; set; }
|
|
||||||
|
|
||||||
public static ResourceLoader? ResourceLoader { get; private set; }
|
private static Mutex? _instanceMutex;
|
||||||
|
|
||||||
public static DispatcherQueue? DispatcherQueue { get; private set; }
|
|
||||||
public static DispatcherQueueTimer? DispatcherQueueTimer { get; private set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes the singleton application object. This is the first line of authored code
|
|
||||||
/// executed, and as such is the logical equivalent of main() or WinMain().
|
|
||||||
/// </summary>
|
|
||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
|
|
||||||
DispatcherQueue = DispatcherQueue.GetForCurrentThread();
|
EnsureSingleInstance();
|
||||||
DispatcherQueueTimer = DispatcherQueue.CreateTimer();
|
|
||||||
ResourceLoader = new ResourceLoader();
|
|
||||||
|
|
||||||
Helper.AppInfo.EnsureDirectories();
|
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||||
|
PathHelper.EnsureDirectories();
|
||||||
ConfigureServices();
|
ConfigureServices();
|
||||||
|
|
||||||
_logger = Ioc.Default.GetService<ILogger<App>>()!;
|
_logger = Ioc.Default.GetRequiredService<ILogger<App>>();
|
||||||
|
|
||||||
UnhandledException += App_UnhandledException;
|
UnhandledException += App_UnhandledException;
|
||||||
|
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||||
|
AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;
|
||||||
|
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EnsureSingleInstance()
|
||||||
|
{
|
||||||
|
_instanceMutex = new Mutex(true, Constants.App.AppName, out bool createdNew);
|
||||||
|
|
||||||
|
if (!createdNew)
|
||||||
|
{
|
||||||
|
User32.MessageBox(HWND.NULL, new ResourceLoader().GetString("TryRunMultipleInstance"), null, User32.MB_FLAGS.MB_APPLMODAL);
|
||||||
|
Environment.Exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnLaunched(LaunchActivatedEventArgs args)
|
||||||
|
{
|
||||||
|
WindowHook.OpenOrShowWindow<LyricsWindow>();
|
||||||
|
if (Ioc.Default.GetRequiredService<ISettingsService>().AppSettings.MusicGallerySettings.AutoOpen)
|
||||||
|
{
|
||||||
|
WindowHook.OpenOrShowWindow<MusicGalleryWindow>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ConfigureServices()
|
private static void ConfigureServices()
|
||||||
{
|
{
|
||||||
Log.Logger = new LoggerConfiguration()
|
Log.Logger = new LoggerConfiguration()
|
||||||
.MinimumLevel.Debug()
|
.MinimumLevel.Is(Serilog.Events.LogEventLevel.Verbose)
|
||||||
.WriteTo.File(Helper.AppInfo.LogFilePattern, rollingInterval: RollingInterval.Day)
|
.WriteTo.File(PathHelper.LogFilePattern, rollingInterval: RollingInterval.Day)
|
||||||
.CreateLogger();
|
.CreateLogger();
|
||||||
|
|
||||||
// Register services
|
// Register services
|
||||||
@@ -76,37 +92,55 @@ namespace BetterLyrics.WinUI3
|
|||||||
loggingBuilder.AddSerilog();
|
loggingBuilder.AddSerilog();
|
||||||
})
|
})
|
||||||
// Services
|
// Services
|
||||||
.AddSingleton<SettingsService>()
|
.AddSingleton<ILiveStatesService, LiveStatesService>()
|
||||||
.AddSingleton<DatabaseService>()
|
.AddSingleton<ISettingsService, SettingsService>()
|
||||||
|
.AddSingleton<IMediaSessionsService, MediaSessionsService>()
|
||||||
|
.AddSingleton<IAlbumArtSearchService, AlbumArtSearchService>()
|
||||||
|
.AddSingleton<ILyricsSearchService, LyricsSearchService>()
|
||||||
|
.AddSingleton<ILibWatcherService, LibWatcherService>()
|
||||||
|
.AddSingleton<ITranslateService, TranslateService>()
|
||||||
|
.AddSingleton<ILastFMService, LastFMService>()
|
||||||
|
.AddSingleton<IResourceService, ResourceService>()
|
||||||
|
.AddSingleton<IDiscordService, DiscordService>()
|
||||||
// ViewModels
|
// ViewModels
|
||||||
.AddSingleton<BaseWindowModel>()
|
.AddSingleton<AppSettingsControlViewModel>()
|
||||||
.AddSingleton<MainViewModel>()
|
.AddSingleton<PlaybackSettingsControlViewModel>()
|
||||||
.AddSingleton<SettingsViewModel>()
|
.AddSingleton<MediaSettingsControlViewModel>()
|
||||||
|
.AddSingleton<LyricsSearchControlViewModel>()
|
||||||
|
.AddSingleton<LyricsWindowSettingsControlViewModel>()
|
||||||
|
.AddSingleton<LyricsWindowSwitchControlViewModel>()
|
||||||
|
.AddSingleton<LyricsWindowSwitchWindowViewModel>()
|
||||||
|
.AddSingleton<LyricsWindowViewModel>()
|
||||||
|
.AddSingleton<SettingsWindowViewModel>()
|
||||||
|
.AddSingleton<SystemTrayViewModel>()
|
||||||
|
.AddSingleton<SettingsPageViewModel>()
|
||||||
|
.AddSingleton<LyricsPageViewModel>()
|
||||||
|
.AddSingleton<MusicGalleryViewModel>()
|
||||||
|
.AddSingleton<LyricsRendererViewModel>()
|
||||||
|
.AddSingleton<AboutControlViewModel>()
|
||||||
.BuildServiceProvider()
|
.BuildServiceProvider()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void App_UnhandledException(
|
private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
|
||||||
object sender,
|
|
||||||
Microsoft.UI.Xaml.UnhandledExceptionEventArgs e
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
_logger.LogError(e.Exception, "App_UnhandledException");
|
_logger.LogError(e.Exception, "App_UnhandledException");
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
private void CurrentDomain_FirstChanceException(object? sender, System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs e)
|
||||||
/// Invoked when the application is launched.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">Details about the launch request and process.</param>
|
|
||||||
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
|
|
||||||
{
|
{
|
||||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
_logger.LogError(e.Exception, "CurrentDomain_FirstChanceException");
|
||||||
|
}
|
||||||
|
|
||||||
// Activate the window
|
private void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
|
||||||
MainWindow = new BaseWindow();
|
{
|
||||||
MainWindow!.Navigate(typeof(MainPage));
|
_logger.LogError(e.ExceptionObject.ToString(), "CurrentDomain_UnhandledException");
|
||||||
MainWindow.Activate();
|
}
|
||||||
|
|
||||||
|
private void TaskScheduler_UnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e)
|
||||||
|
{
|
||||||
|
_logger.LogError(e.Exception, "TaskScheduler_UnobservedTaskException");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
After Width: | Height: | Size: 6.8 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Alipay.jpg
Normal file
|
After Width: | Height: | Size: 140 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Empty.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/EmptyBox.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/EmptyState.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/FluidEffect.bin
Normal file
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/LastFM.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Leaf.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Logo.ico
Normal file
|
After Width: | Height: | Size: 201 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Page.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/WeChatReward.png
Normal file
|
After Width: | Height: | Size: 209 KiB |
328503
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Assets/Wiki82.profile.xml
Normal file
@@ -1,68 +1,300 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net8.0-windows10.0.26100.0</TargetFramework>
|
<TargetFramework>net10.0-windows10.0.26100.0</TargetFramework>
|
||||||
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
|
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
|
||||||
<RootNamespace>BetterLyrics.WinUI3</RootNamespace>
|
<RootNamespace>BetterLyrics.WinUI3</RootNamespace>
|
||||||
<Platforms>x86;x64;ARM64</Platforms>
|
<Platforms>x86;x64;ARM64</Platforms>
|
||||||
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
|
||||||
<UseWinUI>true</UseWinUI>
|
<UseWinUI>true</UseWinUI>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
<LangVersion>preview</LangVersion>
|
||||||
<ItemGroup>
|
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||||
<Content Include="Logo.ico" />
|
</PropertyGroup>
|
||||||
</ItemGroup>
|
<ItemGroup>
|
||||||
<ItemGroup>
|
<Compile Remove="ViewModels\Lyrics\**" />
|
||||||
<Manifest Include="$(ApplicationManifest)" />
|
<Content Remove="ViewModels\Lyrics\**" />
|
||||||
</ItemGroup>
|
<EmbeddedResource Remove="ViewModels\Lyrics\**" />
|
||||||
<ItemGroup>
|
<None Remove="ViewModels\Lyrics\**" />
|
||||||
<PackageReference Include="CommunityToolkit.Labs.WinUI.MarqueeText" Version="0.1.230830" />
|
<Page Remove="ViewModels\Lyrics\**" />
|
||||||
<PackageReference
|
<PRIResource Remove="ViewModels\Lyrics\**" />
|
||||||
Include="CommunityToolkit.Labs.WinUI.OpacityMaskView"
|
</ItemGroup>
|
||||||
Version="0.1.250513-build.2126"
|
<ItemGroup>
|
||||||
/>
|
<None Remove="Assets\Segoe Fluent Icons.ttf" />
|
||||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
<None Remove="Assets\Wiki82.profile.xml" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.2.250402" />
|
<None Remove="Controls\AboutControl.xaml" />
|
||||||
<PackageReference
|
<None Remove="Controls\AlbumArtLayoutSettingsControl.xaml" />
|
||||||
Include="CommunityToolkit.WinUI.Controls.SettingsControls"
|
<None Remove="Controls\AppSettingsControl.xaml" />
|
||||||
Version="8.2.250402"
|
<None Remove="Controls\DemoWindowGrid.xaml" />
|
||||||
/>
|
<None Remove="Controls\ExtendedSlider.xaml" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.2.250402" />
|
<None Remove="Controls\FontFamilyAutoSuggestBox.xaml" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.2.250402" />
|
<None Remove="Controls\LyricsSearchControl.xaml" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.2.250402" />
|
<None Remove="Controls\LyricsStyleSettingsControl.xaml" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.2.250402" />
|
<None Remove="Controls\LyricsWindowSettingsControl.xaml" />
|
||||||
<PackageReference Include="DevWinUI" Version="8.3.0" />
|
<None Remove="Controls\LyricsWindowSwitchControl.xaml" />
|
||||||
<PackageReference Include="DevWinUI.Controls" Version="8.3.0" />
|
<None Remove="Controls\MediaSettingsControl.xaml" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
|
<None Remove="Controls\PlaybackSettingsControl.xaml" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.5" />
|
<None Remove="Controls\ShortcutTextBox.xaml" />
|
||||||
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.3.2" />
|
<None Remove="Controls\SystemTray.xaml" />
|
||||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.4188" />
|
<None Remove="Views\LyricsSearchWindow.xaml" />
|
||||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.250513003" />
|
<None Remove="Views\LyricsWindowSwitchWindow.xaml" />
|
||||||
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="3.0.0" />
|
<None Remove="Views\MusicGalleryPage.xaml" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<None Remove="Views\MusicGalleryWindow.xaml" />
|
||||||
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.2" />
|
<None Remove="Views\SettingsWindow.xaml" />
|
||||||
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
|
</ItemGroup>
|
||||||
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
|
<ItemGroup>
|
||||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.5" />
|
<Content Include="Logo.ico" />
|
||||||
<PackageReference Include="Ude.NetStandard" Version="1.2.0" />
|
</ItemGroup>
|
||||||
<PackageReference Include="z440.atl.core" Version="6.24.0" />
|
<ItemGroup>
|
||||||
</ItemGroup>
|
<Manifest Include="$(ApplicationManifest)" />
|
||||||
<ItemGroup>
|
</ItemGroup>
|
||||||
<Content Update="Assets\AI - 甜度爆表.mp3">
|
<ItemGroup>
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<PackageReference Include="3v.EvtSource" Version="2.0.0" />
|
||||||
</Content>
|
<PackageReference Include="CommunityToolkit.Labs.WinUI.Controls.OpacityMaskView" Version="0.1.251021-build.2365" />
|
||||||
</ItemGroup>
|
<PackageReference Include="CommunityToolkit.Labs.WinUI.Shimmer" Version="0.1.250703-build.2173" />
|
||||||
<!-- Publish Properties -->
|
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||||
<PropertyGroup>
|
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.2.250402" />
|
||||||
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
|
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.250402" />
|
||||||
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
|
<PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.2.250402" />
|
||||||
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
|
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.2.250402" />
|
||||||
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
|
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.2.250402" />
|
||||||
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
|
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.2.250402" />
|
||||||
</PropertyGroup>
|
<PackageReference Include="CommunityToolkit.WinUI.Media" Version="8.2.250402" />
|
||||||
<PropertyGroup>
|
<PackageReference Include="CommunityToolkit.WinUI.Triggers" Version="8.2.250402" />
|
||||||
<DefineConstants>$(DefineConstants);DISABLE_XAML_GENERATED_MAIN</DefineConstants>
|
<PackageReference Include="ComputeSharp.D2D1.WinUI" Version="3.2.0" />
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<PackageReference Include="csharp-kana" Version="1.0.2" />
|
||||||
<ApplicationIcon>Logo.ico</ApplicationIcon>
|
<PackageReference Include="csharp-pinyin" Version="1.0.1" />
|
||||||
</PropertyGroup>
|
<PackageReference Include="DevWinUI.Controls" Version="9.5.0" />
|
||||||
|
<PackageReference Include="DiscordRichPresence" Version="1.6.1.70" />
|
||||||
|
<PackageReference Include="Dubya.WindowsMediaController" Version="2.5.5" />
|
||||||
|
<PackageReference Include="H.NotifyIcon.WinUI" Version="2.3.2" />
|
||||||
|
<PackageReference Include="Hqub.Last.fm" Version="2.5.1" />
|
||||||
|
<PackageReference Include="Lyricify.Lyrics.Helper-NativeAot" Version="0.1.4-alpha.5" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.3.2" />
|
||||||
|
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.6901" />
|
||||||
|
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.251106002" />
|
||||||
|
<PackageReference Include="NAudio.Wasapi" Version="2.2.1" />
|
||||||
|
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
|
||||||
|
<PackageReference Include="Nito.AsyncEx.Tasks" Version="5.1.2" />
|
||||||
|
<PackageReference Include="NTextCat" Version="0.3.65" />
|
||||||
|
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.3-dev-02320" />
|
||||||
|
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
|
||||||
|
<PackageReference Include="System.Drawing.Common" Version="10.0.0" />
|
||||||
|
<PackageReference Include="System.Text.Encoding.CodePages" Version="10.0.0" />
|
||||||
|
<PackageReference Include="TagLibSharp" Version="2.3.0" />
|
||||||
|
<PackageReference Include="Ude.NetStandard" Version="1.2.0" />
|
||||||
|
<PackageReference Include="Vanara.PInvoke.DwmApi" Version="4.2.1" />
|
||||||
|
<PackageReference Include="Vanara.PInvoke.Gdi32" Version="4.2.1" />
|
||||||
|
<PackageReference Include="Vanara.PInvoke.Shell32" Version="4.2.1" />
|
||||||
|
<PackageReference Include="Vanara.PInvoke.User32" Version="4.2.1" />
|
||||||
|
<PackageReference Include="Vanara.Windows.Shell" Version="4.2.1" />
|
||||||
|
<PackageReference Include="WinUIEx" Version="2.9.0" />
|
||||||
|
<PackageReference Include="z440.atl.core" Version="7.8.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\ColorThief.WinUI3\ColorThief.WinUI3.csproj" />
|
||||||
|
<ProjectReference Include="..\..\Impressionist\Impressionist\Impressionist.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Rendering\InAppLyricsRenderer.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Rendering\DesktopLyricsRenderer.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<!--Disable Trimming for Specific Packages-->
|
||||||
|
<ItemGroup>
|
||||||
|
<TrimmerRootAssembly Include="NAudio.Wasapi" />
|
||||||
|
<TrimmerRootAssembly Include="TagLibSharp" />
|
||||||
|
<TrimmerRootAssembly Include="Vanara.PInvoke.DwmApi" />
|
||||||
|
<TrimmerRootAssembly Include="Vanara.PInvoke.Gdi32" />
|
||||||
|
<TrimmerRootAssembly Include="Vanara.PInvoke.Shell32" />
|
||||||
|
<TrimmerRootAssembly Include="Vanara.PInvoke.User32" />
|
||||||
|
<TrimmerRootAssembly Include="Vanara.Windows.Shell" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Update="Assets\AlbumArtPlaceholder.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Alipay.jpg">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\FluidEffect.bin">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Empty.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\EmptyBox.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\EmptyState.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\LastFM.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Leaf.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Logo.ico">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Logo.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Page.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Segoe Fluent Icons.ttf">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\WeChatReward.png">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Update="Assets\Wiki82.profile.xml">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\FontFamilyAutoSuggestBox.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\LyricsStyleSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Views\LyricsWindowSwitchWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\LyricsWindowSwitchControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\DemoWindowGrid.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\LyricsWindowSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Views\LyricsSearchWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\LyricsSearchControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\ShortcutTextBox.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\ExtendedSlider.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\LyricsEffectSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\MediaSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\PlaybackSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\AlbumArtLayoutSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\LyricsBackgroundSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\AppSettingsControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Views\MusicGalleryWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Views\MusicGalleryPage.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Views\SettingsWindow.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\SystemTray.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PRIResource Update="Strings\en-US\Resources.resw">
|
||||||
|
<Generator></Generator>
|
||||||
|
</PRIResource>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="TemplateSelector\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="Controls\AboutControl.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<!-- Publish Properties -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
|
||||||
|
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
|
||||||
|
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
|
||||||
|
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
|
||||||
|
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<DefineConstants>$(DefineConstants)</DefineConstants>
|
||||||
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
|
<ApplicationIcon>Logo.ico</ApplicationIcon>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<ShouldCreateLogs>True</ShouldCreateLogs>
|
||||||
|
<AdvancedSettingsExpanded>True</AdvancedSettingsExpanded>
|
||||||
|
<UpdateAssemblyVersion>False</UpdateAssemblyVersion>
|
||||||
|
<UpdateAssemblyFileVersion>False</UpdateAssemblyFileVersion>
|
||||||
|
<UpdateAssemblyInfoVersion>False</UpdateAssemblyInfoVersion>
|
||||||
|
<UpdatePackageVersion>True</UpdatePackageVersion>
|
||||||
|
<AssemblyInfoVersionType>SettingsVersion</AssemblyInfoVersionType>
|
||||||
|
<InheritWinAppVersionFrom>AssemblyVersion</InheritWinAppVersionFrom>
|
||||||
|
<PackageVersionSettings>AssemblyVersion.None.None</PackageVersionSettings>
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -0,0 +1,122 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Collections.Specialized;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Collections
|
||||||
|
{
|
||||||
|
// https://stackoverflow.com/a/32013610/11048731
|
||||||
|
public class FullyObservableCollection<T> : ObservableCollection<T>
|
||||||
|
where T : INotifyPropertyChanged
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs when a property is changed within an item.
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<ItemPropertyChangedEventArgs> ItemPropertyChanged;
|
||||||
|
|
||||||
|
public FullyObservableCollection() : base()
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public FullyObservableCollection(List<T> list) : base(list)
|
||||||
|
{
|
||||||
|
ObserveAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public FullyObservableCollection(IEnumerable<T> enumerable) : base(enumerable)
|
||||||
|
{
|
||||||
|
ObserveAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Action == NotifyCollectionChangedAction.Remove ||
|
||||||
|
e.Action == NotifyCollectionChangedAction.Replace)
|
||||||
|
{
|
||||||
|
foreach (T item in e.OldItems)
|
||||||
|
item.PropertyChanged -= ChildPropertyChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.Action == NotifyCollectionChangedAction.Add ||
|
||||||
|
e.Action == NotifyCollectionChangedAction.Replace)
|
||||||
|
{
|
||||||
|
foreach (T item in e.NewItems)
|
||||||
|
item.PropertyChanged += ChildPropertyChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnCollectionChanged(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void OnItemPropertyChanged(ItemPropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
ItemPropertyChanged?.Invoke(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void OnItemPropertyChanged(int index, PropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
OnItemPropertyChanged(new ItemPropertyChangedEventArgs(index, e));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void ClearItems()
|
||||||
|
{
|
||||||
|
foreach (T item in Items)
|
||||||
|
item.PropertyChanged -= ChildPropertyChanged;
|
||||||
|
|
||||||
|
base.ClearItems();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ObserveAll()
|
||||||
|
{
|
||||||
|
foreach (T item in Items)
|
||||||
|
item.PropertyChanged += ChildPropertyChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChildPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
T typedSender = (T)sender;
|
||||||
|
int i = Items.IndexOf(typedSender);
|
||||||
|
|
||||||
|
if (i < 0)
|
||||||
|
throw new ArgumentException("Received property notification from item not in collection");
|
||||||
|
|
||||||
|
OnItemPropertyChanged(i, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Refresh()
|
||||||
|
{
|
||||||
|
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides data for the <see cref="FullyObservableCollection{T}.ItemPropertyChanged"/> event.
|
||||||
|
/// </summary>
|
||||||
|
public class ItemPropertyChangedEventArgs : PropertyChangedEventArgs
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the index in the collection for which the property change has occurred.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// Index in parent collection.
|
||||||
|
/// </value>
|
||||||
|
public int CollectionIndex { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ItemPropertyChangedEventArgs"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="index">The index in the collection of changed item.</param>
|
||||||
|
/// <param name="name">The name of the property that changed.</param>
|
||||||
|
public ItemPropertyChangedEventArgs(int index, string name) : base(name)
|
||||||
|
{
|
||||||
|
CollectionIndex = index;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ItemPropertyChangedEventArgs"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="index">The index.</param>
|
||||||
|
/// <param name="args">The <see cref="PropertyChangedEventArgs"/> instance containing the event data.</param>
|
||||||
|
public ItemPropertyChangedEventArgs(int index, PropertyChangedEventArgs args) : this(index, args.PropertyName)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class AmllTTmlDB
|
||||||
|
{
|
||||||
|
public const string BaseUrl = "https://raw.githubusercontent.com/Steve-xmh/amll-ttml-db/refs/heads/main";
|
||||||
|
public const string QueryPrefix = "raw-lyrics";
|
||||||
|
public const string IndexSuffix = "metadata/raw-lyrics-index.jsonl";
|
||||||
|
}
|
||||||
|
}
|
||||||
10
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Constants/App.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class App
|
||||||
|
{
|
||||||
|
public const string AppAuthor = "Zhe Fang";
|
||||||
|
public const string AppName = "BetterLyrics";
|
||||||
|
|
||||||
|
public const string AutoStartupTaskId = "AutoStartup";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class AppleMusic
|
||||||
|
{
|
||||||
|
public const string MediaUserTokenKey = "AppleMusicMediaUserToken";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
class Discord
|
||||||
|
{
|
||||||
|
public const string AppID = "Your Discord app ID here";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public class ExtendedGenreFiled
|
||||||
|
{
|
||||||
|
public const string NetEaseCloudMusicTrackID = "NCM-";
|
||||||
|
public const string FileName = "FILENAME-";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class LXMusic
|
||||||
|
{
|
||||||
|
public const string QuerySuffix = "/subscribe-player-status?filter=progress,duration,picUrl";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class LastFM
|
||||||
|
{
|
||||||
|
public const string ApiKey = "Your api key here";
|
||||||
|
public const string SharedSecret = "Your shared secret here";
|
||||||
|
public const string UnAuthUrl = "https://www.last.fm/settings/applications";
|
||||||
|
public const string SessionKeyCredentialKey = "LastFMSessionKey";
|
||||||
|
}
|
||||||
|
}
|
||||||
17
BetterLyrics.WinUI3/BetterLyrics.WinUI3/Constants/Link.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class Link
|
||||||
|
{
|
||||||
|
public const string MicrosoftStoreUrl = "https://apps.microsoft.com/detail/9p1wcd1p597r";
|
||||||
|
public const string GitHubUrl = "https://github.com/jayfunc/BetterLyrics";
|
||||||
|
public const string ShareHubUrl = $"{GitHubUrl}/blob/dev/ShareHub/index.md";
|
||||||
|
public const string TermsOfServiceUrl = $"{GitHubUrl}/blob/dev/TermsofService.md";
|
||||||
|
public const string PrivacyPolicy = $"{GitHubUrl}/blob/dev/PrivacyPolicy.md";
|
||||||
|
public const string WikiUrl = "https://jayfunc.blog/work/betterlyrics";
|
||||||
|
public const string AppleMusicCfgUrl = $"{WikiUrl}#lyrics-sources-configuration";
|
||||||
|
public const string FAQUrl = $"{WikiUrl}#faq";
|
||||||
|
public const string QQGroupUrl = "https://qun.qq.com/universal-share/share?ac=1&authKey=4Q%2BYTq3wZldYpF5SbS5c19ECFsiYoLZFAIcBNNzYpBUtiEjaZ8sZ%2F%2BnFN0qw3lad&busi_data=eyJncm91cENvZGUiOiIxMDU0NzAwMzg4IiwidG9rZW4iOiJiVnhqemVYN0N5QVc3b1ZkR24wWmZOTUtvUkJoWm1JRWlaWW5iZnlBcXJtZUtGc2FFTHNlUlFZMi9iRm03cWF5IiwidWluIjoiMTM5NTczOTY2MCJ9&data=39UmAihyH_o6CZaOs7nk2mO_lz2ruODoDou6pxxh7utcxP4WF5sbDBDOPvZ_Wqfzeey4441anegsLYQJxkrBAA&svctype=4&tempid=h5_group_info";
|
||||||
|
public const string DiscordUrl = "https://discord.gg/5yAQPnyCKv";
|
||||||
|
public const string TelegramUrl = "https://t.me/+svhSLZ7awPsxNGY1";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class SpecialHandlePlayerID
|
||||||
|
{
|
||||||
|
public const string LXMusic = "cn.toside.music.desktop";
|
||||||
|
public const string LXMusicPortable = "lx-music-desktop.exe";
|
||||||
|
public const string AppleMusic = "AppleInc.AppleMusicWin_nzyj5cx40ttqa!App";
|
||||||
|
public const string AppleMusicAlternative = "AppleMusic.exe";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class Time
|
||||||
|
{
|
||||||
|
public static readonly TimeSpan DebounceTimeout = TimeSpan.FromMilliseconds(300);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace BetterLyrics.WinUI3.Constants
|
||||||
|
{
|
||||||
|
public static class iTunes
|
||||||
|
{
|
||||||
|
public const string QueryPrefix = "https://itunes.apple.com/search?";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,203 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.AboutControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:const="using:BetterLyrics.WinUI3.Constants"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dev="using:DevWinUI"
|
||||||
|
xmlns:helper="using:BetterLyrics.WinUI3.Helper"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:uc="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<dev:SettingsExpander HeaderIcon="{ui:BitmapIcon Source=ms-appx:///Assets/Logo.png}" IsExpanded="True">
|
||||||
|
<dev:SettingsExpander.Header>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<TextBlock Text="BetterLyrics" />
|
||||||
|
</StackPanel>
|
||||||
|
</dev:SettingsExpander.Header>
|
||||||
|
<dev:SettingsExpander.Description>
|
||||||
|
<StackPanel
|
||||||
|
Margin="0,2,0,0"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="2">
|
||||||
|
<TextBlock Text="©" />
|
||||||
|
<HyperlinkButton
|
||||||
|
Margin="0,-1,0,0"
|
||||||
|
Content="Zhe Fang"
|
||||||
|
NavigateUri="https://github.com/jayfunc" />
|
||||||
|
<TextBlock Text="2025" />
|
||||||
|
</StackPanel>
|
||||||
|
</dev:SettingsExpander.Description>
|
||||||
|
<RichTextBlock Foreground="{ThemeResource TextFillColorSecondaryBrush}">
|
||||||
|
<Paragraph>
|
||||||
|
<Run x:Uid="SettingsPageVersion" />
|
||||||
|
<Run Text="{x:Bind helper:MetadataHelper.AppVersion}" />
|
||||||
|
</Paragraph>
|
||||||
|
</RichTextBlock>
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
|
||||||
|
<dev:SettingsCard HorizontalContentAlignment="Left" ContentAlignment="Left">
|
||||||
|
<StackPanel Spacing="6">
|
||||||
|
<StackPanel Margin="-12,0,0,0" Orientation="Horizontal">
|
||||||
|
<HyperlinkButton Content="GitHub" NavigateUri="{x:Bind const:Link.GitHubUrl}" />
|
||||||
|
<HyperlinkButton Content="Wiki" NavigateUri="{x:Bind const:Link.WikiUrl}" />
|
||||||
|
<HyperlinkButton Content="FAQ" NavigateUri="{x:Bind const:Link.FAQUrl}" />
|
||||||
|
<HyperlinkButton x:Uid="PrivacyPolicy" NavigateUri="{x:Bind const:Link.PrivacyPolicy}" />
|
||||||
|
<HyperlinkButton x:Uid="TermsOfService" NavigateUri="{x:Bind const:Link.TermsOfServiceUrl}" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard HorizontalContentAlignment="Left" ContentAlignment="Left">
|
||||||
|
<StackPanel Spacing="6">
|
||||||
|
<TextBlock x:Uid="SetingsPageFeedback" />
|
||||||
|
<StackPanel Margin="-12,0,0,0" Orientation="Horizontal">
|
||||||
|
<HyperlinkButton x:Uid="SettingsPageQQGroup" NavigateUri="{x:Bind const:Link.QQGroupUrl}" />
|
||||||
|
<HyperlinkButton x:Uid="SettingsPageDiscord" NavigateUri="{x:Bind const:Link.DiscordUrl}" />
|
||||||
|
<HyperlinkButton x:Uid="SettingsPageTelegram" NavigateUri="{x:Bind const:Link.TelegramUrl}" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard HorizontalContentAlignment="Left" ContentAlignment="Left">
|
||||||
|
<StackPanel Spacing="6">
|
||||||
|
<TextBlock x:Uid="SetingsPageDonation" />
|
||||||
|
<StackPanel Margin="-12,0,0,0" Orientation="Horizontal">
|
||||||
|
<HyperlinkButton Content="Buy Me a Coffee" NavigateUri="https://buymeacoffee.com/founchoo" />
|
||||||
|
<HyperlinkButton Content="PayPal" NavigateUri="https://paypal.me/zhefangpay" />
|
||||||
|
<Button
|
||||||
|
Content="支付宝"
|
||||||
|
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}">
|
||||||
|
<Button.Flyout>
|
||||||
|
<Flyout>
|
||||||
|
<Flyout.FlyoutPresenterStyle>
|
||||||
|
<Style TargetType="FlyoutPresenter">
|
||||||
|
<Setter Property="CornerRadius" Value="12" />
|
||||||
|
<Setter Property="Padding" Value="0" />
|
||||||
|
</Style>
|
||||||
|
</Flyout.FlyoutPresenterStyle>
|
||||||
|
<Image Height="300" Source="/Assets/Alipay.jpg" />
|
||||||
|
</Flyout>
|
||||||
|
</Button.Flyout>
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
Content="微信"
|
||||||
|
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}">
|
||||||
|
<Button.Flyout>
|
||||||
|
<Flyout>
|
||||||
|
<Flyout.FlyoutPresenterStyle>
|
||||||
|
<Style TargetType="FlyoutPresenter">
|
||||||
|
<Setter Property="CornerRadius" Value="12" />
|
||||||
|
<Setter Property="Padding" Value="0" />
|
||||||
|
</Style>
|
||||||
|
</Flyout.FlyoutPresenterStyle>
|
||||||
|
<Image Height="300" Source="/Assets/WeChatReward.png" />
|
||||||
|
</Flyout>
|
||||||
|
</Button.Flyout>
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<TextBlock Foreground="{ThemeResource TextFillColorSecondaryBrush}" Text="*" />
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SetingsPageThanks"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard HorizontalContentAlignment="Left" ContentAlignment="Left">
|
||||||
|
<StackPanel Spacing="6">
|
||||||
|
<TextBlock x:Uid="SetingsPageContributors" />
|
||||||
|
<StackPanel Margin="-12,0,0,0" Orientation="Horizontal">
|
||||||
|
<HyperlinkButton Content="jayfunc" NavigateUri="https://github.com/jayfunc" />
|
||||||
|
<HyperlinkButton Content="Raspberry-Monster" NavigateUri="https://github.com/Raspberry-Monster" />
|
||||||
|
<HyperlinkButton Content="ZHider" NavigateUri="https://github.com/ZHider" />
|
||||||
|
<HyperlinkButton Content="kusutori" NavigateUri="https://github.com/kusutori" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsExpander.ItemsFooter>
|
||||||
|
<InfoBar
|
||||||
|
x:Uid="SettingsPageDisclaimer"
|
||||||
|
BorderThickness="0"
|
||||||
|
CornerRadius="0"
|
||||||
|
IsClosable="False"
|
||||||
|
IsOpen="True"
|
||||||
|
Severity="Warning" />
|
||||||
|
</dev:SettingsExpander.ItemsFooter>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageMockMusicPlaying">
|
||||||
|
<HyperlinkButton x:Uid="SettingsPagePlayingMockMusicButton" NavigateUri="https://soundcloud.com/carlyraejepsen/cut-to-the-feeling" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsExpander x:Uid="SettingsPageCache" IsExpanded="True">
|
||||||
|
<Button x:Uid="SettingsPageOpenFolderButton" Command="{x:Bind ViewModel.OpenCacheFolderCommand}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard>
|
||||||
|
<Button x:Uid="SettingsPageClearCache" Command="{x:Bind ViewModel.ClearCacheFilesCommand}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageSettings">
|
||||||
|
<Button x:Uid="SettingsPageOpenFolderButton" Command="{x:Bind ViewModel.OpenSettingsFolderCommand}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsExpander x:Uid="SettingsPageSettingsManager" IsExpanded="True">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<Button x:Uid="SettingsPageImportSettingsButton" Command="{x:Bind ViewModel.ImportSettingsCommand}" />
|
||||||
|
<Button x:Uid="SettingsPageExportSettingsButton" Command="{x:Bind ViewModel.ExportSettingsCommand}" />
|
||||||
|
</StackPanel>
|
||||||
|
<dev:SettingsExpander.ItemsHeader>
|
||||||
|
<InfoBar
|
||||||
|
x:Uid="SettingsPageImportSettingsInfo"
|
||||||
|
BorderThickness="0"
|
||||||
|
CornerRadius="0"
|
||||||
|
IsClosable="False"
|
||||||
|
IsOpen="True"
|
||||||
|
Severity="Warning" />
|
||||||
|
</dev:SettingsExpander.ItemsHeader>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageDebugOverlay">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.IsDebugOverlayEnabled, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageFixedTimeStep" Visibility="Collapsed">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.AdvancedSettings.IsFixedTimeStep, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageFPS" Visibility="Collapsed">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Default="60"
|
||||||
|
Frequency="10"
|
||||||
|
Maximum="240"
|
||||||
|
Minimum="30"
|
||||||
|
Value="{x:Bind ViewModel.AppSettings.AdvancedSettings.FPS, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class AboutControl : UserControl
|
||||||
|
{
|
||||||
|
public AboutControlViewModel ViewModel => (AboutControlViewModel)DataContext;
|
||||||
|
|
||||||
|
public AboutControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetRequiredService<AboutControlViewModel>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.AlbumArtLayoutSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dev="using:DevWinUI"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<TextBlock x:Uid="SettingsPageAlbumArt" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageAlbumArtSize"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="True">
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAutoAdjust">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind AlbumArtLayoutSettings.AutoAlbumArtSize, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard IsEnabled="{x:Bind AlbumArtLayoutSettings.AutoAlbumArtSize, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Frequency="2"
|
||||||
|
Maximum="800"
|
||||||
|
Minimum="10"
|
||||||
|
ResetButtonVisibility="Collapsed"
|
||||||
|
Unit="px"
|
||||||
|
Value="{x:Bind AlbumArtLayoutSettings.AlbumArtSize, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAlbumRadius" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="12"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind AlbumArtLayoutSettings.CoverImageRadius, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAlbumShadowAmount" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="12"
|
||||||
|
Maximum="64"
|
||||||
|
Minimum="0"
|
||||||
|
Value="{x:Bind AlbumArtLayoutSettings.CoverImageShadowAmount, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<TextBlock x:Uid="SettingsPageSongInfo" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageSongInfoAlignment" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind AlbumArtLayoutSettings.SongInfoAlignmentType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageSongInfoLeft" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageSongInfoCenter" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageSongInfoRight" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageLyricsFontSize"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="True">
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAutoAdjust">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind AlbumArtLayoutSettings.IsAutoSongInfoFontSize, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard>
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="18"
|
||||||
|
Frequency="2"
|
||||||
|
IsEnabled="{x:Bind AlbumArtLayoutSettings.IsAutoSongInfoFontSize, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
|
||||||
|
Maximum="72"
|
||||||
|
Minimum="8"
|
||||||
|
Value="{x:Bind AlbumArtLayoutSettings.SongInfoFontSize, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageShowTitle"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="True">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind AlbumArtLayoutSettings.ShowTitle, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageShowArtists">
|
||||||
|
<ToggleSwitch IsEnabled="{x:Bind AlbumArtLayoutSettings.ShowTitle, Mode=OneWay}" IsOn="{x:Bind AlbumArtLayoutSettings.ShowArtists, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageShowAlbum">
|
||||||
|
<ToggleSwitch IsEnabled="{x:Bind AlbumArtLayoutSettings.ShowTitle, Mode=OneWay}" IsOn="{x:Bind AlbumArtLayoutSettings.ShowAlbum, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using BetterLyrics.WinUI3.Models.Settings;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class AlbumArtLayoutSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public static readonly DependencyProperty AlbumArtLayoutSettingsProperty =
|
||||||
|
DependencyProperty.Register(nameof(AlbumArtLayoutSettings), typeof(AlbumArtLayoutSettings), typeof(AlbumArtLayoutSettingsControl), new PropertyMetadata(default));
|
||||||
|
|
||||||
|
public AlbumArtLayoutSettings AlbumArtLayoutSettings
|
||||||
|
{
|
||||||
|
get => (AlbumArtLayoutSettings)GetValue(AlbumArtLayoutSettingsProperty);
|
||||||
|
set => SetValue(AlbumArtLayoutSettingsProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AlbumArtLayoutSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.AppSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dev="using:DevWinUI"
|
||||||
|
xmlns:globalization="using:Windows.Globalization"
|
||||||
|
xmlns:helper="using:BetterLyrics.WinUI3.Helper"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:models="using:BetterLyrics.WinUI3.Models"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<!-- App appearance -->
|
||||||
|
|
||||||
|
<TextBlock x:Uid="SettingsPageAppAppearance" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageLanguage"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="True">
|
||||||
|
<ComboBox ItemsSource="{x:Bind helper:LanguageHelper.SupportedDisplayLanguages}" SelectedIndex="{x:Bind ViewModel.AppSettings.GeneralSettings.LanguageCode, Mode=TwoWay, Converter={StaticResource DisplayLanguageCodeToIndexConverter}}">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate x:DataType="models:ExtendedLanguage">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<TextBlock Text="{x:Bind Name}" />
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard>
|
||||||
|
<Button x:Uid="SettingsPageRestart" Command="{x:Bind ViewModel.RestartAppCommand}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<!-- App behavior -->
|
||||||
|
|
||||||
|
<TextBlock x:Uid="SettingsPageAppBehavior" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAutoStart" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch
|
||||||
|
x:Name="AutoStartupToggleSwitch"
|
||||||
|
Loaded="AutoStartupToggleSwitch_Loaded"
|
||||||
|
Unloaded="AutoStartupToggleSwitch_Unloaded" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAutoOpenMusicGalleryWindow" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.MusicGallerySettings.AutoOpen, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAutoPlayWhenOpenMusicGalleryWindow" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.MusicGallerySettings.AutoPlay, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageExitOnLyricsWindowClosed" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.GeneralSettings.ExitOnLyricsWindowClosed, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageListenNewSession" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.GeneralSettings.ListenOnNewPlaybackSource, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageShowHideHotKey" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ShortcutTextBox Shortcut="{x:Bind ViewModel.AppSettings.GeneralSettings.ShowOrHideLyricsWindowShortcut, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageBorderlessHotKey" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ShortcutTextBox Shortcut="{x:Bind ViewModel.AppSettings.GeneralSettings.BorderlessShortcut, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageClickThroughHotKey" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ShortcutTextBox Shortcut="{x:Bind ViewModel.AppSettings.GeneralSettings.ClickThroughShortcut, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsWindowSwitchHotKey" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ShortcutTextBox Shortcut="{x:Bind ViewModel.AppSettings.GeneralSettings.LyricsWindowSwitchShortcut, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<!-- Playback shortcut -->
|
||||||
|
|
||||||
|
<TextBlock x:Uid="SettingsPagePlaybackShortcut" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPagePlayOrPauseSongHotKey" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ShortcutTextBox Shortcut="{x:Bind ViewModel.AppSettings.GeneralSettings.PlayOrPauseShortcut, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageNextSongHotKey" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ShortcutTextBox Shortcut="{x:Bind ViewModel.AppSettings.GeneralSettings.NextSongShortcut, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPagePreviousSongHotKey" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ShortcutTextBox Shortcut="{x:Bind ViewModel.AppSettings.GeneralSettings.PreviousSongShortcut, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class AppSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public AppSettingsControlViewModel ViewModel => (AppSettingsControlViewModel)DataContext;
|
||||||
|
|
||||||
|
public AppSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetRequiredService<AppSettingsControlViewModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void AutoStartupToggleSwitch_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
AutoStartupToggleSwitch.IsOn = await ViewModel.DetectIsAutoStartupEnabledAsync();
|
||||||
|
AutoStartupToggleSwitch.Toggled += AutoStartupToggleSwitch_Toggled;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AutoStartupToggleSwitch_Toggled(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.ToggleAutoStartupAsync(AutoStartupToggleSwitch.IsOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AutoStartupToggleSwitch_Unloaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
AutoStartupToggleSwitch.Toggled -= AutoStartupToggleSwitch_Toggled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.DemoWindowGrid"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid
|
||||||
|
Width="{x:Bind LyricsWindowStatus.DemoMonitorBounds.Width, Mode=OneWay}"
|
||||||
|
Height="{x:Bind LyricsWindowStatus.DemoMonitorBounds.Height, Mode=OneWay}"
|
||||||
|
Background="{ThemeResource AcrylicBackgroundFillColorBaseBrush}"
|
||||||
|
CornerRadius="4">
|
||||||
|
<Grid
|
||||||
|
Width="{x:Bind LyricsWindowStatus.DemoWindowBounds.Width, Mode=OneWay}"
|
||||||
|
Height="{x:Bind LyricsWindowStatus.DemoWindowBounds.Height, Mode=OneWay}"
|
||||||
|
Margin="{x:Bind LyricsWindowStatus.DemoWindowBounds, Converter={StaticResource RectToMarginConverter}, Mode=OneWay}"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Background="{ThemeResource AccentAcrylicBackgroundFillColorDefaultBrush}"
|
||||||
|
CornerRadius="4" />
|
||||||
|
<!-- Is default -->
|
||||||
|
<Grid
|
||||||
|
Margin="4"
|
||||||
|
Padding="6,3"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Background="{ThemeResource AcrylicBackgroundFillColorBaseBrush}"
|
||||||
|
CornerRadius="4"
|
||||||
|
Opacity="0.7"
|
||||||
|
Visibility="{x:Bind LyricsWindowStatus.IsDefault, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}">
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="DemoWindowControlDefault"
|
||||||
|
FontSize="12"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</Grid>
|
||||||
|
<!-- Is always on top -->
|
||||||
|
<Grid
|
||||||
|
Margin="4"
|
||||||
|
Padding="6,3"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Background="{ThemeResource AcrylicBackgroundFillColorBaseBrush}"
|
||||||
|
CornerRadius="4"
|
||||||
|
Opacity="0.7"
|
||||||
|
Visibility="{x:Bind LyricsWindowStatus.IsAlwaysOnTop, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}">
|
||||||
|
<FontIcon
|
||||||
|
FontFamily="{StaticResource IconFontFamily}"
|
||||||
|
FontSize="12"
|
||||||
|
Glyph="" />
|
||||||
|
<FontIcon
|
||||||
|
FontFamily="{StaticResource IconFontFamily}"
|
||||||
|
FontSize="12"
|
||||||
|
Glyph=""
|
||||||
|
Visibility="{x:Bind LyricsWindowStatus.IsAlwaysOnTopPolling, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<!-- Moniter name -->
|
||||||
|
<Grid
|
||||||
|
Margin="4"
|
||||||
|
Padding="6,3"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
Background="{ThemeResource AcrylicBackgroundFillColorBaseBrush}"
|
||||||
|
CornerRadius="4"
|
||||||
|
Opacity="0.7">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,0,3,0"
|
||||||
|
FontSize="12"
|
||||||
|
Text="{x:Bind LyricsWindowStatus.MonitorDeviceName, Mode=OneWay}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
<TextBlock FontSize="12" Text="[" />
|
||||||
|
<TextBlock FontSize="12" Text="{x:Bind LyricsWindowStatus.MonitorBounds.Width, Mode=OneWay}" />
|
||||||
|
<TextBlock FontSize="12" Text="×" />
|
||||||
|
<TextBlock FontSize="12" Text="{x:Bind LyricsWindowStatus.MonitorBounds.Height, Mode=OneWay}" />
|
||||||
|
<TextBlock FontSize="12" Text="]" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
<!-- Config name -->
|
||||||
|
<Grid
|
||||||
|
Padding="6,3"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
CornerRadius="4"
|
||||||
|
Opacity="0.7">
|
||||||
|
<TextBlock
|
||||||
|
FontWeight="ExtraBlack"
|
||||||
|
Text="{x:Bind LyricsWindowStatus.Name, Mode=OneWay}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using BetterLyrics.WinUI3.Models;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls;
|
||||||
|
|
||||||
|
public sealed partial class DemoWindowGrid : UserControl
|
||||||
|
{
|
||||||
|
public DemoWindowGrid()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty LyricsWindowStatusProperty =
|
||||||
|
DependencyProperty.Register(nameof(LyricsWindowStatus), typeof(LyricsWindowStatus), typeof(DemoWindowGrid), new PropertyMetadata(default));
|
||||||
|
|
||||||
|
public LyricsWindowStatus LyricsWindowStatus
|
||||||
|
{
|
||||||
|
get => (LyricsWindowStatus)GetValue(LyricsWindowStatusProperty);
|
||||||
|
set => SetValue(LyricsWindowStatusProperty, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.ExtendedSlider"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<StackPanel>
|
||||||
|
|
||||||
|
<Slider
|
||||||
|
IsEnabled="{x:Bind IsSliderEnabled, Mode=OneWay}"
|
||||||
|
Maximum="{x:Bind Maximum, Mode=OneWay}"
|
||||||
|
Minimum="{x:Bind Minimum, Mode=OneWay}"
|
||||||
|
SnapsTo="Ticks"
|
||||||
|
StepFrequency="{x:Bind Frequency, Mode=OneWay}"
|
||||||
|
Tapped="Slider_Tapped"
|
||||||
|
TickFrequency="{x:Bind Frequency, Mode=OneWay}"
|
||||||
|
TickPlacement="None"
|
||||||
|
Value="{x:Bind Value, Mode=TwoWay}" />
|
||||||
|
|
||||||
|
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||||
|
<Button
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Click="ResetButton_Click"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}"
|
||||||
|
Visibility="{x:Bind ResetButtonVisibility, Mode=OneWay}" />
|
||||||
|
<Button
|
||||||
|
x:Name="SubtractButton"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Click="SubtractButton_Click"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
|
||||||
|
<StackPanel
|
||||||
|
Margin="3,-2,3,0"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="2">
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="{x:Bind RoundedValue, Mode=OneWay}" />
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="{x:Bind Unit, Mode=OneWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
x:Name="AddButton"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Click="AddButton_Click"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,147 @@
|
|||||||
|
using BetterLyrics.WinUI3.Events;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class ExtendedSlider : UserControl
|
||||||
|
{
|
||||||
|
public event EventHandler<ExtendedSliderValueChangedByUserEventArgs>? ValueChangedByUser;
|
||||||
|
|
||||||
|
public ExtendedSlider()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Subtract()
|
||||||
|
{
|
||||||
|
if (Value - Frequency < Minimum)
|
||||||
|
{
|
||||||
|
Value = Minimum;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Value -= Frequency;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Add()
|
||||||
|
{
|
||||||
|
if (Value + Frequency > Maximum)
|
||||||
|
{
|
||||||
|
Value = Maximum;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Value += Frequency;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SubtractTimer_Tick(object? sender, object e)
|
||||||
|
{
|
||||||
|
Subtract();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddTimer_Tick(object? sender, object e)
|
||||||
|
{
|
||||||
|
Add();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty FrequencyProperty =
|
||||||
|
DependencyProperty.Register(nameof(Frequency), typeof(double), typeof(ExtendedSlider), new PropertyMetadata(1.0));
|
||||||
|
public static readonly DependencyProperty MinimumProperty =
|
||||||
|
DependencyProperty.Register(nameof(Minimum), typeof(double), typeof(ExtendedSlider), new PropertyMetadata(default));
|
||||||
|
public static readonly DependencyProperty MaximumProperty =
|
||||||
|
DependencyProperty.Register(nameof(Maximum), typeof(double), typeof(ExtendedSlider), new PropertyMetadata(default));
|
||||||
|
public static readonly DependencyProperty ValueProperty =
|
||||||
|
DependencyProperty.Register(nameof(Value), typeof(double), typeof(ExtendedSlider), new PropertyMetadata(default));
|
||||||
|
private static readonly DependencyProperty RoundedValueProperty =
|
||||||
|
DependencyProperty.Register(nameof(Value), typeof(string), typeof(ExtendedSlider), new PropertyMetadata(default));
|
||||||
|
public static readonly DependencyProperty DefaultProperty =
|
||||||
|
DependencyProperty.Register(nameof(Default), typeof(double), typeof(ExtendedSlider), new PropertyMetadata(default));
|
||||||
|
public static readonly DependencyProperty ResetButtonVisibilityProperty =
|
||||||
|
DependencyProperty.Register(nameof(ResetButtonVisibility), typeof(Visibility), typeof(ExtendedSlider), new PropertyMetadata(Visibility.Visible));
|
||||||
|
public static readonly DependencyProperty UnitProperty =
|
||||||
|
DependencyProperty.Register(nameof(Unit), typeof(string), typeof(ExtendedSlider), new PropertyMetadata(""));
|
||||||
|
public static readonly DependencyProperty IsSliderEnabledProperty =
|
||||||
|
DependencyProperty.Register(nameof(IsSliderEnabled), typeof(bool), typeof(ExtendedSlider), new PropertyMetadata(true));
|
||||||
|
|
||||||
|
public double Frequency
|
||||||
|
{
|
||||||
|
get => (double)GetValue(FrequencyProperty);
|
||||||
|
set => SetValue(FrequencyProperty, value);
|
||||||
|
}
|
||||||
|
public double Minimum
|
||||||
|
{
|
||||||
|
get => (double)GetValue(MinimumProperty);
|
||||||
|
set => SetValue(MinimumProperty, value);
|
||||||
|
}
|
||||||
|
public double Maximum
|
||||||
|
{
|
||||||
|
get => (double)GetValue(MaximumProperty);
|
||||||
|
set => SetValue(MaximumProperty, value);
|
||||||
|
}
|
||||||
|
public double Value
|
||||||
|
{
|
||||||
|
get => (double)GetValue(ValueProperty);
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SetValue(ValueProperty, value);
|
||||||
|
SetValue(RoundedValueProperty, value.ToString("F1").Replace(".0", ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string RoundedValue
|
||||||
|
{
|
||||||
|
get => (string)GetValue(RoundedValueProperty);
|
||||||
|
set => SetValue(RoundedValueProperty, value);
|
||||||
|
}
|
||||||
|
public double Default
|
||||||
|
{
|
||||||
|
get => (double)GetValue(DefaultProperty);
|
||||||
|
set => SetValue(DefaultProperty, value);
|
||||||
|
}
|
||||||
|
public Visibility ResetButtonVisibility
|
||||||
|
{
|
||||||
|
get => (Visibility)GetValue(ResetButtonVisibilityProperty);
|
||||||
|
set => SetValue(ResetButtonVisibilityProperty, value);
|
||||||
|
}
|
||||||
|
public string Unit
|
||||||
|
{
|
||||||
|
get => (string)GetValue(UnitProperty);
|
||||||
|
set => SetValue(UnitProperty, value);
|
||||||
|
}
|
||||||
|
public bool IsSliderEnabled
|
||||||
|
{
|
||||||
|
get => (bool)GetValue(IsSliderEnabledProperty);
|
||||||
|
set => SetValue(IsSliderEnabledProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ResetButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Value = Default;
|
||||||
|
ValueChangedByUser?.Invoke(this, new ExtendedSliderValueChangedByUserEventArgs(Value));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SubtractButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Subtract();
|
||||||
|
ValueChangedByUser?.Invoke(this, new ExtendedSliderValueChangedByUserEventArgs(Value));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Add();
|
||||||
|
ValueChangedByUser?.Invoke(this, new ExtendedSliderValueChangedByUserEventArgs(Value));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Slider_Tapped(object sender, TappedRoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ValueChangedByUser?.Invoke(this, new ExtendedSliderValueChangedByUserEventArgs(Value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.FontFamilyAutoSuggestBox"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<AutoSuggestBox
|
||||||
|
x:Name="AutoSuggestBox"
|
||||||
|
Width="150"
|
||||||
|
GotFocus="AutoSuggestBox_GotFocus"
|
||||||
|
LostFocus="AutoSuggestBox_LostFocus"
|
||||||
|
SuggestionChosen="AutoSuggestBox_SuggestionChosen"
|
||||||
|
Text="{x:Bind SelectedFontFamily, Mode=OneWay}"
|
||||||
|
TextChanged="AutoSuggestBox_TextChanged" />
|
||||||
|
<Button
|
||||||
|
Click="Button_Click"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
using BetterLyrics.WinUI3.Helper;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class FontFamilyAutoSuggestBox : UserControl
|
||||||
|
{
|
||||||
|
private List<string> SystemFontNames { get; set; } = [.. FontHelper.SystemFontFamilies];
|
||||||
|
|
||||||
|
public FontFamilyAutoSuggestBox()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty SelectedFontFamilyProperty =
|
||||||
|
DependencyProperty.Register(nameof(SelectedFontFamily), typeof(string), typeof(FontFamilyAutoSuggestBox), new PropertyMetadata(default));
|
||||||
|
|
||||||
|
public string SelectedFontFamily
|
||||||
|
{
|
||||||
|
get => (string)GetValue(SelectedFontFamilyProperty);
|
||||||
|
set => SetValue(SelectedFontFamilyProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void AutoSuggestBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args)
|
||||||
|
{
|
||||||
|
SelectedFontFamily = args.SelectedItem.ToString() ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateAutoSuggestBoxItemsSource()
|
||||||
|
{
|
||||||
|
var suitableItems = new List<string>();
|
||||||
|
var splitText = AutoSuggestBox.Text.ToLower().Split(" ");
|
||||||
|
foreach (var fontFamily in SystemFontNames)
|
||||||
|
{
|
||||||
|
var found = splitText.All((key) =>
|
||||||
|
{
|
||||||
|
return fontFamily.ToLower().Contains(key);
|
||||||
|
});
|
||||||
|
if (found)
|
||||||
|
{
|
||||||
|
suitableItems.Add(fontFamily);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (suitableItems.Count == 0)
|
||||||
|
{
|
||||||
|
suitableItems.Add("N/A");
|
||||||
|
}
|
||||||
|
AutoSuggestBox.ItemsSource = suitableItems.Order();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
|
||||||
|
{
|
||||||
|
// Since selecting an item will also change the text,
|
||||||
|
// only listen to changes caused by user entering text.
|
||||||
|
if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
|
||||||
|
{
|
||||||
|
UpdateAutoSuggestBoxItemsSource();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
SystemFontNames = [.. FontHelper.SystemFontFamilies];
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AutoSuggestBox_GotFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
UpdateAutoSuggestBoxItemsSource();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AutoSuggestBox_LostFocus(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
AutoSuggestBox.Text = SelectedFontFamily;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.LyricsBackgroundSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dev="using:DevWinUI"
|
||||||
|
xmlns:enums="using:BetterLyrics.WinUI3.Enums"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:uc="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageTheme" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox x:Name="ThemeComboBox" SelectedIndex="{x:Bind LyricsBackgroundSettings.LyricsBackgroundTheme, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageFollowSystem" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLight" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageDark" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPagePureLayer"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="{x:Bind LyricsBackgroundSettings.IsPureColorOverlayEnabled, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsBackgroundSettings.IsPureColorOverlayEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageOpacity" IsEnabled="{x:Bind LyricsBackgroundSettings.IsPureColorOverlayEnabled, Mode=OneWay}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Default="100"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind LyricsBackgroundSettings.PureColorOverlayOpacity, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageAlbumArtLayer"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageOpacity" IsEnabled="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Default="100"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind LyricsBackgroundSettings.CoverOverlayOpacity, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageSpeed" IsEnabled="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Default="50"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind LyricsBackgroundSettings.CoverOverlaySpeed, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageBlurAmount" IsEnabled="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Default="100"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Value="{x:Bind LyricsBackgroundSettings.CoverOverlayBlurAmount, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageBackgroundAcrylicEffectAmount" IsEnabled="{x:Bind LyricsBackgroundSettings.IsCoverOverlayEnabled, Mode=OneWay}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Default="0"
|
||||||
|
Maximum="10"
|
||||||
|
Minimum="0"
|
||||||
|
Value="{x:Bind LyricsBackgroundSettings.CoverAcrylicEffectAmount, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageFluidLayer"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="{x:Bind LyricsBackgroundSettings.IsFluidOverlayEnabled, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsBackgroundSettings.IsFluidOverlayEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageOpacity" IsEnabled="{x:Bind LyricsBackgroundSettings.IsFluidOverlayEnabled, Mode=OneWay}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Default="100"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind LyricsBackgroundSettings.FluidOverlayOpacity, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPagePaletteGeneratorType" IsEnabled="{x:Bind LyricsBackgroundSettings.IsFluidOverlayEnabled, Mode=OneWay}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsBackgroundSettings.PaletteGeneratorType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageMedianCut" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageOctTree" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageSnowFlakeLayer"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="{x:Bind LyricsBackgroundSettings.IsSnowFlakeOverlayEnabled, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsBackgroundSettings.IsSnowFlakeOverlayEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAmount" IsEnabled="{x:Bind LyricsBackgroundSettings.IsSnowFlakeOverlayEnabled, Mode=OneWay}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Maximum="10"
|
||||||
|
Minimum="0"
|
||||||
|
ResetButtonVisibility="Collapsed"
|
||||||
|
Value="{x:Bind LyricsBackgroundSettings.SnowFlakeOverlayAmount, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageSpeed" IsEnabled="{x:Bind LyricsBackgroundSettings.IsSnowFlakeOverlayEnabled, Mode=OneWay}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Maximum="10"
|
||||||
|
Minimum="1"
|
||||||
|
ResetButtonVisibility="Collapsed"
|
||||||
|
Value="{x:Bind LyricsBackgroundSettings.SnowFlakeOverlaySpeed, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageFogLayer" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsBackgroundSettings.IsFogOverlayEnabled, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageSpectrumLayer"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="{x:Bind LyricsBackgroundSettings.IsSpectrumOverlayEnabled, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsBackgroundSettings.IsSpectrumOverlayEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageSpectrumLayerPlacement" IsEnabled="{x:Bind LyricsBackgroundSettings.IsSpectrumOverlayEnabled, Mode=OneWay}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsBackgroundSettings.SpectrumPlacement, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageSpectrumPlacementTop" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageSpectrumPlacementBottom" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using BetterLyrics.WinUI3.Models.Settings;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class LyricsBackgroundSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public static readonly DependencyProperty LyricsBackgroundSettingsProperty =
|
||||||
|
DependencyProperty.Register(nameof(LyricsBackgroundSettings), typeof(LyricsBackgroundSettings), typeof(LyricsBackgroundSettingsControl), new PropertyMetadata(default));
|
||||||
|
|
||||||
|
public LyricsBackgroundSettings LyricsBackgroundSettings
|
||||||
|
{
|
||||||
|
get => (LyricsBackgroundSettings)GetValue(LyricsBackgroundSettingsProperty);
|
||||||
|
set => SetValue(LyricsBackgroundSettingsProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LyricsBackgroundSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,296 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.LyricsEffectSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dev="using:DevWinUI"
|
||||||
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<!-- Effect -->
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SettingsPageLyricsEffect"
|
||||||
|
Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||||
|
Text="Effect" />
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsVerticalEdgeOpacity" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
x:Uid="SettingsPageLyricsVerticalEdgeOpacitySlider"
|
||||||
|
Default="0"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsVerticalEdgeOpacity, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsBlurAmount" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
x:Uid="SettingsPageLyricsBlurAmountExtendedSlider"
|
||||||
|
Default="5"
|
||||||
|
Maximum="10"
|
||||||
|
Minimum="0"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsBlurAmount, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsLineFade" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsEffectSettings.IsLyricsLineFadeEnabled, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<!-- 高亮 -->
|
||||||
|
<dev:SettingsExpander x:Uid="SettingsPageLyricsHighlight" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPagePhoneticText">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="60"
|
||||||
|
Frequency="5"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.PhoneticLyricsHighlightAmount, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsHighlightScope">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsEffectSettings.OriginalLyricsHighlightScope, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeCurrentChar" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeLineStartToCurrentChar" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeCurrentLine" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageOriginalText">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="60"
|
||||||
|
Frequency="5"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.OriginalLyricsHighlightAmount, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageTranslatedText">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="60"
|
||||||
|
Frequency="5"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.TranslatedLyricsHighlightAmount, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<!-- 阴影 -->
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageLyricsShadow"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="{x:Bind LyricsEffectSettings.IsLyricsShadowEnabled, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsEffectSettings.IsLyricsShadowEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageScope" IsEnabled="{x:Bind LyricsEffectSettings.IsLyricsShadowEnabled, Mode=OneWay}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsEffectSettings.LyricsShadowScope, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeCurrentChar" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeLineStartToCurrentChar" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeCurrentLine" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAmount" IsEnabled="{x:Bind LyricsEffectSettings.IsLyricsShadowEnabled, Mode=OneWay}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="8"
|
||||||
|
Maximum="20"
|
||||||
|
Minimum="1"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsShadowAmount, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<!-- 辉光效果 -->
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageLyricsGlowEffect"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="{x:Bind LyricsEffectSettings.IsLyricsGlowEffectEnabled, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsEffectSettings.IsLyricsGlowEffectEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageScope" IsEnabled="{x:Bind LyricsEffectSettings.IsLyricsGlowEffectEnabled, Mode=OneWay}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsEffectSettings.LyricsGlowEffectScope, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeCurrentChar" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeLineStartToCurrentChar" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRendingScopeCurrentLine" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAmount" IsEnabled="{x:Bind LyricsEffectSettings.IsLyricsGlowEffectEnabled, Mode=OneWay}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="8"
|
||||||
|
Maximum="20"
|
||||||
|
Minimum="1"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsGlowEffectAmount, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<!-- 浮动动画 -->
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageLyricsFloatAnimation"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="True">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsEffectSettings.IsLyricsFloatAnimationEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAmount" IsEnabled="{x:Bind LyricsEffectSettings.IsLyricsGlowEffectEnabled, Mode=OneWay}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="1"
|
||||||
|
Maximum="4"
|
||||||
|
Minimum="1"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsFloatAmount, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<!-- 扇形歌词 -->
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageFan"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="{x:Bind LyricsEffectSettings.IsFanLyricsEnabled, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsEffectSettings.IsFanLyricsEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard IsEnabled="{x:Bind LyricsEffectSettings.IsFanLyricsEnabled, Mode=OneWay}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="30"
|
||||||
|
Maximum="90"
|
||||||
|
Minimum="-90"
|
||||||
|
Unit="°"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.FanLyricsAngle, Mode=TwoWay}" />
|
||||||
|
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<!-- 3D 歌词 -->
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPage3DLyrics"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="{x:Bind LyricsEffectSettings.Is3DLyricsEnabled, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsEffectSettings.Is3DLyricsEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard Header="X" IsEnabled="{x:Bind LyricsEffectSettings.Is3DLyricsEnabled, Mode=OneWay}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="0"
|
||||||
|
Maximum="90"
|
||||||
|
Minimum="-90"
|
||||||
|
Unit="°"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.Lyrics3DXAngle, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard Header="Y" IsEnabled="{x:Bind LyricsEffectSettings.Is3DLyricsEnabled, Mode=OneWay}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="0"
|
||||||
|
Maximum="90"
|
||||||
|
Minimum="-90"
|
||||||
|
Unit="°"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.Lyrics3DYAngle, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard Header="Z" IsEnabled="{x:Bind LyricsEffectSettings.Is3DLyricsEnabled, Mode=OneWay}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="0"
|
||||||
|
Maximum="90"
|
||||||
|
Minimum="-90"
|
||||||
|
Unit="°"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.Lyrics3DZAngle, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPage3DLyricsDepth" IsEnabled="{x:Bind LyricsEffectSettings.Is3DLyricsEnabled, Mode=OneWay}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="1000"
|
||||||
|
Frequency="10"
|
||||||
|
Maximum="1000"
|
||||||
|
Minimum="100"
|
||||||
|
Unit="°"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.Lyrics3DDepth, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<!-- 滚动动画 -->
|
||||||
|
<dev:SettingsExpander x:Uid="SettingsPageScrollEasing" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsEffectSettings.LyricsScrollEasingType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeLinear" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeSmoothStep" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutSine" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutQuad" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutCubic" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutQuart" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutQuint" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutExpo" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutCirc" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutBack" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutElastic" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEasingTypeEaseInOutBounce" />
|
||||||
|
</ComboBox>
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageScrollTopDuration">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="500"
|
||||||
|
Frequency="50"
|
||||||
|
Maximum="1000"
|
||||||
|
Minimum="50"
|
||||||
|
Unit="ms"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsScrollTopDuration, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageScrollDuration">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="500"
|
||||||
|
Frequency="50"
|
||||||
|
Maximum="1000"
|
||||||
|
Minimum="50"
|
||||||
|
Unit="ms"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsScrollDuration, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageScrollBottomDuration">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="500"
|
||||||
|
Frequency="50"
|
||||||
|
Maximum="1000"
|
||||||
|
Minimum="50"
|
||||||
|
Unit="ms"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsScrollBottomDuration, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageScrollTopDelay">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="0"
|
||||||
|
Frequency="50"
|
||||||
|
Maximum="2000"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="ms"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsScrollTopDelay, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageScrollBottomDelay">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="0"
|
||||||
|
Frequency="50"
|
||||||
|
Maximum="2000"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="ms"
|
||||||
|
Value="{x:Bind LyricsEffectSettings.LyricsScrollBottomDelay, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using BetterLyrics.WinUI3.Models.Settings;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class LyricsEffectSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public LyricsEffectSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty LyricsEffectSettingsProperty =
|
||||||
|
DependencyProperty.Register(nameof(LyricsEffectSettings), typeof(LyricsEffectSettings), typeof(LyricsEffectSettingsControl), new PropertyMetadata(default));
|
||||||
|
|
||||||
|
public LyricsEffectSettings LyricsEffectSettings
|
||||||
|
{
|
||||||
|
get => (LyricsEffectSettings)GetValue(LyricsEffectSettingsProperty);
|
||||||
|
set => SetValue(LyricsEffectSettingsProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,297 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.LyricsSearchControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dev="using:DevWinUI"
|
||||||
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:models="using:BetterLyrics.WinUI3.Models"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid Padding="16" RowSpacing="6">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid Grid.Row="0">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid Grid.Column="0">
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
<TextBlock x:Uid="LyricsSearchControlSongInfoMapping" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<Grid
|
||||||
|
Padding="16"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
CornerRadius="4">
|
||||||
|
<StackPanel Spacing="6">
|
||||||
|
<TextBlock x:Uid="LyricsSearchControlTitle" />
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
IsTextSelectionEnabled="True"
|
||||||
|
Text="{x:Bind ViewModel.MappedSongSearchQuery.OriginalTitle, Mode=OneWay}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
|
<TextBlock x:Uid="LyricsSearchControlMappedAs" VerticalAlignment="Center" />
|
||||||
|
<TextBox Text="{x:Bind ViewModel.MappedSongSearchQuery.MappedTitle, Mode=TwoWay}" TextWrapping="Wrap" />
|
||||||
|
<Button
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Command="{x:Bind ViewModel.ResetMappedTitleCommand}"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid
|
||||||
|
Padding="16"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
CornerRadius="4">
|
||||||
|
<StackPanel Spacing="6">
|
||||||
|
|
||||||
|
<TextBlock x:Uid="LyricsSearchControlArtist" />
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
IsTextSelectionEnabled="True"
|
||||||
|
Text="{x:Bind ViewModel.MappedSongSearchQuery.OriginalArtist, Mode=OneWay}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
|
<TextBlock x:Uid="LyricsSearchControlMappedAs" VerticalAlignment="Center" />
|
||||||
|
<TextBox Text="{x:Bind ViewModel.MappedSongSearchQuery.MappedArtist, Mode=TwoWay}" TextWrapping="Wrap" />
|
||||||
|
<RichTextBlock Foreground="{ThemeResource TextFillColorSecondaryBrush}" TextWrapping="Wrap">
|
||||||
|
<Paragraph>
|
||||||
|
<Run x:Uid="ArtistsSplitHint" />
|
||||||
|
<Run Text=";" />
|
||||||
|
<Run Text="," />
|
||||||
|
<Run Text="/" />
|
||||||
|
<Run Text=";" />
|
||||||
|
<Run Text="、" />
|
||||||
|
<Run Text="," />
|
||||||
|
</Paragraph>
|
||||||
|
</RichTextBlock>
|
||||||
|
<Button
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Command="{x:Bind ViewModel.ResetMappedArtistCommand}"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid
|
||||||
|
Padding="16"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
CornerRadius="4">
|
||||||
|
<StackPanel Spacing="6">
|
||||||
|
|
||||||
|
<TextBlock x:Uid="LyricsSearchControlAlbum" />
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
IsTextSelectionEnabled="True"
|
||||||
|
Text="{x:Bind ViewModel.MappedSongSearchQuery.OriginalAlbum, Mode=OneWay}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
|
<TextBlock x:Uid="LyricsSearchControlMappedAs" VerticalAlignment="Center" />
|
||||||
|
<TextBox Text="{x:Bind ViewModel.MappedSongSearchQuery.MappedAlbum, Mode=TwoWay}" TextWrapping="Wrap" />
|
||||||
|
<Button
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Command="{x:Bind ViewModel.ResetMappedAlbumCommand}"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<dev:SettingsCard>
|
||||||
|
<CheckBox x:Uid="LyricsSearchControlMarkAsPureMusic" IsChecked="{x:Bind ViewModel.MappedSongSearchQuery.IsMarkedAsPureMusic, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="LyricsSearchControlTargetSearchProvider">
|
||||||
|
<Button
|
||||||
|
x:Uid="LyricsSearchControlSearch"
|
||||||
|
Command="{x:Bind ViewModel.SearchCommand}"
|
||||||
|
Style="{StaticResource AccentButtonStyle}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
<Grid Grid.Column="1">
|
||||||
|
<ListView ItemsSource="{x:Bind ViewModel.LyricsSearchResults, Mode=OneWay}" SelectedItem="{x:Bind ViewModel.SelectedLyricsSearchResult, Mode=TwoWay}">
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate x:DataType="models:LyricsSearchResult">
|
||||||
|
<ListViewItem IsEnabled="{x:Bind IsFound}">
|
||||||
|
<StackPanel Padding="3,6" Opacity="{x:Bind IsFound, Converter={StaticResource BoolToPartialOpacityConverter}}">
|
||||||
|
<TextBlock Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}" Text="{x:Bind Provider, Converter={StaticResource LyricsSearchProviderToDisplayNameConverter}}" />
|
||||||
|
<TextBlock
|
||||||
|
Text="{x:Bind Title}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Visibility="{x:Bind IsFound, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Text="{x:Bind DisplayArtists}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Visibility="{x:Bind IsFound, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Text="{x:Bind Album}"
|
||||||
|
TextWrapping="Wrap"
|
||||||
|
Visibility="{x:Bind IsFound, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="LyricsSearchControlNotFound"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Visibility="{x:Bind IsFound, Converter={StaticResource BoolNegationToVisibilityConverter}}" />
|
||||||
|
</StackPanel>
|
||||||
|
</ListViewItem>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.LyricsSearchResults.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.LyricsSearchResults.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
</ListView>
|
||||||
|
<StackPanel
|
||||||
|
Padding="0,36"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Spacing="12">
|
||||||
|
<Image MaxWidth="100" Source="/Assets/Empty.png" />
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.LyricsSearchResults.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.LyricsSearchResults.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
</StackPanel>
|
||||||
|
<ProgressBar
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
IsIndeterminate="True"
|
||||||
|
ShowError="False"
|
||||||
|
ShowPaused="False"
|
||||||
|
Visibility="{x:Bind ViewModel.IsSearching, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid Grid.Column="2">
|
||||||
|
<Pivot ItemsSource="{x:Bind ViewModel.LyricsDataArr, Mode=OneWay}">
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.LyricsDataArr, Mode=OneWay}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="{x:Null}">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.LyricsDataArr, Mode=OneWay}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="{x:Null}">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
<Pivot.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Text="{Binding LanguageCode, Mode=OneWay, Converter={StaticResource LanguageCodeToDisplayedNameConverter}}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</Pivot.HeaderTemplate>
|
||||||
|
<Pivot.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<ListView ItemsSource="{Binding LyricsLines, Mode=OneWay}" SelectionChanged="ListView_SelectionChanged">
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Foreground="{ThemeResource SystemFillColorNeutralBrush}" Text="{Binding StartMs, Converter={StaticResource MillisecondsToFormattedTimeConverter}}" />
|
||||||
|
<TextBlock
|
||||||
|
Margin="1,0"
|
||||||
|
Foreground="{ThemeResource SystemFillColorNeutralBrush}"
|
||||||
|
Text="-" />
|
||||||
|
<TextBlock Foreground="{ThemeResource SystemFillColorNeutralBrush}" Text="{Binding EndMs, Converter={StaticResource MillisecondsToFormattedTimeConverter}}" />
|
||||||
|
<TextBlock Margin="6,0" Text="{Binding OriginalText}" />
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
</DataTemplate>
|
||||||
|
</Pivot.ItemTemplate>
|
||||||
|
</Pivot>
|
||||||
|
<StackPanel
|
||||||
|
Padding="0,36"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Spacing="12">
|
||||||
|
<Image MaxWidth="100" Source="/Assets/Page.png" />
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.LyricsDataArr, Mode=OneWay}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="{x:Null}">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.LyricsDataArr, Mode=OneWay}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="{x:Null}">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
<Grid Grid.Row="1">
|
||||||
|
<RelativePanel>
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="LyricsSearchControlHelp"
|
||||||
|
Margin="0,0,24,0"
|
||||||
|
FontSize="12"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
RelativePanel.AlignVerticalCenterWithPanel="True"
|
||||||
|
RelativePanel.LeftOf="Reset"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
<Button
|
||||||
|
x:Name="Reset"
|
||||||
|
x:Uid="LyricsSearchControlReset"
|
||||||
|
Margin="0,0,6,0"
|
||||||
|
Command="{x:Bind ViewModel.ResetCommand}"
|
||||||
|
RelativePanel.AlignVerticalCenterWithPanel="True"
|
||||||
|
RelativePanel.LeftOf="SaveChanges" />
|
||||||
|
<Button
|
||||||
|
x:Name="SaveChanges"
|
||||||
|
x:Uid="LyricsSearchControlSaveChanges"
|
||||||
|
Command="{x:Bind ViewModel.SaveCommand}"
|
||||||
|
RelativePanel.AlignRightWithPanel="True"
|
||||||
|
RelativePanel.AlignVerticalCenterWithPanel="True"
|
||||||
|
Style="{StaticResource AccentButtonStyle}" />
|
||||||
|
</RelativePanel>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using BetterLyrics.WinUI3.Models;
|
||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class LyricsSearchControl : UserControl
|
||||||
|
{
|
||||||
|
public LyricsSearchControlViewModel ViewModel => (LyricsSearchControlViewModel)DataContext;
|
||||||
|
|
||||||
|
public LyricsSearchControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetRequiredService<LyricsSearchControlViewModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.SelectedLyricsLine = e.OriginalSource as LyricsLine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,241 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.LyricsStyleSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dev="using:DevWinUI"
|
||||||
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<!-- Lyrics style -->
|
||||||
|
|
||||||
|
<TextBlock x:Uid="SettingsPageLyricsStyle" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsAlignment" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsStyleSettings.LyricsAlignmentType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsLeft" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsCenter" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsRight" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsExpander x:Uid="SettingsPageLyricsFontFamily" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageCJK">
|
||||||
|
<local:FontFamilyAutoSuggestBox SelectedFontFamily="{x:Bind LyricsStyleSettings.LyricsCJKFontFamily, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageWesternChar">
|
||||||
|
<local:FontFamilyAutoSuggestBox SelectedFontFamily="{x:Bind LyricsStyleSettings.LyricsWesternFontFamily, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsFontWeight" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsStyleSettings.LyricsFontWeight, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsThin" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsExtraLight" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsLight" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsSemiLight" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsNormal" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsMedium" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsSemiBold" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsBold" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsExtraBold" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsBlack" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsExtraBlack" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsBgFontOpacity" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="30"
|
||||||
|
Maximum="100"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="%"
|
||||||
|
Value="{x:Bind LyricsStyleSettings.LyricsBgFontOpacity, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsFontStrokeWidth" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Default="0"
|
||||||
|
Maximum="10"
|
||||||
|
Minimum="0"
|
||||||
|
Value="{x:Bind LyricsStyleSettings.LyricsFontStrokeWidth, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<!-- 字体颜色 -->
|
||||||
|
<dev:SettingsExpander x:Uid="SettingsPageFontColor" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageStrokeFontColor">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsStyleSettings.LyricsStrokeFontColorType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorAdaptiveColored" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorAdaptiveGrayed" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorCustom" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard HorizontalContentAlignment="Left">
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind LyricsStyleSettings.LyricsStrokeFontColorType, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="2">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind LyricsStyleSettings.LyricsStrokeFontColorType, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="2">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
<ColorPicker
|
||||||
|
ColorSpectrumShape="Box"
|
||||||
|
IsAlphaEnabled="True"
|
||||||
|
IsAlphaSliderVisible="True"
|
||||||
|
IsAlphaTextInputVisible="True"
|
||||||
|
IsColorChannelTextInputVisible="True"
|
||||||
|
IsColorSliderVisible="True"
|
||||||
|
IsHexInputVisible="True"
|
||||||
|
IsMoreButtonVisible="True"
|
||||||
|
Color="{x:Bind LyricsStyleSettings.LyricsCustomStrokeFontColor, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsBgFontColor">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsStyleSettings.LyricsBgFontColorType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorAdaptiveColored" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorAdaptiveGrayed" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorCustom" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard>
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind LyricsStyleSettings.LyricsBgFontColorType, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="2">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind LyricsStyleSettings.LyricsBgFontColorType, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="2">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
<ColorPicker
|
||||||
|
ColorSpectrumShape="Box"
|
||||||
|
IsAlphaEnabled="True"
|
||||||
|
IsAlphaSliderVisible="True"
|
||||||
|
IsAlphaTextInputVisible="True"
|
||||||
|
IsColorChannelTextInputVisible="True"
|
||||||
|
IsColorSliderVisible="True"
|
||||||
|
IsHexInputVisible="True"
|
||||||
|
IsMoreButtonVisible="True"
|
||||||
|
Color="{x:Bind LyricsStyleSettings.LyricsCustomBgFontColor, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsFgFontColor">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind LyricsStyleSettings.LyricsFgFontColorType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorAdaptiveColored" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorAdaptiveGrayed" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLyricsFontColorCustom" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard>
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind LyricsStyleSettings.LyricsFgFontColorType, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="2">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind LyricsStyleSettings.LyricsFgFontColorType, Mode=OneWay, Converter={StaticResource EnumToIntConverter}}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="2">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
<ColorPicker
|
||||||
|
ColorSpectrumShape="Box"
|
||||||
|
IsAlphaEnabled="True"
|
||||||
|
IsAlphaSliderVisible="True"
|
||||||
|
IsAlphaTextInputVisible="True"
|
||||||
|
IsColorChannelTextInputVisible="True"
|
||||||
|
IsColorSliderVisible="True"
|
||||||
|
IsHexInputVisible="True"
|
||||||
|
IsMoreButtonVisible="True"
|
||||||
|
Color="{x:Bind LyricsStyleSettings.LyricsCustomFgFontColor, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<!-- 字体大小 -->
|
||||||
|
<dev:SettingsExpander x:Uid="SettingsPageLyricsFontSize" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAutoAdjust">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind LyricsStyleSettings.IsDynamicLyricsFontSize, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPagePhoneticText" IsEnabled="{x:Bind LyricsStyleSettings.IsDynamicLyricsFontSize, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Frequency="2"
|
||||||
|
Maximum="256"
|
||||||
|
Minimum="12"
|
||||||
|
ResetButtonVisibility="Collapsed"
|
||||||
|
Value="{x:Bind LyricsStyleSettings.PhoneticLyricsFontSize, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageOriginalText" IsEnabled="{x:Bind LyricsStyleSettings.IsDynamicLyricsFontSize, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Frequency="2"
|
||||||
|
Maximum="256"
|
||||||
|
Minimum="12"
|
||||||
|
ResetButtonVisibility="Collapsed"
|
||||||
|
Value="{x:Bind LyricsStyleSettings.OriginalLyricsFontSize, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageTranslatedText" IsEnabled="{x:Bind LyricsStyleSettings.IsDynamicLyricsFontSize, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Frequency="2"
|
||||||
|
Maximum="256"
|
||||||
|
Minimum="12"
|
||||||
|
ResetButtonVisibility="Collapsed"
|
||||||
|
Value="{x:Bind LyricsStyleSettings.TranslatedLyricsFontSize, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsLineSpacingFactor" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
x:Uid="SettingsPageLyricsLineSpacingFactorSlider"
|
||||||
|
Default="0.5"
|
||||||
|
Frequency="0.1"
|
||||||
|
Maximum="2"
|
||||||
|
Minimum="0"
|
||||||
|
Unit="x"
|
||||||
|
Value="{x:Bind LyricsStyleSettings.LyricsLineSpacingFactor, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsTranslationSeparator" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<TextBox AcceptsReturn="True" Text="{x:Bind LyricsStyleSettings.LyricsTranslationSeparator, Mode=TwoWay}" />
|
||||||
|
<Button Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, FontSize=12, Glyph=}" Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
</StackPanel>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using BetterLyrics.WinUI3.Models.Settings;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class LyricsStyleSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public LyricsStyleSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty LyricsStyleSettingsProperty =
|
||||||
|
DependencyProperty.Register(nameof(LyricsStyleSettings), typeof(LyricsStyleSettings), typeof(LyricsStyleSettingsControl), new PropertyMetadata(default));
|
||||||
|
|
||||||
|
public LyricsStyleSettings LyricsStyleSettings
|
||||||
|
{
|
||||||
|
get => (LyricsStyleSettings)GetValue(LyricsStyleSettingsProperty);
|
||||||
|
set => SetValue(LyricsStyleSettingsProperty, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,399 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.LyricsWindowSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:constants="using:BetterLyrics.WinUI3.Constants"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dev="using:DevWinUI"
|
||||||
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:uc="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid ColumnSpacing="6">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid Grid.Column="0">
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SettingsPageRecordedWindowStatus"
|
||||||
|
RelativePanel.AlignLeftWithPanel="True"
|
||||||
|
Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="3">
|
||||||
|
|
||||||
|
<!-- Create from templates -->
|
||||||
|
<Button Content="{ui:FontIcon FontSize=16, FontFamily={StaticResource IconFontFamily}, Glyph=}" Style="{StaticResource GhostButtonStyle}">
|
||||||
|
<ToolTipService.ToolTip>
|
||||||
|
<ToolTip x:Uid="SettingsPageCreateFromTemplates" />
|
||||||
|
</ToolTipService.ToolTip>
|
||||||
|
<Button.Flyout>
|
||||||
|
<MenuFlyout>
|
||||||
|
<MenuFlyoutItem x:Uid="SettingsPageStandardMode" Command="{x:Bind ViewModel.CreateStandardLyricsWindowStatusCommand}" />
|
||||||
|
<MenuFlyoutItem x:Uid="SettingsPageDesktopMode" Command="{x:Bind ViewModel.CreateTransparentLyricsWindowStatusCommand}" />
|
||||||
|
<MenuFlyoutItem x:Uid="SettingsPageDockedMode" Command="{x:Bind ViewModel.CreateDockedLyricsWindowStatusCommand}" />
|
||||||
|
<MenuFlyoutItem x:Uid="SettingsPageFullscreenMode" Command="{x:Bind ViewModel.CreateFullLyricsWindowStatusCommand}" />
|
||||||
|
<MenuFlyoutItem x:Uid="SettingsPageNarrowMode" Command="{x:Bind ViewModel.CreateNarrowLyricsWindowStatusCommand}" />
|
||||||
|
</MenuFlyout>
|
||||||
|
</Button.Flyout>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<!-- Import -->
|
||||||
|
<Button
|
||||||
|
Click="ImportButton_Click"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=16,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}">
|
||||||
|
<ToolTipService.ToolTip>
|
||||||
|
<ToolTip x:Uid="SettingsPageImport" />
|
||||||
|
</ToolTipService.ToolTip>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<!-- Sharing hub -->
|
||||||
|
<HyperlinkButton x:Uid="SettingsPageShareHub" NavigateUri="{x:Bind constants:Link.ShareHubUrl}" />
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel
|
||||||
|
Padding="24,0"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
CornerRadius="4"
|
||||||
|
Spacing="16"
|
||||||
|
Visibility="{Binding ElementName=LyricsWindowManagerExpander, Path=IsExpanded, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
x:Name="WindowStatusListView"
|
||||||
|
Padding="0,12"
|
||||||
|
CornerRadius="4"
|
||||||
|
ItemsSource="{x:Bind ViewModel.AppSettings.WindowBoundsRecords, Mode=OneWay}"
|
||||||
|
SelectedItem="{x:Bind ViewModel.LiveStates.LyricsWindowStatus, Mode=TwoWay}">
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<controls:WrapPanel HorizontalSpacing="0" VerticalSpacing="0" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel
|
||||||
|
Padding="0,10"
|
||||||
|
RightTapped="StackPanel_RightTapped"
|
||||||
|
Spacing="6">
|
||||||
|
<StackPanel.ContextFlyout>
|
||||||
|
<MenuBarItemFlyout>
|
||||||
|
<MenuFlyoutItem
|
||||||
|
x:Uid="LyricsWindowSettingsControlSetDefault"
|
||||||
|
Click="SetDefaultMenuFlyoutItem_Click"
|
||||||
|
IsEnabled="{Binding IsDefault, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}" />
|
||||||
|
<MenuFlyoutItem x:Uid="SettingsPageCreateFromCurrent" Click="CopyMenuFlyoutItem_Click" />
|
||||||
|
<MenuFlyoutItem x:Uid="LyricsWindowSettingsControlShare" Click="ShareMenuFlyoutItem_Click" />
|
||||||
|
<MenuFlyoutItem
|
||||||
|
x:Uid="SettingsPageDelete"
|
||||||
|
Click="DeleteMenuFlyoutItem_Click"
|
||||||
|
IsEnabled="{Binding IsDefault, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}" />
|
||||||
|
</MenuBarItemFlyout>
|
||||||
|
</StackPanel.ContextFlyout>
|
||||||
|
<uc:DemoWindowGrid LyricsWindowStatus="{Binding}" />
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
<Grid Grid.Column="1">
|
||||||
|
|
||||||
|
<Grid Padding="36,0" Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<TextBlock x:Uid="LyricsWindowSettingsControlCurrentLyricsWindowConfig" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<Pivot SelectionChanged="Pivot_SelectionChanged">
|
||||||
|
|
||||||
|
<PivotItem Tag="General">
|
||||||
|
<PivotItem.Header>
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="AppSettingsControlGeneral"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}" />
|
||||||
|
</PivotItem.Header>
|
||||||
|
</PivotItem>
|
||||||
|
|
||||||
|
<PivotItem Tag="AlbumArtStyle">
|
||||||
|
<PivotItem.Header>
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SettingsPageAlbumStyle"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}" />
|
||||||
|
</PivotItem.Header>
|
||||||
|
</PivotItem>
|
||||||
|
|
||||||
|
<PivotItem Tag="LyricsStyle">
|
||||||
|
<PivotItem.Header>
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SettingsPageLyricsStyle"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}" />
|
||||||
|
</PivotItem.Header>
|
||||||
|
</PivotItem>
|
||||||
|
|
||||||
|
<PivotItem Tag="LyricsEffect">
|
||||||
|
<PivotItem.Header>
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SettingsPageLyricsEffect"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}" />
|
||||||
|
</PivotItem.Header>
|
||||||
|
</PivotItem>
|
||||||
|
|
||||||
|
<PivotItem Tag="LyricsBackground">
|
||||||
|
<PivotItem.Header>
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SettingsPageBackgroundOverlay"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}" />
|
||||||
|
</PivotItem.Header>
|
||||||
|
</PivotItem>
|
||||||
|
|
||||||
|
<PivotItem Tag="Advanced">
|
||||||
|
<PivotItem.Header>
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SettingsPageAdvanced"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource BodyTextBlockStyle}" />
|
||||||
|
</PivotItem.Header>
|
||||||
|
</PivotItem>
|
||||||
|
|
||||||
|
</Pivot>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<controls:SwitchPresenter Margin="0,110,0,0" Value="{x:Bind ViewModel.ListViewSelectedItemTag, Mode=OneWay}">
|
||||||
|
<controls:SwitchPresenter.ContentTransitions>
|
||||||
|
<TransitionCollection>
|
||||||
|
<PopupThemeTransition />
|
||||||
|
</TransitionCollection>
|
||||||
|
</controls:SwitchPresenter.ContentTransitions>
|
||||||
|
|
||||||
|
<!-- General -->
|
||||||
|
<controls:Case Value="General">
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageConfigName" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<StackPanel
|
||||||
|
Margin="0,6,0,0"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="6">
|
||||||
|
<TextBox Text="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.Name, Mode=TwoWay}" TextWrapping="Wrap" />
|
||||||
|
<Button Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, FontSize=12, Glyph=}" Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
</StackPanel>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageDisplayTypeSwitcher"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="True">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.LyricsDisplayType, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="MainPageAlbumArtOnly" />
|
||||||
|
<ComboBoxItem x:Uid="MainPageLyriscOnly" />
|
||||||
|
<ComboBoxItem x:Uid="MainPageSplitView" />
|
||||||
|
</ComboBox>
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLayoutOrientation">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.LyricsLayoutOrientation, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLayoutOrientationHorizontal" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageLayoutOrientationVertical" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageWorkArea"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsWorkArea, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsWorkArea, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageWorkAreaHeight" IsEnabled="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsWorkArea, Mode=OneWay}">
|
||||||
|
<uc:ExtendedSlider
|
||||||
|
Default="64"
|
||||||
|
Maximum="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.MonitorBounds.Height, Mode=OneWay}"
|
||||||
|
Minimum="64"
|
||||||
|
Unit="px"
|
||||||
|
Value="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.DockHeight, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageDockPlacement" IsEnabled="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsWorkArea, Mode=OneWay}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.DockPlacement, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageDockPlacementTop" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageDockPlacementBottom" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageDockMonitor" IsEnabled="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsWorkArea, Mode=OneWay}">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<ComboBox ItemsSource="{x:Bind ViewModel.MonitorDeviceNames, Mode=OneWay}" SelectedItem="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.MonitorDeviceName, Mode=TwoWay}" />
|
||||||
|
<Button
|
||||||
|
Command="{x:Bind ViewModel.RefreshMonitorDeviceNamesCommand}"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
</StackPanel>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageAdaptEnvColor"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsAdaptToEnvironment, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsAdaptToEnvironment, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard
|
||||||
|
x:Uid="SettingsPageEnvColorSample"
|
||||||
|
Header="Environment color sample mode"
|
||||||
|
IsEnabled="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsAdaptToEnvironment, Mode=OneWay}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.EnvironmentSampleMode, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEnvColorSampleBelow" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEnvColorSampleAbove" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEnvColorSampleInner" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageEnvColorSampleEdge" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageWindowBounds"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="True">
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard Header="X">
|
||||||
|
<NumberBox
|
||||||
|
SmallChange="10"
|
||||||
|
SpinButtonPlacementMode="Inline"
|
||||||
|
Value="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.WindowX, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard Header="Y">
|
||||||
|
<NumberBox
|
||||||
|
SmallChange="10"
|
||||||
|
SpinButtonPlacementMode="Inline"
|
||||||
|
Value="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.WindowY, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageWidth">
|
||||||
|
<NumberBox
|
||||||
|
SmallChange="10"
|
||||||
|
SpinButtonPlacementMode="Inline"
|
||||||
|
Value="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.WindowWidth, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageHeight">
|
||||||
|
<NumberBox
|
||||||
|
SmallChange="10"
|
||||||
|
SpinButtonPlacementMode="Inline"
|
||||||
|
Value="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.WindowHeight, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageAOT"
|
||||||
|
HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
IsExpanded="True">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsAlwaysOnTop, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageForceAlwaysOnTop" IsEnabled="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsAlwaysOnTop, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsAlwaysOnTopPolling, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageHideWindow" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.AutoShowOrHideWindow, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</controls:Case>
|
||||||
|
|
||||||
|
<!-- Album art area style -->
|
||||||
|
<controls:Case Value="AlbumArtStyle">
|
||||||
|
<uc:AlbumArtLayoutSettingsControl AlbumArtLayoutSettings="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.AlbumArtLayoutSettings, Mode=OneWay}" />
|
||||||
|
</controls:Case>
|
||||||
|
|
||||||
|
<!-- Lyrics style -->
|
||||||
|
<controls:Case Value="LyricsStyle">
|
||||||
|
<uc:LyricsStyleSettingsControl LyricsStyleSettings="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.LyricsStyleSettings, Mode=OneWay}" />
|
||||||
|
</controls:Case>
|
||||||
|
|
||||||
|
<!-- Lyrics effect -->
|
||||||
|
<controls:Case Value="LyricsEffect">
|
||||||
|
<uc:LyricsEffectSettingsControl LyricsEffectSettings="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.LyricsEffectSettings, Mode=OneWay}" />
|
||||||
|
</controls:Case>
|
||||||
|
|
||||||
|
<!-- Lyrics background -->
|
||||||
|
<controls:Case Value="LyricsBackground">
|
||||||
|
<uc:LyricsBackgroundSettingsControl LyricsBackgroundSettings="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.LyricsBackgroundSettings, Mode=OneWay}" />
|
||||||
|
</controls:Case>
|
||||||
|
|
||||||
|
<!-- Advanced -->
|
||||||
|
<controls:Case Value="Advanced">
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageShowInSwitchers" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsShownInSwitchers, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageClickThrough" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsClickThrough, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageBorderless" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.IsBorderless, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageDragArea" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind ViewModel.LiveStates.LyricsWindowStatus.TitleBarArea, Mode=TwoWay, Converter={StaticResource EnumToIntConverter}}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageTitleBarAreaNone" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageTitleBarAreaTop" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageTitleBarAreaWhole" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</controls:Case>
|
||||||
|
|
||||||
|
</controls:SwitchPresenter>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
using BetterLyrics.WinUI3.Helper;
|
||||||
|
using BetterLyrics.WinUI3.Models;
|
||||||
|
using BetterLyrics.WinUI3.Serialization;
|
||||||
|
using BetterLyrics.WinUI3.Services.LiveStatesService;
|
||||||
|
using BetterLyrics.WinUI3.Services.ResourceService;
|
||||||
|
using BetterLyrics.WinUI3.Services.SettingsService;
|
||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using BetterLyrics.WinUI3.Views;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using NTextCat.Commons;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using Windows.Storage;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class LyricsWindowSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public LyricsWindowSettingsControlViewModel ViewModel => (LyricsWindowSettingsControlViewModel)DataContext;
|
||||||
|
|
||||||
|
private readonly ISettingsService _settingsService = Ioc.Default.GetRequiredService<ISettingsService>();
|
||||||
|
private readonly ILiveStatesService _liveStatesService = Ioc.Default.GetRequiredService<ILiveStatesService>();
|
||||||
|
private readonly IResourceService _resourceService = Ioc.Default.GetRequiredService<IResourceService>();
|
||||||
|
|
||||||
|
public LyricsWindowSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetRequiredService<LyricsWindowSettingsControlViewModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DeleteMenuFlyoutItem_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is MenuFlyoutItem menuFlyoutItem)
|
||||||
|
{
|
||||||
|
if (menuFlyoutItem.DataContext is LyricsWindowStatus data)
|
||||||
|
{
|
||||||
|
if (_liveStatesService.LiveStates.LyricsWindowStatus == data)
|
||||||
|
{
|
||||||
|
_liveStatesService.LiveStates.LyricsWindowStatus = ViewModel.AppSettings.WindowBoundsRecords.First();
|
||||||
|
}
|
||||||
|
ViewModel.AppSettings.WindowBoundsRecords.Remove(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetDefaultMenuFlyoutItem_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is MenuFlyoutItem menuFlyoutItem)
|
||||||
|
{
|
||||||
|
if (menuFlyoutItem.DataContext is LyricsWindowStatus data)
|
||||||
|
{
|
||||||
|
ViewModel.AppSettings.WindowBoundsRecords.ForEach(x => x.IsDefault = false);
|
||||||
|
data.IsDefault = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ShareMenuFlyoutItem_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is MenuFlyoutItem menuFlyoutItem)
|
||||||
|
{
|
||||||
|
if (menuFlyoutItem.DataContext is LyricsWindowStatus data)
|
||||||
|
{
|
||||||
|
IDictionary<string, IList<string>> fileTypeChoices = new Dictionary<string, IList<string>>()
|
||||||
|
{
|
||||||
|
{ "JSON", new List<string>() { ".json" } }
|
||||||
|
};
|
||||||
|
StorageFile? file;
|
||||||
|
if (this.Parent is FlyoutPresenter)
|
||||||
|
{
|
||||||
|
file = await PickerHelper.PickSaveFileAsync<LyricsWindow>(fileTypeChoices);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
file = await PickerHelper.PickSaveFileAsync<SettingsWindow>(fileTypeChoices);
|
||||||
|
}
|
||||||
|
if (file != null)
|
||||||
|
{
|
||||||
|
var clonedData = (LyricsWindowStatus)data.Clone();
|
||||||
|
clonedData.IsDefault = false;
|
||||||
|
var json = System.Text.Json.JsonSerializer.Serialize(clonedData, SourceGenerationContext.Default.LyricsWindowStatus);
|
||||||
|
File.WriteAllText(file.Path, json);
|
||||||
|
DevWinUI.Growl.Success(_resourceService.GetLocalizedString("ExportSettingsSuccess"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CopyMenuFlyoutItem_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is MenuFlyoutItem menuFlyoutItem)
|
||||||
|
{
|
||||||
|
if (menuFlyoutItem.DataContext is LyricsWindowStatus data)
|
||||||
|
{
|
||||||
|
var clonedData = (LyricsWindowStatus)data.Clone();
|
||||||
|
clonedData.IsDefault = false;
|
||||||
|
ViewModel.AppSettings.WindowBoundsRecords.Add(clonedData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StackPanel_RightTapped(object sender, RightTappedRoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is StackPanel stackPanel)
|
||||||
|
{
|
||||||
|
if (stackPanel.DataContext is MenuBarItemFlyout menuBarItemFlyout)
|
||||||
|
{
|
||||||
|
menuBarItemFlyout.ShowAt(stackPanel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is Pivot pivot)
|
||||||
|
{
|
||||||
|
if (pivot.SelectedItem is PivotItem pivotItem)
|
||||||
|
{
|
||||||
|
ViewModel?.ListViewSelectedItemTag = pivotItem.Tag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void ImportButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
string[] fileTypeFilter = [".json"];
|
||||||
|
StorageFile? file;
|
||||||
|
if (this.Parent is FlyoutPresenter)
|
||||||
|
{
|
||||||
|
file = await PickerHelper.PickSingleFileAsync<LyricsWindow>(fileTypeFilter);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
file = await PickerHelper.PickSingleFileAsync<SettingsWindow>(fileTypeFilter);
|
||||||
|
}
|
||||||
|
if (file != null)
|
||||||
|
{
|
||||||
|
var json = File.ReadAllText(file.Path);
|
||||||
|
var data = System.Text.Json.JsonSerializer.Deserialize(json, SourceGenerationContext.Default.LyricsWindowStatus);
|
||||||
|
if (data != null)
|
||||||
|
{
|
||||||
|
ViewModel.AppSettings.WindowBoundsRecords.Add(data);
|
||||||
|
DevWinUI.Growl.Success(_resourceService.GetLocalizedString("ImportSettingsSuccess"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.LyricsWindowSwitchControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:uc="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<Grid x:Name="ShadowCastGrid" />
|
||||||
|
<Border
|
||||||
|
x:Name="ShadowRect"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
CornerRadius="12"
|
||||||
|
Loaded="ShadowRect_Loaded"
|
||||||
|
Translation="0,0,64">
|
||||||
|
<Border.Shadow>
|
||||||
|
<ThemeShadow x:Name="Shadow" />
|
||||||
|
</Border.Shadow>
|
||||||
|
</Border>
|
||||||
|
<Grid Background="{ThemeResource AcrylicBackgroundFillColorDefaultBrush}" CornerRadius="12">
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SystemTraySwitch"
|
||||||
|
Margin="20"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Top" />
|
||||||
|
<Button
|
||||||
|
Margin="12"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Click="Button_Click"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}">
|
||||||
|
<Button.KeyboardAccelerators>
|
||||||
|
<KeyboardAccelerator Key="Escape" />
|
||||||
|
</Button.KeyboardAccelerators>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
Margin="48,56"
|
||||||
|
ItemsSource="{x:Bind ViewModel.AppSettings.WindowBoundsRecords, Mode=OneWay}"
|
||||||
|
SelectedItem="{x:Bind ViewModel.LiveStates.LyricsWindowStatus, Mode=TwoWay}">
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<controls:WrapPanel HorizontalSpacing="0" VerticalSpacing="0" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid
|
||||||
|
Margin="0,10"
|
||||||
|
Padding="5"
|
||||||
|
AllowFocusOnInteraction="True"
|
||||||
|
CornerRadius="4"
|
||||||
|
Tapped="Grid_Tapped">
|
||||||
|
<uc:DemoWindowGrid LyricsWindowStatus="{Binding}" />
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
<StackPanel
|
||||||
|
Margin="20"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="6">
|
||||||
|
<HyperlinkButton Click="SettingsHypelinkButton_Click">
|
||||||
|
<HyperlinkButton.Content>
|
||||||
|
<TextBlock x:Uid="LyricsWindowSwitchWindowHelp" />
|
||||||
|
</HyperlinkButton.Content>
|
||||||
|
</HyperlinkButton>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
using BetterLyrics.WinUI3.Hooks;
|
||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using BetterLyrics.WinUI3.Views;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class LyricsWindowSwitchControl : UserControl
|
||||||
|
{
|
||||||
|
public LyricsWindowSwitchControlViewModel ViewModel => (LyricsWindowSwitchControlViewModel)DataContext;
|
||||||
|
|
||||||
|
public LyricsWindowSwitchControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetRequiredService<LyricsWindowSwitchControlViewModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void Grid_Tapped(object sender, TappedRoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await HideAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void Button_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await HideAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task HideAsync()
|
||||||
|
{
|
||||||
|
var lyricsWindowSwitchWindow = WindowHook.GetWindow<LyricsWindowSwitchWindow>();
|
||||||
|
lyricsWindowSwitchWindow?.ViewModel.RootGridOpacity = 0;
|
||||||
|
await Task.Delay(300);
|
||||||
|
WindowHook.HideWindow<LyricsWindowSwitchWindow>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShadowRect_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Shadow.Receivers.Add(ShadowCastGrid);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void SettingsHypelinkButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await HideAsync();
|
||||||
|
WindowHook.OpenOrShowWindow<SettingsWindow>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.MediaSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dev="using:DevWinUI"
|
||||||
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel>
|
||||||
|
|
||||||
|
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageMusicLib" HeaderIcon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}" />
|
||||||
|
|
||||||
|
<InfoBar
|
||||||
|
x:Uid="SettingsPageRemoveInfo"
|
||||||
|
BorderThickness="0"
|
||||||
|
CornerRadius="0"
|
||||||
|
IsClosable="False"
|
||||||
|
IsOpen="True"
|
||||||
|
Severity="Success">
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.AppSettings.LocalMediaFolders.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.AppSettings.LocalMediaFolders.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
</InfoBar>
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
ItemContainerStyle="{StaticResource ListViewStretchedItemContainerStyle}"
|
||||||
|
ItemsSource="{x:Bind ViewModel.AppSettings.LocalMediaFolders, Mode=OneWay}"
|
||||||
|
SelectionMode="None">
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<dev:SettingsExpander>
|
||||||
|
<dev:SettingsExpander.Header>
|
||||||
|
<HyperlinkButton
|
||||||
|
Click="LocalFolderHyperlinkButton_Click"
|
||||||
|
Content="{Binding Path, Mode=OneWay}"
|
||||||
|
Tag="{Binding Path, Mode=OneWay}" />
|
||||||
|
</dev:SettingsExpander.Header>
|
||||||
|
<ToggleSwitch IsOn="{Binding IsEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard>
|
||||||
|
<dev:SettingsCard.Header>
|
||||||
|
<HyperlinkButton
|
||||||
|
x:Uid="SettingsPageRemovePath"
|
||||||
|
Click="SettingsPageRemovePathButton_Click"
|
||||||
|
Tag="{Binding}" />
|
||||||
|
</dev:SettingsCard.Header>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageMusicLibRealTimeWatch">
|
||||||
|
<ToggleSwitch IsOn="{Binding IsRealTimeWatchEnabled, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAddFolder" Style="{StaticResource DefaultSettingsExpanderItemStyle}">
|
||||||
|
<Button
|
||||||
|
x:Uid="SettingsPageAddFolderButton"
|
||||||
|
Command="{x:Bind ViewModel.SelectAndAddFolderCommand}"
|
||||||
|
CommandParameter="{Binding ElementName=RootGrid}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using BetterLyrics.WinUI3.Models;
|
||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using System;
|
||||||
|
using Windows.System;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class MediaSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public MediaSettingsControlViewModel ViewModel => (MediaSettingsControlViewModel)DataContext;
|
||||||
|
public MediaSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetRequiredService<MediaSettingsControlViewModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SettingsPageRemovePathButton_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ViewModel.RemoveFolderAsync((LocalMediaFolder)(sender as HyperlinkButton)!.Tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void LocalFolderHyperlinkButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is HyperlinkButton button && button.Tag is string uriStr)
|
||||||
|
{
|
||||||
|
if (Uri.TryCreate(uriStr, UriKind.Absolute, out var uri))
|
||||||
|
{
|
||||||
|
await Launcher.LaunchUriAsync(uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,458 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.PlaybackSettingsControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:constants="using:BetterLyrics.WinUI3.Constants"
|
||||||
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:dev="using:DevWinUI"
|
||||||
|
xmlns:globalization="using:Windows.Globalization"
|
||||||
|
xmlns:helper="using:BetterLyrics.WinUI3.Helper"
|
||||||
|
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:models="using:BetterLyrics.WinUI3.Models"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid ColumnSpacing="6">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Grid Grid.Column="0" RowSpacing="18">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.AppSettings.MediaSourceProvidersInfo.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.AppSettings.MediaSourceProvidersInfo.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
|
||||||
|
<!-- 播放源列表 -->
|
||||||
|
<ListView
|
||||||
|
x:Name="MediaSourceProvidersListView"
|
||||||
|
Grid.Row="0"
|
||||||
|
AllowDrop="True"
|
||||||
|
CanDragItems="True"
|
||||||
|
CanReorderItems="True"
|
||||||
|
DragItemsCompleted="MediaSourceProvidersListView_DragItemsCompleted"
|
||||||
|
ItemsSource="{x:Bind ViewModel.AppSettings.MediaSourceProvidersInfo, Mode=OneWay}"
|
||||||
|
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||||
|
ScrollViewer.HorizontalScrollMode="Enabled"
|
||||||
|
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
||||||
|
ScrollViewer.VerticalScrollMode="Disabled"
|
||||||
|
SelectedItem="{x:Bind ViewModel.SelectedMediaSourceProvider, Mode=TwoWay}">
|
||||||
|
<ListView.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<ItemsStackPanel Orientation="Horizontal" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ListView.ItemsPanel>
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate x:DataType="models:MediaSourceProviderInfo">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<ToolTipService.ToolTip>
|
||||||
|
<ToolTip Content="{Binding Provider, Mode=OneWay}" />
|
||||||
|
</ToolTipService.ToolTip>
|
||||||
|
<FontIcon
|
||||||
|
FontFamily="Segoe UI Symbol"
|
||||||
|
FontSize="12"
|
||||||
|
Glyph="⠿" />
|
||||||
|
<Grid
|
||||||
|
Width="16"
|
||||||
|
Height="16"
|
||||||
|
CornerRadius="4">
|
||||||
|
<Image Source="{Binding Logo, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<TextBlock
|
||||||
|
MaxWidth="200"
|
||||||
|
Text="{Binding DisplayName, Mode=OneWay}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
<ScrollViewer Grid.Row="1" Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageMediaSourceProvidersConfig">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.SelectedMediaSourceProvider.IsEnabled, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLastFMTrack" IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.SelectedMediaSourceProvider.IsLastFMTrackEnabled, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageDiscordPresence">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.SelectedMediaSourceProvider.IsDiscordPresenceEnabled, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<!-- LX music server -->
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLXMusicServer" Visibility="{x:Bind ViewModel.SelectedMediaSourceProvider.IsLXMusic, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}">
|
||||||
|
<Grid ColumnSpacing="6">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBox
|
||||||
|
x:Uid="SettingsPageLXMusicServerInput"
|
||||||
|
Grid.Column="0"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsLXMusicServerTesting, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}"
|
||||||
|
Text="{x:Bind ViewModel.AppSettings.GeneralSettings.LXMusicServer, Mode=TwoWay}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
<Button
|
||||||
|
x:Uid="SettingsPageServerTestButton"
|
||||||
|
Grid.Column="1"
|
||||||
|
Command="{x:Bind ViewModel.LXMusicServerTestCommand}"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsLXMusicServerTesting, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<!-- 时间轴相关配置 -->
|
||||||
|
<dev:SettingsExpander x:Uid="SettingsPageLyricsTimeline" IsExpanded="True">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.SelectedMediaSourceProvider.IsTimelineSyncEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLyricsTimelineThreshold" IsEnabled="{x:Bind ViewModel.SelectedMediaSourceProvider.IsTimelineSyncEnabled, Mode=OneWay}">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
Frequency="100"
|
||||||
|
Maximum="1000"
|
||||||
|
Minimum="0"
|
||||||
|
ResetButtonVisibility="Collapsed"
|
||||||
|
Unit="ms"
|
||||||
|
Value="{x:Bind ViewModel.SelectedMediaSourceProvider.TimelineSyncThreshold, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
<dev:SettingsExpander x:Uid="MainPagePositionOffsetSlider" IsExpanded="True">
|
||||||
|
<local:ExtendedSlider
|
||||||
|
x:Uid="SettingsPagePositionOffsetReset"
|
||||||
|
Default="0"
|
||||||
|
Frequency="100"
|
||||||
|
Maximum="5000"
|
||||||
|
Minimum="-5000"
|
||||||
|
Unit="ms"
|
||||||
|
Value="{x:Bind ViewModel.SelectedMediaSourceProvider.PositionOffset, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="LyricsPagePositionOffsetHint">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.SelectedMediaSourceProvider.ResetPositionOffsetOnSongChanged, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<!-- 专辑封面源配置 -->
|
||||||
|
<TextBlock x:Uid="SettingsPageAlbumArtSearchProvidersConfig" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<ListView
|
||||||
|
x:Name="AlbumArtSearchProvidersListView"
|
||||||
|
AllowDrop="True"
|
||||||
|
CanDragItems="True"
|
||||||
|
CanReorderItems="True"
|
||||||
|
DragItemsCompleted="AlbumArtSearchProvidersListView_DragItemsCompleted"
|
||||||
|
ItemContainerStyle="{StaticResource ListViewStretchedItemContainerStyle}"
|
||||||
|
ItemsSource="{x:Bind ViewModel.SelectedMediaSourceProvider.AlbumArtSearchProvidersInfo, Mode=OneWay}"
|
||||||
|
SelectionMode="None">
|
||||||
|
<ListView.OpacityTransition>
|
||||||
|
<ScalarTransition />
|
||||||
|
</ListView.OpacityTransition>
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate x:DataType="models:AlbumArtSearchProviderInfo">
|
||||||
|
<dev:SettingsCard Header="{Binding Provider, Converter={StaticResource AlbumArtSearchProviderToDisplayNameConverter}, Mode=OneWay}">
|
||||||
|
<dev:SettingsCard.HeaderIcon>
|
||||||
|
<FontIcon FontFamily="Segoe UI Symbol" Glyph="⠿" />
|
||||||
|
</dev:SettingsCard.HeaderIcon>
|
||||||
|
<ToggleSwitch IsOn="{Binding IsEnabled, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
<!-- 歌词源配置 -->
|
||||||
|
<TextBlock x:Uid="SettingsPageLyricsSearchProvidersConfig" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<ListView
|
||||||
|
x:Name="LyricsSearchProvidersListView"
|
||||||
|
AllowDrop="True"
|
||||||
|
CanDragItems="True"
|
||||||
|
CanReorderItems="True"
|
||||||
|
DragItemsCompleted="LyricsSearchProvidersListView_DragItemsCompleted"
|
||||||
|
ItemsSource="{x:Bind ViewModel.SelectedMediaSourceProvider.LyricsSearchProvidersInfo, Mode=OneWay}"
|
||||||
|
SelectionMode="None">
|
||||||
|
<ListView.OpacityTransition>
|
||||||
|
<ScalarTransition />
|
||||||
|
</ListView.OpacityTransition>
|
||||||
|
<ListView.ItemContainerStyle>
|
||||||
|
<Style TargetType="ListViewItem">
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||||
|
<Setter Property="Margin" Value="0" />
|
||||||
|
<Setter Property="Padding" Value="0" />
|
||||||
|
</Style>
|
||||||
|
</ListView.ItemContainerStyle>
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate x:DataType="models:LyricsSearchProviderInfo">
|
||||||
|
<dev:SettingsCard Header="{Binding Provider, Converter={StaticResource LyricsSearchProviderToDisplayNameConverter}, Mode=OneWay}">
|
||||||
|
<dev:SettingsCard.HeaderIcon>
|
||||||
|
<FontIcon FontFamily="Segoe UI Symbol" Glyph="⠿" />
|
||||||
|
</dev:SettingsCard.HeaderIcon>
|
||||||
|
<ToggleSwitch IsOn="{Binding IsEnabled, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<StackPanel
|
||||||
|
Grid.Column="0"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Spacing="12">
|
||||||
|
<interactivity:Interaction.Behaviors>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.AppSettings.MediaSourceProvidersInfo.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="Equal"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
<interactivity:DataTriggerBehavior
|
||||||
|
Binding="{x:Bind ViewModel.AppSettings.MediaSourceProvidersInfo.Count, Mode=OneWay}"
|
||||||
|
ComparisonCondition="NotEqual"
|
||||||
|
Value="0">
|
||||||
|
<interactivity:ChangePropertyAction PropertyName="Visibility" Value="Collapsed" />
|
||||||
|
</interactivity:DataTriggerBehavior>
|
||||||
|
</interactivity:Interaction.Behaviors>
|
||||||
|
<Image MaxWidth="200" Source="/Assets/Leaf.png" />
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SettingsPagePlaybackNotFound"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
|
||||||
|
</StackPanel>
|
||||||
|
<Grid Grid.Column="1">
|
||||||
|
<ScrollViewer Style="{StaticResource SettingsScrollViewerStyle}">
|
||||||
|
<Grid Style="{StaticResource SettingsGridStyle}">
|
||||||
|
<StackPanel Spacing="{StaticResource SettingsCardSpacing}">
|
||||||
|
|
||||||
|
<!-- Provider info -->
|
||||||
|
<TextBlock x:Uid="SettingsPageRealtimeStatus" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<dev:SettingsCard ContentAlignment="Left">
|
||||||
|
<StackPanel Spacing="6">
|
||||||
|
<Grid ColumnSpacing="12">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SettingsPagePlaybackSource"
|
||||||
|
Grid.Column="0"
|
||||||
|
VerticalAlignment="Center" />
|
||||||
|
<RichTextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
IsTextSelectionEnabled="True"
|
||||||
|
TextWrapping="Wrap">
|
||||||
|
<Paragraph>
|
||||||
|
<Run Text="{x:Bind ViewModel.MediaSessionsService.CurrentMediaSourceProviderInfo.DisplayName, Mode=OneWay}" />
|
||||||
|
<Run Text="(" />
|
||||||
|
<Run Text="{x:Bind ViewModel.MediaSessionsService.CurrentSongInfo.PlayerId, TargetNullValue=N/A, Mode=OneWay}" />
|
||||||
|
<Run Text=")" />
|
||||||
|
</Paragraph>
|
||||||
|
</RichTextBlock>
|
||||||
|
</Grid>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="12">
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="NCM ID" />
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
IsTextSelectionEnabled="True"
|
||||||
|
Text="{x:Bind ViewModel.MediaSessionsService.CurrentSongInfo.SongId, Mode=OneWay, TargetNullValue=N/A}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="12">
|
||||||
|
<TextBlock x:Uid="LyricsPageLyricsProviderPrefix" VerticalAlignment="Center" />
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
IsTextSelectionEnabled="True"
|
||||||
|
Text="{x:Bind ViewModel.MediaSessionsService.CurrentLyricsSearchResult.ProviderIfFound, Mode=OneWay, Converter={StaticResource LyricsSearchProviderToDisplayNameConverter}}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="12">
|
||||||
|
<TextBlock x:Uid="LyricsPageTranslationProviderPrefix" VerticalAlignment="Center" />
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
IsTextSelectionEnabled="True"
|
||||||
|
Text="{x:Bind ViewModel.MediaSessionsService.TranslationSearchProvider, Mode=OneWay, Converter={StaticResource TranslationSearchProviderToDisplayNameConverter}}" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageForceWordByWordEffect">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.GeneralSettings.IsForceWordByWordEffect, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<!-- Lyrics translation -->
|
||||||
|
<TextBlock x:Uid="SettingsPageTranslation" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<dev:SettingsExpander x:Uid="LyricsPageTranslationEnabled" IsExpanded="True">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.TranslationSettings.IsTranslationEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageTargetLanguage" IsEnabled="{x:Bind ViewModel.AppSettings.TranslationSettings.IsTranslationEnabled, Mode=OneWay}">
|
||||||
|
<ComboBox ItemsSource="{x:Bind helper:LanguageHelper.SupportedTranslationTargetLanguages}" SelectedIndex="{x:Bind ViewModel.SelectedTargetLanguageIndex, Mode=TwoWay}">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate x:DataType="models:ExtendedLanguage">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<TextBlock Text="{x:Bind Name}" />
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageTranslationConfig" IsEnabled="{x:Bind ViewModel.AppSettings.TranslationSettings.IsTranslationEnabled, Mode=OneWay}">
|
||||||
|
<dev:SettingsCard.Description>
|
||||||
|
<HyperlinkButton Content="https://github.com/LibreTranslate/LibreTranslate" NavigateUri="https://github.com/LibreTranslate/LibreTranslate" />
|
||||||
|
</dev:SettingsCard.Description>
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.TranslationSettings.IsLibreTranslateEnabled, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLibreTranslateServer" IsEnabled="{x:Bind ViewModel.AppSettings.TranslationSettings.IsLibreTranslateEnabled, Mode=OneWay}">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="12">
|
||||||
|
<TextBox
|
||||||
|
x:Uid="LibreTranslateServerTextBox"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsLibreTranslateServerTesting, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}"
|
||||||
|
Text="{x:Bind ViewModel.AppSettings.TranslationSettings.LibreTranslateServer, Mode=TwoWay}" />
|
||||||
|
<Button
|
||||||
|
x:Uid="SettingsPageServerTestButton"
|
||||||
|
Command="{x:Bind ViewModel.LibreTranslateServerTestCommand}"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsLibreTranslateServerTesting, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<!-- Lyrics phonetic -->
|
||||||
|
<TextBlock x:Uid="SettingsPagePhonetic" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<dev:SettingsExpander x:Uid="SettingsPageChinese" IsExpanded="{x:Bind ViewModel.AppSettings.TranslationSettings.IsChineseRomanizationEnabled, Mode=OneWay}">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.TranslationSettings.IsChineseRomanizationEnabled, Mode=TwoWay}" />
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard IsEnabled="{x:Bind ViewModel.AppSettings.TranslationSettings.IsChineseRomanizationEnabled, Mode=OneWay}">
|
||||||
|
<ComboBox SelectedIndex="{x:Bind ViewModel.AppSettings.TranslationSettings.ChineseRomanization, Converter={StaticResource EnumToIntConverter}, Mode=TwoWay}">
|
||||||
|
<ComboBoxItem x:Uid="SettingsPagePinyin" />
|
||||||
|
<ComboBoxItem x:Uid="SettingsPageJyutping" />
|
||||||
|
</ComboBox>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageJapanese">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.TranslationSettings.IsJapaneseRomanizationEnabled, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<!-- 中文简体繁体偏好 -->
|
||||||
|
<TextBlock x:Uid="SettingsPageChineseLyrics" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageChinesePreference">
|
||||||
|
<ToggleSwitch IsOn="{x:Bind ViewModel.AppSettings.TranslationSettings.IsTraditionalChineseEnabled, Mode=TwoWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<!-- Last.fm -->
|
||||||
|
<TextBlock x:Uid="SettingsPageLastFM" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<dev:SettingsExpander
|
||||||
|
x:Uid="SettingsPageLastFMManager"
|
||||||
|
HeaderIcon="{ui:BitmapIcon Source=ms-appx:///Assets/LastFM.png}"
|
||||||
|
IsExpanded="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}">
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<Button
|
||||||
|
x:Uid="SettingsPageLastFMAuth"
|
||||||
|
Command="{x:Bind ViewModel.LastFMAuthCommand}"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}" />
|
||||||
|
<Button
|
||||||
|
x:Uid="SettingsPageLastFMUnAuth"
|
||||||
|
Command="{x:Bind ViewModel.LastFMUnAuthCommand}"
|
||||||
|
IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
<dev:SettingsExpander.Items>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLastFMUsername" IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}">
|
||||||
|
<HyperlinkButton Content="{x:Bind ViewModel.LastFMUser.Name, Mode=OneWay}" NavigateUri="{x:Bind ViewModel.LastFMUser.Url, Mode=OneWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLastFMPlaycount" IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}">
|
||||||
|
<TextBlock Text="{x:Bind ViewModel.LastFMUser.Playcount, Mode=OneWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageLastFMRegistered" IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}">
|
||||||
|
<TextBlock Text="{x:Bind ViewModel.LastFMUser.Registered.ToLongDateString(), Mode=OneWay}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
<dev:SettingsCard IsEnabled="{x:Bind ViewModel.IsLastFMAuthenticated, Mode=OneWay}">
|
||||||
|
<Button x:Uid="SettingsPageLastFMRefresh" Command="{x:Bind ViewModel.LastFMRefreshCommand}" />
|
||||||
|
</dev:SettingsCard>
|
||||||
|
</dev:SettingsExpander.Items>
|
||||||
|
</dev:SettingsExpander>
|
||||||
|
|
||||||
|
<!-- amll-ttml-db -->
|
||||||
|
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="amll-ttml-db" />
|
||||||
|
<dev:SettingsCard x:Uid="SettingsPageAmllTtmlDbBaseUrl">
|
||||||
|
<Grid ColumnSpacing="6">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBox
|
||||||
|
Grid.Column="0"
|
||||||
|
Text="{x:Bind ViewModel.AppSettings.GeneralSettings.AmllTtmlDbBaseUrl, Mode=TwoWay}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
<Button
|
||||||
|
Grid.Column="1"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
</Grid>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
<!-- Apple Music token -->
|
||||||
|
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="Apple Muisc media-user-token" />
|
||||||
|
<dev:SettingsCard
|
||||||
|
Background="{ThemeResource SystemFillColorCautionBackgroundBrush}"
|
||||||
|
Description="Use at your own risk"
|
||||||
|
Foreground="{ThemeResource SystemFillColorCautionBrush}"
|
||||||
|
Header="WARNING">
|
||||||
|
<Grid ColumnSpacing="6">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBox
|
||||||
|
Grid.Column="0"
|
||||||
|
PlaceholderText="media-user-token"
|
||||||
|
Text="{x:Bind ViewModel.AppleMusicMediaUserToken, Mode=TwoWay}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
<HyperlinkButton
|
||||||
|
Grid.Column="1"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
NavigateUri="{x:Bind constants:Link.AppleMusicCfgUrl}" />
|
||||||
|
<Button
|
||||||
|
Grid.Column="2"
|
||||||
|
Command="{x:Bind ViewModel.SaveAppleMusicMediaUserTokenCommand}"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
</Grid>
|
||||||
|
</dev:SettingsCard>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class PlaybackSettingsControl : UserControl
|
||||||
|
{
|
||||||
|
public PlaybackSettingsControlViewModel ViewModel => (PlaybackSettingsControlViewModel)DataContext;
|
||||||
|
|
||||||
|
public PlaybackSettingsControl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetRequiredService<PlaybackSettingsControlViewModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AlbumArtSearchProvidersListView_DragItemsCompleted(ListViewBase sender, DragItemsCompletedEventArgs args)
|
||||||
|
{
|
||||||
|
// <20><> AlbumArtSearchProvidersInfo <20><><EFBFBD><EFBFBD> CollectionChanged <20>¼<EFBFBD>
|
||||||
|
ViewModel.SelectedMediaSourceProvider?.AlbumArtSearchProvidersInfo?.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LyricsSearchProvidersListView_DragItemsCompleted(ListViewBase sender, DragItemsCompletedEventArgs args)
|
||||||
|
{
|
||||||
|
// <20><> LyricsSearchProvidersInfo <20><><EFBFBD><EFBFBD> CollectionChanged <20>¼<EFBFBD>
|
||||||
|
ViewModel.SelectedMediaSourceProvider?.LyricsSearchProvidersInfo?.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MediaSourceProvidersListView_DragItemsCompleted(ListViewBase sender, DragItemsCompletedEventArgs args)
|
||||||
|
{
|
||||||
|
// <20><> MediaSourceProvidersInfo <20><><EFBFBD><EFBFBD> CollectionChanged <20>¼<EFBFBD>
|
||||||
|
ViewModel.AppSettings.MediaSourceProvidersInfo?.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.ShortcutTextBox"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBox
|
||||||
|
x:Name="TextBox"
|
||||||
|
IsReadOnly="True"
|
||||||
|
KeyDown="TextBox_KeyDown"
|
||||||
|
Loaded="TextBox_Loaded" />
|
||||||
|
<Button
|
||||||
|
Margin="3,0,0,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Click="ClearButton_Click"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
<Button
|
||||||
|
Margin="3,0,0,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Click="CheckButton_Click"
|
||||||
|
Content="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
FontSize=12,
|
||||||
|
Glyph=}"
|
||||||
|
Style="{StaticResource GhostButtonStyle}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
using BetterLyrics.WinUI3.Hooks;
|
||||||
|
using BetterLyrics.WinUI3.Services.ResourceService;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Input;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Windows.UI.Core;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class ShortcutTextBox : UserControl
|
||||||
|
{
|
||||||
|
private readonly IResourceService _resourceService = Ioc.Default.GetRequiredService<IResourceService>();
|
||||||
|
|
||||||
|
public ShortcutTextBox()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty ShortcutProperty =
|
||||||
|
DependencyProperty.Register(nameof(Shortcut), typeof(List<string>), typeof(ShortcutTextBox), new PropertyMetadata(default));
|
||||||
|
|
||||||
|
public List<string> Shortcut
|
||||||
|
{
|
||||||
|
get => (List<string>)GetValue(ShortcutProperty);
|
||||||
|
set => SetValue(ShortcutProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TextBox_KeyDown(object sender, KeyRoutedEventArgs e)
|
||||||
|
{
|
||||||
|
List<string> shortcut = [];
|
||||||
|
|
||||||
|
bool ctrl = InputKeyboardSource.GetKeyStateForCurrentThread(Windows.System.VirtualKey.Control).HasFlag(CoreVirtualKeyStates.Down);
|
||||||
|
bool shift = InputKeyboardSource.GetKeyStateForCurrentThread(Windows.System.VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down);
|
||||||
|
bool alt = InputKeyboardSource.GetKeyStateForCurrentThread(Windows.System.VirtualKey.Menu).HasFlag(CoreVirtualKeyStates.Down);
|
||||||
|
bool win = InputKeyboardSource.GetKeyStateForCurrentThread(Windows.System.VirtualKey.LeftWindows).HasFlag(CoreVirtualKeyStates.Down) ||
|
||||||
|
InputKeyboardSource.GetKeyStateForCurrentThread(Windows.System.VirtualKey.RightWindows).HasFlag(CoreVirtualKeyStates.Down);
|
||||||
|
|
||||||
|
if (ctrl)
|
||||||
|
{
|
||||||
|
shortcut.Add("Ctrl");
|
||||||
|
}
|
||||||
|
if (shift)
|
||||||
|
{
|
||||||
|
shortcut.Add("Shift");
|
||||||
|
}
|
||||||
|
if (alt)
|
||||||
|
{
|
||||||
|
shortcut.Add("Alt");
|
||||||
|
}
|
||||||
|
if (win)
|
||||||
|
{
|
||||||
|
shortcut.Add("Win");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.Key != Windows.System.VirtualKey.Control &&
|
||||||
|
e.Key != Windows.System.VirtualKey.Shift &&
|
||||||
|
e.Key != Windows.System.VirtualKey.Menu &&
|
||||||
|
e.Key != Windows.System.VirtualKey.LeftWindows &&
|
||||||
|
e.Key != Windows.System.VirtualKey.RightWindows)
|
||||||
|
{
|
||||||
|
shortcut.Add(e.Key.ToString());
|
||||||
|
}
|
||||||
|
Shortcut = shortcut;
|
||||||
|
|
||||||
|
UpdateTextBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateTextBox()
|
||||||
|
{
|
||||||
|
TextBox.Text = string.Join(" + ", Shortcut);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TextBox_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
UpdateTextBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClearButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Shortcut = [];
|
||||||
|
UpdateTextBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
bool registered = GlobalHotKeyHook.IsHotKeyRegistered(Shortcut);
|
||||||
|
if (registered)
|
||||||
|
{
|
||||||
|
DevWinUI.Growl.Success(_resourceService.GetLocalizedString("SettingsPageShortcutRegSuccessInfo"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DevWinUI.Growl.Error(_resourceService.GetLocalizedString("SettingsPageShortcutRegFailInfo"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<UserControl
|
||||||
|
x:Class="BetterLyrics.WinUI3.Controls.SystemTray"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="using:BetterLyrics.WinUI3.Controls"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:tb="using:H.NotifyIcon"
|
||||||
|
xmlns:ui="using:CommunityToolkit.WinUI"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<tb:TaskbarIcon
|
||||||
|
x:Name="TrayIcon"
|
||||||
|
x:FieldModifier="public"
|
||||||
|
ContextMenuMode="SecondWindow"
|
||||||
|
DoubleClickCommand="{x:Bind ViewModel.OpenLyricsCommand}"
|
||||||
|
IconSource="ms-appx:///Assets/Logo.ico"
|
||||||
|
LeftClickCommand="{x:Bind ViewModel.OpenLyricsCommand}"
|
||||||
|
NoLeftClickDelay="True"
|
||||||
|
ToolTipText="{x:Bind ViewModel.ToolTipText, Mode=OneWay}">
|
||||||
|
<tb:TaskbarIcon.ContextFlyout>
|
||||||
|
<MenuFlyout
|
||||||
|
AreOpenCloseAnimationsEnabled="True"
|
||||||
|
LightDismissOverlayMode="On"
|
||||||
|
ShowMode="TransientWithDismissOnPointerMoveAway">
|
||||||
|
<MenuFlyout.MenuFlyoutPresenterStyle>
|
||||||
|
<Style BasedOn="{StaticResource DefaultMenuFlyoutPresenterStyle}" TargetType="MenuFlyoutPresenter">
|
||||||
|
<Setter Property="MinWidth" Value="600" />
|
||||||
|
</Style>
|
||||||
|
</MenuFlyout.MenuFlyoutPresenterStyle>
|
||||||
|
<MenuFlyoutItem
|
||||||
|
x:Uid="SystemTraySwitch"
|
||||||
|
Command="{x:Bind ViewModel.OpenLyricsWindowSwitchCommand}"
|
||||||
|
Icon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}" />
|
||||||
|
<MenuFlyoutItem
|
||||||
|
x:Uid="SystemTraySearch"
|
||||||
|
Command="{x:Bind ViewModel.OpenLyricsSearchWindowCommand}"
|
||||||
|
Icon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}" />
|
||||||
|
<MenuFlyoutItem
|
||||||
|
x:Uid="SystemTrayLyrics"
|
||||||
|
Command="{x:Bind ViewModel.OpenLyricsCommand}"
|
||||||
|
Icon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}" />
|
||||||
|
<MenuFlyoutItem
|
||||||
|
x:Uid="SystemTrayMusicGallery"
|
||||||
|
Command="{x:Bind ViewModel.OpenMusicGalleryCommand}"
|
||||||
|
Icon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}" />
|
||||||
|
<MenuFlyoutItem
|
||||||
|
x:Uid="SystemTraySettings"
|
||||||
|
Command="{x:Bind ViewModel.OpenSettingsCommand}"
|
||||||
|
Icon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}" />
|
||||||
|
<MenuFlyoutItem
|
||||||
|
x:Uid="SystemTrayResetWindowPosition"
|
||||||
|
Command="{x:Bind ViewModel.ResetWindowPositionCommand}"
|
||||||
|
Icon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}" />
|
||||||
|
<MenuFlyoutItem
|
||||||
|
x:Uid="SystemTrayRestart"
|
||||||
|
Command="{x:Bind ViewModel.RestartAppCommand}"
|
||||||
|
Icon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}" />
|
||||||
|
<MenuFlyoutItem
|
||||||
|
x:Uid="SystemTrayExit"
|
||||||
|
Command="{x:Bind ViewModel.ExitAppCommand}"
|
||||||
|
Icon="{ui:FontIcon FontFamily={StaticResource IconFontFamily},
|
||||||
|
Glyph=}" />
|
||||||
|
</MenuFlyout>
|
||||||
|
</tb:TaskbarIcon.ContextFlyout>
|
||||||
|
</tb:TaskbarIcon>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using BetterLyrics.WinUI3.ViewModels;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Controls
|
||||||
|
{
|
||||||
|
public sealed partial class SystemTray : UserControl
|
||||||
|
{
|
||||||
|
public SystemTrayViewModel ViewModel => (SystemTrayViewModel)DataContext;
|
||||||
|
|
||||||
|
public SystemTray()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = Ioc.Default.GetService<SystemTrayViewModel>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
using BetterLyrics.WinUI3.Enums;
|
||||||
|
using BetterLyrics.WinUI3.Services.ResourceService;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class AlbumArtSearchProviderToDisplayNameConverter : IValueConverter
|
||||||
|
{
|
||||||
|
private readonly IResourceService _resourceService = Ioc.Default.GetRequiredService<IResourceService>();
|
||||||
|
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is AlbumArtSearchProvider provider)
|
||||||
|
{
|
||||||
|
return provider switch
|
||||||
|
{
|
||||||
|
AlbumArtSearchProvider.Local => _resourceService.GetLocalizedString("AlbumArtSearchLocalProvider"),
|
||||||
|
AlbumArtSearchProvider.SMTC => _resourceService.GetLocalizedString("AlbumArtSearchSMTCProvider"),
|
||||||
|
AlbumArtSearchProvider.iTunes => "iTunes",
|
||||||
|
_ => throw new Exception($"Unknown AlbumArtSearchProvider: {provider}"),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
throw new ArgumentException("Value must be of type AlbumArtSearchProvider", nameof(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class BoolNegationToOpacityConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is bool boolValue)
|
||||||
|
{
|
||||||
|
return boolValue ? 0.0 : 1.0;
|
||||||
|
}
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class BoolNegationToVisibilityConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is bool boolValue)
|
||||||
|
{
|
||||||
|
return boolValue ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
}
|
||||||
|
return Visibility.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class BoolToOpacityConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is bool boolValue)
|
||||||
|
{
|
||||||
|
return boolValue ? 1.0 : 0.0;
|
||||||
|
}
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public class BoolToPartialOpacityConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is bool boolValue)
|
||||||
|
{
|
||||||
|
return boolValue ? 1.0 : 0.3;
|
||||||
|
}
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using BetterLyrics.WinUI3.Helper;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using Microsoft.UI.Xaml.Media.Imaging;
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class ByteArrayToImageConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is byte[] byteArray && byteArray.Length > 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var ms = new MemoryStream(byteArray))
|
||||||
|
{
|
||||||
|
var stream = ms.AsRandomAccessStream();
|
||||||
|
var bitmapImage = new BitmapImage();
|
||||||
|
|
||||||
|
bitmapImage.SetSource(stream);
|
||||||
|
|
||||||
|
return bitmapImage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return PathHelper.AlbumArtPlaceholderPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PathHelper.AlbumArtPlaceholderPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,13 @@
|
|||||||
using System;
|
// 2025/6/23 by Zhe Fang
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.UI.Xaml.Data;
|
using Microsoft.UI.Xaml.Data;
|
||||||
using Microsoft.UI.Xaml.Media;
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using System;
|
||||||
using Windows.UI;
|
using Windows.UI;
|
||||||
|
|
||||||
namespace BetterLyrics.WinUI3.Converter
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
{
|
{
|
||||||
public class ColorToBrushConverter : IValueConverter
|
public partial class ColorToBrushConverter : IValueConverter
|
||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, string language)
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class CornerRadiusToDoubleConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is Microsoft.UI.Xaml.CornerRadius cornerRadius)
|
||||||
|
{
|
||||||
|
return (double)cornerRadius.TopLeft;
|
||||||
|
}
|
||||||
|
return .0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using BetterLyrics.WinUI3.Helper;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class DisplayLanguageCodeToIndexConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is string langCode)
|
||||||
|
{
|
||||||
|
return LanguageHelper.SupportedDisplayLanguages.FindIndex(x => x.LanguageCode == langCode);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is int index)
|
||||||
|
{
|
||||||
|
return LanguageHelper.SupportedDisplayLanguages.ElementAt(index).LanguageCode;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class EnumToIntConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is Enum)
|
||||||
|
{
|
||||||
|
return System.Convert.ToInt32(value);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is int && targetType.IsEnum)
|
||||||
|
{
|
||||||
|
return Enum.ToObject(targetType, value);
|
||||||
|
}
|
||||||
|
return Enum.ToObject(targetType, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public class FPSToTimeSpanConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is int fps)
|
||||||
|
{
|
||||||
|
return TimeSpan.FromSeconds(1.0 / fps);
|
||||||
|
}
|
||||||
|
return TimeSpan.FromSeconds(1.0 / 60);
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class IndexToDisplayConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
int display = 0;
|
||||||
|
if (value is int index)
|
||||||
|
{
|
||||||
|
display = index + 1;
|
||||||
|
}
|
||||||
|
return display.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class IntToBoolConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is int intValue)
|
||||||
|
{
|
||||||
|
return intValue != 0;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class IntToCornerRadius : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is int intValue && parameter is double controlHeight)
|
||||||
|
{
|
||||||
|
return new Microsoft.UI.Xaml.CornerRadius(intValue / 100f * controlHeight / 2);
|
||||||
|
}
|
||||||
|
return new Microsoft.UI.Xaml.CornerRadius(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public class IntToDoubleConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is int intValue)
|
||||||
|
{
|
||||||
|
return (double)intValue;
|
||||||
|
}
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
using BetterLyrics.WinUI3.Helper;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
using Windows.Globalization;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class LanguageCodeToDisplayedNameConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is string langCode)
|
||||||
|
{
|
||||||
|
if (PhoneticHelper.IsPhoneticCode(langCode))
|
||||||
|
{
|
||||||
|
return PhoneticHelper.GetDisplayName(langCode);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return new Language(langCode).DisplayName ?? langCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value?.ToString() ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using BetterLyrics.WinUI3.Enums;
|
||||||
|
using BetterLyrics.WinUI3.Services.ResourceService;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class LyricsSearchProviderToDisplayNameConverter : IValueConverter
|
||||||
|
{
|
||||||
|
private readonly IResourceService _resourceService = Ioc.Default.GetRequiredService<IResourceService>();
|
||||||
|
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is LyricsSearchProvider provider)
|
||||||
|
{
|
||||||
|
return provider switch
|
||||||
|
{
|
||||||
|
LyricsSearchProvider.LrcLib => "LrcLib",
|
||||||
|
LyricsSearchProvider.QQ => "QQ 音乐",
|
||||||
|
LyricsSearchProvider.Netease => "网易云音乐",
|
||||||
|
LyricsSearchProvider.Kugou => "酷狗音乐",
|
||||||
|
LyricsSearchProvider.AmllTtmlDb => "amll-ttml-db",
|
||||||
|
LyricsSearchProvider.AppleMusic => "Apple Music",
|
||||||
|
LyricsSearchProvider.LocalLrcFile => _resourceService.GetLocalizedString("LyricsSearchProviderLocalLrcFile"),
|
||||||
|
LyricsSearchProvider.LocalMusicFile => _resourceService.GetLocalizedString("LyricsSearchProviderLocalMusicFile"),
|
||||||
|
LyricsSearchProvider.LocalEslrcFile => _resourceService.GetLocalizedString("LyricsSearchProviderEslrcFile"),
|
||||||
|
LyricsSearchProvider.LocalTtmlFile => _resourceService.GetLocalizedString("LyricsSearchProviderTtmlFile"),
|
||||||
|
_ => "N/A",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return "N/A";
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using BetterLyrics.WinUI3.Services.ResourceService;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class MatchedLocalFilesPathToVisibilityConverter : IValueConverter
|
||||||
|
{
|
||||||
|
private readonly IResourceService _resourceService = Ioc.Default.GetRequiredService<IResourceService>();
|
||||||
|
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is string path)
|
||||||
|
{
|
||||||
|
if (path == _resourceService.GetLocalizedString("MainPageNoLocalFilesMatched"))
|
||||||
|
{
|
||||||
|
return Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public class MillisecondsToFormattedTimeConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is int milliseconds)
|
||||||
|
{
|
||||||
|
return TimeSpan.FromMilliseconds(milliseconds).ToString(@"mm\:ss\.fff");
|
||||||
|
}
|
||||||
|
else if (value is double doubleMilliseconds)
|
||||||
|
{
|
||||||
|
return TimeSpan.FromMilliseconds(doubleMilliseconds).ToString(@"mm\:ss\.fff");
|
||||||
|
}
|
||||||
|
return value?.ToString() ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public class MillisecondsToSecondsConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is int intValue)
|
||||||
|
{
|
||||||
|
return intValue / 1000.0;
|
||||||
|
}
|
||||||
|
else if (value is double doubleValue)
|
||||||
|
{
|
||||||
|
return doubleValue / 1000.0;
|
||||||
|
}
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class PathToParentFolderConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is string path)
|
||||||
|
{
|
||||||
|
return Directory.GetParent(path)?.Name ?? "";
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public class RectToMarginConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is Windows.Foundation.Rect rect)
|
||||||
|
{
|
||||||
|
return new Microsoft.UI.Xaml.Thickness(rect.X, rect.Y, 0, 0);
|
||||||
|
}
|
||||||
|
return new Microsoft.UI.Xaml.Thickness(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class SecondsToFormattedTimeConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
TimeSpan timeSpan = TimeSpan.Zero;
|
||||||
|
if (value is double seconds)
|
||||||
|
{
|
||||||
|
timeSpan = TimeSpan.FromSeconds(seconds);
|
||||||
|
}
|
||||||
|
else if (value is int secondsInt)
|
||||||
|
{
|
||||||
|
timeSpan = TimeSpan.FromSeconds(secondsInt);
|
||||||
|
}
|
||||||
|
if (timeSpan.Days > 0)
|
||||||
|
{
|
||||||
|
return timeSpan.ToString(@"dd\.hh\:mm\:ss");
|
||||||
|
}
|
||||||
|
else if (timeSpan.Hours > 0)
|
||||||
|
{
|
||||||
|
return timeSpan.ToString(@"hh\:mm\:ss");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return timeSpan.ToString(@"mm\:ss");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public class ShortcutToStringConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is List<string> shortcut)
|
||||||
|
{
|
||||||
|
return string.Join(" + ", shortcut);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.UI.Xaml;
|
|
||||||
using Microsoft.UI.Xaml.Data;
|
|
||||||
|
|
||||||
namespace BetterLyrics.WinUI3.Converter
|
|
||||||
{
|
|
||||||
internal class ThemeTypeToElementThemeConverter : IValueConverter
|
|
||||||
{
|
|
||||||
public object Convert(object value, Type targetType, object parameter, string language)
|
|
||||||
{
|
|
||||||
if (value is int themeType)
|
|
||||||
{
|
|
||||||
return (ElementTheme)themeType;
|
|
||||||
}
|
|
||||||
return ElementTheme.Default;
|
|
||||||
}
|
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using ATL;
|
||||||
|
using BetterLyrics.WinUI3.Extensions;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class TrackToLyricsConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is Track track)
|
||||||
|
{
|
||||||
|
return track.GetRawLyrics();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
// 2025/6/23 by Zhe Fang
|
||||||
|
|
||||||
|
using BetterLyrics.WinUI3.Enums;
|
||||||
|
using BetterLyrics.WinUI3.Services.ResourceService;
|
||||||
|
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BetterLyrics.WinUI3.Converter
|
||||||
|
{
|
||||||
|
public partial class TranslationSearchProviderToDisplayNameConverter : IValueConverter
|
||||||
|
{
|
||||||
|
private readonly IResourceService _resourceService = Ioc.Default.GetRequiredService<IResourceService>();
|
||||||
|
|
||||||
|
public object Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
if (value is TranslationSearchProvider provider)
|
||||||
|
{
|
||||||
|
return provider switch
|
||||||
|
{
|
||||||
|
TranslationSearchProvider.LrcLib => "LrcLib",
|
||||||
|
TranslationSearchProvider.QQ => "QQ 音乐",
|
||||||
|
TranslationSearchProvider.Netease => "网易云音乐",
|
||||||
|
TranslationSearchProvider.Kugou => "酷狗音乐",
|
||||||
|
TranslationSearchProvider.AmllTtmlDb => "amll-ttml-db",
|
||||||
|
TranslationSearchProvider.AppleMusic => "Apple Music",
|
||||||
|
TranslationSearchProvider.LocalLrcFile => _resourceService.GetLocalizedString("LyricsSearchProviderLocalLrcFile"),
|
||||||
|
TranslationSearchProvider.LocalMusicFile => _resourceService.GetLocalizedString("LyricsSearchProviderLocalMusicFile"),
|
||||||
|
TranslationSearchProvider.LocalEslrcFile => _resourceService.GetLocalizedString("LyricsSearchProviderEslrcFile"),
|
||||||
|
TranslationSearchProvider.LocalTtmlFile => _resourceService.GetLocalizedString("LyricsSearchProviderTtmlFile"),
|
||||||
|
TranslationSearchProvider.LibreTranslate => "LibreTranslate",
|
||||||
|
_ => "N/A",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return "N/A";
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace BetterLyrics.WinUI3.Enums
|
||||||
|
{
|
||||||
|
public enum AlbumArtSearchProvider
|
||||||
|
{
|
||||||
|
Local,
|
||||||
|
SMTC,
|
||||||
|
iTunes,
|
||||||
|
}
|
||||||
|
}
|
||||||