mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-27 06:52:50 -05:00
Compare commits
1902 Commits
v0.0.8
...
doctor-dbu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17ec547737 | ||
|
|
f9a2ed025f | ||
|
|
f8cfbdcd90 | ||
|
|
623eec3689 | ||
|
|
53a033fe35 | ||
|
|
c490ee24f4 | ||
|
|
cc1e49294e | ||
|
|
e6fa46ae26 | ||
|
|
35fe774a1b | ||
|
|
1e6a0f9423 | ||
|
|
cc1877aadb | ||
|
|
f1eb1fa9ba | ||
|
|
bdd01e335d | ||
|
|
4b7baf82cd | ||
|
|
15c88ce1d2 | ||
|
|
8891c388d0 | ||
|
|
cd9d92d884 | ||
|
|
1b69a5e62b | ||
|
|
61d311b157 | ||
|
|
6b76b86930 | ||
|
|
dcfb947c36 | ||
|
|
59893b7f44 | ||
|
|
d2c62f5533 | ||
|
|
2bbe9a0c45 | ||
|
|
4e2ce82c0a | ||
|
|
104762186f | ||
|
|
f1233ab1e3 | ||
|
|
d6b407ec37 | ||
|
|
022b4b4bb3 | ||
|
|
49b322582d | ||
|
|
1280bd047d | ||
|
|
6f206d7523 | ||
|
|
2e58283859 | ||
|
|
99a5721fe8 | ||
|
|
5302ebd840 | ||
|
|
fa427ea1ac | ||
|
|
7027bd1646 | ||
|
|
3c38e17472 | ||
|
|
510ea5d2e4 | ||
|
|
bb2234d328 | ||
|
|
edbdeb0fb8 | ||
|
|
19541fc573 | ||
|
|
7c936cacfb | ||
|
|
c60cd3a341 | ||
|
|
e37135f80d | ||
|
|
aac937cbcc | ||
|
|
4b46d022af | ||
|
|
7f0181b310 | ||
|
|
6a109274f8 | ||
|
|
0f09cc693a | ||
|
|
af0166a553 | ||
|
|
a283017f26 | ||
|
|
5ae2cd1dfb | ||
|
|
eece811fb0 | ||
|
|
1ff1f3a7f2 | ||
|
|
a21a846bf5 | ||
|
|
f5f21e738a | ||
|
|
033e62418a | ||
|
|
3c69e8b1cc | ||
|
|
118be27796 | ||
|
|
721d35d417 | ||
|
|
7bc3d5910d | ||
|
|
ccc7047be0 | ||
|
|
a5e107c89d | ||
|
|
646d60dcbf | ||
|
|
5dc7c0d797 | ||
|
|
db1de9df38 | ||
|
|
3dd21382ba | ||
|
|
ec2b3d0d4b | ||
|
|
a205df1bd6 | ||
|
|
e822fa73da | ||
|
|
634e75b80c | ||
|
|
ec5b507efc | ||
|
|
e6d289d48c | ||
|
|
745d7f26ce | ||
|
|
ad43053b94 | ||
|
|
721700190b | ||
|
|
8c9c936d0e | ||
|
|
842bf6e3ff | ||
|
|
c1fbeb3f5e | ||
|
|
c45eb2cccf | ||
|
|
1b5abca83a | ||
|
|
45818b202f | ||
|
|
1c8ce46f25 | ||
|
|
f762f9ae49 | ||
|
|
4484f6bd61 | ||
|
|
0076c45496 | ||
|
|
ab071e12aa | ||
|
|
8386b40c50 | ||
|
|
03a985228d | ||
|
|
ef7d7ec13d | ||
|
|
824792cca7 | ||
|
|
850e5b6572 | ||
|
|
64310854a6 | ||
|
|
4005a55bf2 | ||
|
|
0236fe3276 | ||
|
|
c1d95a3086 | ||
|
|
9b027df1d5 | ||
|
|
5e03afe7f0 | ||
|
|
145a974b6d | ||
|
|
d23fc9f2df | ||
|
|
7ac5191e8d | ||
|
|
29d27ebd6d | ||
|
|
e45075dd84 | ||
|
|
80bc87e76b | ||
|
|
76d88517ec | ||
|
|
151d695212 | ||
|
|
2e1bed5fb5 | ||
|
|
f163b97c17 | ||
|
|
436c99927e | ||
|
|
aa72eacae7 | ||
|
|
913bb2ff67 | ||
|
|
3bb2696263 | ||
|
|
166843ded4 | ||
|
|
02166a4ca5 | ||
|
|
f0f2e6ef72 | ||
|
|
8d8d5de5fd | ||
|
|
6d76f0b476 | ||
|
|
f3f720bb37 | ||
|
|
2bf85bc4dd | ||
|
|
faddc46185 | ||
|
|
2991aac82e | ||
|
|
e1817027b1 | ||
|
|
ba2d51bcbb | ||
|
|
7f10d6a9b8 | ||
|
|
405749aa98 | ||
|
|
77681fd387 | ||
|
|
8253ec4496 | ||
|
|
a1e001e640 | ||
|
|
3a65ea21ba | ||
|
|
7d761c4c9a | ||
|
|
4cb90c5367 | ||
|
|
1c7d15db0b | ||
|
|
7268a3fe7f | ||
|
|
d2c4391514 | ||
|
|
69b1d0c2da | ||
|
|
ba28767492 | ||
|
|
6cff5f1146 | ||
|
|
3e1c6534bd | ||
|
|
c1d57946d9 | ||
|
|
5e111d89a5 | ||
|
|
1a98da22b2 | ||
|
|
618ccbcb2f | ||
|
|
d3a79a055e | ||
|
|
bae32e51ff | ||
|
|
edfda965e9 | ||
|
|
a547966b23 | ||
|
|
f6279b1b2e | ||
|
|
957c89a85d | ||
|
|
571a9dabcd | ||
|
|
51ca9a7686 | ||
|
|
c141ad1e34 | ||
|
|
37f972d075 | ||
|
|
7d8de6e6f0 | ||
|
|
7ff751f8a2 | ||
|
|
651672afe2 | ||
|
|
2dbadfe1b5 | ||
|
|
621710bd86 | ||
|
|
1edecb05bb | ||
|
|
f1a876301b | ||
|
|
97a07c399a | ||
|
|
18f095cb23 | ||
|
|
d95d516d64 | ||
|
|
45ba64ab02 | ||
|
|
9501d66af6 | ||
|
|
2127fc339a | ||
|
|
7962fee0bd | ||
|
|
d5c7b5c0cc | ||
|
|
5f77d69dd8 | ||
|
|
60034be06a | ||
|
|
518a5d38aa | ||
|
|
2eeaf8ff62 | ||
|
|
cffee0fae6 | ||
|
|
f08e2ef5b8 | ||
|
|
2b0070c31a | ||
|
|
ae82716afa | ||
|
|
c281bf3b53 | ||
|
|
45b8b2a895 | ||
|
|
7b9ba840fb | ||
|
|
84fb567ff5 | ||
|
|
bbd57e0673 | ||
|
|
b1632a0a03 | ||
|
|
7aff1182c8 | ||
|
|
fbe362cd20 | ||
|
|
e7f94c94cc | ||
|
|
7523190b16 | ||
|
|
da37e16b6e | ||
|
|
5c420ab50b | ||
|
|
4493b7c231 | ||
|
|
40a96c6eaf | ||
|
|
23a93082c6 | ||
|
|
f7650b5e1f | ||
|
|
3ebdd5631c | ||
|
|
6c4caf121a | ||
|
|
89788e9ca7 | ||
|
|
0787c63fed | ||
|
|
9fc0d5efff | ||
|
|
6611dfbe05 | ||
|
|
8a71ead51d | ||
|
|
d9d6ab5776 | ||
|
|
d6fe7bea27 | ||
|
|
1194f3ffb8 | ||
|
|
5ac81e6dd6 | ||
|
|
987856a1de | ||
|
|
ef52ce0990 | ||
|
|
06b14a5869 | ||
|
|
fd839059c0 | ||
|
|
ec6db7962a | ||
|
|
adf92cbc46 | ||
|
|
6b6f51cd1f | ||
|
|
df6c60213f | ||
|
|
6303304a10 | ||
|
|
8e76789119 | ||
|
|
10e81cfdd3 | ||
|
|
03fd3a4f16 | ||
|
|
8fdc748ed2 | ||
|
|
6c56d23b93 | ||
|
|
45d34dcb5b | ||
|
|
d7ac0d50fa | ||
|
|
1d4d145187 | ||
|
|
a5b9ff98c0 | ||
|
|
6feaecd92e | ||
|
|
b066a25308 | ||
|
|
777a552b57 | ||
|
|
7dbe608c28 | ||
|
|
61630e447b | ||
|
|
91385e7c83 | ||
|
|
04648fcca7 | ||
|
|
080fc7e44e | ||
|
|
0b60da3d6d | ||
|
|
a4492b90e7 | ||
|
|
c9331b7338 | ||
|
|
4982ea53dd | ||
|
|
c703cb6504 | ||
|
|
a7494971fd | ||
|
|
c548255bfc | ||
|
|
9656c7afd7 | ||
|
|
414b8c8272 | ||
|
|
b4f83d09d4 | ||
|
|
67ee74ac20 | ||
|
|
93539d2b6b | ||
|
|
524d967745 | ||
|
|
0effbebbb6 | ||
|
|
dca07a70f8 | ||
|
|
02936c97fd | ||
|
|
8f7e732827 | ||
|
|
5ffe563b7d | ||
|
|
6ef08c3d54 | ||
|
|
908b4b58cd | ||
|
|
f2611e0de0 | ||
|
|
ea75a9d351 | ||
|
|
3a744d7d68 | ||
|
|
195d312ae2 | ||
|
|
76006a7377 | ||
|
|
11536da512 | ||
|
|
2a91bc41f7 | ||
|
|
baf23157fc | ||
|
|
83b81be825 | ||
|
|
4aefa0f1f7 | ||
|
|
e53a7cee97 | ||
|
|
8437e1aa7b | ||
|
|
632f40cc0a | ||
|
|
7d81445341 | ||
|
|
78a5f401d7 | ||
|
|
8745f98c95 | ||
|
|
f0f5bcc630 | ||
|
|
8a3c513605 | ||
|
|
145d2636dd | ||
|
|
f2b9dc8988 | ||
|
|
2e4d56728b | ||
|
|
18231ed324 | ||
|
|
d0b61d8ed1 | ||
|
|
d385a44949 | ||
|
|
d97392d46e | ||
|
|
6abb2c73fd | ||
|
|
7e141c6b36 | ||
|
|
53553c1f62 | ||
|
|
523ccc6bf8 | ||
|
|
811e89fcfa | ||
|
|
5d5be4d9d7 | ||
|
|
88457ab139 | ||
|
|
0034926df7 | ||
|
|
d082d41ab9 | ||
|
|
b7911475b6 | ||
|
|
672754b0b5 | ||
|
|
0d1553123b | ||
|
|
ba6c51c102 | ||
|
|
d64206a9ff | ||
|
|
d9a1089039 | ||
|
|
55fe463405 | ||
|
|
e84210e962 | ||
|
|
ff506548d3 | ||
|
|
f6b09751e9 | ||
|
|
3d863979c4 | ||
|
|
2947ff4131 | ||
|
|
b8fca10896 | ||
|
|
33e45794d2 | ||
|
|
42cc88ca65 | ||
|
|
0b7f2416ca | ||
|
|
5d5c745ee5 | ||
|
|
e0429e4c60 | ||
|
|
0bece5287e | ||
|
|
60b5e47836 | ||
|
|
aa75b44790 | ||
|
|
769f58caa9 | ||
|
|
e7facf740d | ||
|
|
04921eef62 | ||
|
|
8863c42879 | ||
|
|
2745116ac5 | ||
|
|
bafe1c5fee | ||
|
|
306d7b2ce0 | ||
|
|
e9f6583c60 | ||
|
|
42a2835929 | ||
|
|
c2c90c680e | ||
|
|
cd01f6378c | ||
|
|
6033075de6 | ||
|
|
79794d3441 | ||
|
|
031f86b417 | ||
|
|
891f53cf6f | ||
|
|
848991cf5b | ||
|
|
d37ddd1d41 | ||
|
|
00d12acd5e | ||
|
|
3bbc78a44f | ||
|
|
b0a6652cc6 | ||
|
|
cb710b2e5f | ||
|
|
ca5fe6f7db | ||
|
|
fb75f4c68b | ||
|
|
5e2a418485 | ||
|
|
24fe215067 | ||
|
|
ab2e8875ac | ||
|
|
dec5740c74 | ||
|
|
208266dfa3 | ||
|
|
32f218d58c | ||
|
|
6fdaab2ccd | ||
|
|
d336866f44 | ||
|
|
b40df5f1c4 | ||
|
|
3c9886ad1b | ||
|
|
ea205ebd12 | ||
|
|
30dad46c94 | ||
|
|
fbf79e62e9 | ||
|
|
efcf72bc08 | ||
|
|
3b511e2f55 | ||
|
|
e4e20fb43a | ||
|
|
48ccff67a6 | ||
|
|
a783d6507b | ||
|
|
fd94e60797 | ||
|
|
a1bcb7ea30 | ||
|
|
31b67164c7 | ||
|
|
786c13f892 | ||
|
|
c652659d54 | ||
|
|
ca39196f13 | ||
|
|
f02dd8fd4b | ||
|
|
0f89886ce7 | ||
|
|
1118404192 | ||
|
|
f011ea6cce | ||
|
|
b2ac9c6c1a | ||
|
|
fbab41abd6 | ||
|
|
82f881af5b | ||
|
|
68de9b437d | ||
|
|
830a715b6d | ||
|
|
ce4aca9a72 | ||
|
|
7641171a01 | ||
|
|
119e084e52 | ||
|
|
7c6d52913e | ||
|
|
f63ab5cf7c | ||
|
|
50f1bc5017 | ||
|
|
c3ab409b6a | ||
|
|
44f6ab4878 | ||
|
|
5fda6e0f12 | ||
|
|
38068e78c9 | ||
|
|
66d22727e9 | ||
|
|
db2f68e35d | ||
|
|
352277ec15 | ||
|
|
d6043e64f2 | ||
|
|
d3f5b8f32e | ||
|
|
6c3c722674 | ||
|
|
5b8edb13d8 | ||
|
|
c595727b94 | ||
|
|
d46302588a | ||
|
|
0ff9fdb365 | ||
|
|
e95f7ce367 | ||
|
|
df1a8f4066 | ||
|
|
32e6c1660f | ||
|
|
d6b9b72e9b | ||
|
|
179ad03fa4 | ||
|
|
c3cb82c84e | ||
|
|
4b52e2ed9e | ||
|
|
77fd61f81e | ||
|
|
c3ffb7f83b | ||
|
|
89dcd72d70 | ||
|
|
5c3346aa9d | ||
|
|
7c4b383477 | ||
|
|
bdc0e8e0fc | ||
|
|
6d66f93565 | ||
|
|
9cac93b724 | ||
|
|
0709f263af | ||
|
|
4e4effd8b1 | ||
|
|
f9632cba61 | ||
|
|
38db6a41d5 | ||
|
|
7c6f0432c8 | ||
|
|
56ff9368be | ||
|
|
597e21d44d | ||
|
|
5bf54632be | ||
|
|
3a8d3ee515 | ||
|
|
1c1cf866e2 | ||
|
|
ccc1df75f1 | ||
|
|
d2c3f87656 | ||
|
|
6d62229b5f | ||
|
|
7c88865d67 | ||
|
|
c8cfe0cb5a | ||
|
|
e573bdba92 | ||
|
|
d8cd15d361 | ||
|
|
1db3907838 | ||
|
|
72cfd37ab7 | ||
|
|
1e67ee995e | ||
|
|
6c26b4080c | ||
|
|
0dbd59b223 | ||
|
|
b2066c60d1 | ||
|
|
8d7ae324ff | ||
|
|
c0d3c4f875 | ||
|
|
27a771648a | ||
|
|
86affc7304 | ||
|
|
d939b99628 | ||
|
|
1fcf777f3d | ||
|
|
7a8e23faa9 | ||
|
|
73a4dd3321 | ||
|
|
13ce873a69 | ||
|
|
406dc64aba | ||
|
|
af5d6a2015 | ||
|
|
61c6f509ae | ||
|
|
98769ecd88 | ||
|
|
8615950bd6 | ||
|
|
1bec8dfc48 | ||
|
|
460486fe25 | ||
|
|
318c50bc6c | ||
|
|
3e08bac7f3 | ||
|
|
c3d64ab185 | ||
|
|
2b73077b50 | ||
|
|
f953bd5488 | ||
|
|
f94011cf05 | ||
|
|
aeacf109eb | ||
|
|
e307de83e2 | ||
|
|
85968ec417 | ||
|
|
993f14a31f | ||
|
|
566d617508 | ||
|
|
542a279fcb | ||
|
|
e784bb89e1 | ||
|
|
f680ace258 | ||
|
|
7aa5976e07 | ||
|
|
f88f1ea951 | ||
|
|
da4561cb35 | ||
|
|
1f89ae9813 | ||
|
|
5647323449 | ||
|
|
bc27253cbf | ||
|
|
0672b711f3 | ||
|
|
ed9ee6e347 | ||
|
|
7ad23ad4a2 | ||
|
|
8a83f03cc1 | ||
|
|
0be9ac4097 | ||
|
|
ba5be6b516 | ||
|
|
c4aea6d326 | ||
|
|
858c6407a9 | ||
|
|
c4313395b5 | ||
|
|
a32aec3d59 | ||
|
|
696bcfe8fa | ||
|
|
2f3a253c6a | ||
|
|
e41fbe0188 | ||
|
|
ef9d28597b | ||
|
|
6f3c4c89ab | ||
|
|
60c577a61e | ||
|
|
f3276c3039 | ||
|
|
37a843323d | ||
|
|
95c780ca8c | ||
|
|
d60d5b154a | ||
|
|
0435a805c7 | ||
|
|
f406a977e0 | ||
|
|
18db1e1ecb | ||
|
|
6bd1beb719 | ||
|
|
1293aecbca | ||
|
|
8a10c2e112 | ||
|
|
c21d777269 | ||
|
|
d864094f48 | ||
|
|
deaac3fdf0 | ||
|
|
b7062fe40c | ||
|
|
64d5e99b9d | ||
|
|
f9d8a7d22b | ||
|
|
52fcd3ad98 | ||
|
|
9d1e0ee29b | ||
|
|
de62f48f50 | ||
|
|
f47b19274c | ||
|
|
bb7f7083b9 | ||
|
|
cd580090dc | ||
|
|
ddb74b598d | ||
|
|
29571fc3aa | ||
|
|
57ee0fb2bd | ||
|
|
3ef10e73a5 | ||
|
|
dc40492fc7 | ||
|
|
e606a76a86 | ||
|
|
8838fd67b9 | ||
|
|
c570e20308 | ||
|
|
0a00ef39e3 | ||
|
|
9a08b81214 | ||
|
|
c617ae26a2 | ||
|
|
f6a776a692 | ||
|
|
54b253099d | ||
|
|
f662aca58c | ||
|
|
76e7755496 | ||
|
|
e05ad81c13 | ||
|
|
cffb16d7f7 | ||
|
|
18ca571944 | ||
|
|
3ae1973e21 | ||
|
|
308c8c3ea7 | ||
|
|
f49b5dd037 | ||
|
|
f245ba82ad | ||
|
|
60d22d6973 | ||
|
|
d6f48a82d9 | ||
|
|
c0d73dae67 | ||
|
|
49eb60589d | ||
|
|
89993b7421 | ||
|
|
511cb93806 | ||
|
|
8ce78e7134 | ||
|
|
9ebfab2e78 | ||
|
|
833d245251 | ||
|
|
00d3024143 | ||
|
|
aedeab8a6a | ||
|
|
4d39169eb8 | ||
|
|
2ddc448150 | ||
|
|
f9a6b4ce2c | ||
|
|
22b2b69413 | ||
|
|
7f11632ea6 | ||
|
|
c0b4d5e2c2 | ||
|
|
2c23d0249c | ||
|
|
c3233fbf61 | ||
|
|
ecfc8e208c | ||
|
|
52d5e21fc4 | ||
|
|
6d0c56554f | ||
|
|
844e91dc9e | ||
|
|
1f00b5f577 | ||
|
|
2c48458384 | ||
|
|
ddda87c5a7 | ||
|
|
6b1bbca620 | ||
|
|
b5378e5d3c | ||
|
|
c69a55df29 | ||
|
|
5faa1a993a | ||
|
|
e56481f6d7 | ||
|
|
f9610d457c | ||
|
|
ae066f42a4 | ||
|
|
c60dd42fa7 | ||
|
|
7aac5ac5a1 | ||
|
|
ad0f3fa33b | ||
|
|
63d121b796 | ||
|
|
4291cfe82f | ||
|
|
f312868154 | ||
|
|
5b42d34ac8 | ||
|
|
397a8c275d | ||
|
|
2aabee453b | ||
|
|
185333a615 | ||
|
|
7d177eb1d4 | ||
|
|
705a84051d | ||
|
|
f6821f80e1 | ||
|
|
e7a6f5228d | ||
|
|
8161fd6acb | ||
|
|
2137920e81 | ||
|
|
879102599c | ||
|
|
44190f07fe | ||
|
|
a41487eb8f | ||
|
|
e1acaaa27c | ||
|
|
08a97aeff8 | ||
|
|
5b7302b46d | ||
|
|
34c0bba130 | ||
|
|
5a53447272 | ||
|
|
b6847289ff | ||
|
|
d22c43e08b | ||
|
|
d9deaa8d74 | ||
|
|
6c7776a9a6 | ||
|
|
62bd6e41ef | ||
|
|
293c7b42c6 | ||
|
|
788da62777 | ||
|
|
2c7f24a913 | ||
|
|
f236706d6a | ||
|
|
b097700591 | ||
|
|
50b112c9d6 | ||
|
|
c2f478b088 | ||
|
|
dccbb137d7 | ||
|
|
90f9940dbd | ||
|
|
f3f7cc9077 | ||
|
|
c331e2f39e | ||
|
|
1c7ebc4323 | ||
|
|
5f5427266f | ||
|
|
33e655becd | ||
|
|
0ea0602aec | ||
|
|
46effd2ca4 | ||
|
|
de055e8260 | ||
|
|
c3077304af | ||
|
|
e15135911f | ||
|
|
d430cae944 | ||
|
|
f92dc6f71b | ||
|
|
a679be68b1 | ||
|
|
c5c5ce8409 | ||
|
|
e7cb0d397e | ||
|
|
b84308cb49 | ||
|
|
0df47d2ce3 | ||
|
|
e24b548b54 | ||
|
|
75af444cee | ||
|
|
02dd19962f | ||
|
|
f552b8ef7b | ||
|
|
9162e31489 | ||
|
|
01b28e3ee8 | ||
|
|
f5aa855125 | ||
|
|
db3610fcdb | ||
|
|
2e3f330058 | ||
|
|
1617a7f2c1 | ||
|
|
69a5566bf9 | ||
|
|
30e5d8b855 | ||
|
|
67ff7726e0 | ||
|
|
f96a2e2325 | ||
|
|
344c4f9385 | ||
|
|
89aa146845 | ||
|
|
468e569bc7 | ||
|
|
139c99001a | ||
|
|
bd99be15c2 | ||
|
|
1d91d8fd94 | ||
|
|
f425f86101 | ||
|
|
83a6b7567f | ||
|
|
9184c70883 | ||
|
|
f5ca4ccce5 | ||
|
|
50f174be92 | ||
|
|
e5d11ce535 | ||
|
|
94851a51aa | ||
|
|
cfc07f4411 | ||
|
|
c6e9abda9f | ||
|
|
25951ddc55 | ||
|
|
bcd9ece077 | ||
|
|
68adbc38ba | ||
|
|
79a4d06cc0 | ||
|
|
18bf3b7548 | ||
|
|
4e66d3532e | ||
|
|
1b6d567451 | ||
|
|
7959a79575 | ||
|
|
abf3249b67 | ||
|
|
35e0dc84e8 | ||
|
|
17639e8729 | ||
|
|
cbd1fd908c | ||
|
|
b2cf20f3d8 | ||
|
|
915f1a5036 | ||
|
|
a55ec6416c | ||
|
|
b1834b1958 | ||
|
|
1beeb9fb55 | ||
|
|
18d86354ec | ||
|
|
6297b0679c | ||
|
|
d62ef635a7 | ||
|
|
c53836040f | ||
|
|
0b638bf85f | ||
|
|
7f6a71b964 | ||
|
|
1b4363a54a | ||
|
|
16d168c970 | ||
|
|
4606d7960e | ||
|
|
4eee126d26 | ||
|
|
dde426658f | ||
|
|
f6874fbcad | ||
|
|
621d4e4d92 | ||
|
|
76062231fd | ||
|
|
261f55fea5 | ||
|
|
202cf4bcc9 | ||
|
|
b7572f727f | ||
|
|
50ab346d58 | ||
|
|
b11b375848 | ||
|
|
e6c3ae9397 | ||
|
|
df663aceb9 | ||
|
|
db7e597f67 | ||
|
|
1d3fe81ff7 | ||
|
|
9c887fbe63 | ||
|
|
4723bffcd2 | ||
|
|
9643de3ca0 | ||
|
|
3bf3a54916 | ||
|
|
bcffc8856a | ||
|
|
6b8c35c27b | ||
|
|
dd409b4d1c | ||
|
|
94a1aebe2b | ||
|
|
d3030c3ec6 | ||
|
|
0221021078 | ||
|
|
966021bfd4 | ||
|
|
f06e6e85d5 | ||
|
|
28ad641070 | ||
|
|
384c775f1a | ||
|
|
ce40c691e9 | ||
|
|
5b0c38b0ed | ||
|
|
734456785f | ||
|
|
4f24312432 | ||
|
|
d79b1ff3b4 | ||
|
|
bbe1c1f1e0 | ||
|
|
1978e67401 | ||
|
|
e129e4a2d0 | ||
|
|
f7f1bbbdd2 | ||
|
|
de8f2e6a68 | ||
|
|
85704e3947 | ||
|
|
4d661ff41d | ||
|
|
d7b39634e6 | ||
|
|
039c98b9e3 | ||
|
|
172c4bf0a9 | ||
|
|
1f2a1c5dec | ||
|
|
e5a6a00282 | ||
|
|
d8153f7611 | ||
|
|
8b6ae3f39b | ||
|
|
24537781b7 | ||
|
|
d2a29506aa | ||
|
|
adf51d5264 | ||
|
|
0864179085 | ||
|
|
8de77f283d | ||
|
|
004a014000 | ||
|
|
80f6eb94aa | ||
|
|
4035c9cc5f | ||
|
|
3a365f6807 | ||
|
|
9920a0a59f | ||
|
|
c17bb9e171 | ||
|
|
03073f6875 | ||
|
|
609caf6e5f | ||
|
|
411141ff88 | ||
|
|
3e472e18bd | ||
|
|
e5b6fbd12a | ||
|
|
c2787f1282 | ||
|
|
df940124b1 | ||
|
|
5288d042ca | ||
|
|
fa98a27c90 | ||
|
|
d341a5a60b | ||
|
|
7f15227de1 | ||
|
|
bb45240665 | ||
|
|
29f84aeab5 | ||
|
|
5a52edcad8 | ||
|
|
b078e23aa1 | ||
|
|
7fa87125b5 | ||
|
|
f618df46d8 | ||
|
|
ee03853901 | ||
|
|
6c4a9bcfb8 | ||
|
|
1bec20ecef | ||
|
|
08c9bf570d | ||
|
|
5e77a10a81 | ||
|
|
3bc6461e2a | ||
|
|
d3194e15e2 | ||
|
|
2db79ef202 | ||
|
|
b3c07edef6 | ||
|
|
b773fdca34 | ||
|
|
2e9f9f7b7e | ||
|
|
30cbfe729d | ||
|
|
b036da2446 | ||
|
|
c8a9fb1674 | ||
|
|
43bea80cad | ||
|
|
23538c0323 | ||
|
|
2ae911230d | ||
|
|
5ce1cb87ea | ||
|
|
2a37028b6a | ||
|
|
8130feb2a0 | ||
|
|
c49a875ec2 | ||
|
|
2a002304b9 | ||
|
|
d9522818ae | ||
|
|
800588e121 | ||
|
|
991c31ebdb | ||
|
|
48f77e1691 | ||
|
|
42de6fd074 | ||
|
|
62845b470c | ||
|
|
fd20986cf8 | ||
|
|
61369cde9e | ||
|
|
644384ce8b | ||
|
|
97c11a2482 | ||
|
|
1e7e1c2d78 | ||
|
|
1c7201fb04 | ||
|
|
61ec0c697a | ||
|
|
4b5fce1bfc | ||
|
|
6cc6e7c8e9 | ||
|
|
89298fce30 | ||
|
|
a3a27e07fa | ||
|
|
4f32376f22 | ||
|
|
58bf189941 | ||
|
|
bcfa508da5 | ||
|
|
c0ae3ef58b | ||
|
|
1e70d7b4c3 | ||
|
|
f8dc6ad2bc | ||
|
|
e22482988f | ||
|
|
4eb896629d | ||
|
|
b310e66275 | ||
|
|
b39da1bea7 | ||
|
|
fa575d0574 | ||
|
|
dfe2f3771b | ||
|
|
46caeb0445 | ||
|
|
59cc9c7006 | ||
|
|
12e91534eb | ||
|
|
d9da88ceb5 | ||
|
|
2dbfec0307 | ||
|
|
09cf8c9641 | ||
|
|
f1bed4d6a3 | ||
|
|
2ed6c33c83 | ||
|
|
7ad532ed17 | ||
|
|
92fe8c5b14 | ||
|
|
8e95572589 | ||
|
|
62da862a66 | ||
|
|
993e34f548 | ||
|
|
e39465aece | ||
|
|
8fd616b680 | ||
|
|
cc054b27de | ||
|
|
dfdaa82245 | ||
|
|
99a307e0ad | ||
|
|
5ddea836a1 | ||
|
|
208d92aa06 | ||
|
|
6ef9ddd4f3 | ||
|
|
1c92d39185 | ||
|
|
c0f072217c | ||
|
|
542562f988 | ||
|
|
4e6f0d5e87 | ||
|
|
10639a5ead | ||
|
|
06d668e710 | ||
|
|
d1472dfcba | ||
|
|
ccb4da3cd8 | ||
|
|
46e96b49f0 | ||
|
|
984cfe7f98 | ||
|
|
d769300137 | ||
|
|
d175d66828 | ||
|
|
c1a314332e | ||
|
|
046ac59d21 | ||
|
|
00c06f07d0 | ||
|
|
3e2ab40c6a | ||
|
|
350ffd0052 | ||
|
|
ecd1a622d2 | ||
|
|
f13968aa61 | ||
|
|
4d1ffde54c | ||
|
|
d69017a706 | ||
|
|
f2deaeccdb | ||
|
|
ea9b0d2a79 | ||
|
|
2e6dbedb8b | ||
|
|
6f359df8f9 | ||
|
|
f6db20cd06 | ||
|
|
6287fae065 | ||
|
|
e441607ce3 | ||
|
|
b5379a95fa | ||
|
|
64ec5be919 | ||
|
|
3916512d66 | ||
|
|
e2f426a1bd | ||
|
|
aa1df8dfcf | ||
|
|
67557555f2 | ||
|
|
4cb652abd9 | ||
|
|
d11868b99f | ||
|
|
1798417e6a | ||
|
|
43dc3e5bb1 | ||
|
|
91891a14ed | ||
|
|
20f7d60147 | ||
|
|
7e17e7d37a | ||
|
|
cbb244f785 | ||
|
|
1c264d858b | ||
|
|
217037c2ae | ||
|
|
b4dbd0b69c | ||
|
|
89a2b5c00b | ||
|
|
929b6dae1a | ||
|
|
52fe493da9 | ||
|
|
3e6be3e762 | ||
|
|
7a8cc449b9 | ||
|
|
8f5a9d6e9f | ||
|
|
1c5e31fea9 | ||
|
|
fd08ae18ab | ||
|
|
a7eb3de06e | ||
|
|
8902dd7c44 | ||
|
|
6387d8400c | ||
|
|
597cacb9cc | ||
|
|
3e285ad9ff | ||
|
|
cc1fa89790 | ||
|
|
b0ed007751 | ||
|
|
e1e2650d2b | ||
|
|
b23f17b633 | ||
|
|
818e40b2df | ||
|
|
5685e39631 | ||
|
|
72534b7674 | ||
|
|
328490d23d | ||
|
|
97a0696930 | ||
|
|
cb4e0660e0 | ||
|
|
67c642de4c | ||
|
|
0d7c2e1024 | ||
|
|
16a779a41b | ||
|
|
c4ca3c8644 | ||
|
|
aabcbe34f3 | ||
|
|
f06626e441 | ||
|
|
c4e1a71776 | ||
|
|
77e6c16bd2 | ||
|
|
9d1fac3570 | ||
|
|
b7aeaa7fc5 | ||
|
|
f6d8c9ff61 | ||
|
|
0490794d6c | ||
|
|
335c83dd3c | ||
|
|
91da720c26 | ||
|
|
b6ac744a68 | ||
|
|
526c4092fd | ||
|
|
ed06dda384 | ||
|
|
6465b11e9b | ||
|
|
b2879878a1 | ||
|
|
3e17b086fb | ||
|
|
0545e6bcda | ||
|
|
27a907433f | ||
|
|
69616800e3 | ||
|
|
abf1f53432 | ||
|
|
881c5f75cb | ||
|
|
4e45796ade | ||
|
|
1ce4ea5230 | ||
|
|
f2a2437baa | ||
|
|
508dc9db1e | ||
|
|
a914e3557f | ||
|
|
f489dc062f | ||
|
|
a7e09f4850 | ||
|
|
8ea97530d4 | ||
|
|
13ab54e83a | ||
|
|
4bc40325cb | ||
|
|
58d9355ea3 | ||
|
|
d46b7528e7 | ||
|
|
1858597fc9 | ||
|
|
83cce5afe4 | ||
|
|
201bd8dc1f | ||
|
|
b62ba69060 | ||
|
|
5d2f5557e5 | ||
|
|
cf75c1aad0 | ||
|
|
76a60df88b | ||
|
|
9322c79b4e | ||
|
|
12365edcf0 | ||
|
|
5efc1f9dad | ||
|
|
ab976cbb24 | ||
|
|
db584b7897 | ||
|
|
0fdc0748cf | ||
|
|
2e79c21dc2 | ||
|
|
5490a230bd | ||
|
|
a6b059b30d | ||
|
|
712e6011aa | ||
|
|
68f6f87410 | ||
|
|
50cdd68b7b | ||
|
|
e8510b925e | ||
|
|
24e800501a | ||
|
|
6013c994a6 | ||
|
|
46c90628b9 | ||
|
|
d2d2dac5d1 | ||
|
|
fd3e7470f4 | ||
|
|
b79e9f72ce | ||
|
|
77eb5dd3bf | ||
|
|
b17c14a07b | ||
|
|
494d90be22 | ||
|
|
da7e599e65 | ||
|
|
e3b7360f39 | ||
|
|
367130882d | ||
|
|
d8563ba79d | ||
|
|
e527453964 | ||
|
|
88fe3c5fbd | ||
|
|
748faf92c1 | ||
|
|
0126aded78 | ||
|
|
695a75ea09 | ||
|
|
80e690f9fc | ||
|
|
e8770b90ef | ||
|
|
eec9da42bf | ||
|
|
1c8f0d6292 | ||
|
|
b753c8840b | ||
|
|
95589982a5 | ||
|
|
37a10bd453 | ||
|
|
7abc76e92c | ||
|
|
7aa4467bda | ||
|
|
471938adb6 | ||
|
|
201a7e3b34 | ||
|
|
11ec3723c3 | ||
|
|
75eb736856 | ||
|
|
8fea126c20 | ||
|
|
cc02d09c4d | ||
|
|
af95631a1d | ||
|
|
7b3d2ab85a | ||
|
|
c52df96af9 | ||
|
|
dee5fa60af | ||
|
|
5e99fdd9c9 | ||
|
|
eb01fe757b | ||
|
|
c52483da2c | ||
|
|
2714c0f4ad | ||
|
|
bba21408ea | ||
|
|
47c5320d67 | ||
|
|
b5c49573e5 | ||
|
|
0197961175 | ||
|
|
f08b98dcba | ||
|
|
3878998080 | ||
|
|
5fa117db4c | ||
|
|
caa085a646 | ||
|
|
392a1c03c5 | ||
|
|
1524d27f4c | ||
|
|
d309957927 | ||
|
|
e0f2c03b91 | ||
|
|
1e5848e0d5 | ||
|
|
18bb7dc47b | ||
|
|
0ea7de12a5 | ||
|
|
c8e382e2dd | ||
|
|
84e19f8565 | ||
|
|
f597ea9948 | ||
|
|
d43e1a7cbe | ||
|
|
8131e713cf | ||
|
|
fefa2bd839 | ||
|
|
cc0984db14 | ||
|
|
f87609417b | ||
|
|
8d57b55f94 | ||
|
|
55776fd7cb | ||
|
|
3963c98689 | ||
|
|
02c59636fc | ||
|
|
989f196894 | ||
|
|
9314de4772 | ||
|
|
44a6cd88cd | ||
|
|
d8774c4787 | ||
|
|
a56066bac1 | ||
|
|
8a96f71d10 | ||
|
|
20a684e8f5 | ||
|
|
c8fcf50095 | ||
|
|
58b637bcca | ||
|
|
86caf92c90 | ||
|
|
35ead280d5 | ||
|
|
5d6c3e364d | ||
|
|
f006175829 | ||
|
|
3e0f325734 | ||
|
|
f8d383cff0 | ||
|
|
f2ec3ae755 | ||
|
|
f95e4e016b | ||
|
|
898e9e67d0 | ||
|
|
15983921b0 | ||
|
|
65c2077e30 | ||
|
|
946a28d3be | ||
|
|
69accb5319 | ||
|
|
4ddcf4391a | ||
|
|
a0d886009a | ||
|
|
91c37aaa96 | ||
|
|
7602247558 | ||
|
|
d5a4035bef | ||
|
|
d9652c7334 | ||
|
|
9b4fd7449b | ||
|
|
bc6b568f7e | ||
|
|
c9ee856f91 | ||
|
|
2355c898f8 | ||
|
|
87d0aed4ad | ||
|
|
3cbc547e0f | ||
|
|
e883ebe307 | ||
|
|
20d797320a | ||
|
|
bc3e043192 | ||
|
|
c0555aa608 | ||
|
|
e75b47c21a | ||
|
|
3702f493f6 | ||
|
|
80d88d4d8f | ||
|
|
95c711ce7e | ||
|
|
0ee89920fd | ||
|
|
fd49a171c0 | ||
|
|
16ad5221eb | ||
|
|
8167c432b8 | ||
|
|
ae5d6c1ba4 | ||
|
|
1e6c80bd03 | ||
|
|
d48cd1acdd | ||
|
|
a5f92165fb | ||
|
|
d834124a71 | ||
|
|
ce6f3afb39 | ||
|
|
f5462fa1bf | ||
|
|
f75e23158a | ||
|
|
253ff71a0a | ||
|
|
8d7db49cb0 | ||
|
|
315509f7a4 | ||
|
|
a7bd8b810b | ||
|
|
a7c8ba332b | ||
|
|
40cadb6a00 | ||
|
|
cbf409dffc | ||
|
|
60a791442e | ||
|
|
528e8bf92e | ||
|
|
8a4243e7f8 | ||
|
|
1ac95f0d14 | ||
|
|
cd51eb25ce | ||
|
|
4e64a2b2b2 | ||
|
|
672c660c41 | ||
|
|
2a56e57490 | ||
|
|
f6efd2363a | ||
|
|
fa08b39bb0 | ||
|
|
81c3110d0d | ||
|
|
c01e636421 | ||
|
|
fd8d2961bf | ||
|
|
9e4b53e20b | ||
|
|
20116b3933 | ||
|
|
bca5ee0c0d | ||
|
|
331bd69021 | ||
|
|
57b11b7699 | ||
|
|
3e9b11c281 | ||
|
|
bbfd618626 | ||
|
|
00abb839f9 | ||
|
|
1d639d5f5a | ||
|
|
c565fc08c3 | ||
|
|
026c71f9fc | ||
|
|
1eed499151 | ||
|
|
21f2aabd58 | ||
|
|
e1f06b7139 | ||
|
|
c4be74bce5 | ||
|
|
7c9e9e1cd9 | ||
|
|
797aabc637 | ||
|
|
630a3d4845 | ||
|
|
3b0bb4ea74 | ||
|
|
e36347a4c3 | ||
|
|
4f59dfc49c | ||
|
|
fc0082a470 | ||
|
|
712449674f | ||
|
|
a64b4527f2 | ||
|
|
71a7ebbfe2 | ||
|
|
d6d701c722 | ||
|
|
43fbbc07f5 | ||
|
|
8504144c32 | ||
|
|
1d3e59b5dd | ||
|
|
3f70ca3506 | ||
|
|
3640d8bd24 | ||
|
|
706a99817f | ||
|
|
4645b2dcab | ||
|
|
13f1673371 | ||
|
|
7d374c4c2a | ||
|
|
5ed449773c | ||
|
|
aef9c2269a | ||
|
|
daa5a3e821 | ||
|
|
5cd1167b28 | ||
|
|
21e7ae3dfd | ||
|
|
5d40138585 | ||
|
|
893fd820a3 | ||
|
|
2d536d99e5 | ||
|
|
a0ee4792b9 | ||
|
|
a8f6880840 | ||
|
|
51296d1d44 | ||
|
|
0f29149014 | ||
|
|
b9f0c277ec | ||
|
|
69964c9704 | ||
|
|
ff1d38e34f | ||
|
|
3abee7f2f5 | ||
|
|
ed0b80008f | ||
|
|
976ff108b3 | ||
|
|
66e3cc77c5 | ||
|
|
229abba1e4 | ||
|
|
8dacaf84cc | ||
|
|
102b185572 | ||
|
|
52ac474f7d | ||
|
|
c0064cfcfa | ||
|
|
414ce5610d | ||
|
|
113ac42814 | ||
|
|
a2f2eef326 | ||
|
|
54a69a6101 | ||
|
|
5e2d3c8d7d | ||
|
|
5a9950a7c3 | ||
|
|
2aadbc1a61 | ||
|
|
749414ab65 | ||
|
|
baaebcd413 | ||
|
|
5a8a60b15d | ||
|
|
f0ddb8db49 | ||
|
|
baa12c0161 | ||
|
|
ca226e98c2 | ||
|
|
453079ef1f | ||
|
|
074aea2c35 | ||
|
|
9cf5f0b9b3 | ||
|
|
89e12eea29 | ||
|
|
03d4caff8f | ||
|
|
89d54dedb7 | ||
|
|
9a9e62ccd3 | ||
|
|
eca38ae920 | ||
|
|
84e89599bf | ||
|
|
e1cdf4ed50 | ||
|
|
e4371ea4fc | ||
|
|
9c45d13cbf | ||
|
|
5f22347d7a | ||
|
|
ca786a3567 | ||
|
|
60ce662d49 | ||
|
|
4f9b0d8925 | ||
|
|
9c2fc570e6 | ||
|
|
0ba982b271 | ||
|
|
ff3123e387 | ||
|
|
1548286083 | ||
|
|
c018d953b8 | ||
|
|
cf66d28774 | ||
|
|
9cec6fd212 | ||
|
|
92926331b5 | ||
|
|
f9932ea222 | ||
|
|
a65d6b7630 | ||
|
|
7252d1e4d7 | ||
|
|
3b5a951431 | ||
|
|
0b1c331705 | ||
|
|
3c354b71f5 | ||
|
|
1eb5f381ae | ||
|
|
c5efd28781 | ||
|
|
53ae8ac917 | ||
|
|
505b6368e6 | ||
|
|
3c20e9e203 | ||
|
|
43427461f5 | ||
|
|
d7740ff6d2 | ||
|
|
1fb4eb33aa | ||
|
|
b27f362b44 | ||
|
|
325e3bc19b | ||
|
|
9215985335 | ||
|
|
293179daa6 | ||
|
|
4fe79dbe85 | ||
|
|
55d738e917 | ||
|
|
986b07f4a9 | ||
|
|
450c2e91ed | ||
|
|
4d06333624 | ||
|
|
fbe4122404 | ||
|
|
baf9b5e6f3 | ||
|
|
c88fc20701 | ||
|
|
b1078d6c73 | ||
|
|
5033d10246 | ||
|
|
986993a890 | ||
|
|
19b13a1e81 | ||
|
|
76637fab33 | ||
|
|
0a79d9a187 | ||
|
|
36b3b3c7ae | ||
|
|
8caeca0c08 | ||
|
|
1c323f54ee | ||
|
|
7ed0b752a8 | ||
|
|
0569906f7c | ||
|
|
2a7cf187ad | ||
|
|
cc5b98a5d2 | ||
|
|
1478c92f49 | ||
|
|
e1785a1738 | ||
|
|
44ebd2918c | ||
|
|
c87fa0de5e | ||
|
|
7b26692c8e | ||
|
|
b294e391e7 | ||
|
|
85f8e362e6 | ||
|
|
d68a6a1056 | ||
|
|
3dae9c0639 | ||
|
|
aede6b064a | ||
|
|
76b168020c | ||
|
|
5e36b1454a | ||
|
|
bd35fbac4d | ||
|
|
e081ec19cc | ||
|
|
d870d8bad6 | ||
|
|
20fd13c836 | ||
|
|
59f98b151d | ||
|
|
4ac1990c12 | ||
|
|
0a5105cc62 | ||
|
|
a9f8b835ee | ||
|
|
0109bd5bda | ||
|
|
01dad64c6d | ||
|
|
ee38f57f6d | ||
|
|
6b163dcb5f | ||
|
|
baadbbc65a | ||
|
|
13a2813db9 | ||
|
|
cfa7d12dd3 | ||
|
|
8bf23d820f | ||
|
|
3c7e903ace | ||
|
|
ee0e3aece9 | ||
|
|
d7efd1b285 | ||
|
|
34f7a7ab18 | ||
|
|
695eb0a401 | ||
|
|
0d44b95a40 | ||
|
|
116c421492 | ||
|
|
53507ef56b | ||
|
|
3c049e031f | ||
|
|
b6688adb35 | ||
|
|
b46fe28c05 | ||
|
|
e7debdcf46 | ||
|
|
2c2930e876 | ||
|
|
ca294fc049 | ||
|
|
86d1a40299 | ||
|
|
7a3884a633 | ||
|
|
7e5c6581c9 | ||
|
|
f17bbbd689 | ||
|
|
24b046e9d7 | ||
|
|
48a7d24c11 | ||
|
|
033f96a4b0 | ||
|
|
f0a1cb6525 | ||
|
|
db5782783b | ||
|
|
29022e260d | ||
|
|
1e1f58d3ed | ||
|
|
12389e2856 | ||
|
|
cde7427449 | ||
|
|
42e7cb7b5f | ||
|
|
d7992bc1f7 | ||
|
|
61c8549401 | ||
|
|
a284dcf61d | ||
|
|
2e462b0899 | ||
|
|
b79c66d59a | ||
|
|
2f2020e7e2 | ||
|
|
b7e99c0d2b | ||
|
|
2648848898 | ||
|
|
79b23ca829 | ||
|
|
0ac5b7bc87 | ||
|
|
1d211e8474 | ||
|
|
1981a83e82 | ||
|
|
cac071e7af | ||
|
|
c6efccd61c | ||
|
|
a90b00e5fe | ||
|
|
7863d03282 | ||
|
|
968606d781 | ||
|
|
f7e8de2556 | ||
|
|
17a8edc1ae | ||
|
|
30dc63c801 | ||
|
|
8db7b8419a | ||
|
|
8c626b20e1 | ||
|
|
a8929c8046 | ||
|
|
f8e4b5e958 | ||
|
|
58cae24157 | ||
|
|
bb4f5f37cc | ||
|
|
237333941a | ||
|
|
e1406875aa | ||
|
|
6ab96898a3 | ||
|
|
7973b2f3da | ||
|
|
90284625af | ||
|
|
6b3442512a | ||
|
|
f9208136af | ||
|
|
9895fbde0d | ||
|
|
30370e4985 | ||
|
|
7a45f370b5 | ||
|
|
38068eeaac | ||
|
|
62df30ed6c | ||
|
|
7e75c9e510 | ||
|
|
42f9edf566 | ||
|
|
c72b6144a5 | ||
|
|
032777e32e | ||
|
|
607b5320fd | ||
|
|
959766b265 | ||
|
|
9774991b56 | ||
|
|
e1587995d0 | ||
|
|
08e6e22046 | ||
|
|
454d8bdc88 | ||
|
|
d0ae7431eb | ||
|
|
d88dc17b21 | ||
|
|
705f569571 | ||
|
|
abc7badfa9 | ||
|
|
e8c2469227 | ||
|
|
1e5e8cd246 | ||
|
|
adc81cfb95 | ||
|
|
e175fa64cb | ||
|
|
f9994d0e42 | ||
|
|
3e5d1c514a | ||
|
|
6310394034 | ||
|
|
f32596053b | ||
|
|
cf4a6969d3 | ||
|
|
0918412916 | ||
|
|
41b1718587 | ||
|
|
ca2acbc704 | ||
|
|
1abd3ef8b1 | ||
|
|
cedba3770c | ||
|
|
f733be1fd1 | ||
|
|
01e02232d7 | ||
|
|
771920b38b | ||
|
|
0f55bbc148 | ||
|
|
ab4e9646ad | ||
|
|
884b73599a | ||
|
|
492c0e7ef7 | ||
|
|
0865ae000b | ||
|
|
049c9b44e4 | ||
|
|
199edd3771 | ||
|
|
8806217d25 | ||
|
|
cc1588debd | ||
|
|
d2ba4b32fe | ||
|
|
b3d5054966 | ||
|
|
57a921425c | ||
|
|
061aaeb933 | ||
|
|
0c7af9c740 | ||
|
|
d5c4b990dc | ||
|
|
a650a79dfc | ||
|
|
7ac6e94348 | ||
|
|
b4abdf3d51 | ||
|
|
b59b87d84e | ||
|
|
799ae1a20e | ||
|
|
1e58e69c59 | ||
|
|
c667bab5ca | ||
|
|
2a744fb174 | ||
|
|
a9744a0cad | ||
|
|
0aab22f242 | ||
|
|
b0f65225a9 | ||
|
|
1311da7258 | ||
|
|
61d68b1f76 | ||
|
|
5dd1769536 | ||
|
|
a45a9bda9e | ||
|
|
4e43c797e2 | ||
|
|
beab1a7b01 | ||
|
|
85c00a9c4e | ||
|
|
b2e5565110 | ||
|
|
95785afec9 | ||
|
|
d9d16eccfe | ||
|
|
26900c9b62 | ||
|
|
8113ddc809 | ||
|
|
3cd6a1a558 | ||
|
|
9128141be0 | ||
|
|
0b0af20a84 | ||
|
|
225144cb46 | ||
|
|
bbe802037e | ||
|
|
1db4e92779 | ||
|
|
072883dcd4 | ||
|
|
a25e929200 | ||
|
|
6c4d27be8a | ||
|
|
8825382502 | ||
|
|
9ce3c5bd73 | ||
|
|
771346c8fa | ||
|
|
a56b2d6a9f | ||
|
|
342f980bad | ||
|
|
dbc1bdeb3b | ||
|
|
1cb10e879e | ||
|
|
d90dd5288b | ||
|
|
e55a517dae | ||
|
|
378def1fa3 | ||
|
|
ea7676c98e | ||
|
|
b9b15568b4 | ||
|
|
701d8cbd8a | ||
|
|
bd525763de | ||
|
|
479868718e | ||
|
|
951136bc4c | ||
|
|
8ab25ef8e4 | ||
|
|
a11cd9b0df | ||
|
|
1e72733e81 | ||
|
|
967b7d05de | ||
|
|
90bc890190 | ||
|
|
647c358b72 | ||
|
|
2a89885437 | ||
|
|
47cc43185d | ||
|
|
aa6e09ed3e | ||
|
|
c7bc3d6f3b | ||
|
|
0b68bf7c07 | ||
|
|
3274ef5e3e | ||
|
|
f93a00c8d4 | ||
|
|
92bcb83b16 | ||
|
|
4e0c813db7 | ||
|
|
d4509c80b7 | ||
|
|
c9313df3a4 | ||
|
|
9b6fb29d46 | ||
|
|
50ce5cf257 | ||
|
|
b19e5b3b40 | ||
|
|
c07ba3f737 | ||
|
|
eff5f60264 | ||
|
|
355b2e16b4 | ||
|
|
c389101a10 | ||
|
|
4aa0b3d0fc | ||
|
|
322f1415f6 | ||
|
|
0d57691e38 | ||
|
|
507b516f89 | ||
|
|
7bf73ab14d | ||
|
|
9a305355c2 | ||
|
|
6ac382a25f | ||
|
|
e02b255442 | ||
|
|
d978740d66 | ||
|
|
62b7492e9f | ||
|
|
c2f42f3f69 | ||
|
|
2c4a40e778 | ||
|
|
635fcad416 | ||
|
|
2c92f830d1 | ||
|
|
4924f3e55a | ||
|
|
53306165e1 | ||
|
|
1ebcdaaf62 | ||
|
|
078ef203b6 | ||
|
|
59669d8b7f | ||
|
|
d38b98459a | ||
|
|
f54e53b8a0 | ||
|
|
851d47213c | ||
|
|
ad778b5d81 | ||
|
|
0cb081a6d0 | ||
|
|
daf3525e80 | ||
|
|
b35198c710 | ||
|
|
1feb77aadb | ||
|
|
d6b690ae2f | ||
|
|
b1ae246c86 | ||
|
|
4ceb5f13e5 | ||
|
|
64960e4dcd | ||
|
|
e1c180a13f | ||
|
|
86a0fd409a | ||
|
|
5a32398446 | ||
|
|
bcb22ec265 | ||
|
|
8719dcf98f | ||
|
|
9b4b2f75c1 | ||
|
|
8acde3a347 | ||
|
|
7c1e247ef8 | ||
|
|
f4cd27d316 | ||
|
|
205c43181b | ||
|
|
05a72abf41 | ||
|
|
14262ba510 | ||
|
|
d847b1e09c | ||
|
|
0086e42a86 | ||
|
|
7474d5a7bf | ||
|
|
5696a36115 | ||
|
|
3cdc1a9c81 | ||
|
|
b095fb9005 | ||
|
|
ce6c16214c | ||
|
|
b6f7f2734e | ||
|
|
4db55e4d77 | ||
|
|
b21f6e80b3 | ||
|
|
a804fb849e | ||
|
|
4ca91cd9f7 | ||
|
|
16e1b587b4 | ||
|
|
5e2756d200 | ||
|
|
ce9ab22ae1 | ||
|
|
72ad35e1f9 | ||
|
|
c0d110cde0 | ||
|
|
b9d5deb2ae | ||
|
|
d4b13ef46b | ||
|
|
748d9e342e | ||
|
|
f49312fc0e | ||
|
|
e0d8bbb243 | ||
|
|
153f2a49f8 | ||
|
|
8b272dc2fd | ||
|
|
87a919bbde | ||
|
|
d3017e98c5 | ||
|
|
5758d7274e | ||
|
|
0e215d69cb | ||
|
|
cbaaa32ce8 | ||
|
|
5c81646397 | ||
|
|
30ca1fb14f | ||
|
|
9fab49984a | ||
|
|
696fa6e4f8 | ||
|
|
921393e84e | ||
|
|
13e894e910 | ||
|
|
7c7e8aaef3 | ||
|
|
7ea3bd9df9 | ||
|
|
7bf7d0afae | ||
|
|
0d329baaca | ||
|
|
941a87b59c | ||
|
|
a9e8ac46d8 | ||
|
|
0d3a294118 | ||
|
|
7a27537632 | ||
|
|
287e778ddb | ||
|
|
ce44edb419 | ||
|
|
9dcd8af7a3 | ||
|
|
76dfcd0ccb | ||
|
|
13a188635d | ||
|
|
cd18fd5aed | ||
|
|
b277bd8014 | ||
|
|
daa0d368ab | ||
|
|
2cc7777e16 | ||
|
|
d276e31f7b | ||
|
|
7f35ba7e21 | ||
|
|
edd54dda84 | ||
|
|
a50a97314d | ||
|
|
4bc05e7083 | ||
|
|
09a45b49a6 | ||
|
|
1c0b71436e | ||
|
|
24f5e9a7e6 | ||
|
|
59d123a4a1 | ||
|
|
ed2afa03f9 | ||
|
|
3c531dc2ec | ||
|
|
83564bd03f | ||
|
|
7146d0d92d | ||
|
|
e842d6761a | ||
|
|
17b405e9dc | ||
|
|
f281513a41 | ||
|
|
63b876479f | ||
|
|
38b833c886 | ||
|
|
d75ea18e9f | ||
|
|
f311b20ef7 | ||
|
|
78f7237422 | ||
|
|
726af3393b | ||
|
|
c772331554 | ||
|
|
80d257b94f | ||
|
|
e2db034959 | ||
|
|
c4e88e5c05 | ||
|
|
e47e7667c6 | ||
|
|
8bb2a64663 | ||
|
|
e056e08fc1 | ||
|
|
342cd55bc0 | ||
|
|
23ef19e683 | ||
|
|
437fd29e96 | ||
|
|
aa7a07fd99 | ||
|
|
5217006dec | ||
|
|
ab4f6baae6 | ||
|
|
1976ea4d49 | ||
|
|
697fc4d2b7 | ||
|
|
38c1f7bbcb | ||
|
|
8cbfaab807 | ||
|
|
f4a4151632 | ||
|
|
5f810fe741 | ||
|
|
adaa0caab8 | ||
|
|
54ef14e765 | ||
|
|
d1383b5d1b | ||
|
|
caa703af99 | ||
|
|
90aab9f4db | ||
|
|
3439030145 | ||
|
|
058c7408d1 | ||
|
|
a4f7fd58f6 | ||
|
|
6f3024c90d | ||
|
|
5f95fa5e79 | ||
|
|
f9cb0506e9 | ||
|
|
2429401d0e | ||
|
|
9ff0d7405f | ||
|
|
5bb5cd296d | ||
|
|
273662e03e | ||
|
|
9c1a89d786 | ||
|
|
524d7ee5c0 | ||
|
|
51d2bc9aae | ||
|
|
0c8a7ff332 | ||
|
|
309b8d9efe | ||
|
|
c2f32b7bdc | ||
|
|
563bc7b359 | ||
|
|
94ca5a5bef | ||
|
|
4464589c0f | ||
|
|
748d4fe2ac | ||
|
|
50b28dc8ca | ||
|
|
118980a9fb | ||
|
|
8aff381676 | ||
|
|
6d0fba1905 | ||
|
|
7e885d3cee | ||
|
|
811daf74ff | ||
|
|
ee755b8bd6 | ||
|
|
1019eb925a | ||
|
|
061bb50b88 | ||
|
|
eb7e665c86 | ||
|
|
80301d1aab | ||
|
|
ea56fb5840 | ||
|
|
692b45c4f0 | ||
|
|
8d53a8826e | ||
|
|
64ea115303 | ||
|
|
b5e29cf50c | ||
|
|
381df1e949 | ||
|
|
13a81eda6f | ||
|
|
a48c39642a | ||
|
|
3be3e622bc | ||
|
|
07fe2ca407 | ||
|
|
9b96dae744 | ||
|
|
0e3d3d1a40 | ||
|
|
cb3274fb0c | ||
|
|
a3ada5b2bb | ||
|
|
3e167a2c52 | ||
|
|
38b3ad2b31 | ||
|
|
56e5cd13b7 | ||
|
|
d63c0fc6f0 | ||
|
|
6814b140fc | ||
|
|
5f7e478118 | ||
|
|
7317024da5 | ||
|
|
9b9fbabc3f | ||
|
|
3c5a23799f | ||
|
|
3bfdc6163c | ||
|
|
cf2f74a38d | ||
|
|
2a7f52c67e | ||
|
|
50fde1e308 | ||
|
|
46fd0ae413 | ||
|
|
65e32dc429 | ||
|
|
413675dfc1 | ||
|
|
a17343f40e | ||
|
|
5d023804c1 | ||
|
|
fa07a846b9 | ||
|
|
5df46b605e | ||
|
|
77cf371a21 | ||
|
|
89802dd040 | ||
|
|
59b95e9dd6 | ||
|
|
b836db5252 | ||
|
|
4dc4b15925 | ||
|
|
5c3062e699 | ||
|
|
3a7777c643 | ||
|
|
71543c35d6 | ||
|
|
f4cf66dc01 | ||
|
|
7870dff0fd | ||
|
|
9fc9c1ed19 | ||
|
|
4d0151350f | ||
|
|
dff10c8d13 | ||
|
|
362bcb9294 | ||
|
|
351b4f8a94 | ||
|
|
90955eb0a1 | ||
|
|
62669747ad | ||
|
|
466d00c666 | ||
|
|
63845ff875 | ||
|
|
d013748a51 | ||
|
|
474af3bc07 | ||
|
|
8e09e155fa | ||
|
|
7f9f4f96b9 | ||
|
|
cd488a8623 | ||
|
|
080b7a28b1 | ||
|
|
6949ed0ebd | ||
|
|
8465fa45bb | ||
|
|
40835ffc89 | ||
|
|
01a42ff330 | ||
|
|
ba49654a64 | ||
|
|
bc6577fe18 | ||
|
|
4ca3f0da67 | ||
|
|
7f2086488b | ||
|
|
3014fd8095 | ||
|
|
27885c8ac3 | ||
|
|
d6be0509ac | ||
|
|
1c85f5e857 | ||
|
|
abe5515aca | ||
|
|
6fba975490 | ||
|
|
2de6798f45 | ||
|
|
04fdfa2a35 | ||
|
|
8f3085290d | ||
|
|
0839fe45f5 | ||
|
|
18f4795fda | ||
|
|
55d9fa622a | ||
|
|
7dc723c764 | ||
|
|
5a63205972 | ||
|
|
a4ceeafb1e | ||
|
|
242e05cc0e | ||
|
|
065dddbe6e | ||
|
|
fa6825252b | ||
|
|
b06e48a444 | ||
|
|
97dbd40f07 | ||
|
|
bc23109f99 | ||
|
|
ecb9675e9c | ||
|
|
e1f9b9e7a4 | ||
|
|
067b485bb3 | ||
|
|
67a4e3074e | ||
|
|
010bc4e8c3 | ||
|
|
9de5e3253e | ||
|
|
e32622ac48 | ||
|
|
5e2371c2cb | ||
|
|
a6ce26ee87 | ||
|
|
2a72c126f1 | ||
|
|
36e1a5d379 | ||
|
|
c12eafa1db | ||
|
|
9e26d8755c | ||
|
|
90bd30e351 | ||
|
|
3fb5d5c4f3 | ||
|
|
9f3685e4d5 | ||
|
|
6565988952 | ||
|
|
10b7a0875b | ||
|
|
bb4b9f1a58 | ||
|
|
981e527560 | ||
|
|
80b2ee719c | ||
|
|
6103d6196f | ||
|
|
ed1a5bfded | ||
|
|
3909ce3350 | ||
|
|
d64cd0b8a4 | ||
|
|
676aa9f93f | ||
|
|
ebd48e2556 | ||
|
|
ad5871aae4 | ||
|
|
e327b1ca5b | ||
|
|
ad43ca11eb | ||
|
|
41ba76e2e2 | ||
|
|
15e773434e | ||
|
|
ed118f4e7a | ||
|
|
3c420f2e30 | ||
|
|
4e271d4f0e | ||
|
|
27f9b3cd0b | ||
|
|
1ed4abd347 | ||
|
|
f71dd1ed54 | ||
|
|
19828d3b06 | ||
|
|
d242e729f0 | ||
|
|
8cd0d5faa5 | ||
|
|
a741d892a9 | ||
|
|
9add3361e0 | ||
|
|
4aac70ab5f | ||
|
|
980aec714a | ||
|
|
af8ee5af0f | ||
|
|
32d9aa0cf2 | ||
|
|
7e49631912 | ||
|
|
43970d34aa | ||
|
|
abb3c40697 | ||
|
|
2757a41102 | ||
|
|
1f8bddaa5e | ||
|
|
4c3b7ca60f | ||
|
|
d9d83e5767 | ||
|
|
b4ebde47be | ||
|
|
ef9f76190d | ||
|
|
71b96efca0 | ||
|
|
7158e09b0e | ||
|
|
8ef125bed2 | ||
|
|
0b11fb2fd5 | ||
|
|
3871f3cf3d | ||
|
|
7c5d1ec0f6 | ||
|
|
b507b08e34 | ||
|
|
1b06090f72 | ||
|
|
5460c20ac3 | ||
|
|
2ccec607a0 | ||
|
|
8a99fcf188 | ||
|
|
1e2489ca76 | ||
|
|
89793d2d62 | ||
|
|
11a1af89f4 | ||
|
|
e24ddb804d | ||
|
|
3524d365be | ||
|
|
2b3b9d037c | ||
|
|
5140cd9d7f | ||
|
|
2df9437b39 | ||
|
|
db440b8a14 | ||
|
|
c3dd70bc99 | ||
|
|
223e783bbc | ||
|
|
ca086dbf16 | ||
|
|
523422cf6c | ||
|
|
2dc310dcbc | ||
|
|
c092cd2921 | ||
|
|
2b14ef76c9 | ||
|
|
fbbf10078f | ||
|
|
2315d423c4 | ||
|
|
9a43465ebf | ||
|
|
fc1444763d | ||
|
|
804bf879ed | ||
|
|
ad44f09421 | ||
|
|
df2469468b | ||
|
|
f8f4fe11eb | ||
|
|
039a370add | ||
|
|
6feebc086d | ||
|
|
bc335c7d72 | ||
|
|
a6dd7254b2 | ||
|
|
7b1026c624 | ||
|
|
4758393cc1 | ||
|
|
52373a3a7d | ||
|
|
c30f9a2841 | ||
|
|
44d6f8f15c | ||
|
|
5ada12f989 | ||
|
|
d213045168 | ||
|
|
d83478239e | ||
|
|
3869955357 | ||
|
|
345d37edf8 | ||
|
|
2788ef28cf | ||
|
|
0d5c1bb3df | ||
|
|
c3d505cdad | ||
|
|
90854e1dd4 | ||
|
|
f96e3b04be | ||
|
|
44449e26a0 | ||
|
|
ddc88fd360 | ||
|
|
fedec450cb | ||
|
|
04ea742830 | ||
|
|
5a5c860cef | ||
|
|
55d06a43f8 | ||
|
|
71eecd6e7b | ||
|
|
6f3019f84b | ||
|
|
e95d3126b2 | ||
|
|
5da265bf0b | ||
|
|
2ce9c43b8c | ||
|
|
740b2f206c | ||
|
|
af622bc7e7 | ||
|
|
7816b50b27 | ||
|
|
4cb7a909f7 | ||
|
|
0fac88e171 | ||
|
|
b4ab9d9650 | ||
|
|
731db13c14 | ||
|
|
414a1ad4d2 | ||
|
|
16055fe96e | ||
|
|
6140c398f0 | ||
|
|
bd02923616 | ||
|
|
6021815fd3 | ||
|
|
8c4aba5479 | ||
|
|
2428b22171 | ||
|
|
a3d30211f6 | ||
|
|
730300d211 | ||
|
|
aaca31276b | ||
|
|
53fb927e36 | ||
|
|
fb5aa0313e | ||
|
|
9b41eecbf1 | ||
|
|
ae461b1caf | ||
|
|
57e36d6710 | ||
|
|
a7c4f09c5b | ||
|
|
554ef16e49 | ||
|
|
082321f860 | ||
|
|
df4f7b8c9e | ||
|
|
3f1742f074 | ||
|
|
4560d5c2d5 | ||
|
|
0ca12d275c | ||
|
|
df9e834309 | ||
|
|
ab1c0bb129 | ||
|
|
5070e4c950 | ||
|
|
c13526ccad | ||
|
|
46e16a6c69 | ||
|
|
53983933dc | ||
|
|
09f3ca39a1 | ||
|
|
42b4c91f35 | ||
|
|
37120776be | ||
|
|
d67bcb66c9 | ||
|
|
acf6e72f35 | ||
|
|
0964b271f5 | ||
|
|
1f7998fc44 | ||
|
|
7ac59f7bd0 | ||
|
|
bf238640af | ||
|
|
6e638cadb7 | ||
|
|
ab0759f441 | ||
|
|
123ec5c78a | ||
|
|
d262c67832 | ||
|
|
fcb9a2838d | ||
|
|
82d1672741 | ||
|
|
657a8b6094 | ||
|
|
165f7e0720 | ||
|
|
91aba84c29 | ||
|
|
02c4ac1bc7 | ||
|
|
c529959027 | ||
|
|
e875d1a5d7 | ||
|
|
d280505b9f | ||
|
|
fdd9d0000b | ||
|
|
74c793eedf | ||
|
|
bd8976c620 | ||
|
|
a3e2563f9b | ||
|
|
a310e3d8fa | ||
|
|
ae9da35af1 | ||
|
|
b45837ff5c | ||
|
|
3dd9ab8a29 | ||
|
|
5ebd2f6b8e | ||
|
|
977043ac92 | ||
|
|
4c6182b79c | ||
|
|
01125e092c | ||
|
|
99ef447a52 | ||
|
|
4722ff9b97 | ||
|
|
23a19df79a | ||
|
|
97b86c6faa | ||
|
|
e6296f20b9 | ||
|
|
0ee9dcc255 | ||
|
|
c7b4e2c49d | ||
|
|
066d1847e4 | ||
|
|
3155bf24c1 | ||
|
|
92bb5b90aa | ||
|
|
a207ed74ff | ||
|
|
9d224113c4 | ||
|
|
934f4b2210 | ||
|
|
a6a41d4de1 | ||
|
|
185ee20f2d | ||
|
|
778b960130 | ||
|
|
184938d10a | ||
|
|
25565af5f9 | ||
|
|
0bd9a4f860 | ||
|
|
fe64dd1dea | ||
|
|
a4a59fd586 | ||
|
|
7ccd2d9418 | ||
|
|
974dd70a06 | ||
|
|
1690e4f63b | ||
|
|
ec75ef468b | ||
|
|
a57c1e6451 | ||
|
|
bdc79a13a9 | ||
|
|
b893694977 | ||
|
|
9be7d44765 | ||
|
|
3f8d8ca379 | ||
|
|
e50c3cceeb | ||
|
|
14e648911d | ||
|
|
3c42a618d4 | ||
|
|
bed2259944 |
8
.editorconfig
Normal file
8
.editorconfig
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[*.sh]
|
||||||
|
# like -i=4
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
[*.nix]
|
||||||
|
# like -i=4
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
15
.github/FUNDING.yml
vendored
Normal file
15
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: [avengemedia]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: # Replace with a single Open Collective username
|
||||||
|
ko_fi: danklinux
|
||||||
|
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: # Replace with a single Buy Me a Coffee username
|
||||||
|
thanks_dev: # Replace with a single thanks.dev username
|
||||||
|
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
55
.github/ISSUE_TEMPLATE/bug_report.md
vendored
55
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,55 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug Report
|
|
||||||
about: Crashes or unexpected behaviors
|
|
||||||
title: ""
|
|
||||||
labels: "bug"
|
|
||||||
assignees: ""
|
|
||||||
---
|
|
||||||
|
|
||||||
<!-- If your issue is related to ICONS
|
|
||||||
- Purple and black checkerboards are QT's way of signalling an icon doesn't exist
|
|
||||||
- FIX: Configure a QT6 or Icon Pack in DMS Settings that has the icon you want
|
|
||||||
- Follow the [THEMING](https://github.com/AvengeMedia/DankMaterialShell/tree/master?tab=readme-ov-file#theming) section to ensure your QT environment variable is configured correctl for themes.
|
|
||||||
- Once done, configure an icon theme - either however you normally do with gtk3 or qt6ct, or through the built-in settings modal. -->
|
|
||||||
|
|
||||||
<!-- If your issue is related to APP LAUNCHER/DOCK/Running Apps being stale
|
|
||||||
Quickshell does not ever update its DesktopEntires.
|
|
||||||
There is an open PR for it, that has been stuck unmerged over there to fix it.
|
|
||||||
We unfortunately are at the mercy of quickshell to merge it.
|
|
||||||
Until then, newly installed and removed apps will not react until the
|
|
||||||
shell is restarted.
|
|
||||||
-->
|
|
||||||
|
|
||||||
## Compositor
|
|
||||||
|
|
||||||
- [ ] niri
|
|
||||||
- [ ] Hyprland
|
|
||||||
- [ ] Other (specify)
|
|
||||||
|
|
||||||
## Description
|
|
||||||
|
|
||||||
<!-- Brief description of the issue -->
|
|
||||||
|
|
||||||
## Expected Behavior
|
|
||||||
|
|
||||||
<!-- Describe what you expected to happen -->
|
|
||||||
|
|
||||||
## Steps to Reproduce
|
|
||||||
|
|
||||||
<!-- Please provide detailed steps to reproduce the issue -->
|
|
||||||
|
|
||||||
1.
|
|
||||||
2.
|
|
||||||
3.
|
|
||||||
|
|
||||||
## Error Messages/Logs
|
|
||||||
|
|
||||||
<!-- Please include any error messages, stack traces, or relevant logs -->
|
|
||||||
|
|
||||||
```
|
|
||||||
Paste error messages or logs here
|
|
||||||
```
|
|
||||||
|
|
||||||
## Screenshots/Recordings
|
|
||||||
|
|
||||||
<!-- If applicable, add screenshots or screen recordings -->
|
|
||||||
96
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
96
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
name: Bug Report
|
||||||
|
description: Crashes or unexpected behaviors
|
||||||
|
labels:
|
||||||
|
- bug
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
## DankMaterialShell Bug Report
|
||||||
|
Limit your report to one issue per submission unless closely related
|
||||||
|
- type: checkboxes
|
||||||
|
id: compositor
|
||||||
|
attributes:
|
||||||
|
label: Compositor
|
||||||
|
options:
|
||||||
|
- label: Niri
|
||||||
|
- label: Hyprland
|
||||||
|
- label: MangoWC (dwl)
|
||||||
|
- label: Sway
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: checkboxes
|
||||||
|
id: distribution
|
||||||
|
attributes:
|
||||||
|
label: Distribution
|
||||||
|
options:
|
||||||
|
- label: Arch Linux
|
||||||
|
- label: CachyOS
|
||||||
|
- label: Fedora
|
||||||
|
- label: NixOS
|
||||||
|
- label: Debian
|
||||||
|
- label: Ubuntu
|
||||||
|
- label: Gentoo
|
||||||
|
- label: OpenSUSE
|
||||||
|
- label: Other (specify below)
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: input
|
||||||
|
id: distribution_other
|
||||||
|
attributes:
|
||||||
|
label: If Other, please specify
|
||||||
|
placeholder: e.g., PikaOS, Void Linux, etc.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: input
|
||||||
|
id: dms_version
|
||||||
|
attributes:
|
||||||
|
label: dms version
|
||||||
|
description: Output of dms version command
|
||||||
|
placeholder: e.g., 1.2.3
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: description
|
||||||
|
attributes:
|
||||||
|
label: Description
|
||||||
|
description: Brief description of the issue
|
||||||
|
placeholder: What happened?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: expected_behavior
|
||||||
|
attributes:
|
||||||
|
label: Expected Behavior
|
||||||
|
description: What did you expect to happen?
|
||||||
|
placeholder: Describe the expected behavior
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: steps_to_reproduce
|
||||||
|
attributes:
|
||||||
|
label: Steps to Reproduce & Installation Method
|
||||||
|
description: Please provide detailed steps to reproduce the issue
|
||||||
|
placeholder: |
|
||||||
|
1. ...
|
||||||
|
2. ...
|
||||||
|
3. ...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: logs
|
||||||
|
attributes:
|
||||||
|
label: Error Messages/Logs
|
||||||
|
description: Please include any error messages, stack traces, or relevant logs
|
||||||
|
placeholder: |
|
||||||
|
Paste error messages or logs here
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: screenshots
|
||||||
|
attributes:
|
||||||
|
label: Screenshots/Recordings
|
||||||
|
description: If applicable, add screenshots or screen recordings
|
||||||
|
placeholder: Attach images or videos here
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
31
.github/ISSUE_TEMPLATE/feature_request.md
vendored
31
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,31 +0,0 @@
|
|||||||
---
|
|
||||||
name: Request a Feature
|
|
||||||
about: New widgets, new widget behavior, etc.
|
|
||||||
title: ""
|
|
||||||
labels: "enhancement"
|
|
||||||
assignees: ""
|
|
||||||
---
|
|
||||||
|
|
||||||
## Feature Description
|
|
||||||
|
|
||||||
<!-- Brief description of the feature requested -->
|
|
||||||
|
|
||||||
## Use Case
|
|
||||||
|
|
||||||
<!-- Explain the purpose of this feature/why it'd be useful to you -->
|
|
||||||
|
|
||||||
## Compositor
|
|
||||||
|
|
||||||
Is this feature specific to one compositor?
|
|
||||||
|
|
||||||
- [ ] All compositors
|
|
||||||
- [ ] niri
|
|
||||||
- [ ] Hyprland
|
|
||||||
|
|
||||||
## Proposed Solution
|
|
||||||
|
|
||||||
<!-- If you have any ideas for how to implement this, please share! -->
|
|
||||||
|
|
||||||
## Alternatives/Existing Solutions
|
|
||||||
|
|
||||||
<!-- Include any similar/pre-existing products that solve this problem -->
|
|
||||||
55
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
55
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
name: Feature Request
|
||||||
|
description: Suggest a new feature or improvement for DMS
|
||||||
|
labels:
|
||||||
|
- enhancement
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
## DankMaterialShell Feature Request
|
||||||
|
- type: textarea
|
||||||
|
id: feature_description
|
||||||
|
attributes:
|
||||||
|
label: Feature Description
|
||||||
|
description: Brief description of the feature requested
|
||||||
|
placeholder: What feature would you like to see?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: use_case
|
||||||
|
attributes:
|
||||||
|
label: Use Case
|
||||||
|
description: Explain the purpose of this feature/why it'd be useful to you
|
||||||
|
placeholder: Why is this feature important?
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: checkboxes
|
||||||
|
id: compositor
|
||||||
|
attributes:
|
||||||
|
label: Compositor(s)
|
||||||
|
description: Is this feature specific to one or more compositors?
|
||||||
|
options:
|
||||||
|
- label: All compositors
|
||||||
|
- label: Niri
|
||||||
|
- label: Hyprland
|
||||||
|
- label: MangoWC (dwl)
|
||||||
|
- label: Sway
|
||||||
|
- label: Other (specify below)
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: proposed_solution
|
||||||
|
attributes:
|
||||||
|
label: Proposed Solution
|
||||||
|
description: If you have any ideas for how to implement this, please share!
|
||||||
|
placeholder: Suggest a solution or approach
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: alternatives
|
||||||
|
attributes:
|
||||||
|
label: Alternatives/Existing Solutions
|
||||||
|
description: Include any similar/pre-existing products that solve this problem
|
||||||
|
placeholder: List alternatives or existing solutions
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
30
.github/ISSUE_TEMPLATE/support_request.md
vendored
30
.github/ISSUE_TEMPLATE/support_request.md
vendored
@@ -1,30 +0,0 @@
|
|||||||
---
|
|
||||||
name: Request Assistance or Support
|
|
||||||
about: Help with installation, usage, or general questions.
|
|
||||||
title: ""
|
|
||||||
labels: "support"
|
|
||||||
assignees: ""
|
|
||||||
---
|
|
||||||
|
|
||||||
## Compositor
|
|
||||||
|
|
||||||
- [ ] niri
|
|
||||||
- [ ] Hyprland
|
|
||||||
- [ ] other
|
|
||||||
|
|
||||||
## Description
|
|
||||||
|
|
||||||
<!-- Brief description of the support needed -->
|
|
||||||
|
|
||||||
## Solutions Tried
|
|
||||||
|
|
||||||
<!-- Describe what you've tried so far -->
|
|
||||||
<!-- Outlining what you've tried so far helps us make improvements to the user experience and documentation to avoid recurrent issues -->
|
|
||||||
|
|
||||||
## Configuration Details
|
|
||||||
|
|
||||||
<!-- Include any configuration if relevant -->
|
|
||||||
|
|
||||||
## Screenshots/Recordings
|
|
||||||
|
|
||||||
<!-- If applicable, add screenshots or screen recordings -->
|
|
||||||
69
.github/ISSUE_TEMPLATE/support_request.yml
vendored
Normal file
69
.github/ISSUE_TEMPLATE/support_request.yml
vendored
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
name: Support Request
|
||||||
|
description: Help with installation, usage, or general questions about DankMaterialShell
|
||||||
|
labels:
|
||||||
|
- support
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
## DankMaterialShell Support Request
|
||||||
|
- type: checkboxes
|
||||||
|
id: compositor
|
||||||
|
attributes:
|
||||||
|
label: Compositor
|
||||||
|
options:
|
||||||
|
- label: Niri
|
||||||
|
- label: Hyprland
|
||||||
|
- label: MangoWC (dwl)
|
||||||
|
- label: Sway
|
||||||
|
- label: Other (specify below)
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: input
|
||||||
|
id: distribution
|
||||||
|
attributes:
|
||||||
|
label: Distribution
|
||||||
|
description: Which Linux distribution are you using? (e.g., Arch, Fedora, Debian, etc.)
|
||||||
|
placeholder: Your Linux distribution
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: input
|
||||||
|
id: dms_version
|
||||||
|
attributes:
|
||||||
|
label: dms version
|
||||||
|
description: Output of dms version command
|
||||||
|
placeholder: e.g., 1.2.3
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: description
|
||||||
|
attributes:
|
||||||
|
label: Description
|
||||||
|
description: Brief description of the support needed
|
||||||
|
placeholder: What do you need help with?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: solutions_tried
|
||||||
|
attributes:
|
||||||
|
label: Solutions Tried
|
||||||
|
description: Describe what you've tried so far (commands, documentation, etc.)
|
||||||
|
placeholder: List steps or resources you've already tried
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: configuration
|
||||||
|
attributes:
|
||||||
|
label: Configuration Details
|
||||||
|
description: Include any relevant configuration if relevant
|
||||||
|
placeholder: Add configuration or environment info
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: textarea
|
||||||
|
id: screenshots
|
||||||
|
attributes:
|
||||||
|
label: Screenshots/Recordings
|
||||||
|
description: If applicable, add screenshots or screen recordings
|
||||||
|
placeholder: Attach images or videos here
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
383
.github/workflows/backup/run-obs.yml.bak
vendored
Normal file
383
.github/workflows/backup/run-obs.yml.bak
vendored
Normal file
@@ -0,0 +1,383 @@
|
|||||||
|
name: Update OBS Packages
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
package:
|
||||||
|
description: "Package to update (dms, dms-git, or all)"
|
||||||
|
required: false
|
||||||
|
default: "all"
|
||||||
|
force_upload:
|
||||||
|
description: "Force upload without version check"
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- "false"
|
||||||
|
- "true"
|
||||||
|
rebuild_release:
|
||||||
|
description: "Release number for rebuilds (e.g., 2, 3, 4 to increment spec Release)"
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
schedule:
|
||||||
|
- cron: "0 */3 * * *" # Every 3 hours for dms-git builds
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-updates:
|
||||||
|
name: Check for updates
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
has_updates: ${{ steps.check.outputs.has_updates }}
|
||||||
|
packages: ${{ steps.check.outputs.packages }}
|
||||||
|
version: ${{ steps.check.outputs.version }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install OSC
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y osc
|
||||||
|
|
||||||
|
mkdir -p ~/.config/osc
|
||||||
|
cat > ~/.config/osc/oscrc << EOF
|
||||||
|
[general]
|
||||||
|
apiurl = https://api.opensuse.org
|
||||||
|
|
||||||
|
[https://api.opensuse.org]
|
||||||
|
user = ${{ secrets.OBS_USERNAME }}
|
||||||
|
pass = ${{ secrets.OBS_PASSWORD }}
|
||||||
|
EOF
|
||||||
|
chmod 600 ~/.config/osc/oscrc
|
||||||
|
|
||||||
|
- name: Check for updates
|
||||||
|
id: check
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" =~ ^refs/tags/ ]]; then
|
||||||
|
echo "packages=dms" >> $GITHUB_OUTPUT
|
||||||
|
VERSION="${GITHUB_REF#refs/tags/}"
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "Triggered by tag: $VERSION (always update)"
|
||||||
|
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
|
||||||
|
echo "packages=dms-git" >> $GITHUB_OUTPUT
|
||||||
|
echo "Checking if dms-git source has changed..."
|
||||||
|
|
||||||
|
# Get current commit hash (8 chars to match spec format)
|
||||||
|
CURRENT_COMMIT=$(git rev-parse --short=8 HEAD)
|
||||||
|
|
||||||
|
# Check OBS for last uploaded commit
|
||||||
|
OBS_BASE="$HOME/.cache/osc-checkouts"
|
||||||
|
mkdir -p "$OBS_BASE"
|
||||||
|
OBS_PROJECT="home:AvengeMedia:dms-git"
|
||||||
|
|
||||||
|
if [[ -d "$OBS_BASE/$OBS_PROJECT/dms-git" ]]; then
|
||||||
|
cd "$OBS_BASE/$OBS_PROJECT/dms-git"
|
||||||
|
osc up -q 2>/dev/null || true
|
||||||
|
|
||||||
|
# Extract commit hash from spec Version line & format like; 0.6.2+git2264.a679be68
|
||||||
|
if [[ -f "dms-git.spec" ]]; then
|
||||||
|
OBS_COMMIT=$(grep "^Version:" "dms-git.spec" | grep -oP '\.[a-f0-9]{8}' | tr -d '.' || echo "")
|
||||||
|
|
||||||
|
if [[ -n "$OBS_COMMIT" ]]; then
|
||||||
|
if [[ "$CURRENT_COMMIT" == "$OBS_COMMIT" ]]; then
|
||||||
|
echo "has_updates=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "📋 Commit $CURRENT_COMMIT already uploaded to OBS, skipping"
|
||||||
|
else
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "📋 New commit detected: $CURRENT_COMMIT (OBS has $OBS_COMMIT)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "📋 Could not extract OBS commit, proceeding with update"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "📋 No spec file in OBS, proceeding with update"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "${{ github.workspace }}"
|
||||||
|
else
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "📋 First upload to OBS, update needed"
|
||||||
|
fi
|
||||||
|
elif [[ "${{ github.event.inputs.force_upload }}" == "true" ]]; then
|
||||||
|
PKG="${{ github.event.inputs.package }}"
|
||||||
|
if [[ -z "$PKG" || "$PKG" == "all" ]]; then
|
||||||
|
echo "packages=all" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "🚀 Force upload: all packages"
|
||||||
|
else
|
||||||
|
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "🚀 Force upload: $PKG"
|
||||||
|
fi
|
||||||
|
elif [[ -n "${{ github.event.inputs.package }}" ]]; then
|
||||||
|
echo "packages=${{ github.event.inputs.package }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "Manual trigger: ${{ github.event.inputs.package }}"
|
||||||
|
else
|
||||||
|
echo "packages=all" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
update-obs:
|
||||||
|
name: Upload to OBS
|
||||||
|
needs: check-updates
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
if: |
|
||||||
|
github.event.inputs.force_upload == 'true' ||
|
||||||
|
github.event_name == 'workflow_dispatch' ||
|
||||||
|
needs.check-updates.outputs.has_updates == 'true'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Generate GitHub App Token
|
||||||
|
id: generate_token
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.APP_ID }}
|
||||||
|
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
token: ${{ steps.generate_token.outputs.token }}
|
||||||
|
|
||||||
|
- name: Check if last commit was automated
|
||||||
|
id: check-loop
|
||||||
|
run: |
|
||||||
|
LAST_COMMIT_MSG=$(git log -1 --pretty=%B | head -1)
|
||||||
|
if [[ "$LAST_COMMIT_MSG" == "ci: Auto-update PPA packages"* ]] || [[ "$LAST_COMMIT_MSG" == "ci: Auto-update OBS packages"* ]]; then
|
||||||
|
echo "⏭️ Last commit was automated ($LAST_COMMIT_MSG), skipping to prevent infinite loop"
|
||||||
|
echo "skip=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "✅ Last commit was not automated, proceeding"
|
||||||
|
echo "skip=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Determine packages to update
|
||||||
|
if: steps.check-loop.outputs.skip != 'true'
|
||||||
|
id: packages
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" =~ ^refs/tags/ ]]; then
|
||||||
|
echo "packages=dms" >> $GITHUB_OUTPUT
|
||||||
|
VERSION="${GITHUB_REF#refs/tags/}"
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "Triggered by tag: $VERSION"
|
||||||
|
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
|
||||||
|
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "Triggered by schedule: updating git package"
|
||||||
|
elif [[ -n "${{ github.event.inputs.package }}" ]]; then
|
||||||
|
echo "packages=${{ github.event.inputs.package }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "Manual trigger: ${{ github.event.inputs.package }}"
|
||||||
|
else
|
||||||
|
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Update dms-git spec version
|
||||||
|
if: steps.check-loop.outputs.skip != 'true' && (contains(steps.packages.outputs.packages, 'dms-git') || steps.packages.outputs.packages == 'all')
|
||||||
|
run: |
|
||||||
|
# Get commit info for dms-git versioning
|
||||||
|
COMMIT_HASH=$(git rev-parse --short=8 HEAD)
|
||||||
|
COMMIT_COUNT=$(git rev-list --count HEAD)
|
||||||
|
BASE_VERSION=$(grep -oP '^Version:\s+\K[0-9.]+' distro/opensuse/dms.spec | head -1 || echo "0.6.2")
|
||||||
|
|
||||||
|
NEW_VERSION="${BASE_VERSION}+git${COMMIT_COUNT}.${COMMIT_HASH}"
|
||||||
|
echo "📦 Updating dms-git.spec to version: $NEW_VERSION"
|
||||||
|
|
||||||
|
# Update version in spec
|
||||||
|
sed -i "s/^Version:.*/Version: $NEW_VERSION/" distro/opensuse/dms-git.spec
|
||||||
|
|
||||||
|
# Add changelog entry
|
||||||
|
DATE_STR=$(date "+%a %b %d %Y")
|
||||||
|
CHANGELOG_ENTRY="* $DATE_STR Avenge Media <AvengeMedia.US@gmail.com> - ${NEW_VERSION}-1\n- Git snapshot (commit $COMMIT_COUNT: $COMMIT_HASH)"
|
||||||
|
sed -i "/%changelog/a\\$CHANGELOG_ENTRY" distro/opensuse/dms-git.spec
|
||||||
|
|
||||||
|
- name: Update Debian dms-git changelog version
|
||||||
|
if: steps.check-loop.outputs.skip != 'true' && (contains(steps.packages.outputs.packages, 'dms-git') || steps.packages.outputs.packages == 'all')
|
||||||
|
run: |
|
||||||
|
# Get commit info for dms-git versioning
|
||||||
|
COMMIT_HASH=$(git rev-parse --short=8 HEAD)
|
||||||
|
COMMIT_COUNT=$(git rev-list --count HEAD)
|
||||||
|
BASE_VERSION=$(grep -oP '^Version:\s+\K[0-9.]+' distro/opensuse/dms.spec | head -1 || echo "0.6.2")
|
||||||
|
|
||||||
|
# Debian version format: 0.6.2+git2256.9162e314
|
||||||
|
NEW_VERSION="${BASE_VERSION}+git${COMMIT_COUNT}.${COMMIT_HASH}"
|
||||||
|
echo "📦 Updating Debian dms-git changelog to version: $NEW_VERSION"
|
||||||
|
|
||||||
|
CHANGELOG_DATE=$(date -R)
|
||||||
|
|
||||||
|
CHANGELOG_FILE="distro/debian/dms-git/debian/changelog"
|
||||||
|
|
||||||
|
# Get current version from changelog
|
||||||
|
CURRENT_VERSION=$(head -1 "$CHANGELOG_FILE" | sed 's/.*(\([^)]*\)).*/\1/')
|
||||||
|
|
||||||
|
echo "Current Debian version: $CURRENT_VERSION"
|
||||||
|
echo "New version: $NEW_VERSION"
|
||||||
|
|
||||||
|
# Only update if version changed
|
||||||
|
if [ "$CURRENT_VERSION" != "$NEW_VERSION" ]; then
|
||||||
|
# Create new changelog entry at top
|
||||||
|
TEMP_CHANGELOG=$(mktemp)
|
||||||
|
|
||||||
|
cat > "$TEMP_CHANGELOG" << EOF
|
||||||
|
dms-git ($NEW_VERSION) nightly; urgency=medium
|
||||||
|
|
||||||
|
* Git snapshot (commit $COMMIT_COUNT: $COMMIT_HASH)
|
||||||
|
|
||||||
|
-- Avenge Media <AvengeMedia.US@gmail.com> $CHANGELOG_DATE
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Prepend to existing changelog
|
||||||
|
cat "$CHANGELOG_FILE" >> "$TEMP_CHANGELOG"
|
||||||
|
mv "$TEMP_CHANGELOG" "$CHANGELOG_FILE"
|
||||||
|
|
||||||
|
echo "✓ Updated Debian changelog: $CURRENT_VERSION → $NEW_VERSION"
|
||||||
|
else
|
||||||
|
echo "✓ Debian changelog already at version $NEW_VERSION"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Update dms stable version
|
||||||
|
if: steps.check-loop.outputs.skip != 'true' && steps.packages.outputs.version != ''
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.packages.outputs.version }}"
|
||||||
|
VERSION_NO_V="${VERSION#v}"
|
||||||
|
echo "Updating packaging to version $VERSION_NO_V"
|
||||||
|
|
||||||
|
# Update openSUSE dms spec (stable only)
|
||||||
|
sed -i "s/^Version:.*/Version: $VERSION_NO_V/" distro/opensuse/dms.spec
|
||||||
|
|
||||||
|
# Update openSUSE spec changelog
|
||||||
|
DATE_STR=$(date "+%a %b %d %Y")
|
||||||
|
CHANGELOG_ENTRY="* $DATE_STR AvengeMedia <maintainer@avengemedia.com> - ${VERSION_NO_V}-1\\n- Update to stable $VERSION release\\n- Bug fixes and improvements"
|
||||||
|
sed -i "/%changelog/a\\$CHANGELOG_ENTRY\\n" distro/opensuse/dms.spec
|
||||||
|
|
||||||
|
# Update Debian _service files (both tar_scm and download_url formats)
|
||||||
|
for service in distro/debian/*/_service; do
|
||||||
|
if [[ -f "$service" ]]; then
|
||||||
|
# Update tar_scm revision parameter (for dms-git)
|
||||||
|
sed -i "s|<param name=\"revision\">v[0-9.]*</param>|<param name=\"revision\">$VERSION</param>|" "$service"
|
||||||
|
|
||||||
|
# Update download_url paths (for dms stable)
|
||||||
|
sed -i "s|/v[0-9.]\+/|/$VERSION/|g" "$service"
|
||||||
|
sed -i "s|/tags/v[0-9.]\+\.tar\.gz|/tags/$VERSION.tar.gz|g" "$service"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Update Debian changelog for dms stable
|
||||||
|
if [[ -f "distro/debian/dms/debian/changelog" ]]; then
|
||||||
|
CHANGELOG_DATE=$(date -R)
|
||||||
|
TEMP_CHANGELOG=$(mktemp)
|
||||||
|
|
||||||
|
cat > "$TEMP_CHANGELOG" << EOF
|
||||||
|
dms ($VERSION_NO_V) stable; urgency=medium
|
||||||
|
|
||||||
|
* Update to $VERSION stable release
|
||||||
|
* Bug fixes and improvements
|
||||||
|
|
||||||
|
-- Avenge Media <AvengeMedia.US@gmail.com> $CHANGELOG_DATE
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat "distro/debian/dms/debian/changelog" >> "$TEMP_CHANGELOG"
|
||||||
|
mv "$TEMP_CHANGELOG" "distro/debian/dms/debian/changelog"
|
||||||
|
|
||||||
|
echo "✓ Updated Debian changelog to $VERSION_NO_V"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Install Go
|
||||||
|
if: steps.check-loop.outputs.skip != 'true'
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: "1.24"
|
||||||
|
|
||||||
|
- name: Install OSC
|
||||||
|
if: steps.check-loop.outputs.skip != 'true'
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y osc
|
||||||
|
|
||||||
|
mkdir -p ~/.config/osc
|
||||||
|
cat > ~/.config/osc/oscrc << EOF
|
||||||
|
[general]
|
||||||
|
apiurl = https://api.opensuse.org
|
||||||
|
|
||||||
|
[https://api.opensuse.org]
|
||||||
|
user = ${{ secrets.OBS_USERNAME }}
|
||||||
|
pass = ${{ secrets.OBS_PASSWORD }}
|
||||||
|
EOF
|
||||||
|
chmod 600 ~/.config/osc/oscrc
|
||||||
|
|
||||||
|
- name: Upload to OBS
|
||||||
|
if: steps.check-loop.outputs.skip != 'true'
|
||||||
|
env:
|
||||||
|
FORCE_UPLOAD: ${{ github.event.inputs.force_upload }}
|
||||||
|
REBUILD_RELEASE: ${{ github.event.inputs.rebuild_release }}
|
||||||
|
run: |
|
||||||
|
PACKAGES="${{ steps.packages.outputs.packages }}"
|
||||||
|
MESSAGE="Automated update from GitHub Actions"
|
||||||
|
|
||||||
|
if [[ -n "${{ steps.packages.outputs.version }}" ]]; then
|
||||||
|
MESSAGE="Update to ${{ steps.packages.outputs.version }}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$PACKAGES" == "all" ]]; then
|
||||||
|
bash distro/scripts/obs-upload.sh dms "$MESSAGE"
|
||||||
|
bash distro/scripts/obs-upload.sh dms-git "Automated git update"
|
||||||
|
else
|
||||||
|
bash distro/scripts/obs-upload.sh "$PACKAGES" "$MESSAGE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Get changed packages
|
||||||
|
if: steps.check-loop.outputs.skip != 'true'
|
||||||
|
id: changed-packages
|
||||||
|
run: |
|
||||||
|
# Check if there are any changes to commit
|
||||||
|
if git diff --exit-code distro/debian/ distro/opensuse/ >/dev/null 2>&1; then
|
||||||
|
echo "has_changes=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "📋 No changelog or spec changes to commit"
|
||||||
|
else
|
||||||
|
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||||
|
# Get list of changed packages for commit message
|
||||||
|
CHANGED_DEB=$(git diff --name-only distro/debian/ 2>/dev/null | grep 'debian/changelog' | xargs dirname 2>/dev/null | xargs dirname 2>/dev/null | xargs basename 2>/dev/null | tr '\n' ', ' | sed 's/, $//' || echo "")
|
||||||
|
CHANGED_SUSE=$(git diff --name-only distro/opensuse/ 2>/dev/null | grep '\.spec$' | sed 's|distro/opensuse/||' | sed 's/\.spec$//' | tr '\n' ', ' | sed 's/, $//' || echo "")
|
||||||
|
|
||||||
|
PKGS=$(echo "$CHANGED_DEB,$CHANGED_SUSE" | tr ',' '\n' | grep -v '^$' | sort -u | tr '\n' ',' | sed 's/,$//')
|
||||||
|
echo "packages=$PKGS" >> $GITHUB_OUTPUT
|
||||||
|
echo "📋 Changed packages: $PKGS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Commit packaging changes
|
||||||
|
if: steps.check-loop.outputs.skip != 'true' && steps.changed-packages.outputs.has_changes == 'true'
|
||||||
|
run: |
|
||||||
|
git config user.name "dms-ci[bot]"
|
||||||
|
git config user.email "dms-ci[bot]@users.noreply.github.com"
|
||||||
|
git add distro/debian/*/debian/changelog distro/opensuse/*.spec
|
||||||
|
git commit -m "ci: Auto-update OBS packages [${{ steps.changed-packages.outputs.packages }}]" -m "🤖 Automated by GitHub Actions"
|
||||||
|
git pull --rebase origin master
|
||||||
|
git push
|
||||||
|
|
||||||
|
- name: Summary
|
||||||
|
run: |
|
||||||
|
echo "### OBS Package Update Complete" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "- **Packages**: ${{ steps.packages.outputs.packages }}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
if [[ -n "${{ steps.packages.outputs.version }}" ]]; then
|
||||||
|
echo "- **Version**: ${{ steps.packages.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
|
if [[ "${{ needs.check-updates.outputs.has_updates }}" == "false" ]]; then
|
||||||
|
echo "- **Status**: Skipped (no changes detected)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
|
echo "- **Project**: https://build.opensuse.org/project/show/home:AvengeMedia" >> $GITHUB_STEP_SUMMARY
|
||||||
298
.github/workflows/backup/run-ppa.yml.bak
vendored
Normal file
298
.github/workflows/backup/run-ppa.yml.bak
vendored
Normal file
@@ -0,0 +1,298 @@
|
|||||||
|
name: Update PPA Packages
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
package:
|
||||||
|
description: "Package to upload (dms, dms-git, dms-greeter, or all)"
|
||||||
|
required: false
|
||||||
|
default: "dms-git"
|
||||||
|
force_upload:
|
||||||
|
description: "Force upload without version check"
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- "false"
|
||||||
|
- "true"
|
||||||
|
rebuild_release:
|
||||||
|
description: "Release number for rebuilds (e.g., 2, 3, 4 for ppa2, ppa3, ppa4)"
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
schedule:
|
||||||
|
- cron: "0 */3 * * *" # Every 3 hours for dms-git builds
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-updates:
|
||||||
|
name: Check for updates
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
has_updates: ${{ steps.check.outputs.has_updates }}
|
||||||
|
packages: ${{ steps.check.outputs.packages }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Check for updates
|
||||||
|
id: check
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.event_name }}" == "schedule" ]]; then
|
||||||
|
echo "packages=dms-git" >> $GITHUB_OUTPUT
|
||||||
|
echo "Checking if dms-git source has changed..."
|
||||||
|
|
||||||
|
# Get current commit hash (8 chars to match changelog format)
|
||||||
|
CURRENT_COMMIT=$(git rev-parse --short=8 HEAD)
|
||||||
|
|
||||||
|
# Extract commit hash from changelog
|
||||||
|
# Format: dms-git (0.6.2+git2264.c5c5ce84) questing; urgency=medium
|
||||||
|
CHANGELOG_FILE="distro/ubuntu/dms-git/debian/changelog"
|
||||||
|
|
||||||
|
if [[ -f "$CHANGELOG_FILE" ]]; then
|
||||||
|
CHANGELOG_COMMIT=$(head -1 "$CHANGELOG_FILE" | grep -oP '\.[a-f0-9]{8}' | tr -d '.' || echo "")
|
||||||
|
|
||||||
|
if [[ -n "$CHANGELOG_COMMIT" ]]; then
|
||||||
|
if [[ "$CURRENT_COMMIT" == "$CHANGELOG_COMMIT" ]]; then
|
||||||
|
echo "has_updates=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "📋 Commit $CURRENT_COMMIT already in changelog, skipping upload"
|
||||||
|
else
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "📋 New commit detected: $CURRENT_COMMIT (changelog has $CHANGELOG_COMMIT)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "📋 Could not extract commit from changelog, proceeding with upload"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "📋 No changelog file found, proceeding with upload"
|
||||||
|
fi
|
||||||
|
elif [[ -n "${{ github.event.inputs.package }}" ]]; then
|
||||||
|
echo "packages=${{ github.event.inputs.package }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "Manual trigger: ${{ github.event.inputs.package }}"
|
||||||
|
else
|
||||||
|
echo "packages=dms-git" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
upload-ppa:
|
||||||
|
name: Upload to PPA
|
||||||
|
needs: check-updates
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
if: |
|
||||||
|
github.event.inputs.force_upload == 'true' ||
|
||||||
|
github.event_name == 'workflow_dispatch' ||
|
||||||
|
needs.check-updates.outputs.has_updates == 'true'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Generate GitHub App Token
|
||||||
|
id: generate_token
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.APP_ID }}
|
||||||
|
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
token: ${{ steps.generate_token.outputs.token }}
|
||||||
|
|
||||||
|
- name: Check if last commit was automated
|
||||||
|
id: check-loop
|
||||||
|
run: |
|
||||||
|
LAST_COMMIT_MSG=$(git log -1 --pretty=%B | head -1)
|
||||||
|
if [[ "$LAST_COMMIT_MSG" == "ci: Auto-update PPA packages"* ]] || [[ "$LAST_COMMIT_MSG" == "ci: Auto-update OBS packages"* ]]; then
|
||||||
|
echo "⏭️ Last commit was automated ($LAST_COMMIT_MSG), skipping to prevent infinite loop"
|
||||||
|
echo "skip=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "✅ Last commit was not automated, proceeding"
|
||||||
|
echo "skip=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
if: steps.check-loop.outputs.skip != 'true'
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: "1.24"
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Install build dependencies
|
||||||
|
if: steps.check-loop.outputs.skip != 'true'
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y \
|
||||||
|
debhelper \
|
||||||
|
devscripts \
|
||||||
|
dput \
|
||||||
|
lftp \
|
||||||
|
build-essential \
|
||||||
|
fakeroot \
|
||||||
|
dpkg-dev
|
||||||
|
|
||||||
|
- name: Configure GPG
|
||||||
|
if: steps.check-loop.outputs.skip != 'true'
|
||||||
|
env:
|
||||||
|
GPG_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
run: |
|
||||||
|
echo "$GPG_KEY" | gpg --import
|
||||||
|
GPG_KEY_ID=$(gpg --list-secret-keys --keyid-format LONG | grep sec | awk '{print $2}' | cut -d'/' -f2)
|
||||||
|
echo "DEBSIGN_KEYID=$GPG_KEY_ID" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Determine packages to upload
|
||||||
|
if: steps.check-loop.outputs.skip != 'true'
|
||||||
|
id: packages
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.event.inputs.force_upload }}" == "true" ]]; then
|
||||||
|
PKG="${{ github.event.inputs.package }}"
|
||||||
|
if [[ -z "$PKG" || "$PKG" == "all" ]]; then
|
||||||
|
echo "packages=all" >> $GITHUB_OUTPUT
|
||||||
|
echo "🚀 Force upload: all packages"
|
||||||
|
else
|
||||||
|
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "🚀 Force upload: $PKG"
|
||||||
|
fi
|
||||||
|
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
|
||||||
|
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "Triggered by schedule: uploading git package"
|
||||||
|
elif [[ -n "${{ github.event.inputs.package }}" ]]; then
|
||||||
|
# Manual package selection should respect change detection
|
||||||
|
SELECTED_PKG="${{ github.event.inputs.package }}"
|
||||||
|
UPDATED_PKG="${{ needs.check-updates.outputs.packages }}"
|
||||||
|
|
||||||
|
# Check if manually selected package is in the updated list
|
||||||
|
if [[ "$UPDATED_PKG" == *"$SELECTED_PKG"* ]] || [[ "$SELECTED_PKG" == "all" ]]; then
|
||||||
|
echo "packages=$SELECTED_PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "📦 Manual selection (has updates): $SELECTED_PKG"
|
||||||
|
else
|
||||||
|
echo "packages=" >> $GITHUB_OUTPUT
|
||||||
|
echo "⚠️ Manual selection '$SELECTED_PKG' has no updates - skipping (use force_upload to override)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Upload to PPA
|
||||||
|
if: steps.check-loop.outputs.skip != 'true'
|
||||||
|
run: |
|
||||||
|
PACKAGES="${{ steps.packages.outputs.packages }}"
|
||||||
|
REBUILD_RELEASE="${{ github.event.inputs.rebuild_release }}"
|
||||||
|
|
||||||
|
if [[ -z "$PACKAGES" ]]; then
|
||||||
|
echo "No packages selected for upload. Skipping."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build command arguments
|
||||||
|
BUILD_ARGS=()
|
||||||
|
if [[ -n "$REBUILD_RELEASE" ]]; then
|
||||||
|
BUILD_ARGS+=("$REBUILD_RELEASE")
|
||||||
|
echo "✓ Using rebuild release number: ppa$REBUILD_RELEASE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$PACKAGES" == "all" ]]; then
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
echo "Uploading dms to PPA..."
|
||||||
|
if [ -n "$REBUILD_RELEASE" ]; then
|
||||||
|
echo "🔄 Using rebuild release number: ppa$REBUILD_RELEASE"
|
||||||
|
fi
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
bash distro/scripts/ppa-upload.sh dms dms questing "${BUILD_ARGS[@]}"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
echo "Uploading dms-git to PPA..."
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
bash distro/scripts/ppa-upload.sh dms-git dms-git questing "${BUILD_ARGS[@]}"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
echo "Uploading dms-greeter to PPA..."
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
bash distro/scripts/ppa-upload.sh dms-greeter danklinux questing "${BUILD_ARGS[@]}"
|
||||||
|
else
|
||||||
|
# Map package to PPA name
|
||||||
|
case "$PACKAGES" in
|
||||||
|
dms)
|
||||||
|
PPA_NAME="dms"
|
||||||
|
;;
|
||||||
|
dms-git)
|
||||||
|
PPA_NAME="dms-git"
|
||||||
|
;;
|
||||||
|
dms-greeter)
|
||||||
|
PPA_NAME="danklinux"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
PPA_NAME="$PACKAGES"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
echo "Uploading $PACKAGES to PPA..."
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
bash distro/scripts/ppa-upload.sh "$PACKAGES" "$PPA_NAME" questing "${BUILD_ARGS[@]}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Get changed packages
|
||||||
|
if: steps.check-loop.outputs.skip != 'true'
|
||||||
|
id: changed-packages
|
||||||
|
run: |
|
||||||
|
# Check if there are any changelog changes to commit
|
||||||
|
if git diff --exit-code distro/ubuntu/ >/dev/null 2>&1; then
|
||||||
|
echo "has_changes=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "📋 No changelog changes to commit"
|
||||||
|
else
|
||||||
|
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||||
|
# Get list of changed packages for commit message (deduplicate)
|
||||||
|
CHANGED=$(git diff --name-only distro/ubuntu/ | grep 'debian/changelog' | sed 's|/debian/changelog||' | xargs -I{} basename {} | sort -u | tr '\n' ',' | sed 's/,$//')
|
||||||
|
echo "packages=$CHANGED" >> $GITHUB_OUTPUT
|
||||||
|
echo "📋 Changed packages: $CHANGED"
|
||||||
|
echo "📋 Debug - Changed files:"
|
||||||
|
git diff --name-only distro/ubuntu/ | grep 'debian/changelog' || echo "No changelog files found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Commit changelog changes
|
||||||
|
if: steps.check-loop.outputs.skip != 'true' && steps.changed-packages.outputs.has_changes == 'true'
|
||||||
|
run: |
|
||||||
|
git config user.name "dms-ci[bot]"
|
||||||
|
git config user.email "dms-ci[bot]@users.noreply.github.com"
|
||||||
|
git add distro/ubuntu/*/debian/changelog
|
||||||
|
git commit -m "ci: Auto-update PPA packages [${{ steps.changed-packages.outputs.packages }}]" -m "🤖 Automated by GitHub Actions"
|
||||||
|
git pull --rebase origin master
|
||||||
|
git push
|
||||||
|
|
||||||
|
- name: Summary
|
||||||
|
run: |
|
||||||
|
echo "### PPA Package Upload Complete" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "- **Packages**: ${{ steps.packages.outputs.packages }}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
if [[ "${{ needs.check-updates.outputs.has_updates }}" == "false" ]]; then
|
||||||
|
echo "- **Status**: Skipped (no changes detected)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
|
|
||||||
|
PACKAGES="${{ steps.packages.outputs.packages }}"
|
||||||
|
if [[ "$PACKAGES" == "all" ]]; then
|
||||||
|
echo "- **PPA dms**: https://launchpad.net/~avengemedia/+archive/ubuntu/dms/+packages" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "- **PPA dms-git**: https://launchpad.net/~avengemedia/+archive/ubuntu/dms-git/+packages" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "- **PPA danklinux**: https://launchpad.net/~avengemedia/+archive/ubuntu/danklinux/+packages" >> $GITHUB_STEP_SUMMARY
|
||||||
|
elif [[ "$PACKAGES" == "dms" ]]; then
|
||||||
|
echo "- **PPA**: https://launchpad.net/~avengemedia/+archive/ubuntu/dms/+packages" >> $GITHUB_STEP_SUMMARY
|
||||||
|
elif [[ "$PACKAGES" == "dms-git" ]]; then
|
||||||
|
echo "- **PPA**: https://launchpad.net/~avengemedia/+archive/ubuntu/dms-git/+packages" >> $GITHUB_STEP_SUMMARY
|
||||||
|
elif [[ "$PACKAGES" == "dms-greeter" ]]; then
|
||||||
|
echo "- **PPA**: https://launchpad.net/~avengemedia/+archive/ubuntu/danklinux/+packages" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${{ steps.packages.outputs.version }}" ]]; then
|
||||||
|
echo "- **Version**: ${{ steps.packages.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Builds will appear once Launchpad processes the uploads." >> $GITHUB_STEP_SUMMARY
|
||||||
55
.github/workflows/go-ci.yml
vendored
Normal file
55
.github/workflows/go-ci.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
name: Go CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
paths:
|
||||||
|
- "core/**"
|
||||||
|
- ".github/workflows/go-ci.yml"
|
||||||
|
pull_request:
|
||||||
|
branches: [master, main]
|
||||||
|
paths:
|
||||||
|
- "core/**"
|
||||||
|
- ".github/workflows/go-ci.yml"
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: go-ci-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint-and-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: core
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install flatpak
|
||||||
|
run: sudo apt update && sudo apt install -y flatpak
|
||||||
|
|
||||||
|
- name: Add flathub
|
||||||
|
run: sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||||
|
|
||||||
|
- name: Add a flatpak that mutagen could support
|
||||||
|
run: sudo flatpak install -y org.freedesktop.Platform/x86_64/24.08 app.zen_browser.zen
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: ./core/go.mod
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test -v ./...
|
||||||
|
|
||||||
|
- name: Build dms
|
||||||
|
run: go build -v ./cmd/dms
|
||||||
|
|
||||||
|
- name: Build dms (distropkg)
|
||||||
|
run: go build -v -tags distro_binary ./cmd/dms
|
||||||
|
|
||||||
|
- name: Build dankinstall
|
||||||
|
run: go build -v ./cmd/dankinstall
|
||||||
23
.github/workflows/nix-pr-check.yml
vendored
Normal file
23
.github/workflows/nix-pr-check.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: Check nix flake
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [master, main]
|
||||||
|
paths:
|
||||||
|
- "flake.*"
|
||||||
|
- "distro/nix/**"
|
||||||
|
jobs:
|
||||||
|
check-flake:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v31
|
||||||
|
|
||||||
|
- name: Check the flake
|
||||||
|
run: nix flake check
|
||||||
24
.github/workflows/prek.yml
vendored
Normal file
24
.github/workflows/prek.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: Pre-commit Checks
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
branches: [master, main]
|
||||||
|
jobs:
|
||||||
|
pre-commit-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install flatpak
|
||||||
|
run: sudo apt update && sudo apt install -y flatpak
|
||||||
|
|
||||||
|
- name: Add flathub
|
||||||
|
run: sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||||
|
|
||||||
|
- name: Add a flatpak that mutagen could support
|
||||||
|
run: sudo flatpak install -y org.freedesktop.Platform/x86_64/24.08 app.zen_browser.zen
|
||||||
|
|
||||||
|
- name: run pre-commit hooks
|
||||||
|
uses: j178/prek-action@v1
|
||||||
407
.github/workflows/release.yml
vendored
407
.github/workflows/release.yml
vendored
@@ -1,59 +1,400 @@
|
|||||||
name: Create Release
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
tags:
|
inputs:
|
||||||
- 'v*'
|
tag:
|
||||||
|
description: "Tag to release (e.g., v1.0.1)"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
actions: write
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: release-${{ github.ref_name }}
|
group: release-${{ inputs.tag }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create_release:
|
build-core:
|
||||||
name: 📦 Create GitHub Release
|
runs-on: ubuntu-latest
|
||||||
runs-on: ubuntu-24.04
|
strategy:
|
||||||
steps:
|
matrix:
|
||||||
- uses: actions/checkout@v4
|
arch: [amd64, arm64]
|
||||||
with:
|
|
||||||
fetch-depth: 0 # Fetch full history for changelog generation
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: core
|
||||||
|
|
||||||
|
env:
|
||||||
|
TAG: ${{ inputs.tag }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.tag }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version-file: ./core/go.mod
|
||||||
|
|
||||||
|
- name: Format check
|
||||||
|
run: |
|
||||||
|
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
|
||||||
|
echo "The following files are not formatted:"
|
||||||
|
gofmt -s -l .
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: go test -v ./...
|
||||||
|
|
||||||
|
- name: Build dankinstall (${{ matrix.arch }})
|
||||||
|
env:
|
||||||
|
GOOS: linux
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
GOARCH: ${{ matrix.arch }}
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
cd cmd/dankinstall
|
||||||
|
go build -trimpath -ldflags "-s -w -X main.Version=${TAG}" \
|
||||||
|
-o ../../dankinstall-${{ matrix.arch }}
|
||||||
|
cd ../..
|
||||||
|
gzip -9 -k dankinstall-${{ matrix.arch }}
|
||||||
|
sha256sum dankinstall-${{ matrix.arch }}.gz > dankinstall-${{ matrix.arch }}.gz.sha256
|
||||||
|
|
||||||
|
- name: Build dms (${{ matrix.arch }})
|
||||||
|
env:
|
||||||
|
GOOS: linux
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
GOARCH: ${{ matrix.arch }}
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
cd cmd/dms
|
||||||
|
go build -trimpath -ldflags "-s -w -X main.Version=${TAG}" \
|
||||||
|
-o ../../dms-${{ matrix.arch }}
|
||||||
|
cd ../..
|
||||||
|
gzip -9 -k dms-${{ matrix.arch }}
|
||||||
|
sha256sum dms-${{ matrix.arch }}.gz > dms-${{ matrix.arch }}.gz.sha256
|
||||||
|
|
||||||
|
- name: Generate shell completions
|
||||||
|
if: matrix.arch == 'amd64'
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
chmod +x dms-amd64
|
||||||
|
./dms-amd64 completion bash > completion.bash
|
||||||
|
./dms-amd64 completion fish > completion.fish
|
||||||
|
./dms-amd64 completion zsh > completion.zsh
|
||||||
|
|
||||||
|
- name: Build dms-distropkg (${{ matrix.arch }})
|
||||||
|
env:
|
||||||
|
GOOS: linux
|
||||||
|
CGO_ENABLED: 0
|
||||||
|
GOARCH: ${{ matrix.arch }}
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
cd cmd/dms
|
||||||
|
go build -trimpath -tags distro_binary -ldflags "-s -w -X main.Version=${TAG}" \
|
||||||
|
-o ../../dms-distropkg-${{ matrix.arch }}
|
||||||
|
cd ../..
|
||||||
|
gzip -9 -k dms-distropkg-${{ matrix.arch }}
|
||||||
|
sha256sum dms-distropkg-${{ matrix.arch }}.gz > dms-distropkg-${{ matrix.arch }}.gz.sha256
|
||||||
|
|
||||||
|
- name: Upload artifacts (${{ matrix.arch }})
|
||||||
|
if: matrix.arch == 'arm64'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: core-assets-${{ matrix.arch }}
|
||||||
|
path: |
|
||||||
|
core/dankinstall-${{ matrix.arch }}.gz
|
||||||
|
core/dankinstall-${{ matrix.arch }}.gz.sha256
|
||||||
|
core/dms-${{ matrix.arch }}.gz
|
||||||
|
core/dms-${{ matrix.arch }}.gz.sha256
|
||||||
|
core/dms-distropkg-${{ matrix.arch }}.gz
|
||||||
|
core/dms-distropkg-${{ matrix.arch }}.gz.sha256
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Upload artifacts with completions
|
||||||
|
if: matrix.arch == 'amd64'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: core-assets-${{ matrix.arch }}
|
||||||
|
path: |
|
||||||
|
core/dankinstall-${{ matrix.arch }}.gz
|
||||||
|
core/dankinstall-${{ matrix.arch }}.gz.sha256
|
||||||
|
core/dms-${{ matrix.arch }}.gz
|
||||||
|
core/dms-${{ matrix.arch }}.gz.sha256
|
||||||
|
core/dms-distropkg-${{ matrix.arch }}.gz
|
||||||
|
core/dms-distropkg-${{ matrix.arch }}.gz.sha256
|
||||||
|
core/completion.bash
|
||||||
|
core/completion.fish
|
||||||
|
core/completion.zsh
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
# update-versions:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# needs: build-core
|
||||||
|
# steps:
|
||||||
|
# - name: Create GitHub App token
|
||||||
|
# id: app_token
|
||||||
|
# uses: actions/create-github-app-token@v1
|
||||||
|
# with:
|
||||||
|
# app-id: ${{ secrets.APP_ID }}
|
||||||
|
# private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
# - name: Checkout
|
||||||
|
# uses: actions/checkout@v4
|
||||||
|
# with:
|
||||||
|
# token: ${{ steps.app_token.outputs.token }}
|
||||||
|
# fetch-depth: 0
|
||||||
|
|
||||||
|
# - name: Update VERSION
|
||||||
|
# env:
|
||||||
|
# GH_TOKEN: ${{ steps.app_token.outputs.token }}
|
||||||
|
# run: |
|
||||||
|
# set -euo pipefail
|
||||||
|
# git config user.name "dms-ci[bot]"
|
||||||
|
# git config user.email "dms-ci[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
|
# version="${GITHUB_REF#refs/tags/}"
|
||||||
|
# echo "Updating to version: $version"
|
||||||
|
# echo "${version}" > quickshell/VERSION
|
||||||
|
# git add quickshell/VERSION
|
||||||
|
|
||||||
|
# if ! git diff --cached --quiet; then
|
||||||
|
# git commit -m "chore: bump version to $version"
|
||||||
|
# git pull --rebase origin master
|
||||||
|
# git push https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git HEAD:master
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# git tag -f "${version}"
|
||||||
|
# git push -f https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git "${version}"
|
||||||
|
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
needs: [build-core] #, update-versions]
|
||||||
|
env:
|
||||||
|
TAG: ${{ inputs.tag }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.tag }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Fetch updated tag after version bump
|
||||||
|
run: |
|
||||||
|
git fetch origin --force tag ${TAG}
|
||||||
|
git checkout ${TAG}
|
||||||
|
|
||||||
|
- name: Download core artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
pattern: core-assets-*
|
||||||
|
merge-multiple: true
|
||||||
|
path: ./_core_assets
|
||||||
|
|
||||||
# Generate changelog
|
|
||||||
- name: Generate Changelog
|
- name: Generate Changelog
|
||||||
id: changelog
|
id: changelog
|
||||||
run: |
|
run: |
|
||||||
# Get the previous tag
|
set -e
|
||||||
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
PREVIOUS_TAG=$(git describe --tags --abbrev=0 "${TAG}^" 2>/dev/null || echo "")
|
||||||
|
|
||||||
if [ -z "$PREVIOUS_TAG" ]; then
|
if [ -z "$PREVIOUS_TAG" ]; then
|
||||||
echo "No previous tag found, using all commits"
|
CHANGELOG=$(git log --oneline --pretty=format:"%an|%s (%h)" | grep -v "^github-actions\[bot\]|" | sed 's/^[^|]*|/- /' | head -50)
|
||||||
CHANGELOG=$(git log --oneline --pretty=format:"- %s (%h)" | head -50)
|
|
||||||
else
|
else
|
||||||
echo "Generating changelog from $PREVIOUS_TAG to HEAD"
|
CHANGELOG=$(git log --oneline --pretty=format:"%an|%s (%h)" "${PREVIOUS_TAG}..${TAG}" | grep -v "^github-actions\[bot\]|" | sed 's/^[^|]*|/- /')
|
||||||
CHANGELOG=$(git log --oneline --pretty=format:"- %s (%h)" $PREVIOUS_TAG..HEAD)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the changelog with proper formatting
|
cat > RELEASE_BODY.md << 'EOF'
|
||||||
cat > CHANGELOG.md << EOF
|
## Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://install.danklinux.com | sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## Assets
|
||||||
|
|
||||||
|
### Complete Packages
|
||||||
|
- **`dms-full-amd64.tar.gz`** - Complete package for x86_64 systems (CLI binaries + QML source + shell completions + installation guide)
|
||||||
|
- **`dms-full-arm64.tar.gz`** - Complete package for ARM64 systems (CLI binaries + QML source + shell completions + installation guide)
|
||||||
|
|
||||||
|
### Individual Components
|
||||||
|
- **`dms-cli-amd64.gz`** - DMS CLI binary for x86_64 systems
|
||||||
|
- **`dms-cli-arm64.gz`** - DMS CLI binary for ARM64 systems
|
||||||
|
- **`dms-distropkg-amd64.gz`** - DMS CLI binary built with distro_package tag for AMD64 systems
|
||||||
|
- **`dms-distropkg-arm64.gz`** - DMS CLI binary built with distro_package tag for ARM64 systems
|
||||||
|
- **`dankinstall-amd64.gz`** - Installer binary for x86_64 systems
|
||||||
|
- **`dankinstall-arm64.gz`** - Installer binary for ARM64 systems
|
||||||
|
- **`dms-qml.tar.gz`** - QML source code only
|
||||||
|
|
||||||
|
### Checksums
|
||||||
|
- **`*.sha256`** - SHA256 checksums for verifying download integrity
|
||||||
|
|
||||||
|
**Installation:** Extract the `dms-full-*.tar.gz` package for your architecture and follow the `INSTALL.md` instructions inside.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat >> RELEASE_BODY.md << EOF
|
||||||
## What's Changed
|
## What's Changed
|
||||||
|
|
||||||
$CHANGELOG
|
$CHANGELOG
|
||||||
|
|
||||||
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREVIOUS_TAG}...${{ github.ref_name }}
|
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREVIOUS_TAG}...${TAG}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Set output for use in release step
|
|
||||||
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
||||||
cat CHANGELOG.md >> $GITHUB_OUTPUT
|
cat RELEASE_BODY.md >> $GITHUB_OUTPUT
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# Create GitHub Release
|
- name: Prepare release assets
|
||||||
|
run: |
|
||||||
|
set -euxo pipefail
|
||||||
|
|
||||||
|
mkdir -p _release_assets
|
||||||
|
|
||||||
|
# Copy core binaries and rename dms-*.gz to dms-cli-*.gz
|
||||||
|
for file in _core_assets/dms-*.gz*; do
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
basename=$(basename "$file")
|
||||||
|
if [[ "$basename" == dms-distropkg-* ]]; then
|
||||||
|
cp "$file" "_release_assets/$basename"
|
||||||
|
else
|
||||||
|
newname=$(echo "$basename" | sed 's/^dms-/dms-cli-/')
|
||||||
|
cp "$file" "_release_assets/$newname"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Copy dankinstall binaries
|
||||||
|
cp _core_assets/dankinstall-*.gz* _release_assets/
|
||||||
|
|
||||||
|
# Copy completions
|
||||||
|
cp _core_assets/completion.* _release_assets/ 2>/dev/null || true
|
||||||
|
|
||||||
|
# Create QML source package (exclude build artifacts and git files)
|
||||||
|
# Copy root LICENSE and CONTRIBUTING.md to quickshell/ for packaging
|
||||||
|
cp LICENSE CONTRIBUTING.md quickshell/
|
||||||
|
|
||||||
|
# Copy root assets directory to quickshell for systemd service and desktop file
|
||||||
|
cp -r assets quickshell/
|
||||||
|
|
||||||
|
# Tar the CONTENTS of quickshell/, not the directory itself
|
||||||
|
(cd quickshell && tar --exclude='.git' \
|
||||||
|
--exclude='.github' \
|
||||||
|
--exclude='*.tar.gz' \
|
||||||
|
-czf ../_release_assets/dms-qml.tar.gz .)
|
||||||
|
|
||||||
|
# Generate checksum for QML package
|
||||||
|
(cd _release_assets && sha256sum dms-qml.tar.gz > dms-qml.tar.gz.sha256)
|
||||||
|
|
||||||
|
# Create full packages for each architecture
|
||||||
|
for arch in amd64 arm64; do
|
||||||
|
mkdir -p _temp_full/dms
|
||||||
|
mkdir -p _temp_full/bin
|
||||||
|
mkdir -p _temp_full/completions
|
||||||
|
|
||||||
|
# Extract QML source
|
||||||
|
tar -xzf _release_assets/dms-qml.tar.gz -C _temp_full/dms
|
||||||
|
|
||||||
|
# Add CLI binaries
|
||||||
|
if [ -f "_core_assets/dms-${arch}.gz" ]; then
|
||||||
|
gunzip -c "_core_assets/dms-${arch}.gz" > _temp_full/bin/dms
|
||||||
|
chmod +x _temp_full/bin/dms
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "_core_assets/dms-distropkg-${arch}.gz" ]; then
|
||||||
|
gunzip -c "_core_assets/dms-distropkg-${arch}.gz" > _temp_full/bin/dms-distropkg
|
||||||
|
chmod +x _temp_full/bin/dms-distropkg
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add shell completions
|
||||||
|
for completion in _core_assets/completion.*; do
|
||||||
|
if [ -f "$completion" ]; then
|
||||||
|
cp "$completion" _temp_full/completions/
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Copy docs directory
|
||||||
|
if [ -d "docs" ]; then
|
||||||
|
cp -r docs _temp_full/
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create installation guide
|
||||||
|
cat > _temp_full/INSTALL.md << 'EOFINSTALL'
|
||||||
|
# DankMaterialShell Installation
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- Wayland compositor (niri or Hyprland recommended)
|
||||||
|
- Quickshell framework
|
||||||
|
- Qt6
|
||||||
|
|
||||||
|
## Installation Steps
|
||||||
|
|
||||||
|
1. **Install quickshell assets:**
|
||||||
|
```bash
|
||||||
|
mkdir -p ~/.config/quickshell
|
||||||
|
cp -r dms ~/.config/quickshell/
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Install the DMS CLI binaries:**
|
||||||
|
```bash
|
||||||
|
sudo install -m 755 bin/dms /usr/local/bin/dms
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Install shell completions (optional):**
|
||||||
|
```bash
|
||||||
|
# Bash
|
||||||
|
sudo install -m 644 completions/completion.bash /usr/share/bash-completion/completions/dms
|
||||||
|
|
||||||
|
# Fish
|
||||||
|
sudo install -m 644 completions/completion.fish /usr/share/fish/vendor_completions.d/dms.fish
|
||||||
|
|
||||||
|
# Zsh
|
||||||
|
sudo install -m 644 completions/completion.zsh /usr/share/zsh/site-functions/_dms
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Start the shell:**
|
||||||
|
```bash
|
||||||
|
dms run
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
- Settings are stored in `~/.config/DankMaterialShell/settings.json`
|
||||||
|
- Plugins go in `~/.config/DankMaterialShell/plugins/`
|
||||||
|
- See the documentation in the `dms/` directory for more details
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
- Run with verbose output: `DMS_LOG_LEVEL=debug dms run`
|
||||||
|
- Ensure all dependencies are installed
|
||||||
|
EOFINSTALL
|
||||||
|
|
||||||
|
# Create the full package
|
||||||
|
(cd _temp_full && tar -czf "../_release_assets/dms-full-${arch}.tar.gz" .)
|
||||||
|
|
||||||
|
# Generate checksum
|
||||||
|
(cd _release_assets && sha256sum "dms-full-${arch}.tar.gz" > "dms-full-${arch}.tar.gz.sha256")
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
rm -rf _temp_full
|
||||||
|
done
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
uses: comnoco/create-release-action@v2.0.5
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
tag_name: ${{ env.TAG }}
|
||||||
|
name: Release ${{ env.TAG }}
|
||||||
|
body: ${{ steps.changelog.outputs.changelog }}
|
||||||
|
files: _release_assets/**
|
||||||
|
draft: false
|
||||||
|
prerelease: ${{ contains(env.TAG, '-') }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
|
||||||
tag_name: ${{ github.ref_name }}
|
|
||||||
release_name: Release ${{ github.ref_name }}
|
|
||||||
body: ${{ steps.changelog.outputs.changelog }}
|
|
||||||
draft: false
|
|
||||||
prerelease: ${{ contains(github.ref_name, '-') }}
|
|
||||||
|
|||||||
210
.github/workflows/run-copr.yml
vendored
Normal file
210
.github/workflows/run-copr.yml
vendored
Normal file
@@ -0,0 +1,210 @@
|
|||||||
|
name: DMS Copr Stable Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
package:
|
||||||
|
description: 'Package to build (dms, dms-greeter, or both)'
|
||||||
|
required: false
|
||||||
|
default: 'dms'
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- dms
|
||||||
|
- dms-greeter
|
||||||
|
- both
|
||||||
|
version:
|
||||||
|
description: 'Versioning (e.g., 1.0.3, leave empty for latest release)'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
release:
|
||||||
|
description: 'Release number (e.g., 1, 2, 3 for hotfixes)'
|
||||||
|
required: false
|
||||||
|
default: '1'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
determine-packages:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
packages: ${{ steps.set-packages.outputs.packages }}
|
||||||
|
steps:
|
||||||
|
- name: Set package list
|
||||||
|
id: set-packages
|
||||||
|
run: |
|
||||||
|
PACKAGE_INPUT="${{ github.event.inputs.package || 'dms' }}"
|
||||||
|
if [ "$PACKAGE_INPUT" = "both" ]; then
|
||||||
|
echo 'packages=["dms","dms-greeter"]' >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "packages=[\"$PACKAGE_INPUT\"]" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
build-and-upload:
|
||||||
|
needs: determine-packages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
package: ${{ fromJSON(needs.determine-packages.outputs.packages) }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Determine version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
# Get version from manual input or latest release
|
||||||
|
if [ -n "${{ github.event.inputs.version }}" ]; then
|
||||||
|
VERSION="${{ github.event.inputs.version }}"
|
||||||
|
echo "Using manual version: $VERSION"
|
||||||
|
else
|
||||||
|
VERSION=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name' | sed 's/^v//')
|
||||||
|
echo "Using latest release version: $VERSION"
|
||||||
|
fi
|
||||||
|
|
||||||
|
RELEASE="${{ github.event.inputs.release }}"
|
||||||
|
if [ -z "$RELEASE" ]; then
|
||||||
|
RELEASE="1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "release=$RELEASE" >> $GITHUB_OUTPUT
|
||||||
|
echo "✅ Building ${{ matrix.package }} version: $VERSION-$RELEASE"
|
||||||
|
|
||||||
|
- name: Setup build environment
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y rpm wget curl jq gzip
|
||||||
|
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
|
||||||
|
echo "✅ RPM build environment ready"
|
||||||
|
|
||||||
|
- name: Download release assets
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.version.outputs.version }}"
|
||||||
|
cd ~/rpmbuild/SOURCES
|
||||||
|
|
||||||
|
echo "📦 Downloading DMS QML source for v${VERSION}..."
|
||||||
|
|
||||||
|
# Download DMS QML source
|
||||||
|
wget "https://github.com/AvengeMedia/DankMaterialShell/releases/download/v${VERSION}/dms-qml.tar.gz" || {
|
||||||
|
echo "❌ Failed to download dms-qml.tar.gz for v${VERSION}"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "✅ Source downloaded"
|
||||||
|
echo "Note: dms-cli binary will be downloaded during build based on target architecture"
|
||||||
|
ls -lh
|
||||||
|
|
||||||
|
- name: Generate stable spec file
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.version.outputs.version }}"
|
||||||
|
RELEASE="${{ steps.version.outputs.release }}"
|
||||||
|
CHANGELOG_DATE="$(date '+%a %b %d %Y')"
|
||||||
|
PACKAGE="${{ matrix.package }}"
|
||||||
|
|
||||||
|
# Copy spec file from repository
|
||||||
|
cp distro/fedora/${PACKAGE}.spec ~/rpmbuild/SPECS/${PACKAGE}.spec
|
||||||
|
|
||||||
|
# Replace placeholders with actual values
|
||||||
|
sed -i "s/VERSION_PLACEHOLDER/${VERSION}/g" ~/rpmbuild/SPECS/${PACKAGE}.spec
|
||||||
|
sed -i "s/RELEASE_PLACEHOLDER/${RELEASE}/g" ~/rpmbuild/SPECS/${PACKAGE}.spec
|
||||||
|
sed -i "s/CHANGELOG_DATE_PLACEHOLDER/${CHANGELOG_DATE}/g" ~/rpmbuild/SPECS/${PACKAGE}.spec
|
||||||
|
|
||||||
|
echo "✅ Spec file generated for ${PACKAGE} v${VERSION}-${RELEASE}"
|
||||||
|
echo ""
|
||||||
|
echo "=== Spec file preview ==="
|
||||||
|
head -40 ~/rpmbuild/SPECS/${PACKAGE}.spec
|
||||||
|
|
||||||
|
- name: Build SRPM
|
||||||
|
id: build
|
||||||
|
run: |
|
||||||
|
cd ~/rpmbuild/SPECS
|
||||||
|
PACKAGE="${{ matrix.package }}"
|
||||||
|
|
||||||
|
echo "🔨 Building SRPM for ${PACKAGE}..."
|
||||||
|
rpmbuild -bs ${PACKAGE}.spec
|
||||||
|
|
||||||
|
SRPM=$(ls ~/rpmbuild/SRPMS/${PACKAGE}-*.src.rpm | tail -n 1)
|
||||||
|
SRPM_NAME=$(basename "$SRPM")
|
||||||
|
|
||||||
|
echo "srpm_path=$SRPM" >> $GITHUB_OUTPUT
|
||||||
|
echo "srpm_name=$SRPM_NAME" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
echo "✅ SRPM built: $SRPM_NAME"
|
||||||
|
echo ""
|
||||||
|
echo "=== SRPM Info ==="
|
||||||
|
rpm -qpi "$SRPM"
|
||||||
|
|
||||||
|
- name: Upload SRPM artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.package }}-stable-srpm-${{ steps.version.outputs.version }}
|
||||||
|
path: ${{ steps.build.outputs.srpm_path }}
|
||||||
|
retention-days: 90
|
||||||
|
|
||||||
|
- name: Install Copr CLI
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y python3-pip
|
||||||
|
pip3 install copr-cli
|
||||||
|
|
||||||
|
mkdir -p ~/.config
|
||||||
|
cat > ~/.config/copr << EOF
|
||||||
|
[copr-cli]
|
||||||
|
login = ${{ secrets.COPR_LOGIN }}
|
||||||
|
username = avengemedia
|
||||||
|
token = ${{ secrets.COPR_TOKEN }}
|
||||||
|
copr_url = https://copr.fedorainfracloud.org
|
||||||
|
EOF
|
||||||
|
chmod 600 ~/.config/copr
|
||||||
|
|
||||||
|
echo "✅ Copr CLI configured"
|
||||||
|
|
||||||
|
- name: Determine Copr project
|
||||||
|
id: copr_project
|
||||||
|
run: |
|
||||||
|
PACKAGE="${{ matrix.package }}"
|
||||||
|
if [ "$PACKAGE" = "dms" ]; then
|
||||||
|
COPR_PROJECT="avengemedia/dms"
|
||||||
|
elif [ "$PACKAGE" = "dms-greeter" ]; then
|
||||||
|
COPR_PROJECT="avengemedia/danklinux"
|
||||||
|
else
|
||||||
|
echo "❌ Unknown package: $PACKAGE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "copr_project=$COPR_PROJECT" >> $GITHUB_OUTPUT
|
||||||
|
echo "✅ Copr project: $COPR_PROJECT"
|
||||||
|
|
||||||
|
- name: Upload to Copr
|
||||||
|
run: |
|
||||||
|
SRPM="${{ steps.build.outputs.srpm_path }}"
|
||||||
|
VERSION="${{ steps.version.outputs.version }}"
|
||||||
|
COPR_PROJECT="${{ steps.copr_project.outputs.copr_project }}"
|
||||||
|
PACKAGE="${{ matrix.package }}"
|
||||||
|
|
||||||
|
echo "🚀 Uploading ${PACKAGE} SRPM to ${COPR_PROJECT}..."
|
||||||
|
echo " SRPM: $(basename $SRPM)"
|
||||||
|
echo " Version: $VERSION"
|
||||||
|
|
||||||
|
BUILD_OUTPUT=$(copr-cli build "$COPR_PROJECT" "$SRPM" --nowait 2>&1)
|
||||||
|
echo "$BUILD_OUTPUT"
|
||||||
|
|
||||||
|
BUILD_ID=$(echo "$BUILD_OUTPUT" | grep -oP 'Build was added to.*\K[0-9]+' || echo "unknown")
|
||||||
|
|
||||||
|
if [ "$BUILD_ID" != "unknown" ]; then
|
||||||
|
echo "✅ Build submitted successfully!"
|
||||||
|
echo "🔗 https://copr.fedorainfracloud.org/coprs/${COPR_PROJECT}/build/$BUILD_ID/"
|
||||||
|
else
|
||||||
|
echo "⚠️ Could not extract build ID, but upload may have succeeded"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build summary
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
PACKAGE="${{ matrix.package }}"
|
||||||
|
COPR_PROJECT="${{ steps.copr_project.outputs.copr_project }}"
|
||||||
|
echo "### 🎉 ${PACKAGE} Stable Build Summary" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "- **Package:** ${PACKAGE}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "- **Version:** ${{ steps.version.outputs.version }}-${{ steps.version.outputs.release }}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "- **SRPM:** ${{ steps.build.outputs.srpm_name }}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "- **Project:** https://copr.fedorainfracloud.org/coprs/${COPR_PROJECT}/" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Stable release has been built and uploaded to Copr!" >> $GITHUB_STEP_SUMMARY
|
||||||
432
.github/workflows/run-obs.yml
vendored
Normal file
432
.github/workflows/run-obs.yml
vendored
Normal file
@@ -0,0 +1,432 @@
|
|||||||
|
name: Update OBS Packages
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
package:
|
||||||
|
description: "Package to update"
|
||||||
|
required: true
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- dms
|
||||||
|
- dms-git
|
||||||
|
- all
|
||||||
|
default: "dms"
|
||||||
|
rebuild_release:
|
||||||
|
description: "Release number for rebuilds (e.g., 2, 3, 4 to increment spec Release)"
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
schedule:
|
||||||
|
- cron: "0 */3 * * *" # Every 3 hours for dms-git builds
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-updates:
|
||||||
|
name: Check for updates
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
has_updates: ${{ steps.check.outputs.has_updates }}
|
||||||
|
packages: ${{ steps.check.outputs.packages }}
|
||||||
|
version: ${{ steps.check.outputs.version }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Check for updates
|
||||||
|
id: check
|
||||||
|
env:
|
||||||
|
OBS_USERNAME: ${{ secrets.OBS_USERNAME }}
|
||||||
|
OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }}
|
||||||
|
run: |
|
||||||
|
# Helper function to check dms-git commit
|
||||||
|
check_dms_git() {
|
||||||
|
local CURRENT_COMMIT=$(git rev-parse --short=8 HEAD)
|
||||||
|
local OBS_SPEC=$(curl -s -u "$OBS_USERNAME:$OBS_PASSWORD" "https://api.opensuse.org/source/home:AvengeMedia:dms-git/dms-git/dms-git.spec" 2>/dev/null || echo "")
|
||||||
|
local OBS_COMMIT=$(echo "$OBS_SPEC" | grep "^Version:" | grep -oP '\.[a-f0-9]{8}' | tr -d '.' || echo "")
|
||||||
|
|
||||||
|
if [[ -n "$OBS_COMMIT" && "$CURRENT_COMMIT" == "$OBS_COMMIT" ]]; then
|
||||||
|
echo "📋 dms-git: Commit $CURRENT_COMMIT already exists, skipping"
|
||||||
|
return 1 # No update needed
|
||||||
|
else
|
||||||
|
echo "📋 dms-git: New commit $CURRENT_COMMIT (OBS has ${OBS_COMMIT:-none})"
|
||||||
|
return 0 # Update needed
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Helper function to check dms stable tag
|
||||||
|
# Sets LATEST_TAG variable in parent scope if update needed
|
||||||
|
check_dms_stable() {
|
||||||
|
LATEST_TAG=$(curl -s https://api.github.com/repos/AvengeMedia/DankMaterialShell/releases/latest | grep '"tag_name"' | sed 's/.*"tag_name": "\([^"]*\)".*/\1/' || echo "")
|
||||||
|
local OBS_SPEC=$(curl -s -u "$OBS_USERNAME:$OBS_PASSWORD" "https://api.opensuse.org/source/home:AvengeMedia:dms/dms/dms.spec" 2>/dev/null || echo "")
|
||||||
|
local OBS_VERSION=$(echo "$OBS_SPEC" | grep "^Version:" | awk '{print $2}' | xargs || echo "")
|
||||||
|
|
||||||
|
if [[ -n "$LATEST_TAG" && "$LATEST_TAG" == "$OBS_VERSION" ]]; then
|
||||||
|
echo "📋 dms: Tag $LATEST_TAG already exists, skipping"
|
||||||
|
return 1 # No update needed
|
||||||
|
else
|
||||||
|
echo "📋 dms: New tag ${LATEST_TAG:-unknown} (OBS has ${OBS_VERSION:-none})"
|
||||||
|
return 0 # Update needed
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Main logic
|
||||||
|
REBUILD="${{ github.event.inputs.rebuild_release }}"
|
||||||
|
|
||||||
|
if [[ "${{ github.ref }}" =~ ^refs/tags/ ]]; then
|
||||||
|
# Tag selected or pushed - always update stable package
|
||||||
|
echo "packages=dms" >> $GITHUB_OUTPUT
|
||||||
|
VERSION="${GITHUB_REF#refs/tags/}"
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "Triggered by tag: $VERSION (always update)"
|
||||||
|
|
||||||
|
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
|
||||||
|
# Scheduled run - check dms-git only
|
||||||
|
echo "packages=dms-git" >> $GITHUB_OUTPUT
|
||||||
|
if check_dms_git; then
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "has_updates=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [[ -n "${{ github.event.inputs.package }}" ]]; then
|
||||||
|
# Manual workflow trigger
|
||||||
|
PKG="${{ github.event.inputs.package }}"
|
||||||
|
|
||||||
|
if [[ -n "$REBUILD" ]]; then
|
||||||
|
# Rebuild requested - always proceed
|
||||||
|
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "🔄 Manual rebuild requested: $PKG (db$REBUILD)"
|
||||||
|
|
||||||
|
elif [[ "$PKG" == "all" ]]; then
|
||||||
|
# Check each package and build list of those needing updates
|
||||||
|
PACKAGES_TO_UPDATE=()
|
||||||
|
check_dms_git && PACKAGES_TO_UPDATE+=("dms-git")
|
||||||
|
if check_dms_stable; then
|
||||||
|
PACKAGES_TO_UPDATE+=("dms")
|
||||||
|
if [[ -n "$LATEST_TAG" ]]; then
|
||||||
|
echo "version=$LATEST_TAG" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${#PACKAGES_TO_UPDATE[@]} -gt 0 ]]; then
|
||||||
|
echo "packages=${PACKAGES_TO_UPDATE[*]}" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "✓ Packages to update: ${PACKAGES_TO_UPDATE[*]}"
|
||||||
|
else
|
||||||
|
echo "packages=" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "✓ All packages up to date"
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [[ "$PKG" == "dms-git" ]]; then
|
||||||
|
if check_dms_git; then
|
||||||
|
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "packages=" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [[ "$PKG" == "dms" ]]; then
|
||||||
|
if check_dms_stable; then
|
||||||
|
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
if [[ -n "$LATEST_TAG" ]]; then
|
||||||
|
echo "version=$LATEST_TAG" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "packages=" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
# Unknown package - proceed anyway
|
||||||
|
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "Manual trigger: $PKG"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Fallback - proceed
|
||||||
|
echo "packages=all" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
update-obs:
|
||||||
|
name: Upload to OBS
|
||||||
|
needs: check-updates
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: needs.check-updates.outputs.has_updates == 'true'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Determine packages to update
|
||||||
|
id: packages
|
||||||
|
run: |
|
||||||
|
# Check if GITHUB_REF points to a tag (works for both push events and workflow_dispatch with tag selected)
|
||||||
|
if [[ "${{ github.ref }}" =~ ^refs/tags/ ]]; then
|
||||||
|
# Tag selected or pushed - use the tag from GITHUB_REF
|
||||||
|
echo "packages=dms" >> $GITHUB_OUTPUT
|
||||||
|
VERSION="${GITHUB_REF#refs/tags/}"
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "Using tag from GITHUB_REF: $VERSION"
|
||||||
|
# Check if check-updates already determined a version (from auto-detection)
|
||||||
|
elif [[ -n "${{ needs.check-updates.outputs.version }}" ]]; then
|
||||||
|
# Use version from check-updates job
|
||||||
|
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "version=${{ needs.check-updates.outputs.version }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "Using version from check-updates: ${{ needs.check-updates.outputs.version }}"
|
||||||
|
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
|
||||||
|
# Scheduled run - dms-git only
|
||||||
|
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "Triggered by schedule: updating git package"
|
||||||
|
elif [[ -n "${{ github.event.inputs.package }}" ]]; then
|
||||||
|
# Manual workflow dispatch
|
||||||
|
|
||||||
|
# Determine version for dms stable
|
||||||
|
if [[ "${{ github.event.inputs.package }}" == "dms" ]]; then
|
||||||
|
# Use github.ref if tag selected, otherwise auto-detect latest
|
||||||
|
if [[ "${{ github.ref }}" =~ ^refs/tags/ ]]; then
|
||||||
|
VERSION="${GITHUB_REF#refs/tags/}"
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "Using tag from GITHUB_REF: $VERSION"
|
||||||
|
else
|
||||||
|
# Auto-detect latest release for dms
|
||||||
|
LATEST_TAG=$(curl -s https://api.github.com/repos/AvengeMedia/DankMaterialShell/releases/latest | grep '"tag_name"' | sed 's/.*"tag_name": "\([^"]*\)".*/\1/' || echo "")
|
||||||
|
if [[ -n "$LATEST_TAG" ]]; then
|
||||||
|
echo "version=$LATEST_TAG" >> $GITHUB_OUTPUT
|
||||||
|
echo "Auto-detected latest release: $LATEST_TAG"
|
||||||
|
else
|
||||||
|
echo "ERROR: Could not auto-detect latest release"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
elif [[ "${{ github.event.inputs.package }}" == "all" ]]; then
|
||||||
|
# Use github.ref if tag selected, otherwise auto-detect latest
|
||||||
|
if [[ "${{ github.ref }}" =~ ^refs/tags/ ]]; then
|
||||||
|
VERSION="${GITHUB_REF#refs/tags/}"
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "Using tag from GITHUB_REF: $VERSION"
|
||||||
|
else
|
||||||
|
# Auto-detect latest release for "all"
|
||||||
|
LATEST_TAG=$(curl -s https://api.github.com/repos/AvengeMedia/DankMaterialShell/releases/latest | grep '"tag_name"' | sed 's/.*"tag_name": "\([^"]*\)".*/\1/' || echo "")
|
||||||
|
if [[ -n "$LATEST_TAG" ]]; then
|
||||||
|
echo "version=$LATEST_TAG" >> $GITHUB_OUTPUT
|
||||||
|
echo "Auto-detected latest release: $LATEST_TAG"
|
||||||
|
else
|
||||||
|
echo "ERROR: Could not auto-detect latest release"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use filtered packages from check-updates when package="all" and no rebuild/tag specified
|
||||||
|
if [[ "${{ github.event.inputs.package }}" == "all" ]] && [[ -z "${{ github.event.inputs.rebuild_release }}" ]] && [[ ! "${{ github.ref }}" =~ ^refs/tags/ ]]; then
|
||||||
|
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "Manual trigger: all (filtered to: ${{ needs.check-updates.outputs.packages }})"
|
||||||
|
else
|
||||||
|
echo "packages=${{ github.event.inputs.package }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "Manual trigger: ${{ github.event.inputs.package }}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
||||||
|
if [[ -n "${{ needs.check-updates.outputs.version }}" ]]; then
|
||||||
|
echo "version=${{ needs.check-updates.outputs.version }}" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Update dms-git spec version
|
||||||
|
if: contains(steps.packages.outputs.packages, 'dms-git') || steps.packages.outputs.packages == 'all'
|
||||||
|
run: |
|
||||||
|
COMMIT_HASH=$(git rev-parse --short=8 HEAD)
|
||||||
|
COMMIT_COUNT=$(git rev-list --count HEAD)
|
||||||
|
BASE_VERSION=$(grep -oP '^Version:\s+\K[0-9.]+' distro/opensuse/dms.spec | head -1 || echo "1.0.2")
|
||||||
|
NEW_VERSION="${BASE_VERSION}+git${COMMIT_COUNT}.${COMMIT_HASH}"
|
||||||
|
echo "📦 Updating dms-git.spec to version: $NEW_VERSION"
|
||||||
|
|
||||||
|
sed -i "s/^Version:.*/Version: $NEW_VERSION/" distro/opensuse/dms-git.spec
|
||||||
|
|
||||||
|
# Single changelog entry (git snapshots don't need history)
|
||||||
|
DATE_STR=$(date "+%a %b %d %Y")
|
||||||
|
LOCAL_SPEC_HEAD=$(sed -n '1,/%changelog/{ /%changelog/d; p }' distro/opensuse/dms-git.spec)
|
||||||
|
{
|
||||||
|
echo "$LOCAL_SPEC_HEAD"
|
||||||
|
echo "%changelog"
|
||||||
|
echo "* $DATE_STR Avenge Media <AvengeMedia.US@gmail.com> - ${NEW_VERSION}-1"
|
||||||
|
echo "- Git snapshot (commit $COMMIT_COUNT: $COMMIT_HASH)"
|
||||||
|
} > distro/opensuse/dms-git.spec
|
||||||
|
|
||||||
|
- name: Update Debian dms-git changelog version
|
||||||
|
if: contains(steps.packages.outputs.packages, 'dms-git') || steps.packages.outputs.packages == 'all'
|
||||||
|
run: |
|
||||||
|
COMMIT_HASH=$(git rev-parse --short=8 HEAD)
|
||||||
|
COMMIT_COUNT=$(git rev-list --count HEAD)
|
||||||
|
BASE_VERSION=$(grep -oP '^Version:\s+\K[0-9.]+' distro/opensuse/dms.spec | head -1 || echo "1.0.2")
|
||||||
|
NEW_VERSION="${BASE_VERSION}+git${COMMIT_COUNT}.${COMMIT_HASH}"
|
||||||
|
echo "📦 Updating Debian dms-git changelog to version: $NEW_VERSION"
|
||||||
|
|
||||||
|
# Single changelog entry (git snapshots don't need history)
|
||||||
|
CHANGELOG_DATE=$(date -R)
|
||||||
|
{
|
||||||
|
echo "dms-git (${NEW_VERSION}db1) nightly; urgency=medium"
|
||||||
|
echo ""
|
||||||
|
echo " * Git snapshot (commit $COMMIT_COUNT: $COMMIT_HASH)"
|
||||||
|
echo ""
|
||||||
|
echo " -- Avenge Media <AvengeMedia.US@gmail.com> $CHANGELOG_DATE"
|
||||||
|
} > "distro/debian/dms-git/debian/changelog"
|
||||||
|
|
||||||
|
- name: Update dms stable version
|
||||||
|
if: steps.packages.outputs.version != ''
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.packages.outputs.version }}"
|
||||||
|
VERSION_NO_V="${VERSION#v}"
|
||||||
|
echo "==> Updating packaging files to version: $VERSION_NO_V"
|
||||||
|
|
||||||
|
# Update spec file
|
||||||
|
sed -i "s/^Version:.*/Version: $VERSION_NO_V/" distro/opensuse/dms.spec
|
||||||
|
|
||||||
|
# Verify the update
|
||||||
|
UPDATED_VERSION=$(grep -oP '^Version:\s+\K[0-9.]+' distro/opensuse/dms.spec | head -1)
|
||||||
|
echo "✓ Spec file now shows Version: $UPDATED_VERSION"
|
||||||
|
|
||||||
|
# Single changelog entry (full history on OBS website)
|
||||||
|
DATE_STR=$(date "+%a %b %d %Y")
|
||||||
|
LOCAL_SPEC_HEAD=$(sed -n '1,/%changelog/{ /%changelog/d; p }' distro/opensuse/dms.spec)
|
||||||
|
{
|
||||||
|
echo "$LOCAL_SPEC_HEAD"
|
||||||
|
echo "%changelog"
|
||||||
|
echo "* $DATE_STR AvengeMedia <maintainer@avengemedia.com> - ${VERSION_NO_V}-1"
|
||||||
|
echo "- Update to stable $VERSION release"
|
||||||
|
} > distro/opensuse/dms.spec
|
||||||
|
|
||||||
|
# Update Debian _service files (both tar_scm and download_url formats)
|
||||||
|
for service in distro/debian/*/_service; do
|
||||||
|
if [[ -f "$service" ]]; then
|
||||||
|
# Update tar_scm revision parameter (for dms-git)
|
||||||
|
sed -i "s|<param name=\"revision\">v[0-9.]*</param>|<param name=\"revision\">$VERSION</param>|" "$service"
|
||||||
|
|
||||||
|
# Update download_url paths (for dms stable)
|
||||||
|
sed -i "s|/v[0-9.]\+/|/$VERSION/|g" "$service"
|
||||||
|
sed -i "s|/tags/v[0-9.]\+\.tar\.gz|/tags/$VERSION.tar.gz|g" "$service"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Update Debian changelog for dms stable (single entry, history on OBS website)
|
||||||
|
if [[ -f "distro/debian/dms/debian/changelog" ]]; then
|
||||||
|
CHANGELOG_DATE=$(date -R)
|
||||||
|
{
|
||||||
|
echo "dms (${VERSION_NO_V}db1) stable; urgency=medium"
|
||||||
|
echo ""
|
||||||
|
echo " * Update to $VERSION stable release"
|
||||||
|
echo ""
|
||||||
|
echo " -- Avenge Media <AvengeMedia.US@gmail.com> $CHANGELOG_DATE"
|
||||||
|
} > "distro/debian/dms/debian/changelog"
|
||||||
|
echo "✓ Updated Debian changelog to ${VERSION_NO_V}db1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: "1.24"
|
||||||
|
|
||||||
|
- name: Install OSC
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y osc
|
||||||
|
|
||||||
|
mkdir -p ~/.config/osc
|
||||||
|
cat > ~/.config/osc/oscrc << EOF
|
||||||
|
[general]
|
||||||
|
apiurl = https://api.opensuse.org
|
||||||
|
|
||||||
|
[https://api.opensuse.org]
|
||||||
|
user = ${{ secrets.OBS_USERNAME }}
|
||||||
|
pass = ${{ secrets.OBS_PASSWORD }}
|
||||||
|
EOF
|
||||||
|
chmod 600 ~/.config/osc/oscrc
|
||||||
|
|
||||||
|
- name: Upload to OBS
|
||||||
|
env:
|
||||||
|
REBUILD_RELEASE: ${{ github.event.inputs.rebuild_release }}
|
||||||
|
TAG_VERSION: ${{ steps.packages.outputs.version }}
|
||||||
|
run: |
|
||||||
|
PACKAGES="${{ steps.packages.outputs.packages }}"
|
||||||
|
|
||||||
|
if [[ -z "$PACKAGES" ]]; then
|
||||||
|
echo "✓ No packages need uploading. All up to date!"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
MESSAGE="Automated update from GitHub Actions"
|
||||||
|
if [[ -n "${{ steps.packages.outputs.version }}" ]]; then
|
||||||
|
MESSAGE="Update to ${{ steps.packages.outputs.version }}"
|
||||||
|
echo "==> Version being uploaded: ${{ steps.packages.outputs.version }}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# PACKAGES can be space-separated list (e.g., "dms-git dms" from "all" check)
|
||||||
|
# Loop through each package and upload
|
||||||
|
for PKG in $PACKAGES; do
|
||||||
|
echo ""
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
echo "Uploading $PKG to OBS..."
|
||||||
|
if [[ -n "$REBUILD_RELEASE" ]]; then
|
||||||
|
echo "🔄 Using rebuild release number: db$REBUILD_RELEASE"
|
||||||
|
fi
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
|
||||||
|
if [[ "$PKG" == "dms-git" ]]; then
|
||||||
|
bash distro/scripts/obs-upload.sh dms-git "Automated git update"
|
||||||
|
else
|
||||||
|
bash distro/scripts/obs-upload.sh "$PKG" "$MESSAGE"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Summary
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
echo "### OBS Package Upload Summary" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
PACKAGES="${{ steps.packages.outputs.packages }}"
|
||||||
|
|
||||||
|
if [[ -z "$PACKAGES" ]]; then
|
||||||
|
echo "**Status:** ✅ All packages up to date (no uploads needed)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "All packages are current. Run completed successfully." >> $GITHUB_STEP_SUMMARY
|
||||||
|
else
|
||||||
|
echo "**Packages Uploaded:**" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
for PKG in $PACKAGES; do
|
||||||
|
case "$PKG" in
|
||||||
|
dms)
|
||||||
|
echo "- ✅ **dms** → [View builds](https://build.opensuse.org/package/show/home:AvengeMedia:dms/dms)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
;;
|
||||||
|
dms-git)
|
||||||
|
echo "- ✅ **dms-git** → [View builds](https://build.opensuse.org/package/show/home:AvengeMedia:dms-git/dms-git)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
if [[ -n "${{ github.event.inputs.rebuild_release }}" ]]; then
|
||||||
|
echo "**Rebuild Number:** db${{ github.event.inputs.rebuild_release }}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${{ steps.packages.outputs.version }}" ]]; then
|
||||||
|
echo "**Version:** ${{ steps.packages.outputs.version }}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Monitor build progress on [OBS project page](https://build.opensuse.org/project/show/home:AvengeMedia)." >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
280
.github/workflows/run-ppa.yml
vendored
Normal file
280
.github/workflows/run-ppa.yml
vendored
Normal file
@@ -0,0 +1,280 @@
|
|||||||
|
name: Update PPA Packages
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
package:
|
||||||
|
description: "Package to upload (dms, dms-git, dms-greeter, or all)"
|
||||||
|
required: false
|
||||||
|
default: "dms-git"
|
||||||
|
rebuild_release:
|
||||||
|
description: "Release number for rebuilds (e.g., 2, 3, 4 for ppa2, ppa3, ppa4)"
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
schedule:
|
||||||
|
- cron: "0 */3 * * *" # Every 3 hours for dms-git builds
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-updates:
|
||||||
|
name: Check for updates
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
has_updates: ${{ steps.check.outputs.has_updates }}
|
||||||
|
packages: ${{ steps.check.outputs.packages }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Check for updates
|
||||||
|
id: check
|
||||||
|
run: |
|
||||||
|
# Helper function to check dms-git commit
|
||||||
|
check_dms_git() {
|
||||||
|
local CURRENT_COMMIT=$(git rev-parse --short=8 HEAD)
|
||||||
|
local PPA_VERSION=$(curl -s "https://api.launchpad.net/1.0/~avengemedia/+archive/ubuntu/dms-git?ws.op=getPublishedSources&source_name=dms-git&status=Published" | grep -oP '"source_package_version":\s*"\K[^"]+' | head -1 || echo "")
|
||||||
|
local PPA_COMMIT=$(echo "$PPA_VERSION" | grep -oP '\.[a-f0-9]{8}' | tr -d '.' || echo "")
|
||||||
|
|
||||||
|
if [[ -n "$PPA_COMMIT" && "$CURRENT_COMMIT" == "$PPA_COMMIT" ]]; then
|
||||||
|
echo "📋 dms-git: Commit $CURRENT_COMMIT already exists, skipping"
|
||||||
|
return 1 # No update needed
|
||||||
|
else
|
||||||
|
echo "📋 dms-git: New commit $CURRENT_COMMIT (PPA has ${PPA_COMMIT:-none})"
|
||||||
|
return 0 # Update needed
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Helper function to check stable package tag
|
||||||
|
check_stable_package() {
|
||||||
|
local PKG="$1"
|
||||||
|
local PPA_NAME="$2"
|
||||||
|
# Use git ls-remote to find the latest tag, sorted by version (descending)
|
||||||
|
local LATEST_TAG=$(git ls-remote --tags --refs --sort='-v:refname' https://github.com/AvengeMedia/DankMaterialShell.git | head -n1 | awk -F/ '{print $NF}' | sed 's/^v//')
|
||||||
|
local PPA_VERSION=$(curl -s "https://api.launchpad.net/1.0/~avengemedia/+archive/ubuntu/$PPA_NAME?ws.op=getPublishedSources&source_name=$PKG&status=Published" | grep -oP '"source_package_version":\s*"\K[^"]+' | head -1 || echo "")
|
||||||
|
local PPA_BASE_VERSION=$(echo "$PPA_VERSION" | sed 's/ppa[0-9]*$//')
|
||||||
|
|
||||||
|
if [[ -n "$LATEST_TAG" && "$LATEST_TAG" == "$PPA_BASE_VERSION" ]]; then
|
||||||
|
echo "📋 $PKG: Tag $LATEST_TAG already exists, skipping"
|
||||||
|
return 1 # No update needed
|
||||||
|
else
|
||||||
|
echo "📋 $PKG: New tag ${LATEST_TAG:-unknown} (PPA has ${PPA_BASE_VERSION:-none})"
|
||||||
|
return 0 # Update needed
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Main logic
|
||||||
|
REBUILD="${{ github.event.inputs.rebuild_release }}"
|
||||||
|
|
||||||
|
if [[ "${{ github.event_name }}" == "schedule" ]]; then
|
||||||
|
# Scheduled run - check dms-git only
|
||||||
|
echo "packages=dms-git" >> $GITHUB_OUTPUT
|
||||||
|
if check_dms_git; then
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "has_updates=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [[ -n "${{ github.event.inputs.package }}" ]]; then
|
||||||
|
# Manual workflow trigger
|
||||||
|
PKG="${{ github.event.inputs.package }}"
|
||||||
|
|
||||||
|
if [[ -n "$REBUILD" ]]; then
|
||||||
|
# Rebuild requested - always proceed
|
||||||
|
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "🔄 Manual rebuild requested: $PKG (ppa$REBUILD)"
|
||||||
|
|
||||||
|
elif [[ "$PKG" == "all" ]]; then
|
||||||
|
# Check each package and build list of those needing updates
|
||||||
|
PACKAGES_TO_UPDATE=()
|
||||||
|
check_dms_git && PACKAGES_TO_UPDATE+=("dms-git")
|
||||||
|
check_stable_package "dms" "dms" && PACKAGES_TO_UPDATE+=("dms")
|
||||||
|
check_stable_package "dms-greeter" "danklinux" && PACKAGES_TO_UPDATE+=("dms-greeter")
|
||||||
|
|
||||||
|
if [[ ${#PACKAGES_TO_UPDATE[@]} -gt 0 ]]; then
|
||||||
|
echo "packages=${PACKAGES_TO_UPDATE[*]}" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "✓ Packages to update: ${PACKAGES_TO_UPDATE[*]}"
|
||||||
|
else
|
||||||
|
echo "packages=" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "✓ All packages up to date"
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [[ "$PKG" == "dms-git" ]]; then
|
||||||
|
if check_dms_git; then
|
||||||
|
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "packages=" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [[ "$PKG" == "dms" ]]; then
|
||||||
|
if check_stable_package "dms" "dms"; then
|
||||||
|
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "packages=" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
elif [[ "$PKG" == "dms-greeter" ]]; then
|
||||||
|
if check_stable_package "dms-greeter" "danklinux"; then
|
||||||
|
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "packages=" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
# Unknown package - proceed anyway
|
||||||
|
echo "packages=$PKG" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "Manual trigger: $PKG"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Fallback
|
||||||
|
echo "packages=dms-git" >> $GITHUB_OUTPUT
|
||||||
|
echo "has_updates=true" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
upload-ppa:
|
||||||
|
name: Upload to PPA
|
||||||
|
needs: check-updates
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: needs.check-updates.outputs.has_updates == 'true'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: "1.24"
|
||||||
|
cache: false
|
||||||
|
|
||||||
|
- name: Install build dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y \
|
||||||
|
debhelper \
|
||||||
|
devscripts \
|
||||||
|
dput \
|
||||||
|
lftp \
|
||||||
|
build-essential \
|
||||||
|
fakeroot \
|
||||||
|
dpkg-dev
|
||||||
|
|
||||||
|
- name: Configure GPG
|
||||||
|
env:
|
||||||
|
GPG_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
run: |
|
||||||
|
echo "$GPG_KEY" | gpg --import
|
||||||
|
GPG_KEY_ID=$(gpg --list-secret-keys --keyid-format LONG | grep sec | awk '{print $2}' | cut -d'/' -f2)
|
||||||
|
echo "DEBSIGN_KEYID=$GPG_KEY_ID" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Determine packages to upload
|
||||||
|
id: packages
|
||||||
|
run: |
|
||||||
|
# Use packages determined by check-updates job
|
||||||
|
echo "packages=${{ needs.check-updates.outputs.packages }}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
if [[ "${{ github.event_name }}" == "schedule" ]]; then
|
||||||
|
echo "Triggered by schedule: uploading git package"
|
||||||
|
elif [[ -n "${{ github.event.inputs.package }}" ]]; then
|
||||||
|
echo "Manual trigger: ${{ needs.check-updates.outputs.packages }}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Upload to PPA
|
||||||
|
run: |
|
||||||
|
PACKAGES="${{ steps.packages.outputs.packages }}"
|
||||||
|
REBUILD_RELEASE="${{ github.event.inputs.rebuild_release }}"
|
||||||
|
|
||||||
|
if [[ -z "$PACKAGES" ]]; then
|
||||||
|
echo "✓ No packages need uploading. All up to date!"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Export REBUILD_RELEASE so ppa-build.sh can use it
|
||||||
|
if [[ -n "$REBUILD_RELEASE" ]]; then
|
||||||
|
export REBUILD_RELEASE
|
||||||
|
echo "✓ Using rebuild release number: ppa$REBUILD_RELEASE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# PACKAGES can be space-separated list (e.g., "dms-git dms" from "all" check)
|
||||||
|
# Loop through each package and upload
|
||||||
|
for PKG in $PACKAGES; do
|
||||||
|
# Map package to PPA name
|
||||||
|
case "$PKG" in
|
||||||
|
dms)
|
||||||
|
PPA_NAME="dms"
|
||||||
|
;;
|
||||||
|
dms-git)
|
||||||
|
PPA_NAME="dms-git"
|
||||||
|
;;
|
||||||
|
dms-greeter)
|
||||||
|
PPA_NAME="danklinux"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "⚠️ Unknown package: $PKG, skipping"
|
||||||
|
continue
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
echo "Uploading $PKG to PPA $PPA_NAME..."
|
||||||
|
if [[ -n "$REBUILD_RELEASE" ]]; then
|
||||||
|
echo "🔄 Using rebuild release number: ppa$REBUILD_RELEASE"
|
||||||
|
fi
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
bash distro/scripts/ppa-upload.sh "$PKG" "$PPA_NAME" questing ${REBUILD_RELEASE:+"$REBUILD_RELEASE"}
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Summary
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
echo "### PPA Package Upload Summary" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
PACKAGES="${{ steps.packages.outputs.packages }}"
|
||||||
|
|
||||||
|
if [[ -z "$PACKAGES" ]]; then
|
||||||
|
echo "**Status:** ✅ All packages up to date (no uploads needed)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "All packages are current. Run will complete successfully." >> $GITHUB_STEP_SUMMARY
|
||||||
|
else
|
||||||
|
echo "**Packages Uploaded:**" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
for PKG in $PACKAGES; do
|
||||||
|
case "$PKG" in
|
||||||
|
dms)
|
||||||
|
echo "- ✅ **dms** → [View builds](https://launchpad.net/~avengemedia/+archive/ubuntu/dms/+packages)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
;;
|
||||||
|
dms-git)
|
||||||
|
echo "- ✅ **dms-git** → [View builds](https://launchpad.net/~avengemedia/+archive/ubuntu/dms-git/+packages)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
;;
|
||||||
|
dms-greeter)
|
||||||
|
echo "- ✅ **dms-greeter** → [View builds](https://launchpad.net/~avengemedia/+archive/ubuntu/danklinux/+packages)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
if [[ -n "${{ github.event.inputs.rebuild_release }}" ]]; then
|
||||||
|
echo "**Rebuild Number:** ppa${{ github.event.inputs.rebuild_release }}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Builds will appear once Launchpad processes the uploads." >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
31
.github/workflows/stable.yml
vendored
Normal file
31
.github/workflows/stable.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
name: Update stable branch
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-stable:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Create GitHub App token
|
||||||
|
id: app_token
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.APP_ID }}
|
||||||
|
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
token: ${{ steps.app_token.outputs.token }}
|
||||||
|
|
||||||
|
- name: Push to stable branch
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ steps.app_token.outputs.token }}
|
||||||
|
run: git push https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git HEAD:refs/heads/stable --force
|
||||||
66
.github/workflows/update-vendor-hash.yml
vendored
Normal file
66
.github/workflows/update-vendor-hash.yml
vendored
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
name: Update Vendor Hash
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "core/go.mod"
|
||||||
|
- "core/go.sum"
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-vendor-hash:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Create GitHub App token
|
||||||
|
id: app_token
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.APP_ID }}
|
||||||
|
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
token: ${{ steps.app_token.outputs.token }}
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v31
|
||||||
|
|
||||||
|
- name: Update vendorHash in flake.nix
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
echo "Attempting nix build to get new vendorHash..."
|
||||||
|
if output=$(nix build .#dms-shell 2>&1); then
|
||||||
|
echo "Build succeeded, no hash update needed"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
new_hash=$(echo "$output" | grep -oP "got:\s+\K\S+" | head -n1)
|
||||||
|
[ -n "$new_hash" ] || { echo "Could not extract new vendorHash"; echo "$output"; exit 1; }
|
||||||
|
current_hash=$(grep -oP 'vendorHash = "\K[^"]+' flake.nix)
|
||||||
|
[ "$current_hash" = "$new_hash" ] && { echo "vendorHash already up to date"; exit 0; }
|
||||||
|
sed -i "s|vendorHash = \"$current_hash\"|vendorHash = \"$new_hash\"|" flake.nix
|
||||||
|
echo "Verifying build with new vendorHash..."
|
||||||
|
nix build .#dms-shell
|
||||||
|
echo "vendorHash updated successfully!"
|
||||||
|
|
||||||
|
- name: Commit and push vendorHash update
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ steps.app_token.outputs.token }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
if ! git diff --quiet flake.nix; then
|
||||||
|
git config user.name "dms-ci[bot]"
|
||||||
|
git config user.email "dms-ci[bot]@users.noreply.github.com"
|
||||||
|
git add flake.nix
|
||||||
|
git commit -m "nix: update vendorHash for go.mod changes" || exit 0
|
||||||
|
git pull --rebase origin master
|
||||||
|
git push https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git HEAD:master
|
||||||
|
else
|
||||||
|
echo "No changes to flake.nix"
|
||||||
|
fi
|
||||||
12
.gitignore
vendored
12
.gitignore
vendored
@@ -27,7 +27,6 @@ qrc_*.cpp
|
|||||||
ui_*.h
|
ui_*.h
|
||||||
*.qmlc
|
*.qmlc
|
||||||
*.jsc
|
*.jsc
|
||||||
Makefile*
|
|
||||||
*build-*
|
*build-*
|
||||||
*.qm
|
*.qm
|
||||||
*.prl
|
*.prl
|
||||||
@@ -97,8 +96,17 @@ go.work
|
|||||||
go.work.sum
|
go.work.sum
|
||||||
|
|
||||||
# env file
|
# env file
|
||||||
.env
|
.env*
|
||||||
|
|
||||||
# Editor/IDE
|
# Editor/IDE
|
||||||
# .idea/
|
# .idea/
|
||||||
# .vscode/
|
# .vscode/
|
||||||
|
vim/
|
||||||
|
|
||||||
|
bin/
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
.envrc
|
||||||
|
.direnv/
|
||||||
|
quickshell/dms-plugins
|
||||||
|
__pycache__
|
||||||
|
|||||||
12
.pre-commit-config.yaml
Normal file
12
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v6.0.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: check-yaml
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- repo: https://github.com/shellcheck-py/shellcheck-py
|
||||||
|
rev: v0.10.0.1
|
||||||
|
hooks:
|
||||||
|
- id: shellcheck
|
||||||
|
args: [-e, SC2164, -e, SC2001, -e, SC2012, -e, SC2317]
|
||||||
23
CHANGELOG.MD
Normal file
23
CHANGELOG.MD
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
This file is more of a quick reference so I know what to account for before next releases.
|
||||||
|
|
||||||
|
# 1.2.0
|
||||||
|
|
||||||
|
- Added clipboard and clipboard history integration
|
||||||
|
- Added swipe to dismiss notification popups and from center
|
||||||
|
- Added paste from clipboard history view - requires wtype
|
||||||
|
- Optimize surface damage of OSD & Toast
|
||||||
|
- Add monitor configurator (niri, Hyprland, MangoWC)
|
||||||
|
- **BREAKING** ghostty theme changed to ~/.config/ghostty/themes/danktheme
|
||||||
|
- requires intervention and doc update
|
||||||
|
- Added desktop widget plugins
|
||||||
|
- dev guidance available
|
||||||
|
- builtin clock & dgop widgets
|
||||||
|
- new IPC targets
|
||||||
|
- Initial RTL support/i18n
|
||||||
|
- Theme registry
|
||||||
|
- Notification persistence & history
|
||||||
|
- **BREAKING** vscode theme needs re-installed
|
||||||
|
- dms doctor cmd
|
||||||
|
- niri/hypr/mango gaps/window/border overrides
|
||||||
|
- settings search
|
||||||
|
- notification display ops on lock screen
|
||||||
@@ -1,29 +1,81 @@
|
|||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
Contributions are welcome and encourages.
|
Contributions are welcome and encouraged.
|
||||||
|
|
||||||
## Formatting
|
To contribute fork this repository, make your changes, and open a pull request.
|
||||||
|
|
||||||
The preferred tool for formatting files is [qmlfmt](https://github.com/jesperhh/qmlfmt) (also available on aur as qmlfmt-git). It actually kinda sucks, but `qmlformat` doesn't work with null safe operators and ternarys and pragma statements and a bunch of other things that are supported.
|
## Setup
|
||||||
|
|
||||||
We need some consistent style, so this at least gives the same formatter that Qt Creator uses.
|
Install [prek](https://prek.j178.dev/) then activate pre-commit hooks:
|
||||||
|
|
||||||
You can configure it to format on save in vscode by configuring the "custom local formatters" extension then adding this to settings json.
|
```bash
|
||||||
|
prek install
|
||||||
```json
|
|
||||||
"customLocalFormatters.formatters": [
|
|
||||||
{
|
|
||||||
"command": "sh -c \"qmlfmt -t 4 -i 4 -b 250 | sed 's/pragma ComponentBehavior$/pragma ComponentBehavior: Bound/g'\"",
|
|
||||||
"languages": ["qml"]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"[qml]": {
|
|
||||||
"editor.defaultFormatter": "jkillian.custom-local-formatters",
|
|
||||||
"editor.formatOnSave": true
|
|
||||||
},
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Sometimes it just breaks code though. Like turning `"_\""` into `"_""`, so you may not want to do formatOnSave.
|
### Nix Development Shell
|
||||||
|
|
||||||
|
If you have Nix installed with flakes enabled, you can use the provided development shell which includes all necessary dependencies:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix develop
|
||||||
|
```
|
||||||
|
|
||||||
|
This will provide:
|
||||||
|
|
||||||
|
- Go 1.24 toolchain (go, gopls, delve, go-tools) and GNU Make
|
||||||
|
- Quickshell and required QML packages
|
||||||
|
- Properly configured QML2_IMPORT_PATH
|
||||||
|
|
||||||
|
The dev shell automatically creates the `.qmlls.ini` file in the `quickshell/` directory.
|
||||||
|
|
||||||
|
## VSCode Setup
|
||||||
|
|
||||||
|
This is a monorepo, the easiest thing to do is to open an editor in either `quickshell`, `core`, or both depending on which part of the project you are working on.
|
||||||
|
|
||||||
|
### QML (`quickshell` directory)
|
||||||
|
|
||||||
|
1. Install the [QML Extension](https://doc.qt.io/vscodeext/)
|
||||||
|
2. Configure `ctrl+shift+p` -> user preferences (json) with qmlls path
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"qt-qml.doNotAskForQmllsDownload": true,
|
||||||
|
"qt-qml.qmlls.customExePath": "/usr/lib/qt6/bin/qmlls"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Create empty `.qmlls.ini` file in `quickshell/` directory
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd quickshell
|
||||||
|
touch .qmlls.ini
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Restart dms to generate the `.qmlls.ini` file
|
||||||
|
|
||||||
|
5. Make your changes, test, and open a pull request.
|
||||||
|
|
||||||
|
### I18n/Localization
|
||||||
|
|
||||||
|
When adding user-facing strings, ensure they are wrapped in `I18n.tr()` with context, for example.
|
||||||
|
|
||||||
|
```qml
|
||||||
|
import qs.Common
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: I18n.tr("Hello World", "<This is context for the translators, example> Hello world greeting that appears on the lock screen")
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Preferably, try to keep new terms to a minimum and re-use existing terms where possible. See `quickshell/translations/en.json` for the list of existing terms. (This isn't always possible obviously, but instead of using `Auto-connect` you would use `Autoconnect` since it's already translated)
|
||||||
|
|
||||||
|
### GO (`core` directory)
|
||||||
|
|
||||||
|
1. Install the [Go Extension](https://code.visualstudio.com/docs/languages/go)
|
||||||
|
2. Ensure code is formatted with `make fmt`
|
||||||
|
3. Add appropriate test coverage and ensure tests pass with `make test`
|
||||||
|
4. Run `go mod tidy`
|
||||||
|
5. Open pull request
|
||||||
|
|
||||||
## Pull request
|
## Pull request
|
||||||
|
|
||||||
|
|||||||
@@ -1,131 +0,0 @@
|
|||||||
pragma Singleton
|
|
||||||
pragma ComponentBehavior: Bound
|
|
||||||
|
|
||||||
import QtCore
|
|
||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
|
|
||||||
Singleton {
|
|
||||||
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property var appUsageRanking: {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
loadSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadSettings() {
|
|
||||||
parseSettings(settingsFile.text())
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseSettings(content) {
|
|
||||||
try {
|
|
||||||
if (content && content.trim()) {
|
|
||||||
var settings = JSON.parse(content)
|
|
||||||
appUsageRanking = settings.appUsageRanking || {}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveSettings() {
|
|
||||||
settingsFile.setText(JSON.stringify({
|
|
||||||
"appUsageRanking": appUsageRanking
|
|
||||||
}, null, 2))
|
|
||||||
}
|
|
||||||
|
|
||||||
function addAppUsage(app) {
|
|
||||||
if (!app)
|
|
||||||
return
|
|
||||||
|
|
||||||
var appId = app.id || (app.execString || app.exec || "")
|
|
||||||
if (!appId)
|
|
||||||
return
|
|
||||||
|
|
||||||
var currentRanking = Object.assign({}, appUsageRanking)
|
|
||||||
|
|
||||||
if (currentRanking[appId]) {
|
|
||||||
currentRanking[appId].usageCount = (currentRanking[appId].usageCount
|
|
||||||
|| 1) + 1
|
|
||||||
currentRanking[appId].lastUsed = Date.now()
|
|
||||||
currentRanking[appId].icon = app.icon || currentRanking[appId].icon
|
|
||||||
|| "application-x-executable"
|
|
||||||
currentRanking[appId].name = app.name
|
|
||||||
|| currentRanking[appId].name || ""
|
|
||||||
} else {
|
|
||||||
currentRanking[appId] = {
|
|
||||||
"name": app.name || "",
|
|
||||||
"exec": app.execString || app.exec || "",
|
|
||||||
"icon": app.icon || "application-x-executable",
|
|
||||||
"comment": app.comment || "",
|
|
||||||
"usageCount": 1,
|
|
||||||
"lastUsed": Date.now()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
appUsageRanking = currentRanking
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAppUsageRanking() {
|
|
||||||
return appUsageRanking
|
|
||||||
}
|
|
||||||
|
|
||||||
function getRankedApps() {
|
|
||||||
var apps = []
|
|
||||||
for (var appId in appUsageRanking) {
|
|
||||||
var appData = appUsageRanking[appId]
|
|
||||||
apps.push({
|
|
||||||
"id": appId,
|
|
||||||
"name": appData.name,
|
|
||||||
"exec": appData.exec,
|
|
||||||
"icon": appData.icon,
|
|
||||||
"comment": appData.comment,
|
|
||||||
"usageCount": appData.usageCount,
|
|
||||||
"lastUsed": appData.lastUsed
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return apps.sort(function (a, b) {
|
|
||||||
if (a.usageCount !== b.usageCount)
|
|
||||||
return b.usageCount - a.usageCount
|
|
||||||
return a.name.localeCompare(b.name)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function cleanupAppUsageRanking(availableAppIds) {
|
|
||||||
var currentRanking = Object.assign({}, appUsageRanking)
|
|
||||||
var hasChanges = false
|
|
||||||
|
|
||||||
for (var appId in currentRanking) {
|
|
||||||
if (availableAppIds.indexOf(appId) === -1) {
|
|
||||||
delete currentRanking[appId]
|
|
||||||
hasChanges = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasChanges) {
|
|
||||||
appUsageRanking = currentRanking
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FileView {
|
|
||||||
id: settingsFile
|
|
||||||
|
|
||||||
path: StandardPaths.writableLocation(
|
|
||||||
StandardPaths.GenericStateLocation) + "/DankMaterialShell/appusage.json"
|
|
||||||
blockLoading: true
|
|
||||||
blockWrites: true
|
|
||||||
watchChanges: true
|
|
||||||
onLoaded: {
|
|
||||||
parseSettings(settingsFile.text())
|
|
||||||
}
|
|
||||||
onLoadFailed: error => {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
pragma Singleton
|
|
||||||
|
|
||||||
import Quickshell
|
|
||||||
import QtQuick
|
|
||||||
|
|
||||||
Singleton {
|
|
||||||
id: modalManager
|
|
||||||
|
|
||||||
signal closeAllModalsExcept(var excludedModal)
|
|
||||||
|
|
||||||
function openModal(modal) {
|
|
||||||
if (!modal.allowStacking) {
|
|
||||||
closeAllModalsExcept(modal)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
pragma Singleton
|
|
||||||
|
|
||||||
import Quickshell
|
|
||||||
import QtCore
|
|
||||||
|
|
||||||
Singleton {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
readonly property url home: StandardPaths.standardLocations(
|
|
||||||
StandardPaths.HomeLocation)[0]
|
|
||||||
readonly property url pictures: StandardPaths.standardLocations(
|
|
||||||
StandardPaths.PicturesLocation)[0]
|
|
||||||
|
|
||||||
readonly property url data: `${StandardPaths.standardLocations(
|
|
||||||
StandardPaths.GenericDataLocation)[0]}/DankMaterialShell`
|
|
||||||
readonly property url state: `${StandardPaths.standardLocations(
|
|
||||||
StandardPaths.GenericStateLocation)[0]}/DankMaterialShell`
|
|
||||||
readonly property url cache: `${StandardPaths.standardLocations(
|
|
||||||
StandardPaths.GenericCacheLocation)[0]}/DankMaterialShell`
|
|
||||||
readonly property url config: `${StandardPaths.standardLocations(
|
|
||||||
StandardPaths.GenericConfigLocation)[0]}/DankMaterialShell`
|
|
||||||
|
|
||||||
readonly property url imagecache: `${cache}/imagecache`
|
|
||||||
|
|
||||||
function stringify(path: url): string {
|
|
||||||
return path.toString().replace(/%20/g, " ")
|
|
||||||
}
|
|
||||||
|
|
||||||
function expandTilde(path: string): string {
|
|
||||||
return strip(path.replace("~", stringify(root.home)))
|
|
||||||
}
|
|
||||||
|
|
||||||
function shortenHome(path: string): string {
|
|
||||||
return path.replace(strip(root.home), "~")
|
|
||||||
}
|
|
||||||
|
|
||||||
function strip(path: url): string {
|
|
||||||
return stringify(path).replace("file://", "")
|
|
||||||
}
|
|
||||||
|
|
||||||
function mkdir(path: url): void {
|
|
||||||
Quickshell.execDetached(["mkdir", "-p", strip(path)])
|
|
||||||
}
|
|
||||||
|
|
||||||
function copy(from: url, to: url): void {
|
|
||||||
Quickshell.execDetached(["cp", strip(from), strip(to)])
|
|
||||||
}
|
|
||||||
|
|
||||||
// ! Spotify and maybe some other apps report the wrong app id in toplevels, hardcode special case
|
|
||||||
function moddedAppId(appId: string): string {
|
|
||||||
if (appId === "Spotify")
|
|
||||||
return "spotify-launcher"
|
|
||||||
if (appId === "beepertexts")
|
|
||||||
return "beeper"
|
|
||||||
if (appId === "home assistant desktop")
|
|
||||||
return "homeassistant-desktop"
|
|
||||||
if (appId.includes("com.transmissionbt.transmission"))
|
|
||||||
return "transmission-gtk"
|
|
||||||
return appId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,695 +0,0 @@
|
|||||||
pragma Singleton
|
|
||||||
pragma ComponentBehavior: Bound
|
|
||||||
|
|
||||||
import QtCore
|
|
||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
|
|
||||||
Singleton {
|
|
||||||
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool isLightMode: false
|
|
||||||
property string wallpaperPath: ""
|
|
||||||
property string wallpaperLastPath: ""
|
|
||||||
property string profileLastPath: ""
|
|
||||||
property bool perMonitorWallpaper: false
|
|
||||||
property var monitorWallpapers: ({})
|
|
||||||
property bool doNotDisturb: false
|
|
||||||
property bool nightModeEnabled: false
|
|
||||||
property int nightModeTemperature: 4500
|
|
||||||
property bool nightModeAutoEnabled: false
|
|
||||||
property string nightModeAutoMode: "time"
|
|
||||||
|
|
||||||
property bool hasTriedDefaultSession: false
|
|
||||||
readonly property string _stateUrl: StandardPaths.writableLocation(StandardPaths.GenericStateLocation)
|
|
||||||
readonly property string _stateDir: Paths.strip(_stateUrl)
|
|
||||||
property int nightModeStartHour: 18
|
|
||||||
property int nightModeStartMinute: 0
|
|
||||||
property int nightModeEndHour: 6
|
|
||||||
property int nightModeEndMinute: 0
|
|
||||||
property real latitude: 0.0
|
|
||||||
property real longitude: 0.0
|
|
||||||
property string nightModeLocationProvider: ""
|
|
||||||
property var pinnedApps: []
|
|
||||||
property int selectedGpuIndex: 0
|
|
||||||
property bool nvidiaGpuTempEnabled: false
|
|
||||||
property bool nonNvidiaGpuTempEnabled: false
|
|
||||||
property var enabledGpuPciIds: []
|
|
||||||
property bool wallpaperCyclingEnabled: false
|
|
||||||
property string wallpaperCyclingMode: "interval" // "interval" or "time"
|
|
||||||
property int wallpaperCyclingInterval: 300 // seconds (5 minutes)
|
|
||||||
property string wallpaperCyclingTime: "06:00" // HH:mm format
|
|
||||||
property var monitorCyclingSettings: ({})
|
|
||||||
property string lastBrightnessDevice: ""
|
|
||||||
property string launchPrefix: ""
|
|
||||||
property string wallpaperTransition: "fade"
|
|
||||||
|
|
||||||
// Power management settings - AC Power
|
|
||||||
property int acMonitorTimeout: 0 // Never
|
|
||||||
property int acLockTimeout: 0 // Never
|
|
||||||
property int acSuspendTimeout: 0 // Never
|
|
||||||
property int acHibernateTimeout: 0 // Never
|
|
||||||
|
|
||||||
// Power management settings - Battery
|
|
||||||
property int batteryMonitorTimeout: 0 // Never
|
|
||||||
property int batteryLockTimeout: 0 // Never
|
|
||||||
property int batterySuspendTimeout: 0 // Never
|
|
||||||
property int batteryHibernateTimeout: 0 // Never
|
|
||||||
|
|
||||||
property bool lockBeforeSuspend: false
|
|
||||||
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
loadSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadSettings() {
|
|
||||||
parseSettings(settingsFile.text())
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseSettings(content) {
|
|
||||||
try {
|
|
||||||
if (content && content.trim()) {
|
|
||||||
var settings = JSON.parse(content)
|
|
||||||
isLightMode = settings.isLightMode !== undefined ? settings.isLightMode : false
|
|
||||||
wallpaperPath = settings.wallpaperPath !== undefined ? settings.wallpaperPath : ""
|
|
||||||
wallpaperLastPath = settings.wallpaperLastPath !== undefined ? settings.wallpaperLastPath : ""
|
|
||||||
profileLastPath = settings.profileLastPath !== undefined ? settings.profileLastPath : ""
|
|
||||||
perMonitorWallpaper = settings.perMonitorWallpaper !== undefined ? settings.perMonitorWallpaper : false
|
|
||||||
monitorWallpapers = settings.monitorWallpapers !== undefined ? settings.monitorWallpapers : {}
|
|
||||||
doNotDisturb = settings.doNotDisturb !== undefined ? settings.doNotDisturb : false
|
|
||||||
nightModeEnabled = settings.nightModeEnabled !== undefined ? settings.nightModeEnabled : false
|
|
||||||
nightModeTemperature = settings.nightModeTemperature !== undefined ? settings.nightModeTemperature : 4500
|
|
||||||
nightModeAutoEnabled = settings.nightModeAutoEnabled !== undefined ? settings.nightModeAutoEnabled : false
|
|
||||||
nightModeAutoMode = settings.nightModeAutoMode !== undefined ? settings.nightModeAutoMode : "time"
|
|
||||||
// Handle legacy time format
|
|
||||||
if (settings.nightModeStartTime !== undefined) {
|
|
||||||
const parts = settings.nightModeStartTime.split(":")
|
|
||||||
nightModeStartHour = parseInt(parts[0]) || 18
|
|
||||||
nightModeStartMinute = parseInt(parts[1]) || 0
|
|
||||||
} else {
|
|
||||||
nightModeStartHour = settings.nightModeStartHour !== undefined ? settings.nightModeStartHour : 18
|
|
||||||
nightModeStartMinute = settings.nightModeStartMinute !== undefined ? settings.nightModeStartMinute : 0
|
|
||||||
}
|
|
||||||
if (settings.nightModeEndTime !== undefined) {
|
|
||||||
const parts = settings.nightModeEndTime.split(":")
|
|
||||||
nightModeEndHour = parseInt(parts[0]) || 6
|
|
||||||
nightModeEndMinute = parseInt(parts[1]) || 0
|
|
||||||
} else {
|
|
||||||
nightModeEndHour = settings.nightModeEndHour !== undefined ? settings.nightModeEndHour : 6
|
|
||||||
nightModeEndMinute = settings.nightModeEndMinute !== undefined ? settings.nightModeEndMinute : 0
|
|
||||||
}
|
|
||||||
latitude = settings.latitude !== undefined ? settings.latitude : 0.0
|
|
||||||
longitude = settings.longitude !== undefined ? settings.longitude : 0.0
|
|
||||||
nightModeLocationProvider = settings.nightModeLocationProvider !== undefined ? settings.nightModeLocationProvider : ""
|
|
||||||
pinnedApps = settings.pinnedApps !== undefined ? settings.pinnedApps : []
|
|
||||||
selectedGpuIndex = settings.selectedGpuIndex !== undefined ? settings.selectedGpuIndex : 0
|
|
||||||
nvidiaGpuTempEnabled = settings.nvidiaGpuTempEnabled !== undefined ? settings.nvidiaGpuTempEnabled : false
|
|
||||||
nonNvidiaGpuTempEnabled = settings.nonNvidiaGpuTempEnabled !== undefined ? settings.nonNvidiaGpuTempEnabled : false
|
|
||||||
enabledGpuPciIds = settings.enabledGpuPciIds !== undefined ? settings.enabledGpuPciIds : []
|
|
||||||
wallpaperCyclingEnabled = settings.wallpaperCyclingEnabled !== undefined ? settings.wallpaperCyclingEnabled : false
|
|
||||||
wallpaperCyclingMode = settings.wallpaperCyclingMode !== undefined ? settings.wallpaperCyclingMode : "interval"
|
|
||||||
wallpaperCyclingInterval = settings.wallpaperCyclingInterval !== undefined ? settings.wallpaperCyclingInterval : 300
|
|
||||||
wallpaperCyclingTime = settings.wallpaperCyclingTime !== undefined ? settings.wallpaperCyclingTime : "06:00"
|
|
||||||
monitorCyclingSettings = settings.monitorCyclingSettings !== undefined ? settings.monitorCyclingSettings : {}
|
|
||||||
lastBrightnessDevice = settings.lastBrightnessDevice !== undefined ? settings.lastBrightnessDevice : ""
|
|
||||||
launchPrefix = settings.launchPrefix !== undefined ? settings.launchPrefix : ""
|
|
||||||
wallpaperTransition = settings.wallpaperTransition !== undefined ? settings.wallpaperTransition : "fade"
|
|
||||||
|
|
||||||
acMonitorTimeout = settings.acMonitorTimeout !== undefined ? settings.acMonitorTimeout : 0
|
|
||||||
acLockTimeout = settings.acLockTimeout !== undefined ? settings.acLockTimeout : 0
|
|
||||||
acSuspendTimeout = settings.acSuspendTimeout !== undefined ? settings.acSuspendTimeout : 0
|
|
||||||
acHibernateTimeout = settings.acHibernateTimeout !== undefined ? settings.acHibernateTimeout : 0
|
|
||||||
batteryMonitorTimeout = settings.batteryMonitorTimeout !== undefined ? settings.batteryMonitorTimeout : 0
|
|
||||||
batteryLockTimeout = settings.batteryLockTimeout !== undefined ? settings.batteryLockTimeout : 0
|
|
||||||
batterySuspendTimeout = settings.batterySuspendTimeout !== undefined ? settings.batterySuspendTimeout : 0
|
|
||||||
batteryHibernateTimeout = settings.batteryHibernateTimeout !== undefined ? settings.batteryHibernateTimeout : 0
|
|
||||||
lockBeforeSuspend = settings.lockBeforeSuspend !== undefined ? settings.lockBeforeSuspend : false
|
|
||||||
|
|
||||||
// Generate system themes but don't override user's theme choice
|
|
||||||
if (typeof Theme !== "undefined") {
|
|
||||||
Theme.generateSystemThemesFromCurrentTheme()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveSettings() {
|
|
||||||
settingsFile.setText(JSON.stringify({
|
|
||||||
"isLightMode": isLightMode,
|
|
||||||
"wallpaperPath": wallpaperPath,
|
|
||||||
"wallpaperLastPath": wallpaperLastPath,
|
|
||||||
"profileLastPath": profileLastPath,
|
|
||||||
"perMonitorWallpaper": perMonitorWallpaper,
|
|
||||||
"monitorWallpapers": monitorWallpapers,
|
|
||||||
"doNotDisturb": doNotDisturb,
|
|
||||||
"nightModeEnabled": nightModeEnabled,
|
|
||||||
"nightModeTemperature": nightModeTemperature,
|
|
||||||
"nightModeAutoEnabled": nightModeAutoEnabled,
|
|
||||||
"nightModeAutoMode": nightModeAutoMode,
|
|
||||||
"nightModeStartHour": nightModeStartHour,
|
|
||||||
"nightModeStartMinute": nightModeStartMinute,
|
|
||||||
"nightModeEndHour": nightModeEndHour,
|
|
||||||
"nightModeEndMinute": nightModeEndMinute,
|
|
||||||
"latitude": latitude,
|
|
||||||
"longitude": longitude,
|
|
||||||
"nightModeLocationProvider": nightModeLocationProvider,
|
|
||||||
"pinnedApps": pinnedApps,
|
|
||||||
"selectedGpuIndex": selectedGpuIndex,
|
|
||||||
"nvidiaGpuTempEnabled": nvidiaGpuTempEnabled,
|
|
||||||
"nonNvidiaGpuTempEnabled": nonNvidiaGpuTempEnabled,
|
|
||||||
"enabledGpuPciIds": enabledGpuPciIds,
|
|
||||||
"wallpaperCyclingEnabled": wallpaperCyclingEnabled,
|
|
||||||
"wallpaperCyclingMode": wallpaperCyclingMode,
|
|
||||||
"wallpaperCyclingInterval": wallpaperCyclingInterval,
|
|
||||||
"wallpaperCyclingTime": wallpaperCyclingTime,
|
|
||||||
"monitorCyclingSettings": monitorCyclingSettings,
|
|
||||||
"lastBrightnessDevice": lastBrightnessDevice,
|
|
||||||
"launchPrefix": launchPrefix,
|
|
||||||
"wallpaperTransition": wallpaperTransition,
|
|
||||||
"acMonitorTimeout": acMonitorTimeout,
|
|
||||||
"acLockTimeout": acLockTimeout,
|
|
||||||
"acSuspendTimeout": acSuspendTimeout,
|
|
||||||
"acHibernateTimeout": acHibernateTimeout,
|
|
||||||
"batteryMonitorTimeout": batteryMonitorTimeout,
|
|
||||||
"batteryLockTimeout": batteryLockTimeout,
|
|
||||||
"batterySuspendTimeout": batterySuspendTimeout,
|
|
||||||
"batteryHibernateTimeout": batteryHibernateTimeout,
|
|
||||||
"lockBeforeSuspend": lockBeforeSuspend
|
|
||||||
}, null, 2))
|
|
||||||
}
|
|
||||||
|
|
||||||
function setLightMode(lightMode) {
|
|
||||||
isLightMode = lightMode
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setDoNotDisturb(enabled) {
|
|
||||||
doNotDisturb = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeEnabled(enabled) {
|
|
||||||
nightModeEnabled = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeTemperature(temperature) {
|
|
||||||
nightModeTemperature = temperature
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeAutoEnabled(enabled) {
|
|
||||||
console.log("SessionData: Setting nightModeAutoEnabled to", enabled)
|
|
||||||
nightModeAutoEnabled = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeAutoMode(mode) {
|
|
||||||
nightModeAutoMode = mode
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeStartHour(hour) {
|
|
||||||
nightModeStartHour = hour
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeStartMinute(minute) {
|
|
||||||
nightModeStartMinute = minute
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeEndHour(hour) {
|
|
||||||
nightModeEndHour = hour
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeEndMinute(minute) {
|
|
||||||
nightModeEndMinute = minute
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setLatitude(lat) {
|
|
||||||
console.log("SessionData: Setting latitude to", lat)
|
|
||||||
latitude = lat
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setLongitude(lng) {
|
|
||||||
console.log("SessionData: Setting longitude to", lng)
|
|
||||||
longitude = lng
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeLocationProvider(provider) {
|
|
||||||
nightModeLocationProvider = provider
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaperPath(path) {
|
|
||||||
wallpaperPath = path
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaper(imagePath) {
|
|
||||||
wallpaperPath = imagePath
|
|
||||||
saveSettings()
|
|
||||||
|
|
||||||
if (typeof Theme !== "undefined") {
|
|
||||||
if (Theme.currentTheme === Theme.dynamic) {
|
|
||||||
Theme.extractColors()
|
|
||||||
}
|
|
||||||
Theme.generateSystemThemesFromCurrentTheme()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaperColor(color) {
|
|
||||||
wallpaperPath = color
|
|
||||||
saveSettings()
|
|
||||||
|
|
||||||
if (typeof Theme !== "undefined") {
|
|
||||||
if (Theme.currentTheme === Theme.dynamic) {
|
|
||||||
Theme.extractColors()
|
|
||||||
}
|
|
||||||
Theme.generateSystemThemesFromCurrentTheme()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearWallpaper() {
|
|
||||||
wallpaperPath = ""
|
|
||||||
saveSettings()
|
|
||||||
|
|
||||||
if (typeof Theme !== "undefined") {
|
|
||||||
if (typeof SettingsData !== "undefined" && SettingsData.theme) {
|
|
||||||
Theme.switchTheme(SettingsData.theme)
|
|
||||||
} else {
|
|
||||||
Theme.switchTheme("blue")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaperLastPath(path) {
|
|
||||||
wallpaperLastPath = path
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setProfileLastPath(path) {
|
|
||||||
profileLastPath = path
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setPinnedApps(apps) {
|
|
||||||
pinnedApps = apps
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function addPinnedApp(appId) {
|
|
||||||
if (!appId)
|
|
||||||
return
|
|
||||||
var currentPinned = [...pinnedApps]
|
|
||||||
if (currentPinned.indexOf(appId) === -1) {
|
|
||||||
currentPinned.push(appId)
|
|
||||||
setPinnedApps(currentPinned)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function removePinnedApp(appId) {
|
|
||||||
if (!appId)
|
|
||||||
return
|
|
||||||
var currentPinned = pinnedApps.filter(id => id !== appId)
|
|
||||||
setPinnedApps(currentPinned)
|
|
||||||
}
|
|
||||||
|
|
||||||
function isPinnedApp(appId) {
|
|
||||||
return appId && pinnedApps.indexOf(appId) !== -1
|
|
||||||
}
|
|
||||||
|
|
||||||
function setSelectedGpuIndex(index) {
|
|
||||||
selectedGpuIndex = index
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNvidiaGpuTempEnabled(enabled) {
|
|
||||||
nvidiaGpuTempEnabled = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNonNvidiaGpuTempEnabled(enabled) {
|
|
||||||
nonNvidiaGpuTempEnabled = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setEnabledGpuPciIds(pciIds) {
|
|
||||||
enabledGpuPciIds = pciIds
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaperCyclingEnabled(enabled) {
|
|
||||||
wallpaperCyclingEnabled = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaperCyclingMode(mode) {
|
|
||||||
wallpaperCyclingMode = mode
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaperCyclingInterval(interval) {
|
|
||||||
wallpaperCyclingInterval = interval
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaperCyclingTime(time) {
|
|
||||||
wallpaperCyclingTime = time
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function getMonitorCyclingSettings(screenName) {
|
|
||||||
return monitorCyclingSettings[screenName] || {
|
|
||||||
enabled: false,
|
|
||||||
mode: "interval",
|
|
||||||
interval: 300,
|
|
||||||
time: "06:00"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setMonitorCyclingEnabled(screenName, enabled) {
|
|
||||||
var newSettings = Object.assign({}, monitorCyclingSettings)
|
|
||||||
if (!newSettings[screenName]) {
|
|
||||||
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
|
||||||
}
|
|
||||||
newSettings[screenName].enabled = enabled
|
|
||||||
monitorCyclingSettings = newSettings
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setMonitorCyclingMode(screenName, mode) {
|
|
||||||
var newSettings = Object.assign({}, monitorCyclingSettings)
|
|
||||||
if (!newSettings[screenName]) {
|
|
||||||
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
|
||||||
}
|
|
||||||
newSettings[screenName].mode = mode
|
|
||||||
monitorCyclingSettings = newSettings
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setMonitorCyclingInterval(screenName, interval) {
|
|
||||||
var newSettings = Object.assign({}, monitorCyclingSettings)
|
|
||||||
if (!newSettings[screenName]) {
|
|
||||||
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
|
||||||
}
|
|
||||||
newSettings[screenName].interval = interval
|
|
||||||
monitorCyclingSettings = newSettings
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setMonitorCyclingTime(screenName, time) {
|
|
||||||
var newSettings = Object.assign({}, monitorCyclingSettings)
|
|
||||||
if (!newSettings[screenName]) {
|
|
||||||
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
|
||||||
}
|
|
||||||
newSettings[screenName].time = time
|
|
||||||
monitorCyclingSettings = newSettings
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setPerMonitorWallpaper(enabled) {
|
|
||||||
perMonitorWallpaper = enabled
|
|
||||||
saveSettings()
|
|
||||||
|
|
||||||
// Refresh dynamic theming when per-monitor mode changes
|
|
||||||
if (typeof Theme !== "undefined") {
|
|
||||||
if (Theme.currentTheme === Theme.dynamic) {
|
|
||||||
Theme.extractColors()
|
|
||||||
}
|
|
||||||
Theme.generateSystemThemesFromCurrentTheme()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setMonitorWallpaper(screenName, path) {
|
|
||||||
var newMonitorWallpapers = Object.assign({}, monitorWallpapers)
|
|
||||||
if (path && path !== "") {
|
|
||||||
newMonitorWallpapers[screenName] = path
|
|
||||||
} else {
|
|
||||||
delete newMonitorWallpapers[screenName]
|
|
||||||
}
|
|
||||||
monitorWallpapers = newMonitorWallpapers
|
|
||||||
saveSettings()
|
|
||||||
|
|
||||||
// Trigger dynamic theming if this is the first monitor and dynamic theming is enabled
|
|
||||||
if (typeof Theme !== "undefined" && typeof Quickshell !== "undefined") {
|
|
||||||
var screens = Quickshell.screens
|
|
||||||
if (screens.length > 0 && screenName === screens[0].name) {
|
|
||||||
if (typeof SettingsData !== "undefined" && SettingsData.wallpaperDynamicTheming) {
|
|
||||||
Theme.switchTheme("dynamic")
|
|
||||||
Theme.extractColors()
|
|
||||||
}
|
|
||||||
Theme.generateSystemThemesFromCurrentTheme()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getMonitorWallpaper(screenName) {
|
|
||||||
if (!perMonitorWallpaper) {
|
|
||||||
return wallpaperPath
|
|
||||||
}
|
|
||||||
return monitorWallpapers[screenName] || wallpaperPath
|
|
||||||
}
|
|
||||||
|
|
||||||
function setLastBrightnessDevice(device) {
|
|
||||||
lastBrightnessDevice = device
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setLaunchPrefix(prefix) {
|
|
||||||
launchPrefix = prefix
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaperTransition(transition) {
|
|
||||||
wallpaperTransition = transition
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setAcMonitorTimeout(timeout) {
|
|
||||||
acMonitorTimeout = timeout
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setAcLockTimeout(timeout) {
|
|
||||||
acLockTimeout = timeout
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setAcSuspendTimeout(timeout) {
|
|
||||||
acSuspendTimeout = timeout
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setBatteryMonitorTimeout(timeout) {
|
|
||||||
batteryMonitorTimeout = timeout
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setBatteryLockTimeout(timeout) {
|
|
||||||
batteryLockTimeout = timeout
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setBatterySuspendTimeout(timeout) {
|
|
||||||
batterySuspendTimeout = timeout
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setAcHibernateTimeout(timeout) {
|
|
||||||
acHibernateTimeout = timeout
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setBatteryHibernateTimeout(timeout) {
|
|
||||||
batteryHibernateTimeout = timeout
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setLockBeforeSuspend(enabled) {
|
|
||||||
lockBeforeSuspend = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
FileView {
|
|
||||||
id: settingsFile
|
|
||||||
|
|
||||||
path: StandardPaths.writableLocation(StandardPaths.GenericStateLocation) + "/DankMaterialShell/session.json"
|
|
||||||
blockLoading: true
|
|
||||||
blockWrites: true
|
|
||||||
watchChanges: true
|
|
||||||
onLoaded: {
|
|
||||||
parseSettings(settingsFile.text())
|
|
||||||
hasTriedDefaultSession = false
|
|
||||||
}
|
|
||||||
onLoadFailed: error => {
|
|
||||||
if (!hasTriedDefaultSession) {
|
|
||||||
hasTriedDefaultSession = true
|
|
||||||
defaultSessionCheckProcess.running = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: defaultSessionCheckProcess
|
|
||||||
|
|
||||||
command: ["sh", "-c", "CONFIG_DIR=\"" + _stateDir
|
|
||||||
+ "/DankMaterialShell\"; if [ -f \"$CONFIG_DIR/default-session.json\" ] && [ ! -f \"$CONFIG_DIR/session.json\" ]; then cp \"$CONFIG_DIR/default-session.json\" \"$CONFIG_DIR/session.json\" && echo 'copied'; else echo 'not_found'; fi"]
|
|
||||||
running: false
|
|
||||||
onExited: exitCode => {
|
|
||||||
if (exitCode === 0) {
|
|
||||||
console.log("Copied default-session.json to session.json")
|
|
||||||
settingsFile.reload()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IpcHandler {
|
|
||||||
target: "wallpaper"
|
|
||||||
|
|
||||||
function get(): string {
|
|
||||||
if (root.perMonitorWallpaper) {
|
|
||||||
return "ERROR: Per-monitor mode enabled. Use getFor(screenName) instead."
|
|
||||||
}
|
|
||||||
return root.wallpaperPath || ""
|
|
||||||
}
|
|
||||||
|
|
||||||
function set(path: string): string {
|
|
||||||
if (root.perMonitorWallpaper) {
|
|
||||||
return "ERROR: Per-monitor mode enabled. Use setFor(screenName, path) instead."
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!path) {
|
|
||||||
return "ERROR: No path provided"
|
|
||||||
}
|
|
||||||
|
|
||||||
var absolutePath = path.startsWith("/") ? path : StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/" + path
|
|
||||||
|
|
||||||
try {
|
|
||||||
root.setWallpaper(absolutePath)
|
|
||||||
return "SUCCESS: Wallpaper set to " + absolutePath
|
|
||||||
} catch (e) {
|
|
||||||
return "ERROR: Failed to set wallpaper: " + e.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function clear(): string {
|
|
||||||
root.setWallpaper("")
|
|
||||||
root.setPerMonitorWallpaper(false)
|
|
||||||
root.monitorWallpapers = {}
|
|
||||||
root.saveSettings()
|
|
||||||
return "SUCCESS: All wallpapers cleared"
|
|
||||||
}
|
|
||||||
|
|
||||||
function next(): string {
|
|
||||||
if (root.perMonitorWallpaper) {
|
|
||||||
return "ERROR: Per-monitor mode enabled. Use nextFor(screenName) instead."
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!root.wallpaperPath) {
|
|
||||||
return "ERROR: No wallpaper set"
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
WallpaperCyclingService.cycleNextManually()
|
|
||||||
return "SUCCESS: Cycling to next wallpaper"
|
|
||||||
} catch (e) {
|
|
||||||
return "ERROR: Failed to cycle wallpaper: " + e.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function prev(): string {
|
|
||||||
if (root.perMonitorWallpaper) {
|
|
||||||
return "ERROR: Per-monitor mode enabled. Use prevFor(screenName) instead."
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!root.wallpaperPath) {
|
|
||||||
return "ERROR: No wallpaper set"
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
WallpaperCyclingService.cyclePrevManually()
|
|
||||||
return "SUCCESS: Cycling to previous wallpaper"
|
|
||||||
} catch (e) {
|
|
||||||
return "ERROR: Failed to cycle wallpaper: " + e.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getFor(screenName: string): string {
|
|
||||||
if (!screenName) {
|
|
||||||
return "ERROR: No screen name provided"
|
|
||||||
}
|
|
||||||
return root.getMonitorWallpaper(screenName) || ""
|
|
||||||
}
|
|
||||||
|
|
||||||
function setFor(screenName: string, path: string): string {
|
|
||||||
if (!screenName) {
|
|
||||||
return "ERROR: No screen name provided"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!path) {
|
|
||||||
return "ERROR: No path provided"
|
|
||||||
}
|
|
||||||
|
|
||||||
var absolutePath = path.startsWith("/") ? path : StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/" + path
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (!root.perMonitorWallpaper) {
|
|
||||||
root.setPerMonitorWallpaper(true)
|
|
||||||
}
|
|
||||||
root.setMonitorWallpaper(screenName, absolutePath)
|
|
||||||
return "SUCCESS: Wallpaper set for " + screenName + " to " + absolutePath
|
|
||||||
} catch (e) {
|
|
||||||
return "ERROR: Failed to set wallpaper for " + screenName + ": " + e.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function nextFor(screenName: string): string {
|
|
||||||
if (!screenName) {
|
|
||||||
return "ERROR: No screen name provided"
|
|
||||||
}
|
|
||||||
|
|
||||||
var currentWallpaper = root.getMonitorWallpaper(screenName)
|
|
||||||
if (!currentWallpaper) {
|
|
||||||
return "ERROR: No wallpaper set for " + screenName
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
WallpaperCyclingService.cycleNextForMonitor(screenName)
|
|
||||||
return "SUCCESS: Cycling to next wallpaper for " + screenName
|
|
||||||
} catch (e) {
|
|
||||||
return "ERROR: Failed to cycle wallpaper for " + screenName + ": " + e.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function prevFor(screenName: string): string {
|
|
||||||
if (!screenName) {
|
|
||||||
return "ERROR: No screen name provided"
|
|
||||||
}
|
|
||||||
|
|
||||||
var currentWallpaper = root.getMonitorWallpaper(screenName)
|
|
||||||
if (!currentWallpaper) {
|
|
||||||
return "ERROR: No wallpaper set for " + screenName
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
WallpaperCyclingService.cyclePrevForMonitor(screenName)
|
|
||||||
return "SUCCESS: Cycling to previous wallpaper for " + screenName
|
|
||||||
} catch (e) {
|
|
||||||
return "ERROR: Failed to cycle wallpaper for " + screenName + ": " + e.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,523 +0,0 @@
|
|||||||
// Stock theme definitions for DankMaterialShell
|
|
||||||
// Separated from Theme.qml to keep that file clean
|
|
||||||
|
|
||||||
const CatppuccinMocha = {
|
|
||||||
surface: "#45475a",
|
|
||||||
surfaceText: "#cdd6f4",
|
|
||||||
surfaceVariant: "#45475a",
|
|
||||||
surfaceVariantText: "#a6adc8",
|
|
||||||
background: "#1e1e2e",
|
|
||||||
backgroundText: "#cdd6f4",
|
|
||||||
outline: "#6c7086",
|
|
||||||
surfaceContainer: "#313244",
|
|
||||||
surfaceContainerHigh: "#585b70"
|
|
||||||
}
|
|
||||||
|
|
||||||
const CatppuccinLatte = {
|
|
||||||
surface: "#bcc0cc",
|
|
||||||
surfaceText: "#4c4f69",
|
|
||||||
surfaceVariant: "#bcc0cc",
|
|
||||||
surfaceVariantText: "#6c6f85",
|
|
||||||
background: "#eff1f5",
|
|
||||||
backgroundText: "#4c4f69",
|
|
||||||
outline: "#9ca0b0",
|
|
||||||
surfaceContainer: "#ccd0da",
|
|
||||||
surfaceContainerHigh: "#acb0be"
|
|
||||||
}
|
|
||||||
|
|
||||||
const CatppuccinVariants = {
|
|
||||||
"cat-rosewater": {
|
|
||||||
name: "Rosewater",
|
|
||||||
dark: { primary: "#f5e0dc", secondary: "#f2cdcd", primaryText: "#1e1e2e", primaryContainer: "#8b6b5e", surfaceTint: "#f5e0dc" },
|
|
||||||
light: { primary: "#dc8a78", secondary: "#dd7878", primaryText: "#ffffff", primaryContainer: "#f4d2ca", surfaceTint: "#dc8a78" }
|
|
||||||
},
|
|
||||||
"cat-flamingo": {
|
|
||||||
name: "Flamingo",
|
|
||||||
dark: { primary: "#f2cdcd", secondary: "#f5e0dc", primaryText: "#1e1e2e", primaryContainer: "#885d62", surfaceTint: "#f2cdcd" },
|
|
||||||
light: { primary: "#dd7878", secondary: "#dc8a78", primaryText: "#ffffff", primaryContainer: "#f4caca", surfaceTint: "#dd7878" }
|
|
||||||
},
|
|
||||||
"cat-pink": {
|
|
||||||
name: "Pink",
|
|
||||||
dark: { primary: "#f5c2e7", secondary: "#cba6f7", primaryText: "#1e1e2e", primaryContainer: "#8b537a", surfaceTint: "#f5c2e7" },
|
|
||||||
light: { primary: "#ea76cb", secondary: "#8839ef", primaryText: "#ffffff", primaryContainer: "#f7c9e7", surfaceTint: "#ea76cb" }
|
|
||||||
},
|
|
||||||
"cat-mauve": {
|
|
||||||
name: "Mauve",
|
|
||||||
dark: { primary: "#cba6f7", secondary: "#b4befe", primaryText: "#1e1e2e", primaryContainer: "#61378a", surfaceTint: "#cba6f7" },
|
|
||||||
light: { primary: "#8839ef", secondary: "#7287fd", primaryText: "#ffffff", primaryContainer: "#e4d3ff", surfaceTint: "#8839ef" }
|
|
||||||
},
|
|
||||||
"cat-red": {
|
|
||||||
name: "Red",
|
|
||||||
dark: { primary: "#f38ba8", secondary: "#eba0ac", primaryText: "#1e1e2e", primaryContainer: "#891c3b", surfaceTint: "#f38ba8" },
|
|
||||||
light: { primary: "#d20f39", secondary: "#e64553", primaryText: "#ffffff", primaryContainer: "#f1b8c4", surfaceTint: "#d20f39" }
|
|
||||||
},
|
|
||||||
"cat-maroon": {
|
|
||||||
name: "Maroon",
|
|
||||||
dark: { primary: "#eba0ac", secondary: "#f38ba8", primaryText: "#1e1e2e", primaryContainer: "#81313f", surfaceTint: "#eba0ac" },
|
|
||||||
light: { primary: "#e64553", secondary: "#d20f39", primaryText: "#ffffff", primaryContainer: "#f4c3c8", surfaceTint: "#e64553" }
|
|
||||||
},
|
|
||||||
"cat-peach": {
|
|
||||||
name: "Peach",
|
|
||||||
dark: { primary: "#fab387", secondary: "#f9e2af", primaryText: "#1e1e2e", primaryContainer: "#90441a", surfaceTint: "#fab387" },
|
|
||||||
light: { primary: "#fe640b", secondary: "#df8e1d", primaryText: "#ffffff", primaryContainer: "#ffddcc", surfaceTint: "#fe640b" }
|
|
||||||
},
|
|
||||||
"cat-yellow": {
|
|
||||||
name: "Yellow",
|
|
||||||
dark: { primary: "#f9e2af", secondary: "#a6e3a1", primaryText: "#1e1e2e", primaryContainer: "#8f7342", surfaceTint: "#f9e2af" },
|
|
||||||
light: { primary: "#df8e1d", secondary: "#40a02b", primaryText: "#ffffff", primaryContainer: "#fff3cc", surfaceTint: "#df8e1d" }
|
|
||||||
},
|
|
||||||
"cat-green": {
|
|
||||||
name: "Green",
|
|
||||||
dark: { primary: "#a6e3a1", secondary: "#94e2d5", primaryText: "#1e1e2e", primaryContainer: "#3c7534", surfaceTint: "#a6e3a1" },
|
|
||||||
light: { primary: "#40a02b", secondary: "#179299", primaryText: "#ffffff", primaryContainer: "#d4f5d4", surfaceTint: "#40a02b" }
|
|
||||||
},
|
|
||||||
"cat-teal": {
|
|
||||||
name: "Teal",
|
|
||||||
dark: { primary: "#94e2d5", secondary: "#89dceb", primaryText: "#1e1e2e", primaryContainer: "#2a7468", surfaceTint: "#94e2d5" },
|
|
||||||
light: { primary: "#179299", secondary: "#04a5e5", primaryText: "#ffffff", primaryContainer: "#ccf2f2", surfaceTint: "#179299" }
|
|
||||||
},
|
|
||||||
"cat-sky": {
|
|
||||||
name: "Sky",
|
|
||||||
dark: { primary: "#89dceb", secondary: "#74c7ec", primaryText: "#1e1e2e", primaryContainer: "#196e7e", surfaceTint: "#89dceb" },
|
|
||||||
light: { primary: "#04a5e5", secondary: "#209fb5", primaryText: "#ffffff", primaryContainer: "#ccebff", surfaceTint: "#04a5e5" }
|
|
||||||
},
|
|
||||||
"cat-sapphire": {
|
|
||||||
name: "Sapphire",
|
|
||||||
dark: { primary: "#74c7ec", secondary: "#89b4fa", primaryText: "#1e1e2e", primaryContainer: "#0a597f", surfaceTint: "#74c7ec" },
|
|
||||||
light: { primary: "#209fb5", secondary: "#1e66f5", primaryText: "#ffffff", primaryContainer: "#d0f0f5", surfaceTint: "#209fb5" }
|
|
||||||
},
|
|
||||||
"cat-blue": {
|
|
||||||
name: "Blue",
|
|
||||||
dark: { primary: "#89b4fa", secondary: "#b4befe", primaryText: "#1e1e2e", primaryContainer: "#19468d", surfaceTint: "#89b4fa" },
|
|
||||||
light: { primary: "#1e66f5", secondary: "#7287fd", primaryText: "#ffffff", primaryContainer: "#ccd9ff", surfaceTint: "#1e66f5" }
|
|
||||||
},
|
|
||||||
"cat-lavender": {
|
|
||||||
name: "Lavender",
|
|
||||||
dark: { primary: "#b4befe", secondary: "#cba6f7", primaryText: "#1e1e2e", primaryContainer: "#4a5091", surfaceTint: "#b4befe" },
|
|
||||||
light: { primary: "#7287fd", secondary: "#8839ef", primaryText: "#ffffff", primaryContainer: "#dde1ff", surfaceTint: "#7287fd" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCatppuccinTheme(variant, isLight = false) {
|
|
||||||
const variantData = CatppuccinVariants[variant]
|
|
||||||
if (!variantData) return null
|
|
||||||
|
|
||||||
const baseColors = isLight ? CatppuccinLatte : CatppuccinMocha
|
|
||||||
const accentColors = isLight ? variantData.light : variantData.dark
|
|
||||||
|
|
||||||
return Object.assign({
|
|
||||||
name: `${variantData.name}${isLight ? ' Light' : ''}`
|
|
||||||
}, baseColors, accentColors)
|
|
||||||
}
|
|
||||||
|
|
||||||
const StockThemes = {
|
|
||||||
DARK: {
|
|
||||||
blue: {
|
|
||||||
name: "Blue",
|
|
||||||
primary: "#42a5f5",
|
|
||||||
primaryText: "#000000",
|
|
||||||
primaryContainer: "#0d47a1",
|
|
||||||
secondary: "#8ab4f8",
|
|
||||||
surface: "#1a1c1e",
|
|
||||||
surfaceText: "#e3e8ef",
|
|
||||||
surfaceVariant: "#44464f",
|
|
||||||
surfaceVariantText: "#c4c7c5",
|
|
||||||
surfaceTint: "#8ab4f8",
|
|
||||||
background: "#1a1c1e",
|
|
||||||
backgroundText: "#e3e8ef",
|
|
||||||
outline: "#8e918f",
|
|
||||||
surfaceContainer: "#1e2023",
|
|
||||||
surfaceContainerHigh: "#292b2f"
|
|
||||||
},
|
|
||||||
purple: {
|
|
||||||
name: "Purple",
|
|
||||||
primary: "#D0BCFF",
|
|
||||||
primaryText: "#381E72",
|
|
||||||
primaryContainer: "#4F378B",
|
|
||||||
secondary: "#CCC2DC",
|
|
||||||
surface: "#10121E",
|
|
||||||
surfaceText: "#E6E0E9",
|
|
||||||
surfaceVariant: "#49454F",
|
|
||||||
surfaceVariantText: "#CAC4D0",
|
|
||||||
surfaceTint: "#D0BCFF",
|
|
||||||
background: "#10121E",
|
|
||||||
backgroundText: "#E6E0E9",
|
|
||||||
outline: "#938F99",
|
|
||||||
surfaceContainer: "#1D1B20",
|
|
||||||
surfaceContainerHigh: "#2B2930"
|
|
||||||
},
|
|
||||||
green: {
|
|
||||||
name: "Green",
|
|
||||||
primary: "#4caf50",
|
|
||||||
primaryText: "#000000",
|
|
||||||
primaryContainer: "#1b5e20",
|
|
||||||
secondary: "#81c995",
|
|
||||||
surface: "#0f1411",
|
|
||||||
surfaceText: "#e1f5e3",
|
|
||||||
surfaceVariant: "#404943",
|
|
||||||
surfaceVariantText: "#c1cbc4",
|
|
||||||
surfaceTint: "#81c995",
|
|
||||||
background: "#0f1411",
|
|
||||||
backgroundText: "#e1f5e3",
|
|
||||||
outline: "#8b938c",
|
|
||||||
surfaceContainer: "#1a1f1b",
|
|
||||||
surfaceContainerHigh: "#252a26"
|
|
||||||
},
|
|
||||||
orange: {
|
|
||||||
name: "Orange",
|
|
||||||
primary: "#ff6d00",
|
|
||||||
primaryText: "#000000",
|
|
||||||
primaryContainer: "#3e2723",
|
|
||||||
secondary: "#ffb74d",
|
|
||||||
surface: "#1c1410",
|
|
||||||
surfaceText: "#f5f1ea",
|
|
||||||
surfaceVariant: "#4a453a",
|
|
||||||
surfaceVariantText: "#cbc5b8",
|
|
||||||
surfaceTint: "#ffb74d",
|
|
||||||
background: "#1c1410",
|
|
||||||
backgroundText: "#f5f1ea",
|
|
||||||
outline: "#958f84",
|
|
||||||
surfaceContainer: "#211e17",
|
|
||||||
surfaceContainerHigh: "#2c291f"
|
|
||||||
},
|
|
||||||
red: {
|
|
||||||
name: "Red",
|
|
||||||
primary: "#f44336",
|
|
||||||
primaryText: "#000000",
|
|
||||||
primaryContainer: "#4a0e0e",
|
|
||||||
secondary: "#f28b82",
|
|
||||||
surface: "#1c1011",
|
|
||||||
surfaceText: "#f5e8ea",
|
|
||||||
surfaceVariant: "#4a3f41",
|
|
||||||
surfaceVariantText: "#cbc2c4",
|
|
||||||
surfaceTint: "#f28b82",
|
|
||||||
background: "#1c1011",
|
|
||||||
backgroundText: "#f5e8ea",
|
|
||||||
outline: "#958b8d",
|
|
||||||
surfaceContainer: "#211b1c",
|
|
||||||
surfaceContainerHigh: "#2c2426"
|
|
||||||
},
|
|
||||||
cyan: {
|
|
||||||
name: "Cyan",
|
|
||||||
primary: "#00bcd4",
|
|
||||||
primaryText: "#000000",
|
|
||||||
primaryContainer: "#004d5c",
|
|
||||||
secondary: "#4dd0e1",
|
|
||||||
surface: "#0f1617",
|
|
||||||
surfaceText: "#e8f4f5",
|
|
||||||
surfaceVariant: "#3f474a",
|
|
||||||
surfaceVariantText: "#c2c9cb",
|
|
||||||
surfaceTint: "#4dd0e1",
|
|
||||||
background: "#0f1617",
|
|
||||||
backgroundText: "#e8f4f5",
|
|
||||||
outline: "#8c9194",
|
|
||||||
surfaceContainer: "#1a1f20",
|
|
||||||
surfaceContainerHigh: "#252b2c"
|
|
||||||
},
|
|
||||||
pink: {
|
|
||||||
name: "Pink",
|
|
||||||
primary: "#e91e63",
|
|
||||||
primaryText: "#000000",
|
|
||||||
primaryContainer: "#4a0e2f",
|
|
||||||
secondary: "#f8bbd9",
|
|
||||||
surface: "#1a1014",
|
|
||||||
surfaceText: "#f3e8ee",
|
|
||||||
surfaceVariant: "#483f45",
|
|
||||||
surfaceVariantText: "#c9c2c7",
|
|
||||||
surfaceTint: "#f8bbd9",
|
|
||||||
background: "#1a1014",
|
|
||||||
backgroundText: "#f3e8ee",
|
|
||||||
outline: "#938a90",
|
|
||||||
surfaceContainer: "#1f1b1e",
|
|
||||||
surfaceContainerHigh: "#2a2428"
|
|
||||||
},
|
|
||||||
amber: {
|
|
||||||
name: "Amber",
|
|
||||||
primary: "#ffc107",
|
|
||||||
primaryText: "#000000",
|
|
||||||
primaryContainer: "#4a3c00",
|
|
||||||
secondary: "#ffd54f",
|
|
||||||
surface: "#1a1710",
|
|
||||||
surfaceText: "#f3f0e8",
|
|
||||||
surfaceVariant: "#49453a",
|
|
||||||
surfaceVariantText: "#cac5b8",
|
|
||||||
surfaceTint: "#ffd54f",
|
|
||||||
background: "#1a1710",
|
|
||||||
backgroundText: "#f3f0e8",
|
|
||||||
outline: "#949084",
|
|
||||||
surfaceContainer: "#1f1e17",
|
|
||||||
surfaceContainerHigh: "#2a281f"
|
|
||||||
},
|
|
||||||
coral: {
|
|
||||||
name: "Coral",
|
|
||||||
primary: "#ffb4ab",
|
|
||||||
primaryText: "#000000",
|
|
||||||
primaryContainer: "#8c1d18",
|
|
||||||
secondary: "#f9dedc",
|
|
||||||
surface: "#1a1110",
|
|
||||||
surfaceText: "#f1e8e7",
|
|
||||||
surfaceVariant: "#4a4142",
|
|
||||||
surfaceVariantText: "#cdc2c1",
|
|
||||||
surfaceTint: "#ffb4ab",
|
|
||||||
background: "#1a1110",
|
|
||||||
backgroundText: "#f1e8e7",
|
|
||||||
outline: "#968b8a",
|
|
||||||
surfaceContainer: "#201a19",
|
|
||||||
surfaceContainerHigh: "#2b2221"
|
|
||||||
},
|
|
||||||
monochrome: {
|
|
||||||
name: "Monochrome",
|
|
||||||
primary: "#ffffff",
|
|
||||||
primaryText: "#2b303c",
|
|
||||||
primaryContainer: "#424753",
|
|
||||||
secondary: "#c4c6d0",
|
|
||||||
surface: "#2a2a2a",
|
|
||||||
surfaceText: "#e4e2e3",
|
|
||||||
surfaceVariant: "#474648",
|
|
||||||
surfaceVariantText: "#c8c6c7",
|
|
||||||
surfaceTint: "#c2c6d6",
|
|
||||||
background: "#131315",
|
|
||||||
backgroundText: "#e4e2e3",
|
|
||||||
outline: "#929092",
|
|
||||||
surfaceContainer: "#2a2a2a",
|
|
||||||
surfaceContainerHigh: "#2a2a2b",
|
|
||||||
error: "#ffb4ab",
|
|
||||||
warning: "#3f4759",
|
|
||||||
info: "#595e6c",
|
|
||||||
matugen_type: "scheme-monochrome"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
LIGHT: {
|
|
||||||
blue: {
|
|
||||||
name: "Blue Light",
|
|
||||||
primary: "#1976d2",
|
|
||||||
primaryText: "#ffffff",
|
|
||||||
primaryContainer: "#e3f2fd",
|
|
||||||
secondary: "#42a5f5",
|
|
||||||
surface: "#fefefe",
|
|
||||||
surfaceText: "#1a1c1e",
|
|
||||||
surfaceVariant: "#e7e0ec",
|
|
||||||
surfaceVariantText: "#49454f",
|
|
||||||
surfaceTint: "#1976d2",
|
|
||||||
background: "#fefefe",
|
|
||||||
backgroundText: "#1a1c1e",
|
|
||||||
outline: "#79747e",
|
|
||||||
surfaceContainer: "#f3f3f3",
|
|
||||||
surfaceContainerHigh: "#ececec"
|
|
||||||
},
|
|
||||||
purple: {
|
|
||||||
name: "Purple Light",
|
|
||||||
primary: "#6750A4",
|
|
||||||
primaryText: "#ffffff",
|
|
||||||
primaryContainer: "#EADDFF",
|
|
||||||
secondary: "#625B71",
|
|
||||||
surface: "#FFFBFE",
|
|
||||||
surfaceText: "#1C1B1F",
|
|
||||||
surfaceVariant: "#E7E0EC",
|
|
||||||
surfaceVariantText: "#49454F",
|
|
||||||
surfaceTint: "#6750A4",
|
|
||||||
background: "#FFFBFE",
|
|
||||||
backgroundText: "#1C1B1F",
|
|
||||||
outline: "#79747E",
|
|
||||||
surfaceContainer: "#F3EDF7",
|
|
||||||
surfaceContainerHigh: "#ECE6F0"
|
|
||||||
},
|
|
||||||
green: {
|
|
||||||
name: "Green Light",
|
|
||||||
primary: "#2e7d32",
|
|
||||||
primaryText: "#ffffff",
|
|
||||||
primaryContainer: "#e8f5e8",
|
|
||||||
secondary: "#4caf50",
|
|
||||||
surface: "#fefefe",
|
|
||||||
surfaceText: "#1a1c1e",
|
|
||||||
surfaceVariant: "#e7e0ec",
|
|
||||||
surfaceVariantText: "#49454f",
|
|
||||||
surfaceTint: "#2e7d32",
|
|
||||||
background: "#fefefe",
|
|
||||||
backgroundText: "#1a1c1e",
|
|
||||||
outline: "#79747e",
|
|
||||||
surfaceContainer: "#f3f3f3",
|
|
||||||
surfaceContainerHigh: "#ececec"
|
|
||||||
},
|
|
||||||
orange: {
|
|
||||||
name: "Orange Light",
|
|
||||||
primary: "#e65100",
|
|
||||||
primaryText: "#ffffff",
|
|
||||||
primaryContainer: "#ffecb3",
|
|
||||||
secondary: "#ff9800",
|
|
||||||
surface: "#fefefe",
|
|
||||||
surfaceText: "#1a1c1e",
|
|
||||||
surfaceVariant: "#e7e0ec",
|
|
||||||
surfaceVariantText: "#49454f",
|
|
||||||
surfaceTint: "#e65100",
|
|
||||||
background: "#fefefe",
|
|
||||||
backgroundText: "#1a1c1e",
|
|
||||||
outline: "#79747e",
|
|
||||||
surfaceContainer: "#f3f3f3",
|
|
||||||
surfaceContainerHigh: "#ececec"
|
|
||||||
},
|
|
||||||
red: {
|
|
||||||
name: "Red Light",
|
|
||||||
primary: "#d32f2f",
|
|
||||||
primaryText: "#ffffff",
|
|
||||||
primaryContainer: "#ffebee",
|
|
||||||
secondary: "#f44336",
|
|
||||||
surface: "#fefefe",
|
|
||||||
surfaceText: "#1a1c1e",
|
|
||||||
surfaceVariant: "#e7e0ec",
|
|
||||||
surfaceVariantText: "#49454f",
|
|
||||||
surfaceTint: "#d32f2f",
|
|
||||||
background: "#fefefe",
|
|
||||||
backgroundText: "#1a1c1e",
|
|
||||||
outline: "#79747e",
|
|
||||||
surfaceContainer: "#f3f3f3",
|
|
||||||
surfaceContainerHigh: "#ececec"
|
|
||||||
},
|
|
||||||
cyan: {
|
|
||||||
name: "Cyan Light",
|
|
||||||
primary: "#0097a7",
|
|
||||||
primaryText: "#ffffff",
|
|
||||||
primaryContainer: "#e0f2f1",
|
|
||||||
secondary: "#00bcd4",
|
|
||||||
surface: "#fefefe",
|
|
||||||
surfaceText: "#1a1c1e",
|
|
||||||
surfaceVariant: "#e7e0ec",
|
|
||||||
surfaceVariantText: "#49454f",
|
|
||||||
surfaceTint: "#0097a7",
|
|
||||||
background: "#fefefe",
|
|
||||||
backgroundText: "#1a1c1e",
|
|
||||||
outline: "#79747e",
|
|
||||||
surfaceContainer: "#f3f3f3",
|
|
||||||
surfaceContainerHigh: "#ececec"
|
|
||||||
},
|
|
||||||
pink: {
|
|
||||||
name: "Pink Light",
|
|
||||||
primary: "#c2185b",
|
|
||||||
primaryText: "#ffffff",
|
|
||||||
primaryContainer: "#fce4ec",
|
|
||||||
secondary: "#e91e63",
|
|
||||||
surface: "#fefefe",
|
|
||||||
surfaceText: "#1a1c1e",
|
|
||||||
surfaceVariant: "#e7e0ec",
|
|
||||||
surfaceVariantText: "#49454f",
|
|
||||||
surfaceTint: "#c2185b",
|
|
||||||
background: "#fefefe",
|
|
||||||
backgroundText: "#1a1c1e",
|
|
||||||
outline: "#79747e",
|
|
||||||
surfaceContainer: "#f3f3f3",
|
|
||||||
surfaceContainerHigh: "#ececec"
|
|
||||||
},
|
|
||||||
amber: {
|
|
||||||
name: "Amber Light",
|
|
||||||
primary: "#ff8f00",
|
|
||||||
primaryText: "#000000",
|
|
||||||
primaryContainer: "#fff8e1",
|
|
||||||
secondary: "#ffc107",
|
|
||||||
surface: "#fefefe",
|
|
||||||
surfaceText: "#1a1c1e",
|
|
||||||
surfaceVariant: "#e7e0ec",
|
|
||||||
surfaceVariantText: "#49454f",
|
|
||||||
surfaceTint: "#ff8f00",
|
|
||||||
background: "#fefefe",
|
|
||||||
backgroundText: "#1a1c1e",
|
|
||||||
outline: "#79747e",
|
|
||||||
surfaceContainer: "#f3f3f3",
|
|
||||||
surfaceContainerHigh: "#ececec"
|
|
||||||
},
|
|
||||||
coral: {
|
|
||||||
name: "Coral Light",
|
|
||||||
primary: "#8c1d18",
|
|
||||||
primaryText: "#ffffff",
|
|
||||||
primaryContainer: "#ffdad6",
|
|
||||||
secondary: "#ff5449",
|
|
||||||
surface: "#fefefe",
|
|
||||||
surfaceText: "#1a1c1e",
|
|
||||||
surfaceVariant: "#e7e0ec",
|
|
||||||
surfaceVariantText: "#49454f",
|
|
||||||
surfaceTint: "#8c1d18",
|
|
||||||
background: "#fefefe",
|
|
||||||
backgroundText: "#1a1c1e",
|
|
||||||
outline: "#79747e",
|
|
||||||
surfaceContainer: "#f3f3f3",
|
|
||||||
surfaceContainerHigh: "#ececec"
|
|
||||||
},
|
|
||||||
monochrome: {
|
|
||||||
name: "Monochrome Light",
|
|
||||||
primary: "#2b303c",
|
|
||||||
primaryText: "#ffffff",
|
|
||||||
primaryContainer: "#d6d7dc",
|
|
||||||
secondary: "#4a4d56",
|
|
||||||
surface: "#f5f5f6",
|
|
||||||
surfaceText: "#2a2a2a",
|
|
||||||
surfaceVariant: "#e0e0e2",
|
|
||||||
surfaceVariantText: "#424242",
|
|
||||||
surfaceTint: "#5a5f6e",
|
|
||||||
background: "#ffffff",
|
|
||||||
backgroundText: "#1a1a1a",
|
|
||||||
outline: "#757577",
|
|
||||||
surfaceContainer: "#f5f5f6",
|
|
||||||
surfaceContainerHigh: "#eaeaeb",
|
|
||||||
error: "#ba1a1a",
|
|
||||||
warning: "#f9e79f",
|
|
||||||
info: "#5d6475",
|
|
||||||
matugen_type: "scheme-monochrome"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const ThemeCategories = {
|
|
||||||
GENERIC: {
|
|
||||||
name: "Generic",
|
|
||||||
variants: ["blue", "purple", "green", "orange", "red", "cyan", "pink", "amber", "coral", "monochrome"]
|
|
||||||
},
|
|
||||||
CATPPUCCIN: {
|
|
||||||
name: "Catppuccin",
|
|
||||||
variants: Object.keys(CatppuccinVariants)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const ThemeNames = {
|
|
||||||
BLUE: "blue",
|
|
||||||
PURPLE: "purple",
|
|
||||||
GREEN: "green",
|
|
||||||
ORANGE: "orange",
|
|
||||||
RED: "red",
|
|
||||||
CYAN: "cyan",
|
|
||||||
PINK: "pink",
|
|
||||||
AMBER: "amber",
|
|
||||||
CORAL: "coral",
|
|
||||||
MONOCHROME: "monochrome",
|
|
||||||
DYNAMIC: "dynamic"
|
|
||||||
}
|
|
||||||
|
|
||||||
function isStockTheme(themeName) {
|
|
||||||
return Object.keys(StockThemes.DARK).includes(themeName)
|
|
||||||
}
|
|
||||||
|
|
||||||
function isCatppuccinVariant(themeName) {
|
|
||||||
return Object.keys(CatppuccinVariants).includes(themeName)
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAvailableThemes(isLight = false) {
|
|
||||||
return isLight ? StockThemes.LIGHT : StockThemes.DARK
|
|
||||||
}
|
|
||||||
|
|
||||||
function getThemeByName(themeName, isLight = false) {
|
|
||||||
if (isCatppuccinVariant(themeName)) {
|
|
||||||
return getCatppuccinTheme(themeName, isLight)
|
|
||||||
}
|
|
||||||
const themes = getAvailableThemes(isLight)
|
|
||||||
return themes[themeName] || themes.blue
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAllThemeNames() {
|
|
||||||
return Object.keys(StockThemes.DARK)
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCatppuccinVariantNames() {
|
|
||||||
return Object.keys(CatppuccinVariants)
|
|
||||||
}
|
|
||||||
|
|
||||||
function getThemeCategories() {
|
|
||||||
return ThemeCategories
|
|
||||||
}
|
|
||||||
958
Common/Theme.qml
958
Common/Theme.qml
@@ -1,958 +0,0 @@
|
|||||||
pragma Singleton
|
|
||||||
|
|
||||||
pragma ComponentBehavior: Bound
|
|
||||||
|
|
||||||
import QtCore
|
|
||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
import Quickshell.Services.UPower
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import "StockThemes.js" as StockThemes
|
|
||||||
|
|
||||||
Singleton {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property string currentTheme: "blue"
|
|
||||||
property string currentThemeCategory: "generic"
|
|
||||||
property bool isLightMode: false
|
|
||||||
|
|
||||||
readonly property string dynamic: "dynamic"
|
|
||||||
readonly property string custom : "custom"
|
|
||||||
|
|
||||||
readonly property string homeDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.HomeLocation))
|
|
||||||
readonly property string configDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.ConfigLocation))
|
|
||||||
readonly property string shellDir: Paths.strip(Qt.resolvedUrl(".").toString()).replace("/Common/", "")
|
|
||||||
readonly property string wallpaperPath: {
|
|
||||||
if (typeof SessionData === "undefined") return ""
|
|
||||||
|
|
||||||
if (SessionData.perMonitorWallpaper) {
|
|
||||||
// Use first monitor's wallpaper for dynamic theming
|
|
||||||
var screens = Quickshell.screens
|
|
||||||
if (screens.length > 0) {
|
|
||||||
var firstMonitorWallpaper = SessionData.getMonitorWallpaper(screens[0].name)
|
|
||||||
var wallpaperPath = firstMonitorWallpaper || SessionData.wallpaperPath
|
|
||||||
|
|
||||||
if (wallpaperPath && wallpaperPath.startsWith("we:")) {
|
|
||||||
return stateDir + "/we_screenshots/" + wallpaperPath.substring(3) + ".jpg"
|
|
||||||
}
|
|
||||||
|
|
||||||
return wallpaperPath
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var wallpaperPath = SessionData.wallpaperPath
|
|
||||||
var screens = Quickshell.screens
|
|
||||||
if (screens.length > 0 && wallpaperPath && wallpaperPath.startsWith("we:")) {
|
|
||||||
return stateDir + "/we_screenshots/" + wallpaperPath.substring(3) + ".jpg"
|
|
||||||
}
|
|
||||||
|
|
||||||
return wallpaperPath
|
|
||||||
}
|
|
||||||
readonly property string rawWallpaperPath: {
|
|
||||||
if (typeof SessionData === "undefined") return ""
|
|
||||||
|
|
||||||
if (SessionData.perMonitorWallpaper) {
|
|
||||||
// Use first monitor's wallpaper for dynamic theming
|
|
||||||
var screens = Quickshell.screens
|
|
||||||
if (screens.length > 0) {
|
|
||||||
var firstMonitorWallpaper = SessionData.getMonitorWallpaper(screens[0].name)
|
|
||||||
return firstMonitorWallpaper || SessionData.wallpaperPath
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return SessionData.wallpaperPath
|
|
||||||
}
|
|
||||||
|
|
||||||
property bool matugenAvailable: false
|
|
||||||
property bool gtkThemingEnabled: typeof SettingsData !== "undefined" ? SettingsData.gtkAvailable : false
|
|
||||||
property bool qtThemingEnabled: typeof SettingsData !== "undefined" ? (SettingsData.qt5ctAvailable || SettingsData.qt6ctAvailable) : false
|
|
||||||
property var workerRunning: false
|
|
||||||
property var matugenColors: ({})
|
|
||||||
property bool extractionRequested: false
|
|
||||||
property int colorUpdateTrigger: 0
|
|
||||||
property var customThemeData: null
|
|
||||||
|
|
||||||
readonly property string stateDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.CacheLocation).toString()) + "/dankshell"
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
Quickshell.execDetached(["mkdir", "-p", stateDir])
|
|
||||||
matugenCheck.running = true
|
|
||||||
if (typeof SessionData !== "undefined")
|
|
||||||
SessionData.isLightModeChanged.connect(root.onLightModeChanged)
|
|
||||||
|
|
||||||
if (typeof SettingsData !== "undefined" && SettingsData.currentThemeName) {
|
|
||||||
switchTheme(SettingsData.currentThemeName, false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getMatugenColor(path, fallback) {
|
|
||||||
colorUpdateTrigger
|
|
||||||
const colorMode = (typeof SessionData !== "undefined" && SessionData.isLightMode) ? "light" : "dark"
|
|
||||||
let cur = matugenColors && matugenColors.colors && matugenColors.colors[colorMode]
|
|
||||||
for (const part of path.split(".")) {
|
|
||||||
if (!cur || typeof cur !== "object" || !(part in cur))
|
|
||||||
return fallback
|
|
||||||
cur = cur[part]
|
|
||||||
}
|
|
||||||
return cur || fallback
|
|
||||||
}
|
|
||||||
|
|
||||||
readonly property var currentThemeData: {
|
|
||||||
if (currentTheme === "custom") {
|
|
||||||
return customThemeData || StockThemes.getThemeByName("blue", isLightMode)
|
|
||||||
} else if (currentTheme === dynamic) {
|
|
||||||
return {
|
|
||||||
"primary": getMatugenColor("primary", "#42a5f5"),
|
|
||||||
"primaryText": getMatugenColor("on_primary", "#ffffff"),
|
|
||||||
"primaryContainer": getMatugenColor("primary_container", "#1976d2"),
|
|
||||||
"secondary": getMatugenColor("secondary", "#8ab4f8"),
|
|
||||||
"surface": getMatugenColor("surface", "#1a1c1e"),
|
|
||||||
"surfaceText": getMatugenColor("on_background", "#e3e8ef"),
|
|
||||||
"surfaceVariant": getMatugenColor("surface_variant", "#44464f"),
|
|
||||||
"surfaceVariantText": getMatugenColor("on_surface_variant", "#c4c7c5"),
|
|
||||||
"surfaceTint": getMatugenColor("surface_tint", "#8ab4f8"),
|
|
||||||
"background": getMatugenColor("background", "#1a1c1e"),
|
|
||||||
"backgroundText": getMatugenColor("on_background", "#e3e8ef"),
|
|
||||||
"outline": getMatugenColor("outline", "#8e918f"),
|
|
||||||
"surfaceContainer": getMatugenColor("surface_container", "#1e2023"),
|
|
||||||
"surfaceContainerHigh": getMatugenColor("surface_container_high", "#292b2f"),
|
|
||||||
"error": "#F2B8B5",
|
|
||||||
"warning": "#FF9800",
|
|
||||||
"info": "#2196F3",
|
|
||||||
"success": "#4CAF50"
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return StockThemes.getThemeByName(currentTheme, isLightMode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
property color primary: currentThemeData.primary
|
|
||||||
property color primaryText: currentThemeData.primaryText
|
|
||||||
property color primaryContainer: currentThemeData.primaryContainer
|
|
||||||
property color secondary: currentThemeData.secondary
|
|
||||||
property color surface: currentThemeData.surface
|
|
||||||
property color surfaceText: currentThemeData.surfaceText
|
|
||||||
property color surfaceVariant: currentThemeData.surfaceVariant
|
|
||||||
property color surfaceVariantText: currentThemeData.surfaceVariantText
|
|
||||||
property color surfaceTint: currentThemeData.surfaceTint
|
|
||||||
property color background: currentThemeData.background
|
|
||||||
property color backgroundText: currentThemeData.backgroundText
|
|
||||||
property color outline: currentThemeData.outline
|
|
||||||
property color outlineVariant: currentThemeData.outlineVariant || Qt.rgba(outline.r, outline.g, outline.b, 0.6)
|
|
||||||
property color surfaceContainer: currentThemeData.surfaceContainer
|
|
||||||
property color surfaceContainerHigh: currentThemeData.surfaceContainerHigh
|
|
||||||
|
|
||||||
property color onSurface: surfaceText
|
|
||||||
property color onSurfaceVariant: surfaceVariantText
|
|
||||||
property color onPrimary: primaryText
|
|
||||||
property color onSurface_12: Qt.rgba(onSurface.r, onSurface.g, onSurface.b, 0.12)
|
|
||||||
property color onSurface_38: Qt.rgba(onSurface.r, onSurface.g, onSurface.b, 0.38)
|
|
||||||
property color onSurfaceVariant_30: Qt.rgba(onSurfaceVariant.r, onSurfaceVariant.g, onSurfaceVariant.b, 0.30)
|
|
||||||
|
|
||||||
property color error: currentThemeData.error || "#F2B8B5"
|
|
||||||
property color warning: currentThemeData.warning || "#FF9800"
|
|
||||||
property color info: currentThemeData.info || "#2196F3"
|
|
||||||
property color tempWarning: "#ff9933"
|
|
||||||
property color tempDanger: "#ff5555"
|
|
||||||
property color success: currentThemeData.success || "#4CAF50"
|
|
||||||
|
|
||||||
property color primaryHover: Qt.rgba(primary.r, primary.g, primary.b, 0.12)
|
|
||||||
property color primaryHoverLight: Qt.rgba(primary.r, primary.g, primary.b, 0.08)
|
|
||||||
property color primaryPressed: Qt.rgba(primary.r, primary.g, primary.b, 0.16)
|
|
||||||
property color primarySelected: Qt.rgba(primary.r, primary.g, primary.b, 0.3)
|
|
||||||
property color primaryBackground: Qt.rgba(primary.r, primary.g, primary.b, 0.04)
|
|
||||||
|
|
||||||
property color secondaryHover: Qt.rgba(secondary.r, secondary.g, secondary.b, 0.08)
|
|
||||||
|
|
||||||
property color surfaceHover: Qt.rgba(surfaceVariant.r, surfaceVariant.g, surfaceVariant.b, 0.08)
|
|
||||||
property color surfacePressed: Qt.rgba(surfaceVariant.r, surfaceVariant.g, surfaceVariant.b, 0.12)
|
|
||||||
property color surfaceSelected: Qt.rgba(surfaceVariant.r, surfaceVariant.g, surfaceVariant.b, 0.15)
|
|
||||||
property color surfaceLight: Qt.rgba(surfaceVariant.r, surfaceVariant.g, surfaceVariant.b, 0.1)
|
|
||||||
property color surfaceVariantAlpha: Qt.rgba(surfaceVariant.r, surfaceVariant.g, surfaceVariant.b, 0.2)
|
|
||||||
property color surfaceTextHover: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.08)
|
|
||||||
property color surfaceTextAlpha: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.3)
|
|
||||||
property color surfaceTextLight: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.06)
|
|
||||||
property color surfaceTextMedium: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.7)
|
|
||||||
|
|
||||||
property color outlineButton: Qt.rgba(outline.r, outline.g, outline.b, 0.5)
|
|
||||||
property color outlineLight: Qt.rgba(outline.r, outline.g, outline.b, 0.05)
|
|
||||||
property color outlineMedium: Qt.rgba(outline.r, outline.g, outline.b, 0.08)
|
|
||||||
property color outlineStrong: Qt.rgba(outline.r, outline.g, outline.b, 0.12)
|
|
||||||
|
|
||||||
property color errorHover: Qt.rgba(error.r, error.g, error.b, 0.12)
|
|
||||||
property color errorPressed: Qt.rgba(error.r, error.g, error.b, 0.16)
|
|
||||||
|
|
||||||
property color shadowMedium: Qt.rgba(0, 0, 0, 0.08)
|
|
||||||
property color shadowStrong: Qt.rgba(0, 0, 0, 0.3)
|
|
||||||
|
|
||||||
property int shorterDuration: 100
|
|
||||||
property int shortDuration: 150
|
|
||||||
property int mediumDuration: 300
|
|
||||||
property int longDuration: 500
|
|
||||||
property int extraLongDuration: 1000
|
|
||||||
property int standardEasing: Easing.OutCubic
|
|
||||||
property int emphasizedEasing: Easing.OutQuart
|
|
||||||
|
|
||||||
property real cornerRadius: typeof SettingsData !== "undefined" ? SettingsData.cornerRadius : 12
|
|
||||||
property real spacingXS: 4
|
|
||||||
property real spacingS: 8
|
|
||||||
property real spacingM: 12
|
|
||||||
property real spacingL: 16
|
|
||||||
property real spacingXL: 24
|
|
||||||
property real fontSizeSmall: (typeof SettingsData !== "undefined" ? SettingsData.fontScale : 1.0) * 12
|
|
||||||
property real fontSizeMedium: (typeof SettingsData !== "undefined" ? SettingsData.fontScale : 1.0) * 14
|
|
||||||
property real fontSizeLarge: (typeof SettingsData !== "undefined" ? SettingsData.fontScale : 1.0) * 16
|
|
||||||
property real fontSizeXLarge: (typeof SettingsData !== "undefined" ? SettingsData.fontScale : 1.0) * 20
|
|
||||||
property real barHeight: 48
|
|
||||||
property real iconSize: 24
|
|
||||||
property real iconSizeSmall: 16
|
|
||||||
property real iconSizeLarge: 32
|
|
||||||
|
|
||||||
property real panelTransparency: 0.85
|
|
||||||
property real widgetTransparency: typeof SettingsData !== "undefined" && SettingsData.topBarWidgetTransparency !== undefined ? SettingsData.topBarWidgetTransparency : 0.85
|
|
||||||
property real popupTransparency: typeof SettingsData !== "undefined" && SettingsData.popupTransparency !== undefined ? SettingsData.popupTransparency : 0.92
|
|
||||||
|
|
||||||
function screenTransition() {
|
|
||||||
CompositorService.isNiri && NiriService.doScreenTransition()
|
|
||||||
}
|
|
||||||
|
|
||||||
function switchTheme(themeName, savePrefs = true, enableTransition = true) {
|
|
||||||
if (enableTransition) {
|
|
||||||
screenTransition()
|
|
||||||
}
|
|
||||||
if (themeName === dynamic) {
|
|
||||||
currentTheme = dynamic
|
|
||||||
currentThemeCategory = dynamic
|
|
||||||
extractColors()
|
|
||||||
} else if (themeName === custom) {
|
|
||||||
currentTheme = custom
|
|
||||||
currentThemeCategory = custom
|
|
||||||
if (typeof SettingsData !== "undefined" && SettingsData.customThemeFile) {
|
|
||||||
loadCustomThemeFromFile(SettingsData.customThemeFile)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
currentTheme = themeName
|
|
||||||
// Determine category based on theme name
|
|
||||||
if (StockThemes.isCatppuccinVariant(themeName)) {
|
|
||||||
currentThemeCategory = "catppuccin"
|
|
||||||
} else {
|
|
||||||
currentThemeCategory = "generic"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (savePrefs && typeof SettingsData !== "undefined")
|
|
||||||
SettingsData.setTheme(currentTheme)
|
|
||||||
|
|
||||||
generateSystemThemesFromCurrentTheme()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setLightMode(light, savePrefs = true) {
|
|
||||||
screenTransition()
|
|
||||||
isLightMode = light
|
|
||||||
if (savePrefs && typeof SessionData !== "undefined")
|
|
||||||
SessionData.setLightMode(isLightMode)
|
|
||||||
PortalService.setLightMode(isLightMode)
|
|
||||||
generateSystemThemesFromCurrentTheme()
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleLightMode(savePrefs = true) {
|
|
||||||
setLightMode(!isLightMode, savePrefs)
|
|
||||||
}
|
|
||||||
|
|
||||||
function forceGenerateSystemThemes() {
|
|
||||||
screenTransition()
|
|
||||||
if (!matugenAvailable) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.showWarning("matugen not available - cannot generate system themes")
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
generateSystemThemesFromCurrentTheme()
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAvailableThemes() {
|
|
||||||
return StockThemes.getAllThemeNames()
|
|
||||||
}
|
|
||||||
|
|
||||||
function getThemeDisplayName(themeName) {
|
|
||||||
const themeData = StockThemes.getThemeByName(themeName, isLightMode)
|
|
||||||
return themeData.name
|
|
||||||
}
|
|
||||||
|
|
||||||
function getThemeColors(themeName) {
|
|
||||||
if (themeName === "custom" && customThemeData) {
|
|
||||||
return customThemeData
|
|
||||||
}
|
|
||||||
return StockThemes.getThemeByName(themeName, isLightMode)
|
|
||||||
}
|
|
||||||
|
|
||||||
function switchThemeCategory(category, defaultTheme) {
|
|
||||||
currentThemeCategory = category
|
|
||||||
switchTheme(defaultTheme, true, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCatppuccinColor(variantName) {
|
|
||||||
const catColors = {
|
|
||||||
"cat-rosewater": "#f5e0dc", "cat-flamingo": "#f2cdcd", "cat-pink": "#f5c2e7", "cat-mauve": "#cba6f7",
|
|
||||||
"cat-red": "#f38ba8", "cat-maroon": "#eba0ac", "cat-peach": "#fab387", "cat-yellow": "#f9e2af",
|
|
||||||
"cat-green": "#a6e3a1", "cat-teal": "#94e2d5", "cat-sky": "#89dceb", "cat-sapphire": "#74c7ec",
|
|
||||||
"cat-blue": "#89b4fa", "cat-lavender": "#b4befe"
|
|
||||||
}
|
|
||||||
return catColors[variantName] || "#cba6f7"
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCatppuccinVariantName(variantName) {
|
|
||||||
const catNames = {
|
|
||||||
"cat-rosewater": "Rosewater", "cat-flamingo": "Flamingo", "cat-pink": "Pink", "cat-mauve": "Mauve",
|
|
||||||
"cat-red": "Red", "cat-maroon": "Maroon", "cat-peach": "Peach", "cat-yellow": "Yellow",
|
|
||||||
"cat-green": "Green", "cat-teal": "Teal", "cat-sky": "Sky", "cat-sapphire": "Sapphire",
|
|
||||||
"cat-blue": "Blue", "cat-lavender": "Lavender"
|
|
||||||
}
|
|
||||||
return catNames[variantName] || "Unknown"
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadCustomTheme(themeData) {
|
|
||||||
screenTransition()
|
|
||||||
if (themeData.dark || themeData.light) {
|
|
||||||
const colorMode = (typeof SessionData !== "undefined" && SessionData.isLightMode) ? "light" : "dark"
|
|
||||||
const selectedTheme = themeData[colorMode] || themeData.dark || themeData.light
|
|
||||||
customThemeData = selectedTheme
|
|
||||||
} else {
|
|
||||||
customThemeData = themeData
|
|
||||||
}
|
|
||||||
|
|
||||||
generateSystemThemesFromCurrentTheme()
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadCustomThemeFromFile(filePath) {
|
|
||||||
customThemeFileView.path = filePath
|
|
||||||
}
|
|
||||||
|
|
||||||
property alias availableThemeNames: root._availableThemeNames
|
|
||||||
readonly property var _availableThemeNames: StockThemes.getAllThemeNames()
|
|
||||||
property string currentThemeName: currentTheme
|
|
||||||
|
|
||||||
function popupBackground() {
|
|
||||||
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, popupTransparency)
|
|
||||||
}
|
|
||||||
|
|
||||||
function contentBackground() {
|
|
||||||
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, popupTransparency)
|
|
||||||
}
|
|
||||||
|
|
||||||
function panelBackground() {
|
|
||||||
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, panelTransparency)
|
|
||||||
}
|
|
||||||
|
|
||||||
property real notepadTransparency: SettingsData.notepadTransparencyOverride >= 0 ? SettingsData.notepadTransparencyOverride : popupTransparency
|
|
||||||
|
|
||||||
property var widgetBaseBackgroundColor: {
|
|
||||||
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sth"
|
|
||||||
switch (colorMode) {
|
|
||||||
case "s":
|
|
||||||
return surface
|
|
||||||
case "sc":
|
|
||||||
return surfaceContainer
|
|
||||||
case "sch":
|
|
||||||
return surfaceContainerHigh
|
|
||||||
case "sth":
|
|
||||||
default:
|
|
||||||
return surfaceTextHover
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
property var widgetBaseHoverColor: {
|
|
||||||
const baseColor = widgetBaseBackgroundColor
|
|
||||||
const factor = 1.2
|
|
||||||
return isLightMode ? Qt.darker(baseColor, factor) : Qt.lighter(baseColor, factor)
|
|
||||||
}
|
|
||||||
|
|
||||||
property var widgetBackground: {
|
|
||||||
const colorMode = typeof SettingsData !== "undefined" ? SettingsData.widgetBackgroundColor : "sth"
|
|
||||||
switch (colorMode) {
|
|
||||||
case "s":
|
|
||||||
return Qt.rgba(surface.r, surface.g, surface.b, widgetTransparency)
|
|
||||||
case "sc":
|
|
||||||
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency)
|
|
||||||
case "sch":
|
|
||||||
return Qt.rgba(surfaceContainerHigh.r, surfaceContainerHigh.g, surfaceContainerHigh.b, widgetTransparency)
|
|
||||||
case "sth":
|
|
||||||
default:
|
|
||||||
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, widgetTransparency)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPopupBackgroundAlpha() {
|
|
||||||
return popupTransparency
|
|
||||||
}
|
|
||||||
|
|
||||||
function getContentBackgroundAlpha() {
|
|
||||||
return popupTransparency
|
|
||||||
}
|
|
||||||
|
|
||||||
function isColorDark(c) {
|
|
||||||
return (0.299 * c.r + 0.587 * c.g + 0.114 * c.b) < 0.5
|
|
||||||
}
|
|
||||||
|
|
||||||
function getBatteryIcon(level, isCharging, batteryAvailable) {
|
|
||||||
if (!batteryAvailable)
|
|
||||||
return _getBatteryPowerProfileIcon()
|
|
||||||
|
|
||||||
if (isCharging) {
|
|
||||||
if (level >= 90)
|
|
||||||
return "battery_charging_full"
|
|
||||||
if (level >= 80)
|
|
||||||
return "battery_charging_90"
|
|
||||||
if (level >= 60)
|
|
||||||
return "battery_charging_80"
|
|
||||||
if (level >= 50)
|
|
||||||
return "battery_charging_60"
|
|
||||||
if (level >= 30)
|
|
||||||
return "battery_charging_50"
|
|
||||||
if (level >= 20)
|
|
||||||
return "battery_charging_30"
|
|
||||||
return "battery_charging_20"
|
|
||||||
} else {
|
|
||||||
if (level >= 95)
|
|
||||||
return "battery_full"
|
|
||||||
if (level >= 85)
|
|
||||||
return "battery_6_bar"
|
|
||||||
if (level >= 70)
|
|
||||||
return "battery_5_bar"
|
|
||||||
if (level >= 55)
|
|
||||||
return "battery_4_bar"
|
|
||||||
if (level >= 40)
|
|
||||||
return "battery_3_bar"
|
|
||||||
if (level >= 25)
|
|
||||||
return "battery_2_bar"
|
|
||||||
if (level >= 10)
|
|
||||||
return "battery_1_bar"
|
|
||||||
return "battery_alert"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _getBatteryPowerProfileIcon() {
|
|
||||||
if (typeof PowerProfiles === "undefined")
|
|
||||||
return "balance"
|
|
||||||
|
|
||||||
switch (PowerProfiles.profile) {
|
|
||||||
case PowerProfile.PowerSaver:
|
|
||||||
return "energy_savings_leaf"
|
|
||||||
case PowerProfile.Performance:
|
|
||||||
return "rocket_launch"
|
|
||||||
default:
|
|
||||||
return "balance"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPowerProfileIcon(profile) {
|
|
||||||
switch (profile) {
|
|
||||||
case PowerProfile.PowerSaver:
|
|
||||||
return "battery_saver"
|
|
||||||
case PowerProfile.Balanced:
|
|
||||||
return "battery_std"
|
|
||||||
case PowerProfile.Performance:
|
|
||||||
return "flash_on"
|
|
||||||
default:
|
|
||||||
return "settings"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPowerProfileLabel(profile) {
|
|
||||||
switch (profile) {
|
|
||||||
case PowerProfile.PowerSaver:
|
|
||||||
return "Power Saver"
|
|
||||||
case PowerProfile.Balanced:
|
|
||||||
return "Balanced"
|
|
||||||
case PowerProfile.Performance:
|
|
||||||
return "Performance"
|
|
||||||
default:
|
|
||||||
return profile.charAt(0).toUpperCase() + profile.slice(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPowerProfileDescription(profile) {
|
|
||||||
switch (profile) {
|
|
||||||
case PowerProfile.PowerSaver:
|
|
||||||
return "Extend battery life"
|
|
||||||
case PowerProfile.Balanced:
|
|
||||||
return "Balance power and performance"
|
|
||||||
case PowerProfile.Performance:
|
|
||||||
return "Prioritize performance"
|
|
||||||
default:
|
|
||||||
return "Custom power profile"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function extractColors() {
|
|
||||||
extractionRequested = true
|
|
||||||
if (matugenAvailable)
|
|
||||||
if (rawWallpaperPath.startsWith("we:")) {
|
|
||||||
fileCheckerTimer.start()
|
|
||||||
} else {
|
|
||||||
fileChecker.running = true
|
|
||||||
}
|
|
||||||
else
|
|
||||||
matugenCheck.running = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function onLightModeChanged() {
|
|
||||||
if (matugenColors && Object.keys(matugenColors).length > 0) {
|
|
||||||
colorUpdateTrigger++
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentTheme === "custom" && customThemeFileView.path) {
|
|
||||||
customThemeFileView.reload()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setDesiredTheme(kind, value, isLight, iconTheme, matugenType) {
|
|
||||||
if (!matugenAvailable) {
|
|
||||||
console.warn("matugen not available - cannot set system theme")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof NiriService !== "undefined" && CompositorService.isNiri) {
|
|
||||||
NiriService.suppressNextToast()
|
|
||||||
}
|
|
||||||
|
|
||||||
const desired = {
|
|
||||||
"kind": kind,
|
|
||||||
"value": value,
|
|
||||||
"mode": isLight ? "light" : "dark",
|
|
||||||
"iconTheme": iconTheme || "System Default",
|
|
||||||
"matugenType": matugenType || "scheme-tonal-spot"
|
|
||||||
}
|
|
||||||
|
|
||||||
const json = JSON.stringify(desired)
|
|
||||||
const desiredPath = stateDir + "/matugen.desired.json"
|
|
||||||
|
|
||||||
Quickshell.execDetached(["sh", "-c", `mkdir -p '${stateDir}' && cat > '${desiredPath}' << 'EOF'\n${json}\nEOF`])
|
|
||||||
workerRunning = true
|
|
||||||
if (rawWallpaperPath.startsWith("we:")) {
|
|
||||||
console.log("calling matugen worker")
|
|
||||||
systemThemeGenerator.command = [
|
|
||||||
"sh", "-c",
|
|
||||||
`sleep 1 && ${shellDir}/scripts/matugen-worker.sh '${stateDir}' '${shellDir}' --run`
|
|
||||||
]
|
|
||||||
} else {
|
|
||||||
systemThemeGenerator.command = [shellDir + "/scripts/matugen-worker.sh", stateDir, shellDir, "--run"]
|
|
||||||
}
|
|
||||||
systemThemeGenerator.running = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateSystemThemesFromCurrentTheme() {
|
|
||||||
if (!matugenAvailable)
|
|
||||||
return
|
|
||||||
|
|
||||||
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode)
|
|
||||||
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
|
|
||||||
|
|
||||||
if (currentTheme === dynamic) {
|
|
||||||
if (!wallpaperPath) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (wallpaperPath.startsWith("#")) {
|
|
||||||
setDesiredTheme("hex", wallpaperPath, isLight, iconTheme)
|
|
||||||
} else {
|
|
||||||
setDesiredTheme("image", wallpaperPath, isLight, iconTheme)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
let primaryColor
|
|
||||||
let matugenType
|
|
||||||
if (currentTheme === "custom") {
|
|
||||||
if (!customThemeData || !customThemeData.primary) {
|
|
||||||
console.warn("Custom theme data not available for system theme generation")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
primaryColor = customThemeData.primary
|
|
||||||
matugenType = customThemeData.matugen_type
|
|
||||||
} else {
|
|
||||||
primaryColor = currentThemeData.primary
|
|
||||||
matugenType = currentThemeData.matugen_type
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!primaryColor) {
|
|
||||||
console.warn("No primary color available for theme:", currentTheme)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
setDesiredTheme("hex", primaryColor, isLight, iconTheme, matugenType)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function applyGtkColors() {
|
|
||||||
if (!matugenAvailable) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.showError("matugen not available - cannot apply GTK colors")
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode) ? "true" : "false"
|
|
||||||
gtkApplier.command = [shellDir + "/scripts/gtk.sh", configDir, isLight, shellDir]
|
|
||||||
gtkApplier.running = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function applyQtColors() {
|
|
||||||
if (!matugenAvailable) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.showError("matugen not available - cannot apply Qt colors")
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
qtApplier.command = [shellDir + "/scripts/qt.sh", configDir]
|
|
||||||
qtApplier.running = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function extractJsonFromText(text) {
|
|
||||||
if (!text)
|
|
||||||
return null
|
|
||||||
|
|
||||||
const start = text.search(/[{\[]/)
|
|
||||||
if (start === -1)
|
|
||||||
return null
|
|
||||||
|
|
||||||
const open = text[start]
|
|
||||||
const pairs = {
|
|
||||||
"{": '}',
|
|
||||||
"[": ']'
|
|
||||||
}
|
|
||||||
const close = pairs[open]
|
|
||||||
if (!close)
|
|
||||||
return null
|
|
||||||
|
|
||||||
let inString = false
|
|
||||||
let escape = false
|
|
||||||
const stack = [open]
|
|
||||||
|
|
||||||
for (var i = start + 1; i < text.length; i++) {
|
|
||||||
const ch = text[i]
|
|
||||||
|
|
||||||
if (inString) {
|
|
||||||
if (escape) {
|
|
||||||
escape = false
|
|
||||||
} else if (ch === '\\') {
|
|
||||||
escape = true
|
|
||||||
} else if (ch === '"') {
|
|
||||||
inString = false
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ch === '"') {
|
|
||||||
inString = true
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if (ch === '{' || ch === '[') {
|
|
||||||
stack.push(ch)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if (ch === '}' || ch === ']') {
|
|
||||||
const last = stack.pop()
|
|
||||||
if (!last || pairs[last] !== ch) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
if (stack.length === 0) {
|
|
||||||
return text.slice(start, i + 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: matugenCheck
|
|
||||||
command: ["which", "matugen"]
|
|
||||||
onExited: code => {
|
|
||||||
matugenAvailable = (code === 0)
|
|
||||||
if (!matugenAvailable) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.wallpaperErrorStatus = "matugen_missing"
|
|
||||||
ToastService.showWarning("matugen not found - dynamic theming disabled")
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (extractionRequested) {
|
|
||||||
if (rawWallpaperPath.startsWith("we:")) {
|
|
||||||
fileCheckerTimer.start()
|
|
||||||
} else {
|
|
||||||
fileChecker.running = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode)
|
|
||||||
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
|
|
||||||
|
|
||||||
if (currentTheme === dynamic) {
|
|
||||||
if (wallpaperPath) {
|
|
||||||
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
|
|
||||||
if (wallpaperPath.startsWith("#")) {
|
|
||||||
setDesiredTheme("hex", wallpaperPath, isLight, iconTheme)
|
|
||||||
} else {
|
|
||||||
setDesiredTheme("image", wallpaperPath, isLight, iconTheme)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
let primaryColor
|
|
||||||
let matugenType
|
|
||||||
if (currentTheme === "custom") {
|
|
||||||
if (customThemeData && customThemeData.primary) {
|
|
||||||
primaryColor = customThemeData.primary
|
|
||||||
matugenType = customThemeData.matugen_type
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
primaryColor = currentThemeData.primary
|
|
||||||
matugenType = currentThemeData.matugen_type
|
|
||||||
}
|
|
||||||
|
|
||||||
if (primaryColor) {
|
|
||||||
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
|
|
||||||
setDesiredTheme("hex", primaryColor, isLight, iconTheme, matugenType)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: fileChecker
|
|
||||||
command: ["test", "-r", wallpaperPath]
|
|
||||||
onExited: code => {
|
|
||||||
if (code === 0) {
|
|
||||||
matugenProcess.running = true
|
|
||||||
} else if (wallpaperPath.startsWith("#")) {
|
|
||||||
colorMatugenProcess.running = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: fileCheckerTimer
|
|
||||||
interval: 1000
|
|
||||||
repeat: false
|
|
||||||
onTriggered: {
|
|
||||||
fileChecker.running = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: matugenProcess
|
|
||||||
command: ["matugen", "image", wallpaperPath, "--json", "hex"]
|
|
||||||
|
|
||||||
stdout: StdioCollector {
|
|
||||||
id: matugenCollector
|
|
||||||
onStreamFinished: {
|
|
||||||
if (!matugenCollector.text) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.wallpaperErrorStatus = "error"
|
|
||||||
ToastService.showError("Wallpaper Processing Failed: Empty JSON extracted from matugen output.")
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const extractedJson = extractJsonFromText(matugenCollector.text)
|
|
||||||
if (!extractedJson) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.wallpaperErrorStatus = "error"
|
|
||||||
ToastService.showError("Wallpaper Processing Failed: Invalid JSON extracted from matugen output.")
|
|
||||||
}
|
|
||||||
console.log("Raw matugen output:", matugenCollector.text)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
root.matugenColors = JSON.parse(extractedJson)
|
|
||||||
root.colorUpdateTrigger++
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.clearWallpaperError()
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.wallpaperErrorStatus = "error"
|
|
||||||
ToastService.showError("Wallpaper processing failed (JSON parse error after extraction)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onExited: code => {
|
|
||||||
if (code !== 0) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.wallpaperErrorStatus = "error"
|
|
||||||
ToastService.showError("Matugen command failed with exit code " + code)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: colorMatugenProcess
|
|
||||||
command: ["matugen", "color", "hex", wallpaperPath, "--json", "hex"]
|
|
||||||
|
|
||||||
stdout: StdioCollector {
|
|
||||||
id: colorMatugenCollector
|
|
||||||
onStreamFinished: {
|
|
||||||
if (!colorMatugenCollector.text) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.wallpaperErrorStatus = "error"
|
|
||||||
ToastService.showError("Color Processing Failed: Empty JSON extracted from matugen output.")
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const extractedJson = extractJsonFromText(colorMatugenCollector.text)
|
|
||||||
if (!extractedJson) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.wallpaperErrorStatus = "error"
|
|
||||||
ToastService.showError("Color Processing Failed: Invalid JSON extracted from matugen output.")
|
|
||||||
}
|
|
||||||
console.log("Raw matugen output:", colorMatugenCollector.text)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
root.matugenColors = JSON.parse(extractedJson)
|
|
||||||
root.colorUpdateTrigger++
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.clearWallpaperError()
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.wallpaperErrorStatus = "error"
|
|
||||||
ToastService.showError("Color processing failed (JSON parse error after extraction)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onExited: code => {
|
|
||||||
if (code !== 0) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.wallpaperErrorStatus = "error"
|
|
||||||
ToastService.showError("Matugen color command failed with exit code " + code)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: ensureStateDir
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: systemThemeGenerator
|
|
||||||
running: false
|
|
||||||
|
|
||||||
onExited: exitCode => {
|
|
||||||
workerRunning = false
|
|
||||||
|
|
||||||
if (exitCode === 2) {
|
|
||||||
// Exit code 2 means wallpaper/color not found - this is expected on first run
|
|
||||||
console.log("Theme worker: wallpaper/color not found, skipping theme generation")
|
|
||||||
} else if (exitCode !== 0) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.showError("Theme worker failed (" + exitCode + ")")
|
|
||||||
}
|
|
||||||
console.warn("Theme worker failed with exit code:", exitCode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: gtkApplier
|
|
||||||
running: false
|
|
||||||
|
|
||||||
stdout: StdioCollector {
|
|
||||||
id: gtkStdout
|
|
||||||
}
|
|
||||||
|
|
||||||
stderr: StdioCollector {
|
|
||||||
id: gtkStderr
|
|
||||||
}
|
|
||||||
|
|
||||||
onExited: exitCode => {
|
|
||||||
if (exitCode === 0) {
|
|
||||||
if (typeof ToastService !== "undefined" && typeof NiriService !== "undefined" && !NiriService.matugenSuppression) {
|
|
||||||
ToastService.showInfo("GTK colors applied successfully")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.showError("Failed to apply GTK colors: " + gtkStderr.text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: qtApplier
|
|
||||||
running: false
|
|
||||||
|
|
||||||
stdout: StdioCollector {
|
|
||||||
id: qtStdout
|
|
||||||
}
|
|
||||||
|
|
||||||
stderr: StdioCollector {
|
|
||||||
id: qtStderr
|
|
||||||
}
|
|
||||||
|
|
||||||
onExited: exitCode => {
|
|
||||||
if (exitCode === 0) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.showInfo("Qt colors applied successfully")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.showError("Failed to apply Qt colors: " + qtStderr.text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FileView {
|
|
||||||
id: customThemeFileView
|
|
||||||
watchChanges: currentTheme === "custom"
|
|
||||||
|
|
||||||
function parseAndLoadTheme() {
|
|
||||||
try {
|
|
||||||
var themeData = JSON.parse(customThemeFileView.text())
|
|
||||||
loadCustomTheme(themeData)
|
|
||||||
} catch (e) {
|
|
||||||
ToastService.showError("Invalid JSON format: " + e.message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onLoaded: {
|
|
||||||
parseAndLoadTheme()
|
|
||||||
}
|
|
||||||
|
|
||||||
onFileChanged: {
|
|
||||||
customThemeFileView.reload()
|
|
||||||
}
|
|
||||||
|
|
||||||
onLoadFailed: function (error) {
|
|
||||||
if (typeof ToastService !== "undefined") {
|
|
||||||
ToastService.showError("Failed to read theme file: " + error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IpcHandler {
|
|
||||||
target: "theme"
|
|
||||||
|
|
||||||
function toggle(): string {
|
|
||||||
root.toggleLightMode()
|
|
||||||
return root.isLightMode ? "light" : "dark"
|
|
||||||
}
|
|
||||||
|
|
||||||
function light(): string {
|
|
||||||
root.setLightMode(true)
|
|
||||||
return "light"
|
|
||||||
}
|
|
||||||
|
|
||||||
function dark(): string {
|
|
||||||
root.setLightMode(false)
|
|
||||||
return "dark"
|
|
||||||
}
|
|
||||||
|
|
||||||
function getMode(): string {
|
|
||||||
return root.isLightMode ? "light" : "dark"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
695
LICENSE
695
LICENSE
@@ -1,674 +1,21 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
MIT License
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
Copyright (c) 2025 Avenge Media LLC
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this license document, but changing it is not allowed.
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
Preamble
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
The GNU General Public License is a free, copyleft license for
|
furnished to do so, subject to the following conditions:
|
||||||
software and other kinds of works.
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
The licenses for most software and other practical works are designed
|
copies or substantial portions of the Software.
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
share and change all versions of a program--to make sure it remains free
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
GNU General Public License for most of our software; it applies also to
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
any other work released this way by its authors. You can apply it to
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
your programs, too.
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
||||||
|
|||||||
156
Makefile
Normal file
156
Makefile
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
# Root Makefile for DankMaterialShell (DMS)
|
||||||
|
# Orchestrates building, installation, and systemd management
|
||||||
|
|
||||||
|
# Build configuration
|
||||||
|
BINARY_NAME=dms
|
||||||
|
CORE_DIR=core
|
||||||
|
BUILD_DIR=$(CORE_DIR)/bin
|
||||||
|
PREFIX ?= /usr/local
|
||||||
|
INSTALL_DIR=$(PREFIX)/bin
|
||||||
|
DATA_DIR=$(PREFIX)/share
|
||||||
|
ICON_DIR=$(DATA_DIR)/icons/hicolor/scalable/apps
|
||||||
|
|
||||||
|
USER_HOME := $(if $(SUDO_USER),$(shell getent passwd $(SUDO_USER) | cut -d: -f6),$(HOME))
|
||||||
|
SYSTEMD_USER_DIR=$(USER_HOME)/.config/systemd/user
|
||||||
|
|
||||||
|
SHELL_DIR=quickshell
|
||||||
|
SHELL_INSTALL_DIR=$(DATA_DIR)/quickshell/dms
|
||||||
|
ASSETS_DIR=assets
|
||||||
|
APPLICATIONS_DIR=$(DATA_DIR)/applications
|
||||||
|
|
||||||
|
.PHONY: all build clean install install-bin install-shell install-completions install-systemd install-icon install-desktop uninstall uninstall-bin uninstall-shell uninstall-completions uninstall-systemd uninstall-icon uninstall-desktop help
|
||||||
|
|
||||||
|
all: build
|
||||||
|
|
||||||
|
build:
|
||||||
|
@echo "Building $(BINARY_NAME)..."
|
||||||
|
@$(MAKE) -C $(CORE_DIR) build
|
||||||
|
@echo "Build complete"
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@echo "Cleaning build artifacts..."
|
||||||
|
@$(MAKE) -C $(CORE_DIR) clean
|
||||||
|
@echo "Clean complete"
|
||||||
|
|
||||||
|
# Installation targets
|
||||||
|
install-bin:
|
||||||
|
@echo "Installing $(BINARY_NAME) to $(INSTALL_DIR)..."
|
||||||
|
@install -D -m 755 $(BUILD_DIR)/$(BINARY_NAME) $(INSTALL_DIR)/$(BINARY_NAME)
|
||||||
|
@echo "Binary installed"
|
||||||
|
|
||||||
|
install-shell:
|
||||||
|
@echo "Installing shell files to $(SHELL_INSTALL_DIR)..."
|
||||||
|
@mkdir -p $(SHELL_INSTALL_DIR)
|
||||||
|
@cp -r $(SHELL_DIR)/* $(SHELL_INSTALL_DIR)/
|
||||||
|
@rm -rf $(SHELL_INSTALL_DIR)/.git* $(SHELL_INSTALL_DIR)/.github
|
||||||
|
@$(MAKE) --no-print-directory -C $(CORE_DIR) print-version > $(SHELL_INSTALL_DIR)/VERSION
|
||||||
|
@echo "Shell files installed"
|
||||||
|
|
||||||
|
install-completions:
|
||||||
|
@echo "Installing shell completions..."
|
||||||
|
@mkdir -p $(DATA_DIR)/bash-completion/completions
|
||||||
|
@mkdir -p $(DATA_DIR)/zsh/site-functions
|
||||||
|
@mkdir -p $(DATA_DIR)/fish/vendor_completions.d
|
||||||
|
@$(BUILD_DIR)/$(BINARY_NAME) completion bash > $(DATA_DIR)/bash-completion/completions/dms 2>/dev/null || true
|
||||||
|
@$(BUILD_DIR)/$(BINARY_NAME) completion zsh > $(DATA_DIR)/zsh/site-functions/_dms 2>/dev/null || true
|
||||||
|
@$(BUILD_DIR)/$(BINARY_NAME) completion fish > $(DATA_DIR)/fish/vendor_completions.d/dms.fish 2>/dev/null || true
|
||||||
|
@echo "Shell completions installed"
|
||||||
|
|
||||||
|
install-systemd:
|
||||||
|
@echo "Installing systemd user service..."
|
||||||
|
@mkdir -p $(SYSTEMD_USER_DIR)
|
||||||
|
@if [ -n "$(SUDO_USER)" ]; then chown -R $(SUDO_USER):$(SUDO_USER) $(SYSTEMD_USER_DIR); fi
|
||||||
|
@sed 's|/usr/bin/dms|$(INSTALL_DIR)/dms|g' $(ASSETS_DIR)/systemd/dms.service > $(SYSTEMD_USER_DIR)/dms.service
|
||||||
|
@chmod 644 $(SYSTEMD_USER_DIR)/dms.service
|
||||||
|
@if [ -n "$(SUDO_USER)" ]; then chown $(SUDO_USER):$(SUDO_USER) $(SYSTEMD_USER_DIR)/dms.service; fi
|
||||||
|
@echo "Systemd service installed to $(SYSTEMD_USER_DIR)/dms.service"
|
||||||
|
|
||||||
|
install-icon:
|
||||||
|
@echo "Installing icon..."
|
||||||
|
@install -D -m 644 $(ASSETS_DIR)/danklogo.svg $(ICON_DIR)/danklogo.svg
|
||||||
|
@gtk-update-icon-cache -q $(DATA_DIR)/icons/hicolor 2>/dev/null || true
|
||||||
|
@echo "Icon installed"
|
||||||
|
|
||||||
|
install-desktop:
|
||||||
|
@echo "Installing desktop entry..."
|
||||||
|
@install -D -m 644 $(ASSETS_DIR)/dms-open.desktop $(APPLICATIONS_DIR)/dms-open.desktop
|
||||||
|
@update-desktop-database -q $(APPLICATIONS_DIR) 2>/dev/null || true
|
||||||
|
@echo "Desktop entry installed"
|
||||||
|
|
||||||
|
install: build install-bin install-shell install-completions install-systemd install-icon install-desktop
|
||||||
|
@echo ""
|
||||||
|
@echo "Installation complete!"
|
||||||
|
@echo ""
|
||||||
|
@echo "=== Cheers, the DMS Team! ==="
|
||||||
|
|
||||||
|
# Uninstallation targets
|
||||||
|
uninstall-bin:
|
||||||
|
@echo "Removing $(BINARY_NAME) from $(INSTALL_DIR)..."
|
||||||
|
@rm -f $(INSTALL_DIR)/$(BINARY_NAME)
|
||||||
|
@echo "Binary removed"
|
||||||
|
|
||||||
|
uninstall-shell:
|
||||||
|
@echo "Removing shell files from $(SHELL_INSTALL_DIR)..."
|
||||||
|
@rm -rf $(SHELL_INSTALL_DIR)
|
||||||
|
@echo "Shell files removed"
|
||||||
|
|
||||||
|
uninstall-completions:
|
||||||
|
@echo "Removing shell completions..."
|
||||||
|
@rm -f $(DATA_DIR)/bash-completion/completions/dms
|
||||||
|
@rm -f $(DATA_DIR)/zsh/site-functions/_dms
|
||||||
|
@rm -f $(DATA_DIR)/fish/vendor_completions.d/dms.fish
|
||||||
|
@echo "Shell completions removed"
|
||||||
|
|
||||||
|
uninstall-systemd:
|
||||||
|
@echo "Removing systemd user service..."
|
||||||
|
@rm -f $(SYSTEMD_USER_DIR)/dms.service
|
||||||
|
@echo "Systemd service removed"
|
||||||
|
@echo "Note: Stop/disable service manually if running: systemctl --user stop dms"
|
||||||
|
|
||||||
|
uninstall-icon:
|
||||||
|
@echo "Removing icon..."
|
||||||
|
@rm -f $(ICON_DIR)/danklogo.svg
|
||||||
|
@gtk-update-icon-cache -q $(DATA_DIR)/icons/hicolor 2>/dev/null || true
|
||||||
|
@echo "Icon removed"
|
||||||
|
|
||||||
|
uninstall-desktop:
|
||||||
|
@echo "Removing desktop entry..."
|
||||||
|
@rm -f $(APPLICATIONS_DIR)/dms-open.desktop
|
||||||
|
@update-desktop-database -q $(APPLICATIONS_DIR) 2>/dev/null || true
|
||||||
|
@echo "Desktop entry removed"
|
||||||
|
|
||||||
|
uninstall: uninstall-systemd uninstall-desktop uninstall-icon uninstall-completions uninstall-shell uninstall-bin
|
||||||
|
@echo ""
|
||||||
|
@echo "Uninstallation complete!"
|
||||||
|
|
||||||
|
# Target assist
|
||||||
|
help:
|
||||||
|
@echo "Available targets:"
|
||||||
|
@echo ""
|
||||||
|
@echo "Build:"
|
||||||
|
@echo " all (default) - Build the DMS binary"
|
||||||
|
@echo " build - Same as 'all'"
|
||||||
|
@echo " clean - Clean build artifacts"
|
||||||
|
@echo ""
|
||||||
|
@echo "Install:"
|
||||||
|
@echo " install - Build and install everything (requires sudo)"
|
||||||
|
@echo " install-bin - Install only the binary"
|
||||||
|
@echo " install-shell - Install only shell files"
|
||||||
|
@echo " install-completions - Install only shell completions"
|
||||||
|
@echo " install-systemd - Install only systemd service"
|
||||||
|
@echo " install-icon - Install only icon"
|
||||||
|
@echo " install-desktop - Install only desktop entry"
|
||||||
|
@echo ""
|
||||||
|
@echo "Uninstall:"
|
||||||
|
@echo " uninstall - Remove everything (requires sudo)"
|
||||||
|
@echo " uninstall-bin - Remove only the binary"
|
||||||
|
@echo " uninstall-shell - Remove only shell files"
|
||||||
|
@echo " uninstall-completions - Remove only shell completions"
|
||||||
|
@echo " uninstall-systemd - Remove only systemd service"
|
||||||
|
@echo " uninstall-icon - Remove only icon"
|
||||||
|
@echo " uninstall-desktop - Remove only desktop entry"
|
||||||
|
@echo ""
|
||||||
|
@echo "Usage:"
|
||||||
|
@echo " sudo make install - Build and install DMS"
|
||||||
|
@echo " sudo make uninstall - Remove DMS"
|
||||||
|
@echo " systemctl --user enable --now dms - Enable and start service"
|
||||||
@@ -1,216 +0,0 @@
|
|||||||
pragma ComponentBehavior: Bound
|
|
||||||
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modals.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
DankModal {
|
|
||||||
id: clipboardHistoryModal
|
|
||||||
|
|
||||||
property int totalCount: 0
|
|
||||||
property var clipboardEntries: []
|
|
||||||
property string searchText: ""
|
|
||||||
property int selectedIndex: 0
|
|
||||||
property bool keyboardNavigationActive: false
|
|
||||||
property bool showKeyboardHints: false
|
|
||||||
property Component clipboardContent
|
|
||||||
property int activeImageLoads: 0
|
|
||||||
readonly property int maxConcurrentLoads: 3
|
|
||||||
|
|
||||||
function updateFilteredModel() {
|
|
||||||
filteredClipboardModel.clear()
|
|
||||||
for (var i = 0; i < clipboardModel.count; i++) {
|
|
||||||
const entry = clipboardModel.get(i).entry
|
|
||||||
if (searchText.trim().length === 0) {
|
|
||||||
filteredClipboardModel.append({
|
|
||||||
"entry": entry
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
const content = getEntryPreview(entry).toLowerCase()
|
|
||||||
if (content.includes(searchText.toLowerCase())) {
|
|
||||||
filteredClipboardModel.append({
|
|
||||||
"entry": entry
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
clipboardHistoryModal.totalCount = filteredClipboardModel.count
|
|
||||||
if (filteredClipboardModel.count === 0) {
|
|
||||||
keyboardNavigationActive = false
|
|
||||||
selectedIndex = 0
|
|
||||||
} else if (selectedIndex >= filteredClipboardModel.count) {
|
|
||||||
selectedIndex = filteredClipboardModel.count - 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle() {
|
|
||||||
if (shouldBeVisible) {
|
|
||||||
hide()
|
|
||||||
} else {
|
|
||||||
show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function show() {
|
|
||||||
open()
|
|
||||||
clipboardHistoryModal.searchText = ""
|
|
||||||
clipboardHistoryModal.activeImageLoads = 0
|
|
||||||
refreshClipboard()
|
|
||||||
keyboardController.reset()
|
|
||||||
|
|
||||||
Qt.callLater(function () {
|
|
||||||
if (contentLoader.item && contentLoader.item.searchField) {
|
|
||||||
contentLoader.item.searchField.text = ""
|
|
||||||
contentLoader.item.searchField.forceActiveFocus()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function hide() {
|
|
||||||
close()
|
|
||||||
clipboardHistoryModal.searchText = ""
|
|
||||||
clipboardHistoryModal.activeImageLoads = 0
|
|
||||||
updateFilteredModel()
|
|
||||||
keyboardController.reset()
|
|
||||||
cleanupTempFiles()
|
|
||||||
}
|
|
||||||
|
|
||||||
function cleanupTempFiles() {
|
|
||||||
Quickshell.execDetached(["sh", "-c", "rm -f /tmp/clipboard_*.png"])
|
|
||||||
}
|
|
||||||
|
|
||||||
function refreshClipboard() {
|
|
||||||
clipboardProcesses.refresh()
|
|
||||||
}
|
|
||||||
|
|
||||||
function copyEntry(entry) {
|
|
||||||
const entryId = entry.split('\t')[0]
|
|
||||||
Quickshell.execDetached(["sh", "-c", `cliphist decode ${entryId} | wl-copy`])
|
|
||||||
ToastService.showInfo("Copied to clipboard")
|
|
||||||
hide()
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteEntry(entry) {
|
|
||||||
clipboardProcesses.deleteEntry(entry)
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearAll() {
|
|
||||||
clipboardProcesses.clearAll()
|
|
||||||
}
|
|
||||||
|
|
||||||
function getEntryPreview(entry) {
|
|
||||||
let content = entry.replace(/^\s*\d+\s+/, "")
|
|
||||||
if (content.includes("image/") || content.includes("binary data") || /\.(png|jpg|jpeg|gif|bmp|webp)/i.test(content)) {
|
|
||||||
const dimensionMatch = content.match(/(\d+)x(\d+)/)
|
|
||||||
if (dimensionMatch) {
|
|
||||||
return `Image ${dimensionMatch[1]}×${dimensionMatch[2]}`
|
|
||||||
}
|
|
||||||
const typeMatch = content.match(/\b(png|jpg|jpeg|gif|bmp|webp)\b/i)
|
|
||||||
if (typeMatch) {
|
|
||||||
return `Image (${typeMatch[1].toUpperCase()})`
|
|
||||||
}
|
|
||||||
return "Image"
|
|
||||||
}
|
|
||||||
if (content.length > ClipboardConstants.previewLength) {
|
|
||||||
return content.substring(0, ClipboardConstants.previewLength) + "..."
|
|
||||||
}
|
|
||||||
return content
|
|
||||||
}
|
|
||||||
|
|
||||||
function getEntryType(entry) {
|
|
||||||
if (entry.includes("image/") || entry.includes("binary data") || /\.(png|jpg|jpeg|gif|bmp|webp)/i.test(entry) || /\b(png|jpg|jpeg|gif|bmp|webp)\b/i.test(entry)) {
|
|
||||||
return "image"
|
|
||||||
}
|
|
||||||
if (entry.length > ClipboardConstants.longTextThreshold) {
|
|
||||||
return "long_text"
|
|
||||||
}
|
|
||||||
return "text"
|
|
||||||
}
|
|
||||||
|
|
||||||
visible: false
|
|
||||||
width: ClipboardConstants.modalWidth
|
|
||||||
height: ClipboardConstants.modalHeight
|
|
||||||
backgroundColor: Theme.popupBackground()
|
|
||||||
cornerRadius: Theme.cornerRadius
|
|
||||||
borderColor: Theme.outlineMedium
|
|
||||||
borderWidth: 1
|
|
||||||
enableShadow: true
|
|
||||||
onBackgroundClicked: hide()
|
|
||||||
modalFocusScope.Keys.onPressed: function (event) {
|
|
||||||
keyboardController.handleKey(event)
|
|
||||||
}
|
|
||||||
content: clipboardContent
|
|
||||||
|
|
||||||
ClipboardKeyboardController {
|
|
||||||
id: keyboardController
|
|
||||||
modal: clipboardHistoryModal
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfirmModal {
|
|
||||||
id: clearConfirmDialog
|
|
||||||
confirmButtonText: "Clear All"
|
|
||||||
confirmButtonColor: Theme.primary
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (visible) {
|
|
||||||
clipboardHistoryModal.shouldHaveFocus = false
|
|
||||||
} else if (clipboardHistoryModal.shouldBeVisible) {
|
|
||||||
clipboardHistoryModal.shouldHaveFocus = true
|
|
||||||
clipboardHistoryModal.modalFocusScope.forceActiveFocus()
|
|
||||||
if (clipboardHistoryModal.contentLoader.item && clipboardHistoryModal.contentLoader.item.searchField) {
|
|
||||||
clipboardHistoryModal.contentLoader.item.searchField.forceActiveFocus()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
property alias filteredClipboardModel: filteredClipboardModel
|
|
||||||
property alias clipboardModel: clipboardModel
|
|
||||||
property var confirmDialog: clearConfirmDialog
|
|
||||||
|
|
||||||
ListModel {
|
|
||||||
id: clipboardModel
|
|
||||||
}
|
|
||||||
|
|
||||||
ListModel {
|
|
||||||
id: filteredClipboardModel
|
|
||||||
}
|
|
||||||
|
|
||||||
ClipboardProcesses {
|
|
||||||
id: clipboardProcesses
|
|
||||||
modal: clipboardHistoryModal
|
|
||||||
clipboardModel: clipboardModel
|
|
||||||
filteredClipboardModel: filteredClipboardModel
|
|
||||||
}
|
|
||||||
|
|
||||||
IpcHandler {
|
|
||||||
function open(): string {
|
|
||||||
clipboardHistoryModal.show()
|
|
||||||
return "CLIPBOARD_OPEN_SUCCESS"
|
|
||||||
}
|
|
||||||
|
|
||||||
function close(): string {
|
|
||||||
clipboardHistoryModal.hide()
|
|
||||||
return "CLIPBOARD_CLOSE_SUCCESS"
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle(): string {
|
|
||||||
clipboardHistoryModal.toggle()
|
|
||||||
return "CLIPBOARD_TOGGLE_SUCCESS"
|
|
||||||
}
|
|
||||||
|
|
||||||
target: "clipboard"
|
|
||||||
}
|
|
||||||
|
|
||||||
clipboardContent: Component {
|
|
||||||
ClipboardContent {
|
|
||||||
modal: clipboardHistoryModal
|
|
||||||
filteredModel: filteredClipboardModel
|
|
||||||
clearConfirmDialog: clipboardHistoryModal.confirmDialog
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: keyboardController
|
|
||||||
|
|
||||||
required property var modal
|
|
||||||
|
|
||||||
function reset() {
|
|
||||||
modal.selectedIndex = 0
|
|
||||||
modal.keyboardNavigationActive = false
|
|
||||||
modal.showKeyboardHints = false
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectNext() {
|
|
||||||
if (!modal.filteredClipboardModel || modal.filteredClipboardModel.count === 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
modal.keyboardNavigationActive = true
|
|
||||||
modal.selectedIndex = Math.min(modal.selectedIndex + 1, modal.filteredClipboardModel.count - 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectPrevious() {
|
|
||||||
if (!modal.filteredClipboardModel || modal.filteredClipboardModel.count === 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
modal.keyboardNavigationActive = true
|
|
||||||
modal.selectedIndex = Math.max(modal.selectedIndex - 1, 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
function copySelected() {
|
|
||||||
if (!modal.filteredClipboardModel || modal.filteredClipboardModel.count === 0 || modal.selectedIndex < 0 || modal.selectedIndex >= modal.filteredClipboardModel.count) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const selectedEntry = modal.filteredClipboardModel.get(modal.selectedIndex).entry
|
|
||||||
modal.copyEntry(selectedEntry)
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteSelected() {
|
|
||||||
if (!modal.filteredClipboardModel || modal.filteredClipboardModel.count === 0 || modal.selectedIndex < 0 || modal.selectedIndex >= modal.filteredClipboardModel.count) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const selectedEntry = modal.filteredClipboardModel.get(modal.selectedIndex).entry
|
|
||||||
modal.deleteEntry(selectedEntry)
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleKey(event) {
|
|
||||||
if (event.key === Qt.Key_Escape) {
|
|
||||||
if (modal.keyboardNavigationActive) {
|
|
||||||
modal.keyboardNavigationActive = false
|
|
||||||
event.accepted = true
|
|
||||||
} else {
|
|
||||||
modal.hide()
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
} else if (event.key === Qt.Key_Down) {
|
|
||||||
if (!modal.keyboardNavigationActive) {
|
|
||||||
modal.keyboardNavigationActive = true
|
|
||||||
modal.selectedIndex = 0
|
|
||||||
event.accepted = true
|
|
||||||
} else {
|
|
||||||
selectNext()
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
} else if (event.key === Qt.Key_Up) {
|
|
||||||
if (!modal.keyboardNavigationActive) {
|
|
||||||
modal.keyboardNavigationActive = true
|
|
||||||
modal.selectedIndex = 0
|
|
||||||
event.accepted = true
|
|
||||||
} else if (modal.selectedIndex === 0) {
|
|
||||||
modal.keyboardNavigationActive = false
|
|
||||||
event.accepted = true
|
|
||||||
} else {
|
|
||||||
selectPrevious()
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
} else if (event.key === Qt.Key_Delete && (event.modifiers & Qt.ShiftModifier)) {
|
|
||||||
modal.clearAll()
|
|
||||||
modal.hide()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (modal.keyboardNavigationActive) {
|
|
||||||
if ((event.key === Qt.Key_C && (event.modifiers & Qt.ControlModifier)) || event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
|
|
||||||
copySelected()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Delete) {
|
|
||||||
deleteSelected()
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (event.key === Qt.Key_F10) {
|
|
||||||
modal.showKeyboardHints = !modal.showKeyboardHints
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import Quickshell.Io
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: clipboardProcesses
|
|
||||||
|
|
||||||
required property var modal
|
|
||||||
required property var clipboardModel
|
|
||||||
required property var filteredClipboardModel
|
|
||||||
|
|
||||||
// Load clipboard entries
|
|
||||||
property var loadProcess: Process {
|
|
||||||
id: loadProcess
|
|
||||||
command: ["cliphist", "list"]
|
|
||||||
running: false
|
|
||||||
|
|
||||||
stdout: StdioCollector {
|
|
||||||
onStreamFinished: {
|
|
||||||
clipboardModel.clear()
|
|
||||||
const lines = text.trim().split('\n')
|
|
||||||
for (const line of lines) {
|
|
||||||
if (line.trim().length > 0) {
|
|
||||||
clipboardModel.append({
|
|
||||||
"entry": line
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
modal.updateFilteredModel()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete single entry
|
|
||||||
property var deleteProcess: Process {
|
|
||||||
id: deleteProcess
|
|
||||||
property string deletedEntry: ""
|
|
||||||
running: false
|
|
||||||
|
|
||||||
onExited: exitCode => {
|
|
||||||
if (exitCode === 0) {
|
|
||||||
for (var i = 0; i < clipboardModel.count; i++) {
|
|
||||||
if (clipboardModel.get(i).entry === deleteProcess.deletedEntry) {
|
|
||||||
clipboardModel.remove(i)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (var j = 0; j < filteredClipboardModel.count; j++) {
|
|
||||||
if (filteredClipboardModel.get(j).entry === deleteProcess.deletedEntry) {
|
|
||||||
filteredClipboardModel.remove(j)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
modal.totalCount = filteredClipboardModel.count
|
|
||||||
if (filteredClipboardModel.count === 0) {
|
|
||||||
modal.keyboardNavigationActive = false
|
|
||||||
modal.selectedIndex = 0
|
|
||||||
} else if (modal.selectedIndex >= filteredClipboardModel.count) {
|
|
||||||
modal.selectedIndex = filteredClipboardModel.count - 1
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.warn("Failed to delete clipboard entry")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear all entries
|
|
||||||
property var clearProcess: Process {
|
|
||||||
id: clearProcess
|
|
||||||
command: ["cliphist", "wipe"]
|
|
||||||
running: false
|
|
||||||
|
|
||||||
onExited: exitCode => {
|
|
||||||
if (exitCode === 0) {
|
|
||||||
clipboardModel.clear()
|
|
||||||
filteredClipboardModel.clear()
|
|
||||||
modal.totalCount = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function refresh() {
|
|
||||||
loadProcess.running = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteEntry(entry) {
|
|
||||||
deleteProcess.deletedEntry = entry
|
|
||||||
deleteProcess.command = ["sh", "-c", `echo '${entry.replace(/'/g, "'\\''")}' | cliphist delete`]
|
|
||||||
deleteProcess.running = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearAll() {
|
|
||||||
clearProcess.running = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import Qt.labs.platform
|
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: colorPickerModal
|
|
||||||
|
|
||||||
signal colorSelected(color selectedColor)
|
|
||||||
|
|
||||||
function show() {
|
|
||||||
colorDialog.open()
|
|
||||||
}
|
|
||||||
|
|
||||||
function hide() {
|
|
||||||
colorDialog.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
function copyColorToClipboard(colorValue) {
|
|
||||||
Quickshell.execDetached(["sh", "-c", `echo "${colorValue}" | wl-copy`])
|
|
||||||
ToastService.showInfo(`Color ${colorValue} copied to clipboard`)
|
|
||||||
console.log("Copied color to clipboard:", colorValue)
|
|
||||||
}
|
|
||||||
|
|
||||||
ColorDialog {
|
|
||||||
id: colorDialog
|
|
||||||
title: "Color Picker - Select and copy color"
|
|
||||||
color: Theme.primary
|
|
||||||
|
|
||||||
onAccepted: {
|
|
||||||
const colorString = color.toString()
|
|
||||||
copyColorToClipboard(colorString)
|
|
||||||
colorSelected(color)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,234 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Effects
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import qs.Common
|
|
||||||
|
|
||||||
PanelWindow {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
WlrLayershell.namespace: "quickshell:modal"
|
|
||||||
|
|
||||||
property alias content: contentLoader.sourceComponent
|
|
||||||
property alias contentLoader: contentLoader
|
|
||||||
property real width: 400
|
|
||||||
property real height: 300
|
|
||||||
readonly property real screenWidth: screen ? screen.width : 1920
|
|
||||||
readonly property real screenHeight: screen ? screen.height : 1080
|
|
||||||
property bool showBackground: true
|
|
||||||
property real backgroundOpacity: 0.5
|
|
||||||
property string positioning: "center"
|
|
||||||
property point customPosition: Qt.point(0, 0)
|
|
||||||
property bool closeOnEscapeKey: true
|
|
||||||
property bool closeOnBackgroundClick: true
|
|
||||||
property string animationType: "scale"
|
|
||||||
property int animationDuration: Theme.shorterDuration
|
|
||||||
property var animationEasing: Theme.emphasizedEasing
|
|
||||||
property color backgroundColor: Theme.surfaceContainer
|
|
||||||
property color borderColor: Theme.outlineMedium
|
|
||||||
property real borderWidth: 1
|
|
||||||
property real cornerRadius: Theme.cornerRadius
|
|
||||||
property bool enableShadow: false
|
|
||||||
property alias modalFocusScope: focusScope
|
|
||||||
property bool shouldBeVisible: false
|
|
||||||
property bool shouldHaveFocus: shouldBeVisible
|
|
||||||
property bool allowFocusOverride: false
|
|
||||||
property bool allowStacking: false
|
|
||||||
|
|
||||||
signal opened
|
|
||||||
signal dialogClosed
|
|
||||||
signal backgroundClicked
|
|
||||||
|
|
||||||
function open() {
|
|
||||||
ModalManager.openModal(root)
|
|
||||||
closeTimer.stop()
|
|
||||||
shouldBeVisible = true
|
|
||||||
visible = true
|
|
||||||
focusScope.forceActiveFocus()
|
|
||||||
}
|
|
||||||
|
|
||||||
function close() {
|
|
||||||
shouldBeVisible = false
|
|
||||||
closeTimer.restart()
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle() {
|
|
||||||
if (shouldBeVisible) {
|
|
||||||
close()
|
|
||||||
} else {
|
|
||||||
open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
visible: shouldBeVisible
|
|
||||||
color: "transparent"
|
|
||||||
WlrLayershell.layer: WlrLayershell.Top // if set to overlay -> virtual keyboards can be stuck under modal
|
|
||||||
WlrLayershell.exclusiveZone: -1
|
|
||||||
WlrLayershell.keyboardFocus: shouldHaveFocus ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (root.visible) {
|
|
||||||
opened()
|
|
||||||
} else {
|
|
||||||
if (Qt.inputMethod) {
|
|
||||||
Qt.inputMethod.hide()
|
|
||||||
Qt.inputMethod.reset()
|
|
||||||
}
|
|
||||||
dialogClosed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onCloseAllModalsExcept(excludedModal) {
|
|
||||||
if (excludedModal !== root && !allowStacking && shouldBeVisible) {
|
|
||||||
close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
target: ModalManager
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: closeTimer
|
|
||||||
|
|
||||||
interval: animationDuration + 50
|
|
||||||
onTriggered: {
|
|
||||||
visible = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
top: true
|
|
||||||
left: true
|
|
||||||
right: true
|
|
||||||
bottom: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: background
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
color: "black"
|
|
||||||
opacity: root.showBackground ? (root.shouldBeVisible ? root.backgroundOpacity : 0) : 0
|
|
||||||
visible: root.showBackground
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
enabled: root.closeOnBackgroundClick
|
|
||||||
onClicked: mouse => {
|
|
||||||
const localPos = mapToItem(contentContainer, mouse.x, mouse.y)
|
|
||||||
if (localPos.x < 0 || localPos.x > contentContainer.width || localPos.y < 0 || localPos.y > contentContainer.height) {
|
|
||||||
root.backgroundClicked()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: root.animationDuration
|
|
||||||
easing.type: root.animationEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: contentContainer
|
|
||||||
|
|
||||||
width: root.width
|
|
||||||
height: root.height
|
|
||||||
anchors.centerIn: positioning === "center" ? parent : undefined
|
|
||||||
x: {
|
|
||||||
if (positioning === "top-right") {
|
|
||||||
return Math.max(Theme.spacingL, root.screenWidth - width - Theme.spacingL)
|
|
||||||
} else if (positioning === "custom") {
|
|
||||||
return root.customPosition.x
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
y: {
|
|
||||||
if (positioning === "top-right") {
|
|
||||||
return Theme.barHeight + Theme.spacingXS
|
|
||||||
} else if (positioning === "custom") {
|
|
||||||
return root.customPosition.y
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
color: root.backgroundColor
|
|
||||||
radius: root.cornerRadius
|
|
||||||
border.color: root.borderColor
|
|
||||||
border.width: root.borderWidth
|
|
||||||
layer.enabled: root.enableShadow
|
|
||||||
opacity: root.shouldBeVisible ? 1 : 0
|
|
||||||
scale: root.animationType === "scale" ? (root.shouldBeVisible ? 1 : 0.9) : 1
|
|
||||||
transform: root.animationType === "slide" ? slideTransform : null
|
|
||||||
|
|
||||||
Translate {
|
|
||||||
id: slideTransform
|
|
||||||
|
|
||||||
x: root.shouldBeVisible ? 0 : 15
|
|
||||||
y: root.shouldBeVisible ? 0 : -30
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: contentLoader
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
active: root.visible
|
|
||||||
asynchronous: false
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: root.animationDuration
|
|
||||||
easing.type: root.animationEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on scale {
|
|
||||||
enabled: root.animationType === "scale"
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
duration: root.animationDuration
|
|
||||||
easing.type: root.animationEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.effect: MultiEffect {
|
|
||||||
shadowEnabled: true
|
|
||||||
shadowHorizontalOffset: 0
|
|
||||||
shadowVerticalOffset: 8
|
|
||||||
shadowBlur: 1
|
|
||||||
shadowColor: Theme.shadowStrong
|
|
||||||
shadowOpacity: 0.3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FocusScope {
|
|
||||||
id: focusScope
|
|
||||||
|
|
||||||
objectName: "modalFocusScope"
|
|
||||||
anchors.fill: parent
|
|
||||||
visible: root.visible // Only active when the modal is visible
|
|
||||||
focus: root.visible
|
|
||||||
Keys.onEscapePressed: event => {
|
|
||||||
if (root.closeOnEscapeKey && shouldHaveFocus) {
|
|
||||||
root.close()
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (visible && shouldHaveFocus) {
|
|
||||||
Qt.callLater(() => focusScope.forceActiveFocus())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onShouldHaveFocusChanged() {
|
|
||||||
if (shouldHaveFocus && visible) {
|
|
||||||
Qt.callLater(() => focusScope.forceActiveFocus())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
target: root
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,908 +0,0 @@
|
|||||||
import Qt.labs.folderlistmodel
|
|
||||||
import QtCore
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell.Io
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modals.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
DankModal {
|
|
||||||
id: fileBrowserModal
|
|
||||||
|
|
||||||
property string homeDir: StandardPaths.writableLocation(StandardPaths.HomeLocation)
|
|
||||||
property string currentPath: ""
|
|
||||||
property var fileExtensions: ["*.*"]
|
|
||||||
property alias filterExtensions: fileBrowserModal.fileExtensions
|
|
||||||
property string browserTitle: "Select File"
|
|
||||||
property string browserIcon: "folder_open"
|
|
||||||
property string browserType: "generic" // "wallpaper" or "profile" for last path memory
|
|
||||||
property bool showHiddenFiles: false
|
|
||||||
property int selectedIndex: -1
|
|
||||||
property bool keyboardNavigationActive: false
|
|
||||||
property bool backButtonFocused: false
|
|
||||||
property bool saveMode: false // Enable save functionality
|
|
||||||
property string defaultFileName: "" // Default filename for save mode
|
|
||||||
property int keyboardSelectionIndex: -1
|
|
||||||
property bool keyboardSelectionRequested: false
|
|
||||||
property bool showKeyboardHints: false
|
|
||||||
property bool showFileInfo: false
|
|
||||||
property string selectedFilePath: ""
|
|
||||||
property string selectedFileName: ""
|
|
||||||
property bool selectedFileIsDir: false
|
|
||||||
property bool showOverwriteConfirmation: false
|
|
||||||
property string pendingFilePath: ""
|
|
||||||
property bool weAvailable: false
|
|
||||||
property string wePath: ""
|
|
||||||
property bool weMode: false
|
|
||||||
|
|
||||||
signal fileSelected(string path)
|
|
||||||
|
|
||||||
function isImageFile(fileName) {
|
|
||||||
if (!fileName) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const ext = fileName.toLowerCase().split('.').pop()
|
|
||||||
return ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'].includes(ext)
|
|
||||||
}
|
|
||||||
|
|
||||||
function getLastPath() {
|
|
||||||
const lastPath = browserType === "wallpaper" ? SessionData.wallpaperLastPath : browserType === "profile" ? SessionData.profileLastPath : ""
|
|
||||||
return (lastPath && lastPath !== "") ? lastPath : homeDir
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveLastPath(path) {
|
|
||||||
if (browserType === "wallpaper") {
|
|
||||||
SessionData.setWallpaperLastPath(path)
|
|
||||||
} else if (browserType === "profile") {
|
|
||||||
SessionData.setProfileLastPath(path)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setSelectedFileData(path, name, isDir) {
|
|
||||||
selectedFilePath = path
|
|
||||||
selectedFileName = name
|
|
||||||
selectedFileIsDir = isDir
|
|
||||||
}
|
|
||||||
|
|
||||||
function navigateUp() {
|
|
||||||
const path = currentPath
|
|
||||||
if (path === homeDir)
|
|
||||||
return
|
|
||||||
|
|
||||||
const lastSlash = path.lastIndexOf('/')
|
|
||||||
if (lastSlash > 0) {
|
|
||||||
const newPath = path.substring(0, lastSlash)
|
|
||||||
if (newPath.length < homeDir.length) {
|
|
||||||
currentPath = homeDir
|
|
||||||
saveLastPath(homeDir)
|
|
||||||
} else {
|
|
||||||
currentPath = newPath
|
|
||||||
saveLastPath(newPath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function navigateTo(path) {
|
|
||||||
currentPath = path
|
|
||||||
saveLastPath(path)
|
|
||||||
selectedIndex = -1
|
|
||||||
backButtonFocused = false
|
|
||||||
}
|
|
||||||
|
|
||||||
function keyboardFileSelection(index) {
|
|
||||||
if (index >= 0) {
|
|
||||||
keyboardSelectionTimer.targetIndex = index
|
|
||||||
keyboardSelectionTimer.start()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function executeKeyboardSelection(index) {
|
|
||||||
keyboardSelectionIndex = index
|
|
||||||
keyboardSelectionRequested = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleSaveFile(filePath) {
|
|
||||||
// Ensure the filePath has the correct file:// protocol format
|
|
||||||
var normalizedPath = filePath
|
|
||||||
if (!normalizedPath.startsWith("file://")) {
|
|
||||||
normalizedPath = "file://" + filePath
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if file exists by looking through the folder model
|
|
||||||
var exists = false
|
|
||||||
var fileName = filePath.split('/').pop()
|
|
||||||
|
|
||||||
for (var i = 0; i < folderModel.count; i++) {
|
|
||||||
if (folderModel.get(i, "fileName") === fileName && !folderModel.get(i, "fileIsDir")) {
|
|
||||||
exists = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (exists) {
|
|
||||||
pendingFilePath = normalizedPath
|
|
||||||
showOverwriteConfirmation = true
|
|
||||||
} else {
|
|
||||||
fileSelected(normalizedPath)
|
|
||||||
fileBrowserModal.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
objectName: "fileBrowserModal"
|
|
||||||
allowStacking: true
|
|
||||||
Component.onCompleted: {
|
|
||||||
currentPath = getLastPath()
|
|
||||||
}
|
|
||||||
|
|
||||||
property var steamPaths: [
|
|
||||||
StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/.steam/steam/steamapps/workshop/content/431960",
|
|
||||||
StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/.local/share/Steam/steamapps/workshop/content/431960",
|
|
||||||
StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/workshop/content/431960",
|
|
||||||
StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/snap/steam/common/.local/share/Steam/steamapps/workshop/content/431960"
|
|
||||||
]
|
|
||||||
property int currentPathIndex: 0
|
|
||||||
|
|
||||||
function discoverWallpaperEngine() {
|
|
||||||
currentPathIndex = 0
|
|
||||||
checkNextPath()
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkNextPath() {
|
|
||||||
if (currentPathIndex >= steamPaths.length) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const wePath = steamPaths[currentPathIndex]
|
|
||||||
const cleanPath = wePath.replace(/^file:\/\//, '')
|
|
||||||
weDiscoveryProcess.command = ["test", "-d", cleanPath]
|
|
||||||
weDiscoveryProcess.wePath = wePath
|
|
||||||
weDiscoveryProcess.running = true
|
|
||||||
}
|
|
||||||
width: 800
|
|
||||||
height: 600
|
|
||||||
enableShadow: true
|
|
||||||
visible: false
|
|
||||||
onBackgroundClicked: close()
|
|
||||||
onOpened: {
|
|
||||||
modalFocusScope.forceActiveFocus()
|
|
||||||
}
|
|
||||||
modalFocusScope.Keys.onPressed: function (event) {
|
|
||||||
keyboardController.handleKey(event)
|
|
||||||
}
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (visible) {
|
|
||||||
currentPath = getLastPath()
|
|
||||||
selectedIndex = -1
|
|
||||||
keyboardNavigationActive = false
|
|
||||||
backButtonFocused = false
|
|
||||||
if (browserType === "wallpaper" && !weAvailable) {
|
|
||||||
discoverWallpaperEngine()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onCurrentPathChanged: {
|
|
||||||
selectedFilePath = ""
|
|
||||||
selectedFileName = ""
|
|
||||||
selectedFileIsDir = false
|
|
||||||
}
|
|
||||||
onSelectedIndexChanged: {
|
|
||||||
if (selectedIndex >= 0 && folderModel && selectedIndex < folderModel.count) {
|
|
||||||
selectedFilePath = ""
|
|
||||||
selectedFileName = ""
|
|
||||||
selectedFileIsDir = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FolderListModel {
|
|
||||||
id: folderModel
|
|
||||||
|
|
||||||
showDirsFirst: true
|
|
||||||
showDotAndDotDot: false
|
|
||||||
showHidden: fileBrowserModal.showHiddenFiles
|
|
||||||
nameFilters: fileExtensions
|
|
||||||
showFiles: true
|
|
||||||
showDirs: true
|
|
||||||
folder: currentPath ? "file://" + currentPath : "file://" + homeDir
|
|
||||||
}
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: keyboardController
|
|
||||||
|
|
||||||
property int totalItems: folderModel.count
|
|
||||||
property int gridColumns: 5
|
|
||||||
|
|
||||||
function handleKey(event) {
|
|
||||||
if (event.key === Qt.Key_Escape) {
|
|
||||||
close()
|
|
||||||
event.accepted = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// F10 toggles keyboard hints
|
|
||||||
if (event.key === Qt.Key_F10) {
|
|
||||||
showKeyboardHints = !showKeyboardHints
|
|
||||||
event.accepted = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// F1 or I key for file information
|
|
||||||
if (event.key === Qt.Key_F1 || event.key === Qt.Key_I) {
|
|
||||||
showFileInfo = !showFileInfo
|
|
||||||
event.accepted = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// Alt+Left or Backspace to go back
|
|
||||||
if ((event.modifiers & Qt.AltModifier && event.key === Qt.Key_Left) || event.key === Qt.Key_Backspace) {
|
|
||||||
if (currentPath !== homeDir) {
|
|
||||||
navigateUp()
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!keyboardNavigationActive) {
|
|
||||||
if (event.key === Qt.Key_Tab || event.key === Qt.Key_Down || event.key === Qt.Key_Right) {
|
|
||||||
keyboardNavigationActive = true
|
|
||||||
if (currentPath !== homeDir) {
|
|
||||||
backButtonFocused = true
|
|
||||||
selectedIndex = -1
|
|
||||||
} else {
|
|
||||||
backButtonFocused = false
|
|
||||||
selectedIndex = 0
|
|
||||||
}
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
switch (event.key) {
|
|
||||||
case Qt.Key_Tab:
|
|
||||||
if (backButtonFocused) {
|
|
||||||
backButtonFocused = false
|
|
||||||
selectedIndex = 0
|
|
||||||
} else if (selectedIndex < totalItems - 1) {
|
|
||||||
selectedIndex++
|
|
||||||
} else if (currentPath !== homeDir) {
|
|
||||||
backButtonFocused = true
|
|
||||||
selectedIndex = -1
|
|
||||||
} else {
|
|
||||||
selectedIndex = 0
|
|
||||||
}
|
|
||||||
event.accepted = true
|
|
||||||
break
|
|
||||||
case Qt.Key_Backtab:
|
|
||||||
if (backButtonFocused) {
|
|
||||||
backButtonFocused = false
|
|
||||||
selectedIndex = totalItems - 1
|
|
||||||
} else if (selectedIndex > 0) {
|
|
||||||
selectedIndex--
|
|
||||||
} else if (currentPath !== homeDir) {
|
|
||||||
backButtonFocused = true
|
|
||||||
selectedIndex = -1
|
|
||||||
} else {
|
|
||||||
selectedIndex = totalItems - 1
|
|
||||||
}
|
|
||||||
event.accepted = true
|
|
||||||
break
|
|
||||||
case Qt.Key_Left:
|
|
||||||
if (backButtonFocused)
|
|
||||||
return
|
|
||||||
|
|
||||||
if (selectedIndex > 0) {
|
|
||||||
selectedIndex--
|
|
||||||
} else if (currentPath !== homeDir) {
|
|
||||||
backButtonFocused = true
|
|
||||||
selectedIndex = -1
|
|
||||||
}
|
|
||||||
event.accepted = true
|
|
||||||
break
|
|
||||||
case Qt.Key_Right:
|
|
||||||
if (backButtonFocused) {
|
|
||||||
backButtonFocused = false
|
|
||||||
selectedIndex = 0
|
|
||||||
} else if (selectedIndex < totalItems - 1) {
|
|
||||||
selectedIndex++
|
|
||||||
}
|
|
||||||
event.accepted = true
|
|
||||||
break
|
|
||||||
case Qt.Key_Up:
|
|
||||||
if (backButtonFocused) {
|
|
||||||
backButtonFocused = false
|
|
||||||
// Go to first row, appropriate column
|
|
||||||
var col = selectedIndex % gridColumns
|
|
||||||
selectedIndex = Math.min(col, totalItems - 1)
|
|
||||||
} else if (selectedIndex >= gridColumns) {
|
|
||||||
// Move up one row
|
|
||||||
selectedIndex -= gridColumns
|
|
||||||
} else if (currentPath !== homeDir) {
|
|
||||||
// At top row, go to back button
|
|
||||||
backButtonFocused = true
|
|
||||||
selectedIndex = -1
|
|
||||||
}
|
|
||||||
event.accepted = true
|
|
||||||
break
|
|
||||||
case Qt.Key_Down:
|
|
||||||
if (backButtonFocused) {
|
|
||||||
backButtonFocused = false
|
|
||||||
selectedIndex = 0
|
|
||||||
} else {
|
|
||||||
// Move down one row if possible
|
|
||||||
var newIndex = selectedIndex + gridColumns
|
|
||||||
if (newIndex < totalItems) {
|
|
||||||
selectedIndex = newIndex
|
|
||||||
} else {
|
|
||||||
// If can't go down a full row, go to last item in the column if exists
|
|
||||||
var lastRowStart = Math.floor((totalItems - 1) / gridColumns) * gridColumns
|
|
||||||
var col = selectedIndex % gridColumns
|
|
||||||
var targetIndex = lastRowStart + col
|
|
||||||
if (targetIndex < totalItems && targetIndex > selectedIndex) {
|
|
||||||
selectedIndex = targetIndex
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
event.accepted = true
|
|
||||||
break
|
|
||||||
case Qt.Key_Return:
|
|
||||||
case Qt.Key_Enter:
|
|
||||||
case Qt.Key_Space:
|
|
||||||
if (backButtonFocused)
|
|
||||||
navigateUp()
|
|
||||||
else if (selectedIndex >= 0 && selectedIndex < totalItems)
|
|
||||||
// Trigger selection by setting the grid's current index and using signal
|
|
||||||
fileBrowserModal.keyboardFileSelection(selectedIndex)
|
|
||||||
event.accepted = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: keyboardSelectionTimer
|
|
||||||
|
|
||||||
property int targetIndex: -1
|
|
||||||
|
|
||||||
interval: 1
|
|
||||||
onTriggered: {
|
|
||||||
// Access the currently selected item through model role names
|
|
||||||
// This will work because QML models expose role data
|
|
||||||
executeKeyboardSelection(targetIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: weDiscoveryProcess
|
|
||||||
|
|
||||||
property string wePath: ""
|
|
||||||
running: false
|
|
||||||
|
|
||||||
onExited: exitCode => {
|
|
||||||
if (exitCode === 0) {
|
|
||||||
fileBrowserModal.weAvailable = true
|
|
||||||
fileBrowserModal.wePath = wePath
|
|
||||||
} else {
|
|
||||||
currentPathIndex++
|
|
||||||
checkNextPath()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
content: Component {
|
|
||||||
Item {
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingM
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: browserIcon
|
|
||||||
size: Theme.iconSizeLarge
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: browserTitle
|
|
||||||
font.pixelSize: Theme.fontSizeXLarge
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
circular: false
|
|
||||||
iconName: "movie"
|
|
||||||
iconSize: Theme.iconSize - 4
|
|
||||||
iconColor: weMode ? Theme.primary : Theme.surfaceText
|
|
||||||
visible: weAvailable && browserType === "wallpaper"
|
|
||||||
onClicked: {
|
|
||||||
weMode = !weMode
|
|
||||||
if (weMode) {
|
|
||||||
navigateTo(wePath)
|
|
||||||
} else {
|
|
||||||
navigateTo(getLastPath())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
circular: false
|
|
||||||
iconName: "info"
|
|
||||||
iconSize: Theme.iconSize - 4
|
|
||||||
iconColor: Theme.surfaceText
|
|
||||||
onClicked: fileBrowserModal.showKeyboardHints = !fileBrowserModal.showKeyboardHints
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
circular: false
|
|
||||||
iconName: "close"
|
|
||||||
iconSize: Theme.iconSize - 4
|
|
||||||
iconColor: Theme.surfaceText
|
|
||||||
onClicked: fileBrowserModal.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: 32
|
|
||||||
height: 32
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: (backButtonMouseArea.containsMouse || (backButtonFocused && keyboardNavigationActive)) && currentPath !== homeDir ? Theme.surfaceVariant : "transparent"
|
|
||||||
opacity: currentPath !== homeDir ? 1 : 0
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "arrow_back"
|
|
||||||
size: Theme.iconSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: backButtonMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: currentPath !== homeDir
|
|
||||||
cursorShape: currentPath !== homeDir ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
||||||
enabled: currentPath !== homeDir
|
|
||||||
onClicked: navigateUp()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: fileBrowserModal.currentPath.replace("file://", "")
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
width: parent.width - 40 - Theme.spacingS
|
|
||||||
elide: Text.ElideMiddle
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
maximumLineCount: 1
|
|
||||||
wrapMode: Text.NoWrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankGridView {
|
|
||||||
id: fileGrid
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height - 80
|
|
||||||
clip: true
|
|
||||||
cellWidth: weMode ? 255 : 150
|
|
||||||
cellHeight: weMode ? 215 : 130
|
|
||||||
cacheBuffer: 260
|
|
||||||
model: folderModel
|
|
||||||
currentIndex: selectedIndex
|
|
||||||
onCurrentIndexChanged: {
|
|
||||||
if (keyboardNavigationActive && currentIndex >= 0)
|
|
||||||
positionViewAtIndex(currentIndex, GridView.Contain)
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBar {
|
|
||||||
policy: ScrollBar.AsNeeded
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollBar.horizontal: ScrollBar {
|
|
||||||
policy: ScrollBar.AlwaysOff
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: StyledRect {
|
|
||||||
id: delegateRoot
|
|
||||||
|
|
||||||
required property bool fileIsDir
|
|
||||||
required property string filePath
|
|
||||||
required property string fileName
|
|
||||||
required property url fileURL
|
|
||||||
required property int index
|
|
||||||
|
|
||||||
width: weMode ? 245 : 140
|
|
||||||
height: weMode ? 205 : 120
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: {
|
|
||||||
if (keyboardNavigationActive && delegateRoot.index === selectedIndex)
|
|
||||||
return Theme.surfacePressed
|
|
||||||
|
|
||||||
return mouseArea.containsMouse ? Theme.surfaceVariant : "transparent"
|
|
||||||
}
|
|
||||||
border.color: keyboardNavigationActive && delegateRoot.index === selectedIndex ? Theme.primary : Theme.outline
|
|
||||||
border.width: (mouseArea.containsMouse || (keyboardNavigationActive && delegateRoot.index === selectedIndex)) ? 1 : 0
|
|
||||||
// Update file info when this item gets selected via keyboard or initially
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (keyboardNavigationActive && delegateRoot.index === selectedIndex)
|
|
||||||
setSelectedFileData(delegateRoot.filePath, delegateRoot.fileName, delegateRoot.fileIsDir)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Watch for selectedIndex changes to update file info during keyboard navigation
|
|
||||||
Connections {
|
|
||||||
function onSelectedIndexChanged() {
|
|
||||||
if (keyboardNavigationActive && selectedIndex === delegateRoot.index)
|
|
||||||
setSelectedFileData(delegateRoot.filePath, delegateRoot.fileName, delegateRoot.fileIsDir)
|
|
||||||
}
|
|
||||||
|
|
||||||
target: fileBrowserModal
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: weMode ? 225 : 80
|
|
||||||
height: weMode ? 165 : 60
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
CachingImage {
|
|
||||||
anchors.fill: parent
|
|
||||||
property var weExtensions: [".jpg", ".jpeg", ".png", ".webp", ".gif", ".bmp", ".tga"]
|
|
||||||
property int weExtIndex: 0
|
|
||||||
source: {
|
|
||||||
if (weMode && delegateRoot.fileIsDir) {
|
|
||||||
return "file://" + delegateRoot.filePath + "/preview" + weExtensions[weExtIndex]
|
|
||||||
}
|
|
||||||
return (!delegateRoot.fileIsDir && isImageFile(delegateRoot.fileName)) ? ("file://" + delegateRoot.filePath) : ""
|
|
||||||
}
|
|
||||||
onStatusChanged: {
|
|
||||||
if (weMode && delegateRoot.fileIsDir && status === Image.Error) {
|
|
||||||
if (weExtIndex < weExtensions.length - 1) {
|
|
||||||
weExtIndex++
|
|
||||||
source = "file://" + delegateRoot.filePath + "/preview" + weExtensions[weExtIndex]
|
|
||||||
} else {
|
|
||||||
source = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fillMode: Image.PreserveAspectCrop
|
|
||||||
visible: (!delegateRoot.fileIsDir && isImageFile(delegateRoot.fileName)) || (weMode && delegateRoot.fileIsDir)
|
|
||||||
maxCacheSize: weMode ? 225 : 80
|
|
||||||
}
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "description"
|
|
||||||
size: Theme.iconSizeLarge
|
|
||||||
color: Theme.primary
|
|
||||||
visible: !delegateRoot.fileIsDir && !isImageFile(delegateRoot.fileName)
|
|
||||||
}
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "folder"
|
|
||||||
size: Theme.iconSizeLarge
|
|
||||||
color: Theme.primary
|
|
||||||
visible: delegateRoot.fileIsDir && !weMode
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: delegateRoot.fileName || ""
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
width: 120
|
|
||||||
elide: Text.ElideMiddle
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
maximumLineCount: 2
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: mouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
// Update selected file info and index first
|
|
||||||
selectedIndex = delegateRoot.index
|
|
||||||
setSelectedFileData(delegateRoot.filePath, delegateRoot.fileName, delegateRoot.fileIsDir)
|
|
||||||
if (weMode && delegateRoot.fileIsDir) {
|
|
||||||
var sceneId = delegateRoot.filePath.split("/").pop()
|
|
||||||
fileSelected("we:" + sceneId)
|
|
||||||
fileBrowserModal.close()
|
|
||||||
} else if (delegateRoot.fileIsDir) {
|
|
||||||
navigateTo(delegateRoot.filePath)
|
|
||||||
} else {
|
|
||||||
fileSelected(delegateRoot.filePath)
|
|
||||||
fileBrowserModal.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle keyboard selection
|
|
||||||
Connections {
|
|
||||||
function onKeyboardSelectionRequestedChanged() {
|
|
||||||
if (fileBrowserModal.keyboardSelectionRequested && fileBrowserModal.keyboardSelectionIndex === delegateRoot.index) {
|
|
||||||
fileBrowserModal.keyboardSelectionRequested = false
|
|
||||||
selectedIndex = delegateRoot.index
|
|
||||||
setSelectedFileData(delegateRoot.filePath, delegateRoot.fileName, delegateRoot.fileIsDir)
|
|
||||||
if (weMode && delegateRoot.fileIsDir) {
|
|
||||||
var sceneId = delegateRoot.filePath.split("/").pop()
|
|
||||||
fileSelected("we:" + sceneId)
|
|
||||||
fileBrowserModal.close()
|
|
||||||
} else if (delegateRoot.fileIsDir) {
|
|
||||||
navigateTo(delegateRoot.filePath)
|
|
||||||
} else {
|
|
||||||
fileSelected(delegateRoot.filePath)
|
|
||||||
fileBrowserModal.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
target: fileBrowserModal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: saveRow
|
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
height: saveMode ? 40 : 0
|
|
||||||
visible: saveMode
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankTextField {
|
|
||||||
id: fileNameInput
|
|
||||||
|
|
||||||
width: parent.width - saveButton.width - Theme.spacingM
|
|
||||||
height: 40
|
|
||||||
text: defaultFileName
|
|
||||||
placeholderText: "Enter filename..."
|
|
||||||
ignoreLeftRightKeys: false
|
|
||||||
focus: saveMode
|
|
||||||
topPadding: Theme.spacingS
|
|
||||||
bottomPadding: Theme.spacingS
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (saveMode)
|
|
||||||
Qt.callLater(() => {
|
|
||||||
forceActiveFocus()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
onAccepted: {
|
|
||||||
if (text.trim() !== "") {
|
|
||||||
// Remove file:// protocol from currentPath if present for proper construction
|
|
||||||
var basePath = currentPath.replace(/^file:\/\//, '')
|
|
||||||
var fullPath = basePath + "/" + text.trim()
|
|
||||||
// Ensure consistent path format - remove any double slashes and normalize
|
|
||||||
fullPath = fullPath.replace(/\/+/g, '/')
|
|
||||||
handleSaveFile(fullPath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
id: saveButton
|
|
||||||
|
|
||||||
width: 80
|
|
||||||
height: 40
|
|
||||||
color: fileNameInput.text.trim() !== "" ? Theme.primary : Theme.surfaceVariant
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "Save"
|
|
||||||
color: fileNameInput.text.trim() !== "" ? Theme.primaryText : Theme.surfaceVariantText
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
}
|
|
||||||
|
|
||||||
StateLayer {
|
|
||||||
stateColor: Theme.primary
|
|
||||||
cornerRadius: Theme.cornerRadius
|
|
||||||
enabled: fileNameInput.text.trim() !== ""
|
|
||||||
onClicked: {
|
|
||||||
if (fileNameInput.text.trim() !== "") {
|
|
||||||
// Remove file:// protocol from currentPath if present for proper construction
|
|
||||||
var basePath = currentPath.replace(/^file:\/\//, '')
|
|
||||||
var fullPath = basePath + "/" + fileNameInput.text.trim()
|
|
||||||
// Ensure consistent path format - remove any double slashes and normalize
|
|
||||||
fullPath = fullPath.replace(/\/+/g, '/')
|
|
||||||
handleSaveFile(fullPath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyboardHints {
|
|
||||||
id: keyboardHints
|
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
showHints: fileBrowserModal.showKeyboardHints
|
|
||||||
}
|
|
||||||
|
|
||||||
FileInfo {
|
|
||||||
id: fileInfo
|
|
||||||
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
width: 300
|
|
||||||
showFileInfo: fileBrowserModal.showFileInfo
|
|
||||||
selectedIndex: fileBrowserModal.selectedIndex
|
|
||||||
sourceFolderModel: folderModel
|
|
||||||
currentPath: fileBrowserModal.currentPath
|
|
||||||
currentFileName: fileBrowserModal.selectedFileName
|
|
||||||
currentFileIsDir: fileBrowserModal.selectedFileIsDir
|
|
||||||
currentFileExtension: {
|
|
||||||
if (fileBrowserModal.selectedFileIsDir || !fileBrowserModal.selectedFileName)
|
|
||||||
return ""
|
|
||||||
|
|
||||||
var lastDot = fileBrowserModal.selectedFileName.lastIndexOf('.')
|
|
||||||
return lastDot > 0 ? fileBrowserModal.selectedFileName.substring(lastDot + 1).toLowerCase() : ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Overwrite confirmation dialog
|
|
||||||
Item {
|
|
||||||
id: overwriteDialog
|
|
||||||
anchors.fill: parent
|
|
||||||
visible: showOverwriteConfirmation
|
|
||||||
|
|
||||||
Keys.onEscapePressed: {
|
|
||||||
showOverwriteConfirmation = false
|
|
||||||
pendingFilePath = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onReturnPressed: {
|
|
||||||
showOverwriteConfirmation = false
|
|
||||||
fileSelected(pendingFilePath)
|
|
||||||
pendingFilePath = ""
|
|
||||||
Qt.callLater(() => fileBrowserModal.close())
|
|
||||||
}
|
|
||||||
|
|
||||||
focus: showOverwriteConfirmation
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
color: Theme.shadowStrong
|
|
||||||
opacity: 0.8
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {
|
|
||||||
showOverwriteConfirmation = false
|
|
||||||
pendingFilePath = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: 400
|
|
||||||
height: 160
|
|
||||||
color: Theme.surfaceContainer
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.color: Theme.outlineMedium
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width - Theme.spacingL * 2
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: qsTr("File Already Exists")
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: qsTr("A file with this name already exists. Do you want to overwrite it?")
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
width: parent.width
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: 80
|
|
||||||
height: 36
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: cancelArea.containsMouse ? Theme.surfaceVariantHover : Theme.surfaceVariant
|
|
||||||
border.color: Theme.outline
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: qsTr("Cancel")
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: cancelArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
showOverwriteConfirmation = false
|
|
||||||
pendingFilePath = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: 90
|
|
||||||
height: 36
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: overwriteArea.containsMouse ? Qt.darker(Theme.primary, 1.1) : Theme.primary
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: qsTr("Overwrite")
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.background
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: overwriteArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
showOverwriteConfirmation = false
|
|
||||||
fileSelected(pendingFilePath)
|
|
||||||
pendingFilePath = ""
|
|
||||||
Qt.callLater(() => fileBrowserModal.close())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,147 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import Quickshell.Io
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modals.Common
|
|
||||||
import qs.Modules.Notifications.Center
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
DankModal {
|
|
||||||
id: notificationModal
|
|
||||||
|
|
||||||
property bool notificationModalOpen: false
|
|
||||||
property var notificationListRef: null
|
|
||||||
|
|
||||||
function show() {
|
|
||||||
notificationModalOpen = true
|
|
||||||
NotificationService.onOverlayOpen()
|
|
||||||
open()
|
|
||||||
modalKeyboardController.reset()
|
|
||||||
if (modalKeyboardController && notificationListRef) {
|
|
||||||
modalKeyboardController.listView = notificationListRef
|
|
||||||
modalKeyboardController.rebuildFlatNavigation()
|
|
||||||
|
|
||||||
Qt.callLater(() => {
|
|
||||||
modalKeyboardController.keyboardNavigationActive = true
|
|
||||||
modalKeyboardController.selectedFlatIndex = 0
|
|
||||||
modalKeyboardController.updateSelectedIdFromIndex()
|
|
||||||
if (notificationListRef) {
|
|
||||||
notificationListRef.keyboardActive = true
|
|
||||||
notificationListRef.currentIndex = 0
|
|
||||||
}
|
|
||||||
modalKeyboardController.selectionVersion++
|
|
||||||
modalKeyboardController.ensureVisible()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function hide() {
|
|
||||||
notificationModalOpen = false
|
|
||||||
NotificationService.onOverlayClose()
|
|
||||||
close()
|
|
||||||
modalKeyboardController.reset()
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle() {
|
|
||||||
if (shouldBeVisible) {
|
|
||||||
hide()
|
|
||||||
} else {
|
|
||||||
show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
width: 500
|
|
||||||
height: 700
|
|
||||||
visible: false
|
|
||||||
onBackgroundClicked: hide()
|
|
||||||
onShouldBeVisibleChanged: (shouldBeVisible) => {
|
|
||||||
if (!shouldBeVisible) {
|
|
||||||
notificationModalOpen = false
|
|
||||||
modalKeyboardController.reset()
|
|
||||||
NotificationService.onOverlayClose()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
modalFocusScope.Keys.onPressed: (event) => modalKeyboardController.handleKey(event)
|
|
||||||
|
|
||||||
NotificationKeyboardController {
|
|
||||||
id: modalKeyboardController
|
|
||||||
|
|
||||||
listView: null
|
|
||||||
isOpen: notificationModal.notificationModalOpen
|
|
||||||
onClose: () => notificationModal.hide()
|
|
||||||
}
|
|
||||||
|
|
||||||
IpcHandler {
|
|
||||||
function open(): string {
|
|
||||||
notificationModal.show();
|
|
||||||
return "NOTIFICATION_MODAL_OPEN_SUCCESS";
|
|
||||||
}
|
|
||||||
|
|
||||||
function close(): string {
|
|
||||||
notificationModal.hide();
|
|
||||||
return "NOTIFICATION_MODAL_CLOSE_SUCCESS";
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle(): string {
|
|
||||||
notificationModal.toggle();
|
|
||||||
return "NOTIFICATION_MODAL_TOGGLE_SUCCESS";
|
|
||||||
}
|
|
||||||
|
|
||||||
target: "notifications"
|
|
||||||
}
|
|
||||||
|
|
||||||
content: Component {
|
|
||||||
Item {
|
|
||||||
id: notificationKeyHandler
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
NotificationHeader {
|
|
||||||
id: notificationHeader
|
|
||||||
|
|
||||||
keyboardController: modalKeyboardController
|
|
||||||
}
|
|
||||||
|
|
||||||
NotificationSettings {
|
|
||||||
id: notificationSettings
|
|
||||||
|
|
||||||
expanded: notificationHeader.showSettings
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyboardNavigatedNotificationList {
|
|
||||||
id: notificationList
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height - y
|
|
||||||
keyboardController: modalKeyboardController
|
|
||||||
Component.onCompleted: {
|
|
||||||
notificationModal.notificationListRef = notificationList
|
|
||||||
if (modalKeyboardController) {
|
|
||||||
modalKeyboardController.listView = notificationList
|
|
||||||
modalKeyboardController.rebuildFlatNavigation()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
NotificationKeyboardHints {
|
|
||||||
id: keyboardHints
|
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
showHints: modalKeyboardController.showKeyboardHints
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,406 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modals.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
DankModal {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property int selectedIndex: 0
|
|
||||||
property int optionCount: SessionService.hibernateSupported ? 5 : 4
|
|
||||||
|
|
||||||
signal powerActionRequested(string action, string title, string message)
|
|
||||||
|
|
||||||
function selectOption(action) {
|
|
||||||
close();
|
|
||||||
const actions = {
|
|
||||||
"logout": {
|
|
||||||
"title": "Log Out",
|
|
||||||
"message": "Are you sure you want to log out?"
|
|
||||||
},
|
|
||||||
"suspend": {
|
|
||||||
"title": "Suspend",
|
|
||||||
"message": "Are you sure you want to suspend the system?"
|
|
||||||
},
|
|
||||||
"hibernate": {
|
|
||||||
"title": "Hibernate",
|
|
||||||
"message": "Are you sure you want to hibernate the system?"
|
|
||||||
},
|
|
||||||
"reboot": {
|
|
||||||
"title": "Reboot",
|
|
||||||
"message": "Are you sure you want to reboot the system?"
|
|
||||||
},
|
|
||||||
"poweroff": {
|
|
||||||
"title": "Power Off",
|
|
||||||
"message": "Are you sure you want to power off the system?"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const selected = actions[action]
|
|
||||||
if (selected) {
|
|
||||||
root.powerActionRequested(action, selected.title, selected.message);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
shouldBeVisible: false
|
|
||||||
width: 320
|
|
||||||
height: contentLoader.item ? contentLoader.item.implicitHeight : 300
|
|
||||||
enableShadow: true
|
|
||||||
onBackgroundClicked: () => {
|
|
||||||
return close();
|
|
||||||
}
|
|
||||||
onOpened: () => {
|
|
||||||
selectedIndex = 0;
|
|
||||||
modalFocusScope.forceActiveFocus();
|
|
||||||
}
|
|
||||||
modalFocusScope.Keys.onPressed: (event) => {
|
|
||||||
switch (event.key) {
|
|
||||||
case Qt.Key_Up:
|
|
||||||
selectedIndex = (selectedIndex - 1 + optionCount) % optionCount;
|
|
||||||
event.accepted = true;
|
|
||||||
break;
|
|
||||||
case Qt.Key_Down:
|
|
||||||
selectedIndex = (selectedIndex + 1) % optionCount;
|
|
||||||
event.accepted = true;
|
|
||||||
break;
|
|
||||||
case Qt.Key_Tab:
|
|
||||||
selectedIndex = (selectedIndex + 1) % optionCount;
|
|
||||||
event.accepted = true;
|
|
||||||
break;
|
|
||||||
case Qt.Key_Return:
|
|
||||||
case Qt.Key_Enter:
|
|
||||||
const actions = ["logout", "suspend"];
|
|
||||||
if (SessionService.hibernateSupported) actions.push("hibernate");
|
|
||||||
actions.push("reboot", "poweroff");
|
|
||||||
if (selectedIndex < actions.length) {
|
|
||||||
selectOption(actions[selectedIndex]);
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
content: Component {
|
|
||||||
Item {
|
|
||||||
anchors.fill: parent
|
|
||||||
implicitHeight: mainColumn.implicitHeight + Theme.spacingL * 2
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: mainColumn
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Power Options"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width - 150
|
|
||||||
height: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
iconName: "close"
|
|
||||||
iconSize: Theme.iconSize - 4
|
|
||||||
iconColor: Theme.surfaceText
|
|
||||||
onClicked: () => {
|
|
||||||
return close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: {
|
|
||||||
if (selectedIndex === 0) {
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12);
|
|
||||||
} else if (logoutArea.containsMouse) {
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08);
|
|
||||||
} else {
|
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
border.color: selectedIndex === 0 ? Theme.primary : "transparent"
|
|
||||||
border.width: selectedIndex === 0 ? 1 : 0
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "logout"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Log Out"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: logoutArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
selectedIndex = 0;
|
|
||||||
selectOption("logout");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: {
|
|
||||||
if (selectedIndex === 1) {
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12);
|
|
||||||
} else if (suspendArea.containsMouse) {
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08);
|
|
||||||
} else {
|
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
border.color: selectedIndex === 1 ? Theme.primary : "transparent"
|
|
||||||
border.width: selectedIndex === 1 ? 1 : 0
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "bedtime"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Suspend"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: suspendArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
selectedIndex = 1;
|
|
||||||
selectOption("suspend");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: {
|
|
||||||
if (selectedIndex === 2) {
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12);
|
|
||||||
} else if (hibernateArea.containsMouse) {
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08);
|
|
||||||
} else {
|
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
border.color: selectedIndex === 2 ? Theme.primary : "transparent"
|
|
||||||
border.width: selectedIndex === 2 ? 1 : 0
|
|
||||||
visible: SessionService.hibernateSupported
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "ac_unit"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Hibernate"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: hibernateArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
selectedIndex = 2;
|
|
||||||
selectOption("hibernate");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: {
|
|
||||||
const rebootIndex = SessionService.hibernateSupported ? 3 : 2;
|
|
||||||
if (selectedIndex === rebootIndex) {
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12);
|
|
||||||
} else if (rebootArea.containsMouse) {
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08);
|
|
||||||
} else {
|
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
border.color: selectedIndex === (SessionService.hibernateSupported ? 3 : 2) ? Theme.primary : "transparent"
|
|
||||||
border.width: selectedIndex === (SessionService.hibernateSupported ? 3 : 2) ? 1 : 0
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "restart_alt"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: rebootArea.containsMouse ? Theme.warning : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Reboot"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: rebootArea.containsMouse ? Theme.warning : Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: rebootArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
selectedIndex = SessionService.hibernateSupported ? 3 : 2;
|
|
||||||
selectOption("reboot");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: {
|
|
||||||
const powerOffIndex = SessionService.hibernateSupported ? 4 : 3;
|
|
||||||
if (selectedIndex === powerOffIndex) {
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12);
|
|
||||||
} else if (powerOffArea.containsMouse) {
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08);
|
|
||||||
} else {
|
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
border.color: selectedIndex === (SessionService.hibernateSupported ? 4 : 3) ? Theme.primary : "transparent"
|
|
||||||
border.width: selectedIndex === (SessionService.hibernateSupported ? 4 : 3) ? 1 : 0
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "power_settings_new"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: powerOffArea.containsMouse ? Theme.error : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Power Off"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: powerOffArea.containsMouse ? Theme.error : Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: powerOffArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
selectedIndex = SessionService.hibernateSupported ? 4 : 3;
|
|
||||||
selectOption("poweroff");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
height: Theme.spacingS
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,356 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modals.Common
|
|
||||||
import qs.Modules.ProcessList
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
DankModal {
|
|
||||||
id: processListModal
|
|
||||||
|
|
||||||
property int currentTab: 0
|
|
||||||
property var tabNames: ["Processes", "Performance", "System"]
|
|
||||||
|
|
||||||
function show() {
|
|
||||||
if (!DgopService.dgopAvailable) {
|
|
||||||
console.warn("ProcessListModal: dgop is not available");
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
open();
|
|
||||||
UserInfoService.getUptime();
|
|
||||||
}
|
|
||||||
|
|
||||||
function hide() {
|
|
||||||
close();
|
|
||||||
if (processContextMenu.visible) {
|
|
||||||
processContextMenu.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle() {
|
|
||||||
if (!DgopService.dgopAvailable) {
|
|
||||||
console.warn("ProcessListModal: dgop is not available");
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
if (shouldBeVisible) {
|
|
||||||
hide();
|
|
||||||
} else {
|
|
||||||
show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
width: 900
|
|
||||||
height: 680
|
|
||||||
visible: false
|
|
||||||
backgroundColor: Theme.popupBackground()
|
|
||||||
cornerRadius: Theme.cornerRadius
|
|
||||||
enableShadow: true
|
|
||||||
onBackgroundClicked: () => {
|
|
||||||
return hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: processesTabComponent
|
|
||||||
|
|
||||||
ProcessesTab {
|
|
||||||
contextMenu: processContextMenu
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: performanceTabComponent
|
|
||||||
|
|
||||||
PerformanceTab {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: systemTabComponent
|
|
||||||
|
|
||||||
SystemTab {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ProcessContextMenu {
|
|
||||||
id: processContextMenu
|
|
||||||
}
|
|
||||||
|
|
||||||
content: Component {
|
|
||||||
Item {
|
|
||||||
anchors.fill: parent
|
|
||||||
focus: true
|
|
||||||
Keys.onPressed: (event) => {
|
|
||||||
if (event.key === Qt.Key_Escape) {
|
|
||||||
processListModal.hide();
|
|
||||||
event.accepted = true;
|
|
||||||
} else if (event.key === Qt.Key_1) {
|
|
||||||
currentTab = 0;
|
|
||||||
event.accepted = true;
|
|
||||||
} else if (event.key === Qt.Key_2) {
|
|
||||||
currentTab = 1;
|
|
||||||
event.accepted = true;
|
|
||||||
} else if (event.key === Qt.Key_3) {
|
|
||||||
currentTab = 2;
|
|
||||||
event.accepted = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show error message when dgop is not available
|
|
||||||
Rectangle {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: 400
|
|
||||||
height: 200
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.1)
|
|
||||||
border.color: Theme.error
|
|
||||||
border.width: 2
|
|
||||||
visible: !DgopService.dgopAvailable
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingL
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "error"
|
|
||||||
size: 48
|
|
||||||
color: Theme.error
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "System Monitor Unavailable"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Bold
|
|
||||||
color: Theme.error
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "The 'dgop' tool is required for system monitoring.\nPlease install dgop to use this feature."
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingL
|
|
||||||
visible: DgopService.dgopAvailable
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "System Monitor"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge + 4
|
|
||||||
font.weight: Font.Bold
|
|
||||||
color: Theme.surfaceText
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
circular: false
|
|
||||||
iconName: "close"
|
|
||||||
iconSize: Theme.iconSize - 4
|
|
||||||
iconColor: Theme.surfaceText
|
|
||||||
onClicked: () => {
|
|
||||||
return processListModal.hide();
|
|
||||||
}
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
height: 52
|
|
||||||
color: Theme.surfaceSelected
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.color: Theme.outlineLight
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: 4
|
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: tabNames
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: (parent.width - (tabNames.length - 1) * 2) / tabNames.length
|
|
||||||
height: 44
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: currentTab === index ? Theme.primaryPressed : (tabMouseArea.containsMouse ? Theme.primaryHoverLight : "transparent")
|
|
||||||
border.color: currentTab === index ? Theme.primary : "transparent"
|
|
||||||
border.width: currentTab === index ? 1 : 0
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: {
|
|
||||||
const tabIcons = ["list_alt", "analytics", "settings"];
|
|
||||||
return tabIcons[index] || "tab";
|
|
||||||
}
|
|
||||||
size: Theme.iconSize - 2
|
|
||||||
color: currentTab === index ? Theme.primary : Theme.surfaceText
|
|
||||||
opacity: currentTab === index ? 1 : 0.7
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: currentTab === index ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.verticalCenterOffset: -1
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: tabMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
currentTab = index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on border.color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Theme.surfaceLight
|
|
||||||
border.color: Theme.outlineLight
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: processesTab
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingS
|
|
||||||
active: processListModal.visible && currentTab === 0
|
|
||||||
visible: currentTab === 0
|
|
||||||
opacity: currentTab === 0 ? 1 : 0
|
|
||||||
sourceComponent: processesTabComponent
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: performanceTab
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingS
|
|
||||||
active: processListModal.visible && currentTab === 1
|
|
||||||
visible: currentTab === 1
|
|
||||||
opacity: currentTab === 1 ? 1 : 0
|
|
||||||
sourceComponent: performanceTabComponent
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: systemTab
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingS
|
|
||||||
active: processListModal.visible && currentTab === 2
|
|
||||||
visible: currentTab === 2
|
|
||||||
opacity: currentTab === 2 ? 1 : 0
|
|
||||||
sourceComponent: systemTabComponent
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,246 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: powerTab
|
|
||||||
|
|
||||||
DankFlickable {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: Theme.spacingL
|
|
||||||
clip: true
|
|
||||||
contentHeight: mainColumn.height
|
|
||||||
contentWidth: width
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: mainColumn
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingXL
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Battery not detected - only AC power settings available"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
visible: !BatteryService.batteryAvailable
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: timeoutSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: timeoutSection
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "schedule"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Idle Settings"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: Math.max(0, parent.width - parent.children[0].width - parent.children[1].width - powerCategory.width - Theme.spacingM * 3)
|
|
||||||
height: parent.height
|
|
||||||
}
|
|
||||||
|
|
||||||
DankButtonGroup {
|
|
||||||
id: powerCategory
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
visible: BatteryService.batteryAvailable
|
|
||||||
model: ["AC Power", "Battery"]
|
|
||||||
currentIndex: 0
|
|
||||||
selectionMode: "single"
|
|
||||||
checkEnabled: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankDropdown {
|
|
||||||
id: lockDropdown
|
|
||||||
property var timeoutOptions: ["Never", "1 minute", "2 minutes", "3 minutes", "5 minutes", "10 minutes", "15 minutes", "20 minutes", "30 minutes", "1 hour", "1 hour 30 minutes", "2 hours", "3 hours"]
|
|
||||||
property var timeoutValues: [0, 60, 120, 180, 300, 600, 900, 1200, 1800, 3600, 5400, 7200, 10800]
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
text: "Automatically lock after"
|
|
||||||
options: timeoutOptions
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: powerCategory
|
|
||||||
function onCurrentIndexChanged() {
|
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acLockTimeout : SessionData.batteryLockTimeout
|
|
||||||
const index = lockDropdown.timeoutValues.indexOf(currentTimeout)
|
|
||||||
lockDropdown.currentValue = index >= 0 ? lockDropdown.timeoutOptions[index] : "Never"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acLockTimeout : SessionData.batteryLockTimeout
|
|
||||||
const index = timeoutValues.indexOf(currentTimeout)
|
|
||||||
currentValue = index >= 0 ? timeoutOptions[index] : "Never"
|
|
||||||
}
|
|
||||||
|
|
||||||
onValueChanged: value => {
|
|
||||||
const index = timeoutOptions.indexOf(value)
|
|
||||||
if (index >= 0) {
|
|
||||||
const timeout = timeoutValues[index]
|
|
||||||
if (powerCategory.currentIndex === 0) {
|
|
||||||
SessionData.setAcLockTimeout(timeout)
|
|
||||||
} else {
|
|
||||||
SessionData.setBatteryLockTimeout(timeout)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankDropdown {
|
|
||||||
id: monitorDropdown
|
|
||||||
property var timeoutOptions: ["Never", "1 minute", "2 minutes", "3 minutes", "5 minutes", "10 minutes", "15 minutes", "20 minutes", "30 minutes", "1 hour", "1 hour 30 minutes", "2 hours", "3 hours"]
|
|
||||||
property var timeoutValues: [0, 60, 120, 180, 300, 600, 900, 1200, 1800, 3600, 5400, 7200, 10800]
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
text: "Turn off monitors after"
|
|
||||||
options: timeoutOptions
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: powerCategory
|
|
||||||
function onCurrentIndexChanged() {
|
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acMonitorTimeout : SessionData.batteryMonitorTimeout
|
|
||||||
const index = monitorDropdown.timeoutValues.indexOf(currentTimeout)
|
|
||||||
monitorDropdown.currentValue = index >= 0 ? monitorDropdown.timeoutOptions[index] : "Never"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acMonitorTimeout : SessionData.batteryMonitorTimeout
|
|
||||||
const index = timeoutValues.indexOf(currentTimeout)
|
|
||||||
currentValue = index >= 0 ? timeoutOptions[index] : "Never"
|
|
||||||
}
|
|
||||||
|
|
||||||
onValueChanged: value => {
|
|
||||||
const index = timeoutOptions.indexOf(value)
|
|
||||||
if (index >= 0) {
|
|
||||||
const timeout = timeoutValues[index]
|
|
||||||
if (powerCategory.currentIndex === 0) {
|
|
||||||
SessionData.setAcMonitorTimeout(timeout)
|
|
||||||
} else {
|
|
||||||
SessionData.setBatteryMonitorTimeout(timeout)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankDropdown {
|
|
||||||
id: suspendDropdown
|
|
||||||
property var timeoutOptions: ["Never", "1 minute", "2 minutes", "3 minutes", "5 minutes", "10 minutes", "15 minutes", "20 minutes", "30 minutes", "1 hour", "1 hour 30 minutes", "2 hours", "3 hours"]
|
|
||||||
property var timeoutValues: [0, 60, 120, 180, 300, 600, 900, 1200, 1800, 3600, 5400, 7200, 10800]
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
text: "Suspend system after"
|
|
||||||
options: timeoutOptions
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: powerCategory
|
|
||||||
function onCurrentIndexChanged() {
|
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acSuspendTimeout : SessionData.batterySuspendTimeout
|
|
||||||
const index = suspendDropdown.timeoutValues.indexOf(currentTimeout)
|
|
||||||
suspendDropdown.currentValue = index >= 0 ? suspendDropdown.timeoutOptions[index] : "Never"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acSuspendTimeout : SessionData.batterySuspendTimeout
|
|
||||||
const index = timeoutValues.indexOf(currentTimeout)
|
|
||||||
currentValue = index >= 0 ? timeoutOptions[index] : "Never"
|
|
||||||
}
|
|
||||||
|
|
||||||
onValueChanged: value => {
|
|
||||||
const index = timeoutOptions.indexOf(value)
|
|
||||||
if (index >= 0) {
|
|
||||||
const timeout = timeoutValues[index]
|
|
||||||
if (powerCategory.currentIndex === 0) {
|
|
||||||
SessionData.setAcSuspendTimeout(timeout)
|
|
||||||
} else {
|
|
||||||
SessionData.setBatterySuspendTimeout(timeout)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankDropdown {
|
|
||||||
id: hibernateDropdown
|
|
||||||
property var timeoutOptions: ["Never", "1 minute", "2 minutes", "3 minutes", "5 minutes", "10 minutes", "15 minutes", "20 minutes", "30 minutes", "1 hour", "1 hour 30 minutes", "2 hours", "3 hours"]
|
|
||||||
property var timeoutValues: [0, 60, 120, 180, 300, 600, 900, 1200, 1800, 3600, 5400, 7200, 10800]
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
text: "Hibernate system after"
|
|
||||||
options: timeoutOptions
|
|
||||||
visible: SessionService.hibernateSupported
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: powerCategory
|
|
||||||
function onCurrentIndexChanged() {
|
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acHibernateTimeout : SessionData.batteryHibernateTimeout
|
|
||||||
const index = hibernateDropdown.timeoutValues.indexOf(currentTimeout)
|
|
||||||
hibernateDropdown.currentValue = index >= 0 ? hibernateDropdown.timeoutOptions[index] : "Never"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acHibernateTimeout : SessionData.batteryHibernateTimeout
|
|
||||||
const index = timeoutValues.indexOf(currentTimeout)
|
|
||||||
currentValue = index >= 0 ? timeoutOptions[index] : "Never"
|
|
||||||
}
|
|
||||||
|
|
||||||
onValueChanged: value => {
|
|
||||||
const index = timeoutOptions.indexOf(value)
|
|
||||||
if (index >= 0) {
|
|
||||||
const timeout = timeoutValues[index]
|
|
||||||
if (powerCategory.currentIndex === 0) {
|
|
||||||
SessionData.setAcHibernateTimeout(timeout)
|
|
||||||
} else {
|
|
||||||
SessionData.setBatteryHibernateTimeout(timeout)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankToggle {
|
|
||||||
width: parent.width
|
|
||||||
text: "Lock before suspend"
|
|
||||||
description: "Automatically lock the screen when the system prepares to suspend"
|
|
||||||
checked: SessionData.lockBeforeSuspend
|
|
||||||
onToggled: checked => SessionData.setLockBeforeSuspend(checked)
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Idle monitoring not supported - requires newer Quickshell version"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.error
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
visible: !IdleService.idleMonitorAvailable
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,171 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modules.Settings
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property int currentIndex: 0
|
|
||||||
property var parentModal: null
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: 0
|
|
||||||
anchors.rightMargin: Theme.spacingS
|
|
||||||
anchors.bottomMargin: Theme.spacingM
|
|
||||||
anchors.topMargin: 0
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: personalizationLoader
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
active: root.currentIndex === 0
|
|
||||||
visible: active
|
|
||||||
asynchronous: true
|
|
||||||
|
|
||||||
sourceComponent: Component {
|
|
||||||
PersonalizationTab {
|
|
||||||
parentModal: root.parentModal
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: timeLoader
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
active: root.currentIndex === 1
|
|
||||||
visible: active
|
|
||||||
asynchronous: true
|
|
||||||
|
|
||||||
sourceComponent: TimeTab {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: weatherLoader
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
active: root.currentIndex === 2
|
|
||||||
visible: active
|
|
||||||
asynchronous: true
|
|
||||||
|
|
||||||
sourceComponent: WeatherTab {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: topBarLoader
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
active: root.currentIndex === 3
|
|
||||||
visible: active
|
|
||||||
asynchronous: true
|
|
||||||
|
|
||||||
sourceComponent: TopBarTab {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: widgetsLoader
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
active: root.currentIndex === 4
|
|
||||||
visible: active
|
|
||||||
asynchronous: true
|
|
||||||
|
|
||||||
sourceComponent: WidgetTweaksTab {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: dockLoader
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
active: root.currentIndex === 5
|
|
||||||
visible: active
|
|
||||||
asynchronous: true
|
|
||||||
|
|
||||||
sourceComponent: Component {
|
|
||||||
DockTab {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: displaysLoader
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
active: root.currentIndex === 6
|
|
||||||
visible: active
|
|
||||||
asynchronous: true
|
|
||||||
|
|
||||||
sourceComponent: DisplaysTab {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: launcherLoader
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
active: root.currentIndex === 7
|
|
||||||
visible: active
|
|
||||||
asynchronous: true
|
|
||||||
|
|
||||||
sourceComponent: LauncherTab {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: themeColorsLoader
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
active: root.currentIndex === 8
|
|
||||||
visible: active
|
|
||||||
asynchronous: true
|
|
||||||
|
|
||||||
sourceComponent: ThemeColorsTab {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: powerLoader
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
active: root.currentIndex === 9
|
|
||||||
visible: active
|
|
||||||
asynchronous: true
|
|
||||||
|
|
||||||
sourceComponent: PowerSettings {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: aboutLoader
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
active: root.currentIndex === 10
|
|
||||||
visible: active
|
|
||||||
asynchronous: true
|
|
||||||
|
|
||||||
sourceComponent: AboutTab {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,199 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Effects
|
|
||||||
import Quickshell.Io
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modals.Common
|
|
||||||
import qs.Modals.FileBrowser
|
|
||||||
import qs.Modules.Settings
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
DankModal {
|
|
||||||
id: settingsModal
|
|
||||||
|
|
||||||
property Component settingsContent
|
|
||||||
property alias profileBrowser: profileBrowser
|
|
||||||
|
|
||||||
signal closingModal()
|
|
||||||
|
|
||||||
function show() {
|
|
||||||
open();
|
|
||||||
}
|
|
||||||
|
|
||||||
function hide() {
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle() {
|
|
||||||
if (shouldBeVisible) {
|
|
||||||
hide();
|
|
||||||
} else {
|
|
||||||
show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
objectName: "settingsModal"
|
|
||||||
width: 800
|
|
||||||
height: 750
|
|
||||||
visible: false
|
|
||||||
onBackgroundClicked: () => {
|
|
||||||
return hide();
|
|
||||||
}
|
|
||||||
content: settingsContent
|
|
||||||
|
|
||||||
IpcHandler {
|
|
||||||
function open(): string {
|
|
||||||
settingsModal.show();
|
|
||||||
return "SETTINGS_OPEN_SUCCESS";
|
|
||||||
}
|
|
||||||
|
|
||||||
function close(): string {
|
|
||||||
settingsModal.hide();
|
|
||||||
return "SETTINGS_CLOSE_SUCCESS";
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle(): string {
|
|
||||||
settingsModal.toggle();
|
|
||||||
return "SETTINGS_TOGGLE_SUCCESS";
|
|
||||||
}
|
|
||||||
|
|
||||||
target: "settings"
|
|
||||||
}
|
|
||||||
|
|
||||||
IpcHandler {
|
|
||||||
function browse(type: string) {
|
|
||||||
if (type === "wallpaper") {
|
|
||||||
wallpaperBrowser.allowStacking = false;
|
|
||||||
wallpaperBrowser.open();
|
|
||||||
} else if (type === "profile") {
|
|
||||||
profileBrowser.allowStacking = false;
|
|
||||||
profileBrowser.open();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
target: "file"
|
|
||||||
}
|
|
||||||
|
|
||||||
FileBrowserModal {
|
|
||||||
id: profileBrowser
|
|
||||||
|
|
||||||
allowStacking: true
|
|
||||||
browserTitle: "Select Profile Image"
|
|
||||||
browserIcon: "person"
|
|
||||||
browserType: "profile"
|
|
||||||
fileExtensions: ["*.jpg", "*.jpeg", "*.png", "*.bmp", "*.gif", "*.webp"]
|
|
||||||
onFileSelected: (path) => {
|
|
||||||
PortalService.setProfileImage(path);
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
onDialogClosed: () => {
|
|
||||||
if (settingsModal) {
|
|
||||||
settingsModal.allowFocusOverride = false;
|
|
||||||
settingsModal.shouldHaveFocus = Qt.binding(() => {
|
|
||||||
return settingsModal.shouldBeVisible;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
allowStacking = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FileBrowserModal {
|
|
||||||
id: wallpaperBrowser
|
|
||||||
|
|
||||||
allowStacking: true
|
|
||||||
browserTitle: "Select Wallpaper"
|
|
||||||
browserIcon: "wallpaper"
|
|
||||||
browserType: "wallpaper"
|
|
||||||
fileExtensions: ["*.jpg", "*.jpeg", "*.png", "*.bmp", "*.gif", "*.webp"]
|
|
||||||
onFileSelected: (path) => {
|
|
||||||
SessionData.setWallpaper(path);
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
onDialogClosed: () => {
|
|
||||||
allowStacking = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
settingsContent: Component {
|
|
||||||
Item {
|
|
||||||
anchors.fill: parent
|
|
||||||
focus: true
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: Theme.spacingL
|
|
||||||
anchors.rightMargin: Theme.spacingL
|
|
||||||
anchors.topMargin: Theme.spacingM
|
|
||||||
anchors.bottomMargin: Theme.spacingL
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: 35
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "settings"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Settings"
|
|
||||||
font.pixelSize: Theme.fontSizeXLarge
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
circular: false
|
|
||||||
iconName: "close"
|
|
||||||
iconSize: Theme.iconSize - 4
|
|
||||||
iconColor: Theme.surfaceText
|
|
||||||
onClicked: () => {
|
|
||||||
return settingsModal.hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height - 35
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
SettingsSidebar {
|
|
||||||
id: sidebar
|
|
||||||
|
|
||||||
parentModal: settingsModal
|
|
||||||
onCurrentIndexChanged: content.currentIndex = currentIndex
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsContent {
|
|
||||||
id: content
|
|
||||||
|
|
||||||
width: parent.width - sidebar.width
|
|
||||||
height: parent.height
|
|
||||||
parentModal: settingsModal
|
|
||||||
currentIndex: sidebar.currentIndex
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modals.Settings
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: sidebarContainer
|
|
||||||
|
|
||||||
property int currentIndex: 0
|
|
||||||
property var parentModal: null
|
|
||||||
readonly property var sidebarItems: [{
|
|
||||||
"text": "Personalization",
|
|
||||||
"icon": "person"
|
|
||||||
}, {
|
|
||||||
"text": "Time & Date",
|
|
||||||
"icon": "schedule"
|
|
||||||
}, {
|
|
||||||
"text": "Weather",
|
|
||||||
"icon": "cloud"
|
|
||||||
}, {
|
|
||||||
"text": "Top Bar",
|
|
||||||
"icon": "toolbar"
|
|
||||||
}, {
|
|
||||||
"text": "Widgets",
|
|
||||||
"icon": "widgets"
|
|
||||||
}, {
|
|
||||||
"text": "Dock",
|
|
||||||
"icon": "dock_to_bottom"
|
|
||||||
}, {
|
|
||||||
"text": "Displays",
|
|
||||||
"icon": "monitor"
|
|
||||||
}, {
|
|
||||||
"text": "Launcher",
|
|
||||||
"icon": "apps"
|
|
||||||
}, {
|
|
||||||
"text": "Theme & Colors",
|
|
||||||
"icon": "palette"
|
|
||||||
}, {
|
|
||||||
"text": "Power",
|
|
||||||
"icon": "power_settings_new"
|
|
||||||
}, {
|
|
||||||
"text": "About",
|
|
||||||
"icon": "info"
|
|
||||||
}]
|
|
||||||
|
|
||||||
width: 270
|
|
||||||
height: parent.height
|
|
||||||
color: Theme.surfaceContainer
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
anchors.rightMargin: Theme.spacingS
|
|
||||||
anchors.bottomMargin: Theme.spacingS
|
|
||||||
anchors.topMargin: Theme.spacingM + 2
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
ProfileSection {
|
|
||||||
parentModal: sidebarContainer.parentModal
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width - Theme.spacingS * 2
|
|
||||||
height: 1
|
|
||||||
color: Theme.outline
|
|
||||||
opacity: 0.2
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: Theme.spacingL
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
id: sidebarRepeater
|
|
||||||
|
|
||||||
model: sidebarContainer.sidebarItems
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
property bool isActive: sidebarContainer.currentIndex === index
|
|
||||||
|
|
||||||
width: parent.width - Theme.spacingS * 2
|
|
||||||
height: 44
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: isActive ? Theme.primaryContainer : tabMouseArea.containsMouse ? Theme.surfaceHover : "transparent"
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: modelData.icon || ""
|
|
||||||
size: Theme.iconSize - 2
|
|
||||||
color: parent.parent.isActive ? Theme.surfaceText : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData.text || ""
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: parent.parent.isActive ? Theme.surfaceText : Theme.surfaceText
|
|
||||||
font.weight: parent.parent.isActive ? Font.Medium : Font.Normal
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: tabMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
sidebarContainer.currentIndex = index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,226 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modals.Spotlight
|
|
||||||
import qs.Modules.AppDrawer
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: spotlightKeyHandler
|
|
||||||
|
|
||||||
property alias appLauncher: appLauncher
|
|
||||||
property alias searchField: searchField
|
|
||||||
property var parentModal: null
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
focus: true
|
|
||||||
Keys.onPressed: event => {
|
|
||||||
if (event.key === Qt.Key_Escape) {
|
|
||||||
if (parentModal)
|
|
||||||
parentModal.hide()
|
|
||||||
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Down) {
|
|
||||||
appLauncher.selectNext()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Up) {
|
|
||||||
appLauncher.selectPrevious()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Right && appLauncher.viewMode === "grid") {
|
|
||||||
appLauncher.selectNextInRow()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Left && appLauncher.viewMode === "grid") {
|
|
||||||
appLauncher.selectPreviousInRow()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
|
|
||||||
appLauncher.launchSelected()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (!searchField.activeFocus && event.text && event.text.length > 0 && event.text.match(/[a-zA-Z0-9\\s]/)) {
|
|
||||||
searchField.forceActiveFocus()
|
|
||||||
searchField.insertText(event.text)
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AppLauncher {
|
|
||||||
id: appLauncher
|
|
||||||
|
|
||||||
viewMode: SettingsData.spotlightModalViewMode
|
|
||||||
gridColumns: 4
|
|
||||||
onAppLaunched: () => {
|
|
||||||
if (parentModal)
|
|
||||||
parentModal.hide()
|
|
||||||
}
|
|
||||||
onViewModeSelected: mode => {
|
|
||||||
SettingsData.setSpotlightModalViewMode(mode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingL
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: categorySelector.height + Theme.spacingM * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Theme.surfaceVariantAlpha
|
|
||||||
border.color: Theme.outlineMedium
|
|
||||||
border.width: 1
|
|
||||||
visible: appLauncher.categories.length > 1 || appLauncher.model.count > 0
|
|
||||||
|
|
||||||
CategorySelector {
|
|
||||||
id: categorySelector
|
|
||||||
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width - Theme.spacingM * 2
|
|
||||||
categories: appLauncher.categories
|
|
||||||
selectedCategory: appLauncher.selectedCategory
|
|
||||||
compact: false
|
|
||||||
onCategorySelected: category => {
|
|
||||||
appLauncher.setCategory(category)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankTextField {
|
|
||||||
id: searchField
|
|
||||||
|
|
||||||
width: parent.width - 80 - Theme.spacingM
|
|
||||||
height: 56
|
|
||||||
cornerRadius: Theme.cornerRadius
|
|
||||||
backgroundColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, Theme.getContentBackgroundAlpha() * 0.7)
|
|
||||||
normalBorderColor: Theme.outlineMedium
|
|
||||||
focusedBorderColor: Theme.primary
|
|
||||||
leftIconName: "search"
|
|
||||||
leftIconSize: Theme.iconSize
|
|
||||||
leftIconColor: Theme.surfaceVariantText
|
|
||||||
leftIconFocusedColor: Theme.primary
|
|
||||||
showClearButton: true
|
|
||||||
textColor: Theme.surfaceText
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
enabled: parentModal ? parentModal.spotlightOpen : true
|
|
||||||
placeholderText: ""
|
|
||||||
ignoreLeftRightKeys: true
|
|
||||||
keyForwardTargets: [spotlightKeyHandler]
|
|
||||||
text: appLauncher.searchQuery
|
|
||||||
onTextEdited: () => {
|
|
||||||
appLauncher.searchQuery = text
|
|
||||||
}
|
|
||||||
Keys.onPressed: event => {
|
|
||||||
if (event.key === Qt.Key_Escape) {
|
|
||||||
if (parentModal)
|
|
||||||
parentModal.hide()
|
|
||||||
|
|
||||||
event.accepted = true
|
|
||||||
} else if ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && text.length > 0) {
|
|
||||||
if (appLauncher.keyboardNavigationActive && appLauncher.model.count > 0)
|
|
||||||
appLauncher.launchSelected()
|
|
||||||
else if (appLauncher.model.count > 0)
|
|
||||||
appLauncher.launchApp(appLauncher.model.get(0))
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Down || event.key === Qt.Key_Up || event.key === Qt.Key_Left || event.key === Qt.Key_Right || ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && text.length === 0)) {
|
|
||||||
event.accepted = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
visible: appLauncher.model.count > 0
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 36
|
|
||||||
height: 36
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: appLauncher.viewMode === "list" ? Theme.primaryHover : listViewArea.containsMouse ? Theme.surfaceHover : "transparent"
|
|
||||||
border.color: appLauncher.viewMode === "list" ? Theme.primarySelected : "transparent"
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "view_list"
|
|
||||||
size: 18
|
|
||||||
color: appLauncher.viewMode === "list" ? Theme.primary : Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: listViewArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
appLauncher.setViewMode("list")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 36
|
|
||||||
height: 36
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: appLauncher.viewMode === "grid" ? Theme.primaryHover : gridViewArea.containsMouse ? Theme.surfaceHover : "transparent"
|
|
||||||
border.color: appLauncher.viewMode === "grid" ? Theme.primarySelected : "transparent"
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "grid_view"
|
|
||||||
size: 18
|
|
||||||
color: appLauncher.viewMode === "grid" ? Theme.primary : Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: gridViewArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
appLauncher.setViewMode("grid")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SpotlightResults {
|
|
||||||
appLauncher: spotlightKeyHandler.appLauncher
|
|
||||||
contextMenu: contextMenu
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SpotlightContextMenu {
|
|
||||||
id: contextMenu
|
|
||||||
|
|
||||||
appLauncher: spotlightKeyHandler.appLauncher
|
|
||||||
parentHandler: spotlightKeyHandler
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
visible: contextMenu.visible
|
|
||||||
z: 999
|
|
||||||
onClicked: () => {
|
|
||||||
contextMenu.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
|
|
||||||
// Prevent closing when clicking on the menu itself
|
|
||||||
x: contextMenu.x
|
|
||||||
y: contextMenu.y
|
|
||||||
width: contextMenu.width
|
|
||||||
height: contextMenu.height
|
|
||||||
onClicked: () => {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,205 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: contextMenu
|
|
||||||
|
|
||||||
property var currentApp: null
|
|
||||||
property bool menuVisible: false
|
|
||||||
property var appLauncher: null
|
|
||||||
property var parentHandler: null
|
|
||||||
|
|
||||||
function show(x, y, app) {
|
|
||||||
currentApp = app
|
|
||||||
const menuWidth = 180
|
|
||||||
const menuHeight = menuColumn.implicitHeight + Theme.spacingS * 2
|
|
||||||
let finalX = x + 8
|
|
||||||
let finalY = y + 8
|
|
||||||
if (parentHandler) {
|
|
||||||
if (finalX + menuWidth > parentHandler.width)
|
|
||||||
finalX = x - menuWidth - 8
|
|
||||||
|
|
||||||
if (finalY + menuHeight > parentHandler.height)
|
|
||||||
finalY = y - menuHeight - 8
|
|
||||||
|
|
||||||
finalX = Math.max(8, Math.min(finalX, parentHandler.width - menuWidth - 8))
|
|
||||||
finalY = Math.max(8, Math.min(finalY, parentHandler.height - menuHeight - 8))
|
|
||||||
}
|
|
||||||
contextMenu.x = finalX
|
|
||||||
contextMenu.y = finalY
|
|
||||||
contextMenu.visible = true
|
|
||||||
contextMenu.menuVisible = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function close() {
|
|
||||||
contextMenu.menuVisible = false
|
|
||||||
Qt.callLater(() => {
|
|
||||||
contextMenu.visible = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
visible: false
|
|
||||||
width: 180
|
|
||||||
height: menuColumn.implicitHeight + Theme.spacingS * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Theme.popupBackground()
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
|
||||||
border.width: 1
|
|
||||||
z: 1000
|
|
||||||
opacity: menuVisible ? 1 : 0
|
|
||||||
scale: menuVisible ? 1 : 0.85
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: 4
|
|
||||||
anchors.leftMargin: 2
|
|
||||||
anchors.rightMargin: -2
|
|
||||||
anchors.bottomMargin: -4
|
|
||||||
radius: parent.radius
|
|
||||||
color: Qt.rgba(0, 0, 0, 0.15)
|
|
||||||
z: parent.z - 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: menuColumn
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingS
|
|
||||||
spacing: 1
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 32
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: pinMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: {
|
|
||||||
if (!contextMenu.currentApp || !contextMenu.currentApp.desktopEntry)
|
|
||||||
return "push_pin"
|
|
||||||
|
|
||||||
const appId = contextMenu.currentApp.desktopEntry.id || contextMenu.currentApp.desktopEntry.execString || ""
|
|
||||||
return SessionData.isPinnedApp(appId) ? "keep_off" : "push_pin"
|
|
||||||
}
|
|
||||||
size: Theme.iconSize - 2
|
|
||||||
color: Theme.surfaceText
|
|
||||||
opacity: 0.7
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: {
|
|
||||||
if (!contextMenu.currentApp || !contextMenu.currentApp.desktopEntry)
|
|
||||||
return "Pin to Dock"
|
|
||||||
|
|
||||||
const appId = contextMenu.currentApp.desktopEntry.id || contextMenu.currentApp.desktopEntry.execString || ""
|
|
||||||
return SessionData.isPinnedApp(appId) ? "Unpin from Dock" : "Pin to Dock"
|
|
||||||
}
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Normal
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: pinMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
if (!contextMenu.currentApp || !contextMenu.currentApp.desktopEntry)
|
|
||||||
return
|
|
||||||
|
|
||||||
const appId = contextMenu.currentApp.desktopEntry.id || contextMenu.currentApp.desktopEntry.execString || ""
|
|
||||||
if (SessionData.isPinnedApp(appId))
|
|
||||||
SessionData.removePinnedApp(appId)
|
|
||||||
else
|
|
||||||
SessionData.addPinnedApp(appId)
|
|
||||||
contextMenu.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width - Theme.spacingS * 2
|
|
||||||
height: 5
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 32
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: launchMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "launch"
|
|
||||||
size: Theme.iconSize - 2
|
|
||||||
color: Theme.surfaceText
|
|
||||||
opacity: 0.7
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Launch"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Normal
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: launchMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
if (contextMenu.currentApp && appLauncher)
|
|
||||||
appLauncher.launchApp(contextMenu.currentApp)
|
|
||||||
|
|
||||||
contextMenu.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on scale {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modals.Common
|
|
||||||
import qs.Modules.AppDrawer
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
DankModal {
|
|
||||||
id: spotlightModal
|
|
||||||
|
|
||||||
property bool spotlightOpen: false
|
|
||||||
property Component spotlightContent
|
|
||||||
|
|
||||||
function show() {
|
|
||||||
spotlightOpen = true
|
|
||||||
open()
|
|
||||||
if (contentLoader.item && contentLoader.item.appLauncher) {
|
|
||||||
contentLoader.item.appLauncher.searchQuery = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
Qt.callLater(() => {
|
|
||||||
if (contentLoader.item && contentLoader.item.searchField) {
|
|
||||||
contentLoader.item.searchField.forceActiveFocus()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function hide() {
|
|
||||||
spotlightOpen = false
|
|
||||||
close()
|
|
||||||
if (contentLoader.item && contentLoader.item.appLauncher) {
|
|
||||||
contentLoader.item.appLauncher.searchQuery = ""
|
|
||||||
contentLoader.item.appLauncher.selectedIndex = 0
|
|
||||||
contentLoader.item.appLauncher.setCategory("All")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle() {
|
|
||||||
if (spotlightOpen) {
|
|
||||||
hide()
|
|
||||||
} else {
|
|
||||||
show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
shouldBeVisible: spotlightOpen
|
|
||||||
width: 550
|
|
||||||
height: 600
|
|
||||||
backgroundColor: Theme.popupBackground()
|
|
||||||
cornerRadius: Theme.cornerRadius
|
|
||||||
borderColor: Theme.outlineMedium
|
|
||||||
borderWidth: 1
|
|
||||||
enableShadow: true
|
|
||||||
onVisibleChanged: () => {
|
|
||||||
if (visible && !spotlightOpen) {
|
|
||||||
show()
|
|
||||||
}
|
|
||||||
if (visible && contentLoader.item) {
|
|
||||||
Qt.callLater(() => {
|
|
||||||
if (contentLoader.item.searchField) {
|
|
||||||
contentLoader.item.searchField.forceActiveFocus()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onBackgroundClicked: () => {
|
|
||||||
return hide()
|
|
||||||
}
|
|
||||||
content: spotlightContent
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onCloseAllModalsExcept(excludedModal) {
|
|
||||||
if (excludedModal !== spotlightModal && !allowStacking && spotlightOpen) {
|
|
||||||
spotlightOpen = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
target: ModalManager
|
|
||||||
}
|
|
||||||
|
|
||||||
IpcHandler {
|
|
||||||
function open(): string {
|
|
||||||
spotlightModal.show()
|
|
||||||
return "SPOTLIGHT_OPEN_SUCCESS"
|
|
||||||
}
|
|
||||||
|
|
||||||
function close(): string {
|
|
||||||
spotlightModal.hide()
|
|
||||||
return "SPOTLIGHT_CLOSE_SUCCESS"
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggle(): string {
|
|
||||||
spotlightModal.toggle()
|
|
||||||
return "SPOTLIGHT_TOGGLE_SUCCESS"
|
|
||||||
}
|
|
||||||
|
|
||||||
target: "spotlight"
|
|
||||||
}
|
|
||||||
|
|
||||||
spotlightContent: Component {
|
|
||||||
SpotlightContent {
|
|
||||||
parentModal: spotlightModal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,324 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: resultsContainer
|
|
||||||
|
|
||||||
property var appLauncher: null
|
|
||||||
property var contextMenu: null
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height - y
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Theme.surfaceLight
|
|
||||||
border.color: Theme.outlineLight
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
DankListView {
|
|
||||||
id: resultsList
|
|
||||||
|
|
||||||
property int itemHeight: 60
|
|
||||||
property int iconSize: 40
|
|
||||||
property bool showDescription: true
|
|
||||||
property int itemSpacing: Theme.spacingS
|
|
||||||
property bool hoverUpdatesSelection: false
|
|
||||||
property bool keyboardNavigationActive: appLauncher ? appLauncher.keyboardNavigationActive : false
|
|
||||||
|
|
||||||
signal keyboardNavigationReset
|
|
||||||
signal itemClicked(int index, var modelData)
|
|
||||||
signal itemRightClicked(int index, var modelData, real mouseX, real mouseY)
|
|
||||||
|
|
||||||
function ensureVisible(index) {
|
|
||||||
if (index < 0 || index >= count)
|
|
||||||
return
|
|
||||||
|
|
||||||
const itemY = index * (itemHeight + itemSpacing)
|
|
||||||
const itemBottom = itemY + itemHeight
|
|
||||||
if (itemY < contentY)
|
|
||||||
contentY = itemY
|
|
||||||
else if (itemBottom > contentY + height)
|
|
||||||
contentY = itemBottom - height
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingS
|
|
||||||
visible: appLauncher && appLauncher.viewMode === "list"
|
|
||||||
model: appLauncher ? appLauncher.model : null
|
|
||||||
currentIndex: appLauncher ? appLauncher.selectedIndex : -1
|
|
||||||
clip: true
|
|
||||||
spacing: itemSpacing
|
|
||||||
focus: true
|
|
||||||
interactive: true
|
|
||||||
cacheBuffer: Math.max(0, Math.min(height * 2, 1000))
|
|
||||||
reuseItems: true
|
|
||||||
onCurrentIndexChanged: {
|
|
||||||
if (keyboardNavigationActive)
|
|
||||||
ensureVisible(currentIndex)
|
|
||||||
}
|
|
||||||
onItemClicked: (index, modelData) => {
|
|
||||||
if (appLauncher)
|
|
||||||
appLauncher.launchApp(modelData)
|
|
||||||
}
|
|
||||||
onItemRightClicked: (index, modelData, mouseX, mouseY) => {
|
|
||||||
if (contextMenu)
|
|
||||||
contextMenu.show(mouseX, mouseY, modelData)
|
|
||||||
}
|
|
||||||
onKeyboardNavigationReset: () => {
|
|
||||||
if (appLauncher)
|
|
||||||
appLauncher.keyboardNavigationActive = false
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: Rectangle {
|
|
||||||
width: ListView.view.width
|
|
||||||
height: resultsList.itemHeight
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: ListView.isCurrentItem ? Theme.primaryPressed : listMouseArea.containsMouse ? Theme.primaryHoverLight : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.03)
|
|
||||||
border.color: ListView.isCurrentItem ? Theme.primarySelected : Theme.outlineMedium
|
|
||||||
border.width: ListView.isCurrentItem ? 2 : 1
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingM
|
|
||||||
spacing: Theme.spacingL
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: resultsList.iconSize
|
|
||||||
height: resultsList.iconSize
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
IconImage {
|
|
||||||
id: listIconImg
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
source: Quickshell.iconPath(model.icon, true)
|
|
||||||
asynchronous: true
|
|
||||||
visible: status === Image.Ready
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
visible: !listIconImg.visible
|
|
||||||
color: Theme.surfaceLight
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.width: 1
|
|
||||||
border.color: Theme.primarySelected
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: (model.name && model.name.length > 0) ? model.name.charAt(0).toUpperCase() : "A"
|
|
||||||
font.pixelSize: resultsList.iconSize * 0.4
|
|
||||||
color: Theme.primary
|
|
||||||
font.weight: Font.Bold
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: parent.width - resultsList.iconSize - Theme.spacingL
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
width: parent.width
|
|
||||||
text: model.name || ""
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
elide: Text.ElideRight
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
width: parent.width
|
|
||||||
text: model.comment || "Application"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
elide: Text.ElideRight
|
|
||||||
maximumLineCount: 1
|
|
||||||
visible: resultsList.showDescription && model.comment && model.comment.length > 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: listMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
||||||
z: 10
|
|
||||||
onEntered: () => {
|
|
||||||
if (resultsList.hoverUpdatesSelection && !resultsList.keyboardNavigationActive)
|
|
||||||
resultsList.currentIndex = index
|
|
||||||
}
|
|
||||||
onPositionChanged: () => {
|
|
||||||
resultsList.keyboardNavigationReset()
|
|
||||||
}
|
|
||||||
onClicked: mouse => {
|
|
||||||
if (mouse.button === Qt.LeftButton) {
|
|
||||||
resultsList.itemClicked(index, model)
|
|
||||||
} else if (mouse.button === Qt.RightButton) {
|
|
||||||
const modalPos = mapToItem(resultsContainer.parent, mouse.x, mouse.y)
|
|
||||||
resultsList.itemRightClicked(index, model, modalPos.x, modalPos.y)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankGridView {
|
|
||||||
id: resultsGrid
|
|
||||||
|
|
||||||
property int currentIndex: appLauncher ? appLauncher.selectedIndex : -1
|
|
||||||
property int columns: 4
|
|
||||||
property bool adaptiveColumns: false
|
|
||||||
property int minCellWidth: 120
|
|
||||||
property int maxCellWidth: 160
|
|
||||||
property int cellPadding: 8
|
|
||||||
property real iconSizeRatio: 0.55
|
|
||||||
property int maxIconSize: 48
|
|
||||||
property int minIconSize: 32
|
|
||||||
property bool hoverUpdatesSelection: false
|
|
||||||
property bool keyboardNavigationActive: appLauncher ? appLauncher.keyboardNavigationActive : false
|
|
||||||
property int baseCellWidth: adaptiveColumns ? Math.max(minCellWidth, Math.min(maxCellWidth, width / columns)) : (width - Theme.spacingS * 2) / columns
|
|
||||||
property int baseCellHeight: baseCellWidth + 20
|
|
||||||
property int actualColumns: adaptiveColumns ? Math.floor(width / cellWidth) : columns
|
|
||||||
property int remainingSpace: width - (actualColumns * cellWidth)
|
|
||||||
|
|
||||||
signal keyboardNavigationReset
|
|
||||||
signal itemClicked(int index, var modelData)
|
|
||||||
signal itemRightClicked(int index, var modelData, real mouseX, real mouseY)
|
|
||||||
|
|
||||||
function ensureVisible(index) {
|
|
||||||
if (index < 0 || index >= count)
|
|
||||||
return
|
|
||||||
|
|
||||||
const itemY = Math.floor(index / actualColumns) * cellHeight
|
|
||||||
const itemBottom = itemY + cellHeight
|
|
||||||
if (itemY < contentY)
|
|
||||||
contentY = itemY
|
|
||||||
else if (itemBottom > contentY + height)
|
|
||||||
contentY = itemBottom - height
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingS
|
|
||||||
visible: appLauncher && appLauncher.viewMode === "grid"
|
|
||||||
model: appLauncher ? appLauncher.model : null
|
|
||||||
clip: true
|
|
||||||
cellWidth: baseCellWidth
|
|
||||||
cellHeight: baseCellHeight
|
|
||||||
leftMargin: Math.max(Theme.spacingS, remainingSpace / 2)
|
|
||||||
rightMargin: leftMargin
|
|
||||||
focus: true
|
|
||||||
interactive: true
|
|
||||||
cacheBuffer: Math.max(0, Math.min(height * 2, 1000))
|
|
||||||
reuseItems: true
|
|
||||||
onCurrentIndexChanged: {
|
|
||||||
if (keyboardNavigationActive)
|
|
||||||
ensureVisible(currentIndex)
|
|
||||||
}
|
|
||||||
onItemClicked: (index, modelData) => {
|
|
||||||
if (appLauncher)
|
|
||||||
appLauncher.launchApp(modelData)
|
|
||||||
}
|
|
||||||
onItemRightClicked: (index, modelData, mouseX, mouseY) => {
|
|
||||||
if (contextMenu)
|
|
||||||
contextMenu.show(mouseX, mouseY, modelData)
|
|
||||||
}
|
|
||||||
onKeyboardNavigationReset: () => {
|
|
||||||
if (appLauncher)
|
|
||||||
appLauncher.keyboardNavigationActive = false
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: Rectangle {
|
|
||||||
width: resultsGrid.cellWidth - resultsGrid.cellPadding
|
|
||||||
height: resultsGrid.cellHeight - resultsGrid.cellPadding
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: resultsGrid.currentIndex === index ? Theme.primaryPressed : gridMouseArea.containsMouse ? Theme.primaryHoverLight : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.03)
|
|
||||||
border.color: resultsGrid.currentIndex === index ? Theme.primarySelected : Theme.outlineMedium
|
|
||||||
border.width: resultsGrid.currentIndex === index ? 2 : 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
Item {
|
|
||||||
property int iconSize: Math.min(resultsGrid.maxIconSize, Math.max(resultsGrid.minIconSize, resultsGrid.cellWidth * resultsGrid.iconSizeRatio))
|
|
||||||
|
|
||||||
width: iconSize
|
|
||||||
height: iconSize
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
IconImage {
|
|
||||||
id: gridIconImg
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
source: Quickshell.iconPath(model.icon, true)
|
|
||||||
smooth: true
|
|
||||||
asynchronous: true
|
|
||||||
visible: status === Image.Ready
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
visible: !gridIconImg.visible
|
|
||||||
color: Theme.surfaceLight
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.width: 1
|
|
||||||
border.color: Theme.primarySelected
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: (model.name && model.name.length > 0) ? model.name.charAt(0).toUpperCase() : "A"
|
|
||||||
font.pixelSize: Math.min(28, parent.width * 0.5)
|
|
||||||
color: Theme.primary
|
|
||||||
font.weight: Font.Bold
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
width: resultsGrid.cellWidth - 12
|
|
||||||
text: model.name || ""
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
elide: Text.ElideRight
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
maximumLineCount: 2
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: gridMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
||||||
z: 10
|
|
||||||
onEntered: () => {
|
|
||||||
if (resultsGrid.hoverUpdatesSelection && !resultsGrid.keyboardNavigationActive)
|
|
||||||
resultsGrid.currentIndex = index
|
|
||||||
}
|
|
||||||
onPositionChanged: () => {
|
|
||||||
resultsGrid.keyboardNavigationReset()
|
|
||||||
}
|
|
||||||
onClicked: mouse => {
|
|
||||||
if (mouse.button === Qt.LeftButton) {
|
|
||||||
resultsGrid.itemClicked(index, model)
|
|
||||||
} else if (mouse.button === Qt.RightButton) {
|
|
||||||
const modalPos = mapToItem(resultsContainer.parent, mouse.x, mouse.y)
|
|
||||||
resultsGrid.itemRightClicked(index, model, modalPos.x, modalPos.y)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,296 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modals.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
DankModal {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property string wifiPasswordSSID: ""
|
|
||||||
property string wifiPasswordInput: ""
|
|
||||||
|
|
||||||
function show(ssid) {
|
|
||||||
wifiPasswordSSID = ssid
|
|
||||||
wifiPasswordInput = ""
|
|
||||||
open()
|
|
||||||
Qt.callLater(() => {
|
|
||||||
if (contentLoader.item && contentLoader.item.passwordInput)
|
|
||||||
contentLoader.item.passwordInput.forceActiveFocus()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
shouldBeVisible: false
|
|
||||||
width: 420
|
|
||||||
height: 230
|
|
||||||
onShouldBeVisibleChanged: () => {
|
|
||||||
if (!shouldBeVisible)
|
|
||||||
wifiPasswordInput = ""
|
|
||||||
}
|
|
||||||
onOpened: {
|
|
||||||
Qt.callLater(() => {
|
|
||||||
if (contentLoader.item && contentLoader.item.passwordInput)
|
|
||||||
contentLoader.item.passwordInput.forceActiveFocus()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
onBackgroundClicked: () => {
|
|
||||||
close()
|
|
||||||
wifiPasswordInput = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: NetworkService
|
|
||||||
|
|
||||||
function onPasswordDialogShouldReopenChanged() {
|
|
||||||
if (NetworkService.passwordDialogShouldReopen && NetworkService.connectingSSID !== "") {
|
|
||||||
wifiPasswordSSID = NetworkService.connectingSSID
|
|
||||||
wifiPasswordInput = ""
|
|
||||||
open()
|
|
||||||
NetworkService.passwordDialogShouldReopen = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
content: Component {
|
|
||||||
FocusScope {
|
|
||||||
id: wifiContent
|
|
||||||
|
|
||||||
property alias passwordInput: passwordInput
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
focus: true
|
|
||||||
Keys.onEscapePressed: event => {
|
|
||||||
close()
|
|
||||||
wifiPasswordInput = ""
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width - Theme.spacingM * 2
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width - 40
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Connect to Wi-Fi"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: `Enter password for "${wifiPasswordSSID}"`
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
width: parent.width
|
|
||||||
elide: Text.ElideRight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
iconName: "close"
|
|
||||||
iconSize: Theme.iconSize - 4
|
|
||||||
iconColor: Theme.surfaceText
|
|
||||||
onClicked: () => {
|
|
||||||
close()
|
|
||||||
wifiPasswordInput = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Theme.surfaceHover
|
|
||||||
border.color: passwordInput.activeFocus ? Theme.primary : Theme.outlineStrong
|
|
||||||
border.width: passwordInput.activeFocus ? 2 : 1
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: () => {
|
|
||||||
passwordInput.forceActiveFocus()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankTextField {
|
|
||||||
id: passwordInput
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
textColor: Theme.surfaceText
|
|
||||||
text: wifiPasswordInput
|
|
||||||
echoMode: showPasswordCheckbox.checked ? TextInput.Normal : TextInput.Password
|
|
||||||
placeholderText: ""
|
|
||||||
backgroundColor: "transparent"
|
|
||||||
focus: true
|
|
||||||
enabled: root.shouldBeVisible
|
|
||||||
onTextEdited: () => {
|
|
||||||
wifiPasswordInput = text
|
|
||||||
}
|
|
||||||
onAccepted: () => {
|
|
||||||
NetworkService.connectToWifi(wifiPasswordSSID, passwordInput.text)
|
|
||||||
close()
|
|
||||||
wifiPasswordInput = ""
|
|
||||||
passwordInput.text = ""
|
|
||||||
}
|
|
||||||
Component.onCompleted: () => {
|
|
||||||
if (root.shouldBeVisible)
|
|
||||||
focusDelayTimer.start()
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: focusDelayTimer
|
|
||||||
|
|
||||||
interval: 100
|
|
||||||
repeat: false
|
|
||||||
onTriggered: () => {
|
|
||||||
if (root.shouldBeVisible)
|
|
||||||
passwordInput.forceActiveFocus()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: root
|
|
||||||
|
|
||||||
function onShouldBeVisibleChanged() {
|
|
||||||
if (root.shouldBeVisible)
|
|
||||||
focusDelayTimer.start()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: showPasswordCheckbox
|
|
||||||
|
|
||||||
property bool checked: false
|
|
||||||
|
|
||||||
width: 20
|
|
||||||
height: 20
|
|
||||||
radius: 4
|
|
||||||
color: checked ? Theme.primary : "transparent"
|
|
||||||
border.color: checked ? Theme.primary : Theme.outlineButton
|
|
||||||
border.width: 2
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "check"
|
|
||||||
size: 12
|
|
||||||
color: Theme.background
|
|
||||||
visible: parent.checked
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
showPasswordCheckbox.checked = !showPasswordCheckbox.checked
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Show password"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: Math.max(70, cancelText.contentWidth + Theme.spacingM * 2)
|
|
||||||
height: 36
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: cancelArea.containsMouse ? Theme.surfaceTextHover : "transparent"
|
|
||||||
border.color: Theme.surfaceVariantAlpha
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: cancelText
|
|
||||||
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "Cancel"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: cancelArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: () => {
|
|
||||||
close()
|
|
||||||
wifiPasswordInput = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: Math.max(80, connectText.contentWidth + Theme.spacingM * 2)
|
|
||||||
height: 36
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: connectArea.containsMouse ? Qt.darker(Theme.primary, 1.1) : Theme.primary
|
|
||||||
enabled: passwordInput.text.length > 0
|
|
||||||
opacity: enabled ? 1 : 0.5
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: connectText
|
|
||||||
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "Connect"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.background
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: connectArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
enabled: parent.enabled
|
|
||||||
onClicked: () => {
|
|
||||||
NetworkService.connectToWifi(wifiPasswordSSID, passwordInput.text)
|
|
||||||
close()
|
|
||||||
wifiPasswordInput = ""
|
|
||||||
passwordInput.text = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,822 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Effects
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modules.AppDrawer
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
DankPopout {
|
|
||||||
id: appDrawerPopout
|
|
||||||
|
|
||||||
property string triggerSection: "left"
|
|
||||||
property var triggerScreen: null
|
|
||||||
|
|
||||||
// Setting to Exclusive, so virtual keyboards can send input to app drawer
|
|
||||||
WlrLayershell.keyboardFocus: shouldBeVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
|
||||||
|
|
||||||
function show() {
|
|
||||||
open()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setTriggerPosition(x, y, width, section, screen) {
|
|
||||||
triggerX = x
|
|
||||||
triggerY = y
|
|
||||||
triggerWidth = width
|
|
||||||
triggerSection = section
|
|
||||||
triggerScreen = screen
|
|
||||||
}
|
|
||||||
|
|
||||||
popupWidth: 520
|
|
||||||
popupHeight: 600
|
|
||||||
triggerX: Theme.spacingL
|
|
||||||
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingXS
|
|
||||||
triggerWidth: 40
|
|
||||||
positioning: "center"
|
|
||||||
screen: triggerScreen
|
|
||||||
|
|
||||||
onShouldBeVisibleChanged: {
|
|
||||||
if (shouldBeVisible) {
|
|
||||||
appLauncher.searchQuery = ""
|
|
||||||
appLauncher.selectedIndex = 0
|
|
||||||
appLauncher.setCategory("All")
|
|
||||||
Qt.callLater(() => {
|
|
||||||
if (contentLoader.item && contentLoader.item.searchField) {
|
|
||||||
contentLoader.item.searchField.text = ""
|
|
||||||
contentLoader.item.searchField.forceActiveFocus()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AppLauncher {
|
|
||||||
id: appLauncher
|
|
||||||
|
|
||||||
viewMode: SettingsData.appLauncherViewMode
|
|
||||||
gridColumns: 4
|
|
||||||
onAppLaunched: appDrawerPopout.close()
|
|
||||||
onViewModeSelected: function (mode) {
|
|
||||||
SettingsData.setAppLauncherViewMode(mode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
content: Component {
|
|
||||||
Rectangle {
|
|
||||||
id: launcherPanel
|
|
||||||
|
|
||||||
property alias searchField: searchField
|
|
||||||
|
|
||||||
color: Theme.popupBackground()
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
antialiasing: true
|
|
||||||
smooth: true
|
|
||||||
|
|
||||||
// Multi-layer border effect
|
|
||||||
Repeater {
|
|
||||||
model: [{
|
|
||||||
"margin": -3,
|
|
||||||
"color": Qt.rgba(0, 0, 0, 0.05),
|
|
||||||
"z": -3
|
|
||||||
}, {
|
|
||||||
"margin": -2,
|
|
||||||
"color": Qt.rgba(0, 0, 0, 0.08),
|
|
||||||
"z": -2
|
|
||||||
}, {
|
|
||||||
"margin": 0,
|
|
||||||
"color": Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12),
|
|
||||||
"z": -1
|
|
||||||
}]
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: modelData.margin
|
|
||||||
color: "transparent"
|
|
||||||
radius: parent.radius + Math.abs(modelData.margin)
|
|
||||||
border.color: modelData.color
|
|
||||||
border.width: 1
|
|
||||||
z: modelData.z
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: keyHandler
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
focus: true
|
|
||||||
readonly property var keyMappings: {
|
|
||||||
const mappings = {}
|
|
||||||
mappings[Qt.Key_Escape] = () => appDrawerPopout.close()
|
|
||||||
mappings[Qt.Key_Down] = () => appLauncher.selectNext()
|
|
||||||
mappings[Qt.Key_Up] = () => appLauncher.selectPrevious()
|
|
||||||
mappings[Qt.Key_Return] = () => appLauncher.launchSelected()
|
|
||||||
mappings[Qt.Key_Enter] = () => appLauncher.launchSelected()
|
|
||||||
|
|
||||||
if (appLauncher.viewMode === "grid") {
|
|
||||||
mappings[Qt.Key_Right] = () => appLauncher.selectNextInRow()
|
|
||||||
mappings[Qt.Key_Left] = () => appLauncher.selectPreviousInRow()
|
|
||||||
}
|
|
||||||
|
|
||||||
return mappings
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onPressed: function (event) {
|
|
||||||
if (keyMappings[event.key]) {
|
|
||||||
keyMappings[event.key]()
|
|
||||||
event.accepted = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!searchField.activeFocus && event.text && /[a-zA-Z0-9\s]/.test(event.text)) {
|
|
||||||
searchField.forceActiveFocus()
|
|
||||||
searchField.insertText(event.text)
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width - Theme.spacingL * 2
|
|
||||||
height: parent.height - Theme.spacingL * 2
|
|
||||||
x: Theme.spacingL
|
|
||||||
y: Theme.spacingL
|
|
||||||
spacing: Theme.spacingL
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
text: "Applications"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge + 4
|
|
||||||
font.weight: Font.Bold
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width - 200
|
|
||||||
height: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
text: appLauncher.model.count + " apps"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankTextField {
|
|
||||||
id: searchField
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
height: 52
|
|
||||||
cornerRadius: Theme.cornerRadius
|
|
||||||
backgroundColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, Theme.getContentBackgroundAlpha() * 0.7)
|
|
||||||
normalBorderColor: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.3)
|
|
||||||
focusedBorderColor: Theme.primary
|
|
||||||
leftIconName: "search"
|
|
||||||
leftIconSize: Theme.iconSize
|
|
||||||
leftIconColor: Theme.surfaceVariantText
|
|
||||||
leftIconFocusedColor: Theme.primary
|
|
||||||
showClearButton: true
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
enabled: appDrawerPopout.shouldBeVisible
|
|
||||||
ignoreLeftRightKeys: true
|
|
||||||
keyForwardTargets: [keyHandler]
|
|
||||||
onTextEdited: {
|
|
||||||
appLauncher.searchQuery = text
|
|
||||||
}
|
|
||||||
Keys.onPressed: function (event) {
|
|
||||||
if (event.key === Qt.Key_Escape) {
|
|
||||||
appDrawerPopout.close()
|
|
||||||
event.accepted = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const isEnterKey = [Qt.Key_Return, Qt.Key_Enter].includes(event.key)
|
|
||||||
const hasText = text.length > 0
|
|
||||||
|
|
||||||
if (isEnterKey && hasText) {
|
|
||||||
if (appLauncher.keyboardNavigationActive && appLauncher.model.count > 0) {
|
|
||||||
appLauncher.launchSelected()
|
|
||||||
} else if (appLauncher.model.count > 0) {
|
|
||||||
appLauncher.launchApp(appLauncher.model.get(0))
|
|
||||||
}
|
|
||||||
event.accepted = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const navigationKeys = [Qt.Key_Down, Qt.Key_Up, Qt.Key_Left, Qt.Key_Right]
|
|
||||||
const isNavigationKey = navigationKeys.includes(event.key)
|
|
||||||
const isEmptyEnter = isEnterKey && !hasText
|
|
||||||
|
|
||||||
event.accepted = !(isNavigationKey || isEmptyEnter)
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onShouldBeVisibleChanged() {
|
|
||||||
if (!appDrawerPopout.shouldBeVisible) {
|
|
||||||
searchField.focus = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
target: appDrawerPopout
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
height: 40
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
visible: searchField.text.length === 0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: 200
|
|
||||||
height: 36
|
|
||||||
|
|
||||||
DankDropdown {
|
|
||||||
anchors.fill: parent
|
|
||||||
text: ""
|
|
||||||
currentValue: appLauncher.selectedCategory
|
|
||||||
options: appLauncher.categories
|
|
||||||
optionIcons: appLauncher.categoryIcons
|
|
||||||
onValueChanged: function (value) {
|
|
||||||
appLauncher.setCategory(value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width - 300
|
|
||||||
height: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: 4
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
buttonSize: 36
|
|
||||||
circular: false
|
|
||||||
iconName: "view_list"
|
|
||||||
iconSize: 20
|
|
||||||
iconColor: appLauncher.viewMode === "list" ? Theme.primary : Theme.surfaceText
|
|
||||||
backgroundColor: appLauncher.viewMode === "list" ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
|
|
||||||
onClicked: {
|
|
||||||
appLauncher.setViewMode("list")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
buttonSize: 36
|
|
||||||
circular: false
|
|
||||||
iconName: "grid_view"
|
|
||||||
iconSize: 20
|
|
||||||
iconColor: appLauncher.viewMode === "grid" ? Theme.primary : Theme.surfaceText
|
|
||||||
backgroundColor: appLauncher.viewMode === "grid" ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
|
|
||||||
onClicked: {
|
|
||||||
appLauncher.setViewMode("grid")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: {
|
|
||||||
let usedHeight = 40 + Theme.spacingL
|
|
||||||
usedHeight += 52 + Theme.spacingL
|
|
||||||
usedHeight += (searchField.text.length === 0 ? 40 + Theme.spacingL : 0)
|
|
||||||
return parent.height - usedHeight
|
|
||||||
}
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.1)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.05)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
DankListView {
|
|
||||||
id: appList
|
|
||||||
|
|
||||||
property int itemHeight: 72
|
|
||||||
property int iconSize: 56
|
|
||||||
property bool showDescription: true
|
|
||||||
property int itemSpacing: Theme.spacingS
|
|
||||||
property bool hoverUpdatesSelection: false
|
|
||||||
property bool keyboardNavigationActive: appLauncher.keyboardNavigationActive
|
|
||||||
|
|
||||||
signal keyboardNavigationReset
|
|
||||||
signal itemClicked(int index, var modelData)
|
|
||||||
signal itemRightClicked(int index, var modelData, real mouseX, real mouseY)
|
|
||||||
|
|
||||||
function ensureVisible(index) {
|
|
||||||
if (index < 0 || index >= count)
|
|
||||||
return
|
|
||||||
|
|
||||||
var itemY = index * (itemHeight + itemSpacing)
|
|
||||||
var itemBottom = itemY + itemHeight
|
|
||||||
if (itemY < contentY)
|
|
||||||
contentY = itemY
|
|
||||||
else if (itemBottom > contentY + height)
|
|
||||||
contentY = itemBottom - height
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingS
|
|
||||||
visible: appLauncher.viewMode === "list"
|
|
||||||
model: appLauncher.model
|
|
||||||
currentIndex: appLauncher.selectedIndex
|
|
||||||
clip: true
|
|
||||||
spacing: itemSpacing
|
|
||||||
focus: true
|
|
||||||
interactive: true
|
|
||||||
cacheBuffer: Math.max(0, Math.min(height * 2, 1000))
|
|
||||||
reuseItems: true
|
|
||||||
|
|
||||||
onCurrentIndexChanged: {
|
|
||||||
if (keyboardNavigationActive)
|
|
||||||
ensureVisible(currentIndex)
|
|
||||||
}
|
|
||||||
|
|
||||||
onItemClicked: function (index, modelData) {
|
|
||||||
appLauncher.launchApp(modelData)
|
|
||||||
}
|
|
||||||
onItemRightClicked: function (index, modelData, mouseX, mouseY) {
|
|
||||||
contextMenu.show(mouseX, mouseY, modelData)
|
|
||||||
}
|
|
||||||
onKeyboardNavigationReset: {
|
|
||||||
appLauncher.keyboardNavigationActive = false
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: Rectangle {
|
|
||||||
width: ListView.view.width
|
|
||||||
height: appList.itemHeight
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: ListView.isCurrentItem ? Theme.primaryPressed : listMouseArea.containsMouse ? Theme.primaryHoverLight : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.03)
|
|
||||||
border.color: ListView.isCurrentItem ? Theme.primarySelected : Theme.outlineMedium
|
|
||||||
border.width: ListView.isCurrentItem ? 2 : 1
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingM
|
|
||||||
spacing: Theme.spacingL
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: appList.iconSize
|
|
||||||
height: appList.iconSize
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
IconImage {
|
|
||||||
id: listIconImg
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
source: Quickshell.iconPath(model.icon, true)
|
|
||||||
smooth: true
|
|
||||||
asynchronous: true
|
|
||||||
visible: status === Image.Ready
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
visible: !listIconImg.visible
|
|
||||||
color: Theme.surfaceLight
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.width: 1
|
|
||||||
border.color: Theme.primarySelected
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: (model.name && model.name.length > 0) ? model.name.charAt(0).toUpperCase() : "A"
|
|
||||||
font.pixelSize: appList.iconSize * 0.4
|
|
||||||
color: Theme.primary
|
|
||||||
font.weight: Font.Bold
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: parent.width - appList.iconSize - Theme.spacingL
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
width: parent.width
|
|
||||||
text: model.name || ""
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
elide: Text.ElideRight
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
width: parent.width
|
|
||||||
text: model.comment || "Application"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
elide: Text.ElideRight
|
|
||||||
maximumLineCount: 1
|
|
||||||
visible: appList.showDescription && model.comment && model.comment.length > 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: listMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
||||||
z: 10
|
|
||||||
onEntered: {
|
|
||||||
if (appList.hoverUpdatesSelection && !appList.keyboardNavigationActive)
|
|
||||||
appList.currentIndex = index
|
|
||||||
}
|
|
||||||
onPositionChanged: {
|
|
||||||
appList.keyboardNavigationReset()
|
|
||||||
}
|
|
||||||
onClicked: mouse => {
|
|
||||||
if (mouse.button === Qt.LeftButton) {
|
|
||||||
appList.itemClicked(index, model)
|
|
||||||
} else if (mouse.button === Qt.RightButton) {
|
|
||||||
var panelPos = mapToItem(contextMenu.parent, mouse.x, mouse.y)
|
|
||||||
appList.itemRightClicked(index, model, panelPos.x, panelPos.y)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankGridView {
|
|
||||||
id: appGrid
|
|
||||||
|
|
||||||
property int currentIndex: appLauncher.selectedIndex
|
|
||||||
property int columns: 4
|
|
||||||
property bool adaptiveColumns: false
|
|
||||||
property int minCellWidth: 120
|
|
||||||
property int maxCellWidth: 160
|
|
||||||
property int cellPadding: 8
|
|
||||||
property real iconSizeRatio: 0.6
|
|
||||||
property int maxIconSize: 56
|
|
||||||
property int minIconSize: 32
|
|
||||||
property bool hoverUpdatesSelection: false
|
|
||||||
property bool keyboardNavigationActive: appLauncher.keyboardNavigationActive
|
|
||||||
property int baseCellWidth: adaptiveColumns ? Math.max(minCellWidth, Math.min(maxCellWidth, width / columns)) : (width - Theme.spacingS * 2) / columns
|
|
||||||
property int baseCellHeight: baseCellWidth + 20
|
|
||||||
property int actualColumns: adaptiveColumns ? Math.floor(width / cellWidth) : columns
|
|
||||||
property int remainingSpace: width - (actualColumns * cellWidth)
|
|
||||||
|
|
||||||
signal keyboardNavigationReset
|
|
||||||
signal itemClicked(int index, var modelData)
|
|
||||||
signal itemRightClicked(int index, var modelData, real mouseX, real mouseY)
|
|
||||||
|
|
||||||
function ensureVisible(index) {
|
|
||||||
if (index < 0 || index >= count)
|
|
||||||
return
|
|
||||||
|
|
||||||
var itemY = Math.floor(index / actualColumns) * cellHeight
|
|
||||||
var itemBottom = itemY + cellHeight
|
|
||||||
if (itemY < contentY)
|
|
||||||
contentY = itemY
|
|
||||||
else if (itemBottom > contentY + height)
|
|
||||||
contentY = itemBottom - height
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingS
|
|
||||||
visible: appLauncher.viewMode === "grid"
|
|
||||||
model: appLauncher.model
|
|
||||||
clip: true
|
|
||||||
cellWidth: baseCellWidth
|
|
||||||
cellHeight: baseCellHeight
|
|
||||||
leftMargin: Math.max(Theme.spacingS, remainingSpace / 2)
|
|
||||||
rightMargin: leftMargin
|
|
||||||
focus: true
|
|
||||||
interactive: true
|
|
||||||
cacheBuffer: Math.max(0, Math.min(height * 2, 1000))
|
|
||||||
reuseItems: true
|
|
||||||
|
|
||||||
onCurrentIndexChanged: {
|
|
||||||
if (keyboardNavigationActive)
|
|
||||||
ensureVisible(currentIndex)
|
|
||||||
}
|
|
||||||
|
|
||||||
onItemClicked: function (index, modelData) {
|
|
||||||
appLauncher.launchApp(modelData)
|
|
||||||
}
|
|
||||||
onItemRightClicked: function (index, modelData, mouseX, mouseY) {
|
|
||||||
contextMenu.show(mouseX, mouseY, modelData)
|
|
||||||
}
|
|
||||||
onKeyboardNavigationReset: {
|
|
||||||
appLauncher.keyboardNavigationActive = false
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: Rectangle {
|
|
||||||
width: appGrid.cellWidth - appGrid.cellPadding
|
|
||||||
height: appGrid.cellHeight - appGrid.cellPadding
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: appGrid.currentIndex === index ? Theme.primaryPressed : gridMouseArea.containsMouse ? Theme.primaryHoverLight : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.03)
|
|
||||||
border.color: appGrid.currentIndex === index ? Theme.primarySelected : Theme.outlineMedium
|
|
||||||
border.width: appGrid.currentIndex === index ? 2 : 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
Item {
|
|
||||||
property int iconSize: Math.min(appGrid.maxIconSize, Math.max(appGrid.minIconSize, appGrid.cellWidth * appGrid.iconSizeRatio))
|
|
||||||
|
|
||||||
width: iconSize
|
|
||||||
height: iconSize
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
IconImage {
|
|
||||||
id: gridIconImg
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
source: Quickshell.iconPath(model.icon, true)
|
|
||||||
smooth: true
|
|
||||||
asynchronous: true
|
|
||||||
visible: status === Image.Ready
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
visible: !gridIconImg.visible
|
|
||||||
color: Theme.surfaceLight
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.width: 1
|
|
||||||
border.color: Theme.primarySelected
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: (model.name && model.name.length > 0) ? model.name.charAt(0).toUpperCase() : "A"
|
|
||||||
font.pixelSize: Math.min(28, parent.width * 0.5)
|
|
||||||
color: Theme.primary
|
|
||||||
font.weight: Font.Bold
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
width: appGrid.cellWidth - 12
|
|
||||||
text: model.name || ""
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
elide: Text.ElideRight
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
maximumLineCount: 2
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: gridMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
||||||
z: 10
|
|
||||||
onEntered: {
|
|
||||||
if (appGrid.hoverUpdatesSelection && !appGrid.keyboardNavigationActive)
|
|
||||||
appGrid.currentIndex = index
|
|
||||||
}
|
|
||||||
onPositionChanged: {
|
|
||||||
appGrid.keyboardNavigationReset()
|
|
||||||
}
|
|
||||||
onClicked: mouse => {
|
|
||||||
if (mouse.button === Qt.LeftButton) {
|
|
||||||
appGrid.itemClicked(index, model)
|
|
||||||
} else if (mouse.button === Qt.RightButton) {
|
|
||||||
var panelPos = mapToItem(contextMenu.parent, mouse.x, mouse.y)
|
|
||||||
appGrid.itemRightClicked(index, model, panelPos.x, panelPos.y)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: contextMenu
|
|
||||||
|
|
||||||
property var currentApp: null
|
|
||||||
property bool menuVisible: false
|
|
||||||
|
|
||||||
readonly property string appId: (currentApp && currentApp.desktopEntry) ? (currentApp.desktopEntry.id || currentApp.desktopEntry.execString || "") : ""
|
|
||||||
readonly property bool isPinned: appId && SessionData.isPinnedApp(appId)
|
|
||||||
|
|
||||||
function show(x, y, app) {
|
|
||||||
currentApp = app
|
|
||||||
|
|
||||||
const menuWidth = 180
|
|
||||||
const menuHeight = menuColumn.implicitHeight + Theme.spacingS * 2
|
|
||||||
|
|
||||||
let finalX = x + 8
|
|
||||||
let finalY = y + 8
|
|
||||||
|
|
||||||
if (finalX + menuWidth > appDrawerPopout.popupWidth) {
|
|
||||||
finalX = x - menuWidth - 8
|
|
||||||
}
|
|
||||||
|
|
||||||
if (finalY + menuHeight > appDrawerPopout.popupHeight) {
|
|
||||||
finalY = y - menuHeight - 8
|
|
||||||
}
|
|
||||||
|
|
||||||
finalX = Math.max(8, Math.min(finalX, appDrawerPopout.popupWidth - menuWidth - 8))
|
|
||||||
finalY = Math.max(8, Math.min(finalY, appDrawerPopout.popupHeight - menuHeight - 8))
|
|
||||||
|
|
||||||
contextMenu.x = finalX
|
|
||||||
contextMenu.y = finalY
|
|
||||||
contextMenu.visible = true
|
|
||||||
contextMenu.menuVisible = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function close() {
|
|
||||||
contextMenu.menuVisible = false
|
|
||||||
Qt.callLater(() => {
|
|
||||||
contextMenu.visible = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
visible: false
|
|
||||||
width: 180
|
|
||||||
height: menuColumn.implicitHeight + Theme.spacingS * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Theme.popupBackground()
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
|
||||||
border.width: 1
|
|
||||||
z: 1000
|
|
||||||
opacity: menuVisible ? 1 : 0
|
|
||||||
scale: menuVisible ? 1 : 0.85
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: 4
|
|
||||||
anchors.leftMargin: 2
|
|
||||||
anchors.rightMargin: -2
|
|
||||||
anchors.bottomMargin: -4
|
|
||||||
radius: parent.radius
|
|
||||||
color: Qt.rgba(0, 0, 0, 0.15)
|
|
||||||
z: parent.z - 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: menuColumn
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingS
|
|
||||||
spacing: 1
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 32
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: pinMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: contextMenu.isPinned ? "keep_off" : "push_pin"
|
|
||||||
size: Theme.iconSize - 2
|
|
||||||
color: Theme.surfaceText
|
|
||||||
opacity: 0.7
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: contextMenu.isPinned ? "Unpin from Dock" : "Pin to Dock"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Normal
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: pinMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
if (!contextMenu.currentApp || !contextMenu.currentApp.desktopEntry) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (contextMenu.isPinned) {
|
|
||||||
SessionData.removePinnedApp(contextMenu.appId)
|
|
||||||
} else {
|
|
||||||
SessionData.addPinnedApp(contextMenu.appId)
|
|
||||||
}
|
|
||||||
contextMenu.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width - Theme.spacingS * 2
|
|
||||||
height: 5
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 32
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: launchMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "launch"
|
|
||||||
size: Theme.iconSize - 2
|
|
||||||
color: Theme.surfaceText
|
|
||||||
opacity: 0.7
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Launch"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Normal
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: launchMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
if (contextMenu.currentApp)
|
|
||||||
appLauncher.launchApp(contextMenu.currentApp)
|
|
||||||
|
|
||||||
contextMenu.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on scale {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
visible: contextMenu.visible
|
|
||||||
z: 999
|
|
||||||
onClicked: {
|
|
||||||
contextMenu.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
x: contextMenu.x
|
|
||||||
y: contextMenu.y
|
|
||||||
width: contextMenu.width
|
|
||||||
height: contextMenu.height
|
|
||||||
onClicked: {
|
|
||||||
|
|
||||||
// Prevent closing when clicking on the menu itself
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,174 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property string searchQuery: ""
|
|
||||||
property string selectedCategory: "All"
|
|
||||||
property string viewMode: "list" // "list" or "grid"
|
|
||||||
property int selectedIndex: 0
|
|
||||||
property int maxResults: 50
|
|
||||||
property int gridColumns: 4
|
|
||||||
property bool debounceSearch: true
|
|
||||||
property int debounceInterval: 50
|
|
||||||
property bool keyboardNavigationActive: false
|
|
||||||
property bool suppressUpdatesWhileLaunching: false
|
|
||||||
readonly property var categories: {
|
|
||||||
const allCategories = AppSearchService.getAllCategories().filter(cat => cat !== "Education" && cat !== "Science")
|
|
||||||
const result = ["All"]
|
|
||||||
return result.concat(allCategories.filter(cat => cat !== "All"))
|
|
||||||
}
|
|
||||||
readonly property var categoryIcons: categories.map(category => AppSearchService.getCategoryIcon(category))
|
|
||||||
property var appUsageRanking: AppUsageHistoryData.appUsageRanking || {}
|
|
||||||
property alias model: filteredModel
|
|
||||||
property var _watchApplications: AppSearchService.applications
|
|
||||||
|
|
||||||
signal appLaunched(var app)
|
|
||||||
signal categorySelected(string category)
|
|
||||||
signal viewModeSelected(string mode)
|
|
||||||
|
|
||||||
function updateFilteredModel() {
|
|
||||||
if (suppressUpdatesWhileLaunching) {
|
|
||||||
suppressUpdatesWhileLaunching = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
filteredModel.clear()
|
|
||||||
selectedIndex = 0
|
|
||||||
keyboardNavigationActive = false
|
|
||||||
|
|
||||||
let apps = []
|
|
||||||
if (searchQuery.length === 0) {
|
|
||||||
apps = selectedCategory === "All" ? AppSearchService.getAppsInCategory("All") : AppSearchService.getAppsInCategory(selectedCategory).slice(0, maxResults)
|
|
||||||
} else {
|
|
||||||
if (selectedCategory === "All") {
|
|
||||||
apps = AppSearchService.searchApplications(searchQuery)
|
|
||||||
} else {
|
|
||||||
const categoryApps = AppSearchService.getAppsInCategory(selectedCategory)
|
|
||||||
if (categoryApps.length > 0) {
|
|
||||||
const allSearchResults = AppSearchService.searchApplications(searchQuery)
|
|
||||||
const categoryNames = new Set(categoryApps.map(app => app.name))
|
|
||||||
apps = allSearchResults.filter(searchApp => categoryNames.has(searchApp.name)).slice(0, maxResults)
|
|
||||||
} else {
|
|
||||||
apps = []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (searchQuery.length === 0) {
|
|
||||||
apps = apps.sort((a, b) => {
|
|
||||||
const aId = a.id || a.execString || a.exec || ""
|
|
||||||
const bId = b.id || b.execString || b.exec || ""
|
|
||||||
const aUsage = appUsageRanking[aId] ? appUsageRanking[aId].usageCount : 0
|
|
||||||
const bUsage = appUsageRanking[bId] ? appUsageRanking[bId].usageCount : 0
|
|
||||||
if (aUsage !== bUsage) {
|
|
||||||
return bUsage - aUsage
|
|
||||||
}
|
|
||||||
return (a.name || "").localeCompare(b.name || "")
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
apps.forEach(app => {
|
|
||||||
if (app) {
|
|
||||||
filteredModel.append({
|
|
||||||
"name": app.name || "",
|
|
||||||
"exec": app.execString || "",
|
|
||||||
"icon": app.icon || "application-x-executable",
|
|
||||||
"comment": app.comment || "",
|
|
||||||
"categories": app.categories || [],
|
|
||||||
"desktopEntry": app
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectNext() {
|
|
||||||
if (filteredModel.count === 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
keyboardNavigationActive = true
|
|
||||||
selectedIndex = viewMode === "grid" ? Math.min(selectedIndex + gridColumns, filteredModel.count - 1) : Math.min(selectedIndex + 1, filteredModel.count - 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectPrevious() {
|
|
||||||
if (filteredModel.count === 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
keyboardNavigationActive = true
|
|
||||||
selectedIndex = viewMode === "grid" ? Math.max(selectedIndex - gridColumns, 0) : Math.max(selectedIndex - 1, 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectNextInRow() {
|
|
||||||
if (filteredModel.count === 0 || viewMode !== "grid") {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
keyboardNavigationActive = true
|
|
||||||
selectedIndex = Math.min(selectedIndex + 1, filteredModel.count - 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectPreviousInRow() {
|
|
||||||
if (filteredModel.count === 0 || viewMode !== "grid") {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
keyboardNavigationActive = true
|
|
||||||
selectedIndex = Math.max(selectedIndex - 1, 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
function launchSelected() {
|
|
||||||
if (filteredModel.count === 0 || selectedIndex < 0 || selectedIndex >= filteredModel.count) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const selectedApp = filteredModel.get(selectedIndex)
|
|
||||||
launchApp(selectedApp)
|
|
||||||
}
|
|
||||||
|
|
||||||
function launchApp(appData) {
|
|
||||||
if (!appData) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
suppressUpdatesWhileLaunching = true
|
|
||||||
SessionService.launchDesktopEntry(appData.desktopEntry)
|
|
||||||
appLaunched(appData)
|
|
||||||
AppUsageHistoryData.addAppUsage(appData.desktopEntry)
|
|
||||||
}
|
|
||||||
|
|
||||||
function setCategory(category) {
|
|
||||||
selectedCategory = category
|
|
||||||
categorySelected(category)
|
|
||||||
}
|
|
||||||
|
|
||||||
function setViewMode(mode) {
|
|
||||||
viewMode = mode
|
|
||||||
viewModeSelected(mode)
|
|
||||||
}
|
|
||||||
|
|
||||||
onSearchQueryChanged: {
|
|
||||||
if (debounceSearch) {
|
|
||||||
searchDebounceTimer.restart()
|
|
||||||
} else {
|
|
||||||
updateFilteredModel()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onSelectedCategoryChanged: updateFilteredModel()
|
|
||||||
onAppUsageRankingChanged: updateFilteredModel()
|
|
||||||
on_WatchApplicationsChanged: updateFilteredModel()
|
|
||||||
Component.onCompleted: {
|
|
||||||
updateFilteredModel()
|
|
||||||
}
|
|
||||||
|
|
||||||
ListModel {
|
|
||||||
id: filteredModel
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: searchDebounceTimer
|
|
||||||
|
|
||||||
interval: root.debounceInterval
|
|
||||||
repeat: false
|
|
||||||
onTriggered: updateFilteredModel()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modules.ControlCenter.Details
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property string expandedSection: ""
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
width: parent.width
|
|
||||||
height: 250
|
|
||||||
y: Theme.spacingS
|
|
||||||
active: parent.height > 0
|
|
||||||
sourceComponent: {
|
|
||||||
switch (root.expandedSection) {
|
|
||||||
case "network":
|
|
||||||
case "wifi": return networkDetailComponent
|
|
||||||
case "bluetooth": return bluetoothDetailComponent
|
|
||||||
case "audioOutput": return audioOutputDetailComponent
|
|
||||||
case "audioInput": return audioInputDetailComponent
|
|
||||||
case "battery": return batteryDetailComponent
|
|
||||||
default: return null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: networkDetailComponent
|
|
||||||
NetworkDetail {}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: bluetoothDetailComponent
|
|
||||||
BluetoothDetail {}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: audioOutputDetailComponent
|
|
||||||
AudioOutputDetail {}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: audioInputDetailComponent
|
|
||||||
AudioInputDetail {}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: batteryDetailComponent
|
|
||||||
BatteryDetail {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,241 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool editMode: false
|
|
||||||
property var widgetData: null
|
|
||||||
property int widgetIndex: -1
|
|
||||||
property bool showSizeControls: true
|
|
||||||
property bool isSlider: false
|
|
||||||
|
|
||||||
signal removeWidget(int index)
|
|
||||||
signal toggleWidgetSize(int index)
|
|
||||||
signal moveWidget(int fromIndex, int toIndex)
|
|
||||||
|
|
||||||
// Delete button in top-right
|
|
||||||
Rectangle {
|
|
||||||
width: 16
|
|
||||||
height: 16
|
|
||||||
radius: 8
|
|
||||||
color: Theme.error
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: -4
|
|
||||||
visible: editMode
|
|
||||||
z: 10
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "close"
|
|
||||||
size: 12
|
|
||||||
color: Theme.primaryText
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: root.removeWidget(widgetIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Size control buttons in bottom-right
|
|
||||||
Row {
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: -8
|
|
||||||
spacing: 4
|
|
||||||
visible: editMode && showSizeControls
|
|
||||||
z: 10
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 24
|
|
||||||
height: 24
|
|
||||||
radius: 12
|
|
||||||
color: (widgetData?.width || 50) === 25 ? Theme.primary : Theme.primaryContainer
|
|
||||||
border.color: Theme.primary
|
|
||||||
border.width: 1
|
|
||||||
visible: !isSlider
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "25"
|
|
||||||
font.pixelSize: 10
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: (widgetData?.width || 50) === 25 ? Theme.primaryText : Theme.primary
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
var widgets = SettingsData.controlCenterWidgets.slice()
|
|
||||||
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
|
||||||
widgets[widgetIndex].width = 25
|
|
||||||
SettingsData.setControlCenterWidgets(widgets)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 24
|
|
||||||
height: 24
|
|
||||||
radius: 12
|
|
||||||
color: (widgetData?.width || 50) === 50 ? Theme.primary : Theme.primaryContainer
|
|
||||||
border.color: Theme.primary
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "50"
|
|
||||||
font.pixelSize: 10
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: (widgetData?.width || 50) === 50 ? Theme.primaryText : Theme.primary
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
var widgets = SettingsData.controlCenterWidgets.slice()
|
|
||||||
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
|
||||||
widgets[widgetIndex].width = 50
|
|
||||||
SettingsData.setControlCenterWidgets(widgets)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 24
|
|
||||||
height: 24
|
|
||||||
radius: 12
|
|
||||||
color: (widgetData?.width || 50) === 75 ? Theme.primary : Theme.primaryContainer
|
|
||||||
border.color: Theme.primary
|
|
||||||
border.width: 1
|
|
||||||
visible: !isSlider
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "75"
|
|
||||||
font.pixelSize: 10
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: (widgetData?.width || 50) === 75 ? Theme.primaryText : Theme.primary
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
var widgets = SettingsData.controlCenterWidgets.slice()
|
|
||||||
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
|
||||||
widgets[widgetIndex].width = 75
|
|
||||||
SettingsData.setControlCenterWidgets(widgets)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 24
|
|
||||||
height: 24
|
|
||||||
radius: 12
|
|
||||||
color: (widgetData?.width || 50) === 100 ? Theme.primary : Theme.primaryContainer
|
|
||||||
border.color: Theme.primary
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "100"
|
|
||||||
font.pixelSize: 9
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: (widgetData?.width || 50) === 100 ? Theme.primaryText : Theme.primary
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
var widgets = SettingsData.controlCenterWidgets.slice()
|
|
||||||
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
|
||||||
widgets[widgetIndex].width = 100
|
|
||||||
SettingsData.setControlCenterWidgets(widgets)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Arrow buttons for reordering in top-left
|
|
||||||
Row {
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.margins: 4
|
|
||||||
spacing: 2
|
|
||||||
visible: editMode
|
|
||||||
z: 20
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 16
|
|
||||||
height: 16
|
|
||||||
radius: 8
|
|
||||||
color: Theme.surfaceContainer
|
|
||||||
border.color: Theme.outline
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "keyboard_arrow_left"
|
|
||||||
size: 12
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
enabled: widgetIndex > 0
|
|
||||||
opacity: enabled ? 1.0 : 0.5
|
|
||||||
onClicked: root.moveWidget(widgetIndex, widgetIndex - 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 16
|
|
||||||
height: 16
|
|
||||||
radius: 8
|
|
||||||
color: Theme.surfaceContainer
|
|
||||||
border.color: Theme.outline
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "keyboard_arrow_right"
|
|
||||||
size: 12
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
enabled: widgetIndex < ((SettingsData.controlCenterWidgets?.length ?? 0) - 1)
|
|
||||||
opacity: enabled ? 1.0 : 0.5
|
|
||||||
onClicked: root.moveWidget(widgetIndex, widgetIndex + 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Border highlight
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1)
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.color: Theme.primary
|
|
||||||
border.width: editMode ? 1 : 0
|
|
||||||
visible: editMode
|
|
||||||
z: -1
|
|
||||||
|
|
||||||
Behavior on border.width {
|
|
||||||
NumberAnimation { duration: Theme.shortDuration }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool expanded: false
|
|
||||||
|
|
||||||
signal powerActionRequested(string action, string title, string message)
|
|
||||||
|
|
||||||
implicitHeight: expanded ? 60 : 0
|
|
||||||
height: implicitHeight
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 60
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r,
|
|
||||||
Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b,
|
|
||||||
Theme.getContentBackgroundAlpha() * 0.4)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.08)
|
|
||||||
border.width: root.expanded ? 1 : 0
|
|
||||||
opacity: root.expanded ? 1 : 0
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: SessionService.hibernateSupported ? Theme.spacingS : Theme.spacingL
|
|
||||||
visible: root.expanded
|
|
||||||
|
|
||||||
PowerButton {
|
|
||||||
width: SessionService.hibernateSupported ? 85 : 100
|
|
||||||
iconName: "logout"
|
|
||||||
text: "Logout"
|
|
||||||
onPressed: root.powerActionRequested("logout", "Logout", "Are you sure you want to logout?")
|
|
||||||
}
|
|
||||||
|
|
||||||
PowerButton {
|
|
||||||
width: SessionService.hibernateSupported ? 85 : 100
|
|
||||||
iconName: "restart_alt"
|
|
||||||
text: "Restart"
|
|
||||||
onPressed: root.powerActionRequested("reboot", "Restart", "Are you sure you want to restart?")
|
|
||||||
}
|
|
||||||
|
|
||||||
PowerButton {
|
|
||||||
width: SessionService.hibernateSupported ? 85 : 100
|
|
||||||
iconName: "bedtime"
|
|
||||||
text: "Suspend"
|
|
||||||
onPressed: root.powerActionRequested("suspend", "Suspend", "Are you sure you want to suspend?")
|
|
||||||
}
|
|
||||||
|
|
||||||
PowerButton {
|
|
||||||
width: SessionService.hibernateSupported ? 85 : 100
|
|
||||||
iconName: "ac_unit"
|
|
||||||
text: "Hibernate"
|
|
||||||
visible: SessionService.hibernateSupported
|
|
||||||
onPressed: root.powerActionRequested("hibernate", "Hibernate", "Are you sure you want to hibernate?")
|
|
||||||
}
|
|
||||||
|
|
||||||
PowerButton {
|
|
||||||
width: SessionService.hibernateSupported ? 85 : 100
|
|
||||||
iconName: "power_settings_new"
|
|
||||||
text: "Shutdown"
|
|
||||||
onPressed: root.powerActionRequested("poweroff", "Shutdown", "Are you sure you want to shutdown?")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,679 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Modules.ControlCenter.Widgets
|
|
||||||
import qs.Modules.ControlCenter.Components
|
|
||||||
import "../utils/layout.js" as LayoutUtils
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool editMode: false
|
|
||||||
property string expandedSection: ""
|
|
||||||
property int expandedWidgetIndex: -1
|
|
||||||
property var model: null
|
|
||||||
|
|
||||||
signal expandClicked(var widgetData, int globalIndex)
|
|
||||||
signal removeWidget(int index)
|
|
||||||
signal moveWidget(int fromIndex, int toIndex)
|
|
||||||
signal toggleWidgetSize(int index)
|
|
||||||
|
|
||||||
spacing: editMode ? Theme.spacingL : Theme.spacingS
|
|
||||||
|
|
||||||
property var currentRowWidgets: []
|
|
||||||
property real currentRowWidth: 0
|
|
||||||
property int expandedRowIndex: -1
|
|
||||||
|
|
||||||
function calculateRowsAndWidgets() {
|
|
||||||
return LayoutUtils.calculateRowsAndWidgets(root, expandedSection, expandedWidgetIndex)
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: {
|
|
||||||
const result = root.calculateRowsAndWidgets()
|
|
||||||
root.expandedRowIndex = result.expandedRowIndex
|
|
||||||
return result.rows
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: root.width
|
|
||||||
spacing: 0
|
|
||||||
property int rowIndex: index
|
|
||||||
property var rowWidgets: modelData
|
|
||||||
property bool isSliderOnlyRow: {
|
|
||||||
const widgets = rowWidgets || []
|
|
||||||
if (widgets.length === 0) return false
|
|
||||||
return widgets.every(w => w.id === "volumeSlider" || w.id === "brightnessSlider" || w.id === "inputVolumeSlider")
|
|
||||||
}
|
|
||||||
topPadding: isSliderOnlyRow ? (root.editMode ? 4 : -12) : 0
|
|
||||||
bottomPadding: isSliderOnlyRow ? (root.editMode ? 4 : -12) : 0
|
|
||||||
|
|
||||||
Flow {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: rowWidgets || []
|
|
||||||
|
|
||||||
Item {
|
|
||||||
property var widgetData: modelData
|
|
||||||
property int globalWidgetIndex: {
|
|
||||||
const widgets = SettingsData.controlCenterWidgets || []
|
|
||||||
for (var i = 0; i < widgets.length; i++) {
|
|
||||||
if (widgets[i].id === modelData.id) {
|
|
||||||
return i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1
|
|
||||||
}
|
|
||||||
property int widgetWidth: modelData.width || 50
|
|
||||||
width: {
|
|
||||||
const baseWidth = root.width
|
|
||||||
const spacing = Theme.spacingS
|
|
||||||
if (widgetWidth <= 25) {
|
|
||||||
return (baseWidth - spacing * 3) / 4
|
|
||||||
} else if (widgetWidth <= 50) {
|
|
||||||
return (baseWidth - spacing) / 2
|
|
||||||
} else if (widgetWidth <= 75) {
|
|
||||||
return (baseWidth - spacing * 2) * 0.75
|
|
||||||
} else {
|
|
||||||
return baseWidth
|
|
||||||
}
|
|
||||||
}
|
|
||||||
height: 60
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: widgetLoader
|
|
||||||
anchors.fill: parent
|
|
||||||
property var widgetData: parent.widgetData
|
|
||||||
property int widgetIndex: parent.globalWidgetIndex
|
|
||||||
property int globalWidgetIndex: parent.globalWidgetIndex
|
|
||||||
property int widgetWidth: parent.widgetWidth
|
|
||||||
|
|
||||||
sourceComponent: {
|
|
||||||
const id = modelData.id || ""
|
|
||||||
if (id === "wifi" || id === "bluetooth" || id === "audioOutput" || id === "audioInput") {
|
|
||||||
return compoundPillComponent
|
|
||||||
} else if (id === "volumeSlider") {
|
|
||||||
return audioSliderComponent
|
|
||||||
} else if (id === "brightnessSlider") {
|
|
||||||
return brightnessSliderComponent
|
|
||||||
} else if (id === "inputVolumeSlider") {
|
|
||||||
return inputAudioSliderComponent
|
|
||||||
} else if (id === "battery") {
|
|
||||||
return widgetWidth <= 25 ? smallBatteryComponent : batteryPillComponent
|
|
||||||
} else {
|
|
||||||
return widgetWidth <= 25 ? smallToggleComponent : toggleButtonComponent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DetailHost {
|
|
||||||
width: parent.width
|
|
||||||
height: active ? (250 + Theme.spacingS) : 0
|
|
||||||
property bool active: root.expandedSection !== "" && rowIndex === root.expandedRowIndex
|
|
||||||
visible: active
|
|
||||||
expandedSection: root.expandedSection
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: compoundPillComponent
|
|
||||||
CompoundPill {
|
|
||||||
property var widgetData: parent.widgetData || {}
|
|
||||||
property int widgetIndex: parent.widgetIndex || 0
|
|
||||||
property var widgetDef: root.model?.getWidgetForId(widgetData.id || "")
|
|
||||||
width: parent.width
|
|
||||||
height: 60
|
|
||||||
iconName: {
|
|
||||||
switch (widgetData.id || "") {
|
|
||||||
case "wifi": {
|
|
||||||
if (NetworkService.wifiToggling) {
|
|
||||||
return "sync"
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "ethernet") {
|
|
||||||
return "settings_ethernet"
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "wifi") {
|
|
||||||
return NetworkService.wifiSignalIcon
|
|
||||||
}
|
|
||||||
if (NetworkService.wifiEnabled) {
|
|
||||||
return "wifi_off"
|
|
||||||
}
|
|
||||||
return "wifi_off"
|
|
||||||
}
|
|
||||||
case "bluetooth": {
|
|
||||||
if (!BluetoothService.available) {
|
|
||||||
return "bluetooth_disabled"
|
|
||||||
}
|
|
||||||
if (!BluetoothService.adapter || !BluetoothService.adapter.enabled) {
|
|
||||||
return "bluetooth_disabled"
|
|
||||||
}
|
|
||||||
const primaryDevice = (() => {
|
|
||||||
if (!BluetoothService.adapter || !BluetoothService.adapter.devices) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
let devices = [...BluetoothService.adapter.devices.values.filter(dev => dev && (dev.paired || dev.trusted))]
|
|
||||||
for (let device of devices) {
|
|
||||||
if (device && device.connected) {
|
|
||||||
return device
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
})()
|
|
||||||
if (primaryDevice) {
|
|
||||||
return BluetoothService.getDeviceIcon(primaryDevice)
|
|
||||||
}
|
|
||||||
return "bluetooth"
|
|
||||||
}
|
|
||||||
case "audioOutput": {
|
|
||||||
if (!AudioService.sink) return "volume_off"
|
|
||||||
let volume = AudioService.sink.audio.volume
|
|
||||||
let muted = AudioService.sink.audio.muted
|
|
||||||
if (muted || volume === 0.0) return "volume_off"
|
|
||||||
if (volume <= 0.33) return "volume_down"
|
|
||||||
if (volume <= 0.66) return "volume_up"
|
|
||||||
return "volume_up"
|
|
||||||
}
|
|
||||||
case "audioInput": {
|
|
||||||
if (!AudioService.source) return "mic_off"
|
|
||||||
let muted = AudioService.source.audio.muted
|
|
||||||
return muted ? "mic_off" : "mic"
|
|
||||||
}
|
|
||||||
default: return widgetDef?.icon || "help"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
primaryText: {
|
|
||||||
switch (widgetData.id || "") {
|
|
||||||
case "wifi": {
|
|
||||||
if (NetworkService.wifiToggling) {
|
|
||||||
return NetworkService.wifiEnabled ? "Disabling WiFi..." : "Enabling WiFi..."
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "ethernet") {
|
|
||||||
return "Ethernet"
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "wifi" && NetworkService.currentWifiSSID) {
|
|
||||||
return NetworkService.currentWifiSSID
|
|
||||||
}
|
|
||||||
if (NetworkService.wifiEnabled) {
|
|
||||||
return "Not connected"
|
|
||||||
}
|
|
||||||
return "WiFi off"
|
|
||||||
}
|
|
||||||
case "bluetooth": {
|
|
||||||
if (!BluetoothService.available) {
|
|
||||||
return "Bluetooth"
|
|
||||||
}
|
|
||||||
if (!BluetoothService.adapter) {
|
|
||||||
return "No adapter"
|
|
||||||
}
|
|
||||||
if (!BluetoothService.adapter.enabled) {
|
|
||||||
return "Disabled"
|
|
||||||
}
|
|
||||||
return "Enabled"
|
|
||||||
}
|
|
||||||
case "audioOutput": return AudioService.sink?.description || "No output device"
|
|
||||||
case "audioInput": return AudioService.source?.description || "No input device"
|
|
||||||
default: return widgetDef?.text || "Unknown"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
secondaryText: {
|
|
||||||
switch (widgetData.id || "") {
|
|
||||||
case "wifi": {
|
|
||||||
if (NetworkService.wifiToggling) {
|
|
||||||
return "Please wait..."
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "ethernet") {
|
|
||||||
return "Connected"
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "wifi") {
|
|
||||||
return NetworkService.wifiSignalStrength > 0 ? NetworkService.wifiSignalStrength + "%" : "Connected"
|
|
||||||
}
|
|
||||||
if (NetworkService.wifiEnabled) {
|
|
||||||
return "Select network"
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
case "bluetooth": {
|
|
||||||
if (!BluetoothService.available) {
|
|
||||||
return "No adapters"
|
|
||||||
}
|
|
||||||
if (!BluetoothService.adapter || !BluetoothService.adapter.enabled) {
|
|
||||||
return "Off"
|
|
||||||
}
|
|
||||||
const primaryDevice = (() => {
|
|
||||||
if (!BluetoothService.adapter || !BluetoothService.adapter.devices) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
let devices = [...BluetoothService.adapter.devices.values.filter(dev => dev && (dev.paired || dev.trusted))]
|
|
||||||
for (let device of devices) {
|
|
||||||
if (device && device.connected) {
|
|
||||||
return device
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
})()
|
|
||||||
if (primaryDevice) {
|
|
||||||
return primaryDevice.name || primaryDevice.alias || primaryDevice.deviceName || "Connected Device"
|
|
||||||
}
|
|
||||||
return "No devices"
|
|
||||||
}
|
|
||||||
case "audioOutput": {
|
|
||||||
if (!AudioService.sink) {
|
|
||||||
return "Select device"
|
|
||||||
}
|
|
||||||
if (AudioService.sink.audio.muted) {
|
|
||||||
return "Muted"
|
|
||||||
}
|
|
||||||
return Math.round(AudioService.sink.audio.volume * 100) + "%"
|
|
||||||
}
|
|
||||||
case "audioInput": {
|
|
||||||
if (!AudioService.source) {
|
|
||||||
return "Select device"
|
|
||||||
}
|
|
||||||
if (AudioService.source.audio.muted) {
|
|
||||||
return "Muted"
|
|
||||||
}
|
|
||||||
return Math.round(AudioService.source.audio.volume * 100) + "%"
|
|
||||||
}
|
|
||||||
default: return widgetDef?.description || ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
isActive: {
|
|
||||||
switch (widgetData.id || "") {
|
|
||||||
case "wifi": {
|
|
||||||
if (NetworkService.wifiToggling) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "ethernet") {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "wifi") {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return NetworkService.wifiEnabled
|
|
||||||
}
|
|
||||||
case "bluetooth": return !!(BluetoothService.available && BluetoothService.adapter && BluetoothService.adapter.enabled)
|
|
||||||
case "audioOutput": return !!(AudioService.sink && !AudioService.sink.audio.muted)
|
|
||||||
case "audioInput": return !!(AudioService.source && !AudioService.source.audio.muted)
|
|
||||||
default: return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
enabled: (widgetDef?.enabled ?? true)
|
|
||||||
onToggled: {
|
|
||||||
if (root.editMode) return
|
|
||||||
switch (widgetData.id || "") {
|
|
||||||
case "wifi": {
|
|
||||||
if (NetworkService.networkStatus !== "ethernet" && !NetworkService.wifiToggling) {
|
|
||||||
NetworkService.toggleWifiRadio()
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case "bluetooth": {
|
|
||||||
if (BluetoothService.available && BluetoothService.adapter) {
|
|
||||||
BluetoothService.adapter.enabled = !BluetoothService.adapter.enabled
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case "audioOutput": {
|
|
||||||
if (AudioService.sink && AudioService.sink.audio) {
|
|
||||||
AudioService.sink.audio.muted = !AudioService.sink.audio.muted
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case "audioInput": {
|
|
||||||
if (AudioService.source && AudioService.source.audio) {
|
|
||||||
AudioService.source.audio.muted = !AudioService.source.audio.muted
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onExpandClicked: {
|
|
||||||
if (root.editMode) return
|
|
||||||
root.expandClicked(widgetData, widgetIndex)
|
|
||||||
}
|
|
||||||
onWheelEvent: function (wheelEvent) {
|
|
||||||
const id = widgetData.id || ""
|
|
||||||
if (id === "audioOutput") {
|
|
||||||
if (!AudioService.sink || !AudioService.sink.audio) return
|
|
||||||
let delta = wheelEvent.angleDelta.y
|
|
||||||
let currentVolume = AudioService.sink.audio.volume * 100
|
|
||||||
let newVolume
|
|
||||||
if (delta > 0)
|
|
||||||
newVolume = Math.min(100, currentVolume + 5)
|
|
||||||
else
|
|
||||||
newVolume = Math.max(0, currentVolume - 5)
|
|
||||||
AudioService.sink.audio.muted = false
|
|
||||||
AudioService.sink.audio.volume = newVolume / 100
|
|
||||||
wheelEvent.accepted = true
|
|
||||||
} else if (id === "audioInput") {
|
|
||||||
if (!AudioService.source || !AudioService.source.audio) return
|
|
||||||
let delta = wheelEvent.angleDelta.y
|
|
||||||
let currentVolume = AudioService.source.audio.volume * 100
|
|
||||||
let newVolume
|
|
||||||
if (delta > 0)
|
|
||||||
newVolume = Math.min(100, currentVolume + 5)
|
|
||||||
else
|
|
||||||
newVolume = Math.max(0, currentVolume - 5)
|
|
||||||
AudioService.source.audio.muted = false
|
|
||||||
AudioService.source.audio.volume = newVolume / 100
|
|
||||||
wheelEvent.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EditModeOverlay {
|
|
||||||
anchors.fill: parent
|
|
||||||
editMode: root.editMode
|
|
||||||
widgetData: parent.widgetData
|
|
||||||
widgetIndex: parent.widgetIndex
|
|
||||||
showSizeControls: true
|
|
||||||
isSlider: false
|
|
||||||
onRemoveWidget: (index) => root.removeWidget(index)
|
|
||||||
onToggleWidgetSize: (index) => root.toggleWidgetSize(index)
|
|
||||||
onMoveWidget: (fromIndex, toIndex) => root.moveWidget(fromIndex, toIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: audioSliderComponent
|
|
||||||
Item {
|
|
||||||
property var widgetData: parent.widgetData || {}
|
|
||||||
property int widgetIndex: parent.widgetIndex || 0
|
|
||||||
property var widgetDef: root.model?.getWidgetForId(widgetData.id || "")
|
|
||||||
width: parent.width
|
|
||||||
height: 16
|
|
||||||
|
|
||||||
AudioSliderRow {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width
|
|
||||||
height: 14
|
|
||||||
property color sliderTrackColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, Theme.getContentBackgroundAlpha() * 0.60)
|
|
||||||
}
|
|
||||||
|
|
||||||
EditModeOverlay {
|
|
||||||
anchors.fill: parent
|
|
||||||
editMode: root.editMode
|
|
||||||
widgetData: parent.widgetData
|
|
||||||
widgetIndex: parent.widgetIndex
|
|
||||||
showSizeControls: true
|
|
||||||
isSlider: true
|
|
||||||
onRemoveWidget: (index) => root.removeWidget(index)
|
|
||||||
onToggleWidgetSize: (index) => root.toggleWidgetSize(index)
|
|
||||||
onMoveWidget: (fromIndex, toIndex) => root.moveWidget(fromIndex, toIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: brightnessSliderComponent
|
|
||||||
Item {
|
|
||||||
property var widgetData: parent.widgetData || {}
|
|
||||||
property int widgetIndex: parent.widgetIndex || 0
|
|
||||||
width: parent.width
|
|
||||||
height: 16
|
|
||||||
|
|
||||||
BrightnessSliderRow {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width
|
|
||||||
height: 14
|
|
||||||
property color sliderTrackColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, Theme.getContentBackgroundAlpha() * 0.60)
|
|
||||||
}
|
|
||||||
|
|
||||||
EditModeOverlay {
|
|
||||||
anchors.fill: parent
|
|
||||||
editMode: root.editMode
|
|
||||||
widgetData: parent.widgetData
|
|
||||||
widgetIndex: parent.widgetIndex
|
|
||||||
showSizeControls: true
|
|
||||||
isSlider: true
|
|
||||||
onRemoveWidget: (index) => root.removeWidget(index)
|
|
||||||
onToggleWidgetSize: (index) => root.toggleWidgetSize(index)
|
|
||||||
onMoveWidget: (fromIndex, toIndex) => root.moveWidget(fromIndex, toIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: inputAudioSliderComponent
|
|
||||||
Item {
|
|
||||||
property var widgetData: parent.widgetData || {}
|
|
||||||
property int widgetIndex: parent.widgetIndex || 0
|
|
||||||
width: parent.width
|
|
||||||
height: 16
|
|
||||||
|
|
||||||
InputAudioSliderRow {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width
|
|
||||||
height: 14
|
|
||||||
property color sliderTrackColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, Theme.getContentBackgroundAlpha() * 0.60)
|
|
||||||
}
|
|
||||||
|
|
||||||
EditModeOverlay {
|
|
||||||
anchors.fill: parent
|
|
||||||
editMode: root.editMode
|
|
||||||
widgetData: parent.widgetData
|
|
||||||
widgetIndex: parent.widgetIndex
|
|
||||||
showSizeControls: true
|
|
||||||
isSlider: true
|
|
||||||
onRemoveWidget: (index) => root.removeWidget(index)
|
|
||||||
onToggleWidgetSize: (index) => root.toggleWidgetSize(index)
|
|
||||||
onMoveWidget: (fromIndex, toIndex) => root.moveWidget(fromIndex, toIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: batteryPillComponent
|
|
||||||
BatteryPill {
|
|
||||||
property var widgetData: parent.widgetData || {}
|
|
||||||
property int widgetIndex: parent.widgetIndex || 0
|
|
||||||
width: parent.width
|
|
||||||
height: 60
|
|
||||||
|
|
||||||
onExpandClicked: {
|
|
||||||
if (!root.editMode) {
|
|
||||||
root.expandClicked(widgetData, widgetIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EditModeOverlay {
|
|
||||||
anchors.fill: parent
|
|
||||||
editMode: root.editMode
|
|
||||||
widgetData: parent.widgetData
|
|
||||||
widgetIndex: parent.widgetIndex
|
|
||||||
showSizeControls: true
|
|
||||||
isSlider: false
|
|
||||||
onRemoveWidget: (index) => root.removeWidget(index)
|
|
||||||
onToggleWidgetSize: (index) => root.toggleWidgetSize(index)
|
|
||||||
onMoveWidget: (fromIndex, toIndex) => root.moveWidget(fromIndex, toIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: smallBatteryComponent
|
|
||||||
SmallBatteryButton {
|
|
||||||
property var widgetData: parent.widgetData || {}
|
|
||||||
property int widgetIndex: parent.widgetIndex || 0
|
|
||||||
width: parent.width
|
|
||||||
height: 48
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
if (!root.editMode) {
|
|
||||||
root.expandClicked(widgetData, widgetIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EditModeOverlay {
|
|
||||||
anchors.fill: parent
|
|
||||||
editMode: root.editMode
|
|
||||||
widgetData: parent.widgetData
|
|
||||||
widgetIndex: parent.widgetIndex
|
|
||||||
showSizeControls: true
|
|
||||||
isSlider: false
|
|
||||||
onRemoveWidget: (index) => root.removeWidget(index)
|
|
||||||
onToggleWidgetSize: (index) => root.toggleWidgetSize(index)
|
|
||||||
onMoveWidget: (fromIndex, toIndex) => root.moveWidget(fromIndex, toIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: toggleButtonComponent
|
|
||||||
ToggleButton {
|
|
||||||
property var widgetData: parent.widgetData || {}
|
|
||||||
property int widgetIndex: parent.widgetIndex || 0
|
|
||||||
property var widgetDef: root.model?.getWidgetForId(widgetData.id || "")
|
|
||||||
width: parent.width
|
|
||||||
height: 60
|
|
||||||
|
|
||||||
iconName: {
|
|
||||||
switch (widgetData.id || "") {
|
|
||||||
case "nightMode": return DisplayService.nightModeEnabled ? "nightlight" : "dark_mode"
|
|
||||||
case "darkMode": return "contrast"
|
|
||||||
case "doNotDisturb": return SessionData.doNotDisturb ? "do_not_disturb_on" : "do_not_disturb_off"
|
|
||||||
case "idleInhibitor": return SessionService.idleInhibited ? "motion_sensor_active" : "motion_sensor_idle"
|
|
||||||
default: return widgetDef?.icon || "help"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
text: {
|
|
||||||
switch (widgetData.id || "") {
|
|
||||||
case "nightMode": return "Night Mode"
|
|
||||||
case "darkMode": return SessionData.isLightMode ? "Light Mode" : "Dark Mode"
|
|
||||||
case "doNotDisturb": return "Do Not Disturb"
|
|
||||||
case "idleInhibitor": return SessionService.idleInhibited ? "Keeping Awake" : "Keep Awake"
|
|
||||||
default: return widgetDef?.text || "Unknown"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
secondaryText: ""
|
|
||||||
|
|
||||||
iconRotation: widgetData.id === "darkMode" && SessionData.isLightMode ? 180 : 0
|
|
||||||
|
|
||||||
isActive: {
|
|
||||||
switch (widgetData.id || "") {
|
|
||||||
case "nightMode": return DisplayService.nightModeEnabled || false
|
|
||||||
case "darkMode": return !SessionData.isLightMode
|
|
||||||
case "doNotDisturb": return SessionData.doNotDisturb || false
|
|
||||||
case "idleInhibitor": return SessionService.idleInhibited || false
|
|
||||||
default: return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
enabled: (widgetDef?.enabled ?? true) && !root.editMode
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
switch (widgetData.id || "") {
|
|
||||||
case "nightMode": {
|
|
||||||
if (DisplayService.automationAvailable) {
|
|
||||||
DisplayService.toggleNightMode()
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case "darkMode": {
|
|
||||||
Theme.toggleLightMode()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case "doNotDisturb": {
|
|
||||||
SessionData.setDoNotDisturb(!SessionData.doNotDisturb)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case "idleInhibitor": {
|
|
||||||
SessionService.toggleIdleInhibit()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EditModeOverlay {
|
|
||||||
anchors.fill: parent
|
|
||||||
editMode: root.editMode
|
|
||||||
widgetData: parent.widgetData
|
|
||||||
widgetIndex: parent.widgetIndex
|
|
||||||
showSizeControls: true
|
|
||||||
isSlider: false
|
|
||||||
onRemoveWidget: (index) => root.removeWidget(index)
|
|
||||||
onToggleWidgetSize: (index) => root.toggleWidgetSize(index)
|
|
||||||
onMoveWidget: (fromIndex, toIndex) => root.moveWidget(fromIndex, toIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: smallToggleComponent
|
|
||||||
SmallToggleButton {
|
|
||||||
property var widgetData: parent.widgetData || {}
|
|
||||||
property int widgetIndex: parent.widgetIndex || 0
|
|
||||||
property var widgetDef: root.model?.getWidgetForId(widgetData.id || "")
|
|
||||||
width: parent.width
|
|
||||||
height: 48
|
|
||||||
|
|
||||||
iconName: {
|
|
||||||
switch (widgetData.id || "") {
|
|
||||||
case "nightMode": return DisplayService.nightModeEnabled ? "nightlight" : "dark_mode"
|
|
||||||
case "darkMode": return "contrast"
|
|
||||||
case "doNotDisturb": return SessionData.doNotDisturb ? "do_not_disturb_on" : "do_not_disturb_off"
|
|
||||||
case "idleInhibitor": return SessionService.idleInhibited ? "motion_sensor_active" : "motion_sensor_idle"
|
|
||||||
default: return widgetDef?.icon || "help"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
iconRotation: widgetData.id === "darkMode" && SessionData.isLightMode ? 180 : 0
|
|
||||||
|
|
||||||
isActive: {
|
|
||||||
switch (widgetData.id || "") {
|
|
||||||
case "nightMode": return DisplayService.nightModeEnabled || false
|
|
||||||
case "darkMode": return !SessionData.isLightMode
|
|
||||||
case "doNotDisturb": return SessionData.doNotDisturb || false
|
|
||||||
case "idleInhibitor": return SessionService.idleInhibited || false
|
|
||||||
default: return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
enabled: (widgetDef?.enabled ?? true) && !root.editMode
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
switch (widgetData.id || "") {
|
|
||||||
case "nightMode": {
|
|
||||||
if (DisplayService.automationAvailable) {
|
|
||||||
DisplayService.toggleNightMode()
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case "darkMode": {
|
|
||||||
Theme.toggleLightMode()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case "doNotDisturb": {
|
|
||||||
SessionData.setDoNotDisturb(!SessionData.doNotDisturb)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case "idleInhibitor": {
|
|
||||||
SessionService.toggleIdleInhibit()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EditModeOverlay {
|
|
||||||
anchors.fill: parent
|
|
||||||
editMode: root.editMode
|
|
||||||
widgetData: parent.widgetData
|
|
||||||
widgetIndex: parent.widgetIndex
|
|
||||||
showSizeControls: true
|
|
||||||
isSlider: false
|
|
||||||
onRemoveWidget: (index) => root.removeWidget(index)
|
|
||||||
onToggleWidgetSize: (index) => root.toggleWidgetSize(index)
|
|
||||||
onMoveWidget: (fromIndex, toIndex) => root.moveWidget(fromIndex, toIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,200 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Effects
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
import qs.Modules.ControlCenter
|
|
||||||
import qs.Modules.ControlCenter.Widgets
|
|
||||||
import qs.Modules.ControlCenter.Details
|
|
||||||
import qs.Modules.TopBar
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
import qs.Modules.ControlCenter.Components
|
|
||||||
import qs.Modules.ControlCenter.Models
|
|
||||||
import "./utils/state.js" as StateUtils
|
|
||||||
|
|
||||||
DankPopout {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property string expandedSection: ""
|
|
||||||
property bool powerOptionsExpanded: false
|
|
||||||
property string triggerSection: "right"
|
|
||||||
property var triggerScreen: null
|
|
||||||
property bool editMode: false
|
|
||||||
property int expandedWidgetIndex: -1
|
|
||||||
|
|
||||||
signal powerActionRequested(string action, string title, string message)
|
|
||||||
signal lockRequested
|
|
||||||
|
|
||||||
readonly property color _containerBg: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, Theme.getContentBackgroundAlpha() * 0.60)
|
|
||||||
|
|
||||||
function setTriggerPosition(x, y, width, section, screen) {
|
|
||||||
StateUtils.setTriggerPosition(root, x, y, width, section, screen)
|
|
||||||
}
|
|
||||||
|
|
||||||
function openWithSection(section) {
|
|
||||||
StateUtils.openWithSection(root, section)
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleSection(section) {
|
|
||||||
StateUtils.toggleSection(root, section)
|
|
||||||
}
|
|
||||||
|
|
||||||
popupWidth: 550
|
|
||||||
popupHeight: Math.min((triggerScreen?.height ?? 1080) - 100, contentLoader.item && contentLoader.item.implicitHeight > 0 ? contentLoader.item.implicitHeight + 20 : 400)
|
|
||||||
triggerX: (triggerScreen?.width ?? 1920) - 600 - Theme.spacingL
|
|
||||||
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingXS
|
|
||||||
triggerWidth: 80
|
|
||||||
positioning: "center"
|
|
||||||
screen: triggerScreen
|
|
||||||
shouldBeVisible: false
|
|
||||||
visible: shouldBeVisible
|
|
||||||
|
|
||||||
onShouldBeVisibleChanged: {
|
|
||||||
if (shouldBeVisible) {
|
|
||||||
Qt.callLater(() => {
|
|
||||||
NetworkService.autoRefreshEnabled = NetworkService.wifiEnabled
|
|
||||||
if (UserInfoService)
|
|
||||||
UserInfoService.getUptime()
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
Qt.callLater(() => {
|
|
||||||
NetworkService.autoRefreshEnabled = false
|
|
||||||
if (BluetoothService.adapter && BluetoothService.adapter.discovering)
|
|
||||||
BluetoothService.adapter.discovering = false
|
|
||||||
editMode = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
WidgetModel {
|
|
||||||
id: widgetModel
|
|
||||||
}
|
|
||||||
|
|
||||||
content: Component {
|
|
||||||
Rectangle {
|
|
||||||
id: controlContent
|
|
||||||
|
|
||||||
implicitHeight: mainColumn.implicitHeight + Theme.spacingM
|
|
||||||
property alias bluetoothCodecSelector: bluetoothCodecSelector
|
|
||||||
|
|
||||||
color: {
|
|
||||||
const transparency = Theme.popupTransparency || 0.92
|
|
||||||
const surface = Theme.surfaceContainer || Qt.rgba(0.1, 0.1, 0.1, 1)
|
|
||||||
return Qt.rgba(surface.r, surface.g, surface.b, transparency)
|
|
||||||
}
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.08)
|
|
||||||
border.width: 1
|
|
||||||
antialiasing: true
|
|
||||||
smooth: true
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: mainColumn
|
|
||||||
width: parent.width - Theme.spacingL * 2
|
|
||||||
x: Theme.spacingL
|
|
||||||
y: Theme.spacingL
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
HeaderPane {
|
|
||||||
id: headerPane
|
|
||||||
width: parent.width
|
|
||||||
powerOptionsExpanded: root.powerOptionsExpanded
|
|
||||||
editMode: root.editMode
|
|
||||||
onPowerOptionsExpandedChanged: root.powerOptionsExpanded = powerOptionsExpanded
|
|
||||||
onEditModeToggled: root.editMode = !root.editMode
|
|
||||||
onPowerActionRequested: (action, title, message) => root.powerActionRequested(action, title, message)
|
|
||||||
onLockRequested: {
|
|
||||||
root.close()
|
|
||||||
root.lockRequested()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PowerOptionsPane {
|
|
||||||
id: powerOptionsPane
|
|
||||||
width: parent.width
|
|
||||||
expanded: root.powerOptionsExpanded
|
|
||||||
onPowerActionRequested: (action, title, message) => {
|
|
||||||
root.powerOptionsExpanded = false
|
|
||||||
root.close()
|
|
||||||
root.powerActionRequested(action, title, message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
WidgetGrid {
|
|
||||||
id: widgetGrid
|
|
||||||
width: parent.width
|
|
||||||
editMode: root.editMode
|
|
||||||
expandedSection: root.expandedSection
|
|
||||||
expandedWidgetIndex: root.expandedWidgetIndex
|
|
||||||
model: widgetModel
|
|
||||||
onExpandClicked: (widgetData, globalIndex) => {
|
|
||||||
root.expandedWidgetIndex = globalIndex
|
|
||||||
root.toggleSection(widgetData.id)
|
|
||||||
}
|
|
||||||
onRemoveWidget: (index) => widgetModel.removeWidget(index)
|
|
||||||
onMoveWidget: (fromIndex, toIndex) => widgetModel.moveWidget(fromIndex, toIndex)
|
|
||||||
onToggleWidgetSize: (index) => widgetModel.toggleWidgetSize(index)
|
|
||||||
}
|
|
||||||
|
|
||||||
EditControls {
|
|
||||||
width: parent.width
|
|
||||||
visible: editMode
|
|
||||||
availableWidgets: {
|
|
||||||
const existingIds = (SettingsData.controlCenterWidgets || []).map(w => w.id)
|
|
||||||
return widgetModel.baseWidgetDefinitions.filter(w => !existingIds.includes(w.id))
|
|
||||||
}
|
|
||||||
onAddWidget: (widgetId) => widgetModel.addWidget(widgetId)
|
|
||||||
onResetToDefault: () => widgetModel.resetToDefault()
|
|
||||||
onClearAll: () => widgetModel.clearAll()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BluetoothCodecSelector {
|
|
||||||
id: bluetoothCodecSelector
|
|
||||||
anchors.fill: parent
|
|
||||||
z: 10000
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: networkDetailComponent
|
|
||||||
NetworkDetail {}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: bluetoothDetailComponent
|
|
||||||
BluetoothDetail {
|
|
||||||
id: bluetoothDetail
|
|
||||||
onShowCodecSelector: function(device) {
|
|
||||||
if (contentLoader.item && contentLoader.item.bluetoothCodecSelector) {
|
|
||||||
contentLoader.item.bluetoothCodecSelector.show(device)
|
|
||||||
contentLoader.item.bluetoothCodecSelector.codecSelected.connect(function(deviceAddress, codecName) {
|
|
||||||
bluetoothDetail.updateDeviceCodecDisplay(deviceAddress, codecName)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: audioOutputDetailComponent
|
|
||||||
AudioOutputDetail {}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: audioInputDetailComponent
|
|
||||||
AudioInputDetail {}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: batteryDetailComponent
|
|
||||||
BatteryDetail {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,220 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Services.Pipewire
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
property bool hasVolumeSliderInCC: {
|
|
||||||
const widgets = SettingsData.controlCenterWidgets || []
|
|
||||||
return widgets.some(widget => widget.id === "volumeSlider")
|
|
||||||
}
|
|
||||||
|
|
||||||
implicitHeight: headerRow.height + (!hasVolumeSliderInCC ? volumeSlider.height : 0) + audioContent.height + Theme.spacingM
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, Theme.getContentBackgroundAlpha() * 0.6)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: headerRow
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.rightMargin: Theme.spacingM
|
|
||||||
anchors.topMargin: Theme.spacingS
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: headerText
|
|
||||||
text: "Audio Devices"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: volumeSlider
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: headerRow.bottom
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.rightMargin: Theme.spacingM
|
|
||||||
anchors.topMargin: Theme.spacingXS
|
|
||||||
height: 35
|
|
||||||
spacing: 0
|
|
||||||
visible: !hasVolumeSliderInCC
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: Theme.iconSize + Theme.spacingS * 2
|
|
||||||
height: Theme.iconSize + Theme.spacingS * 2
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
radius: (Theme.iconSize + Theme.spacingS * 2) / 2
|
|
||||||
color: iconArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation { duration: Theme.shortDuration }
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: iconArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
if (AudioService.sink && AudioService.sink.audio) {
|
|
||||||
AudioService.sink.audio.muted = !AudioService.sink.audio.muted
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: {
|
|
||||||
if (!AudioService.sink || !AudioService.sink.audio) return "volume_off"
|
|
||||||
let muted = AudioService.sink.audio.muted
|
|
||||||
let volume = AudioService.sink.audio.volume
|
|
||||||
if (muted || volume === 0.0) return "volume_off"
|
|
||||||
if (volume <= 0.33) return "volume_down"
|
|
||||||
if (volume <= 0.66) return "volume_up"
|
|
||||||
return "volume_up"
|
|
||||||
}
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: AudioService.sink && AudioService.sink.audio && !AudioService.sink.audio.muted && AudioService.sink.audio.volume > 0 ? Theme.primary : Theme.surfaceText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankSlider {
|
|
||||||
readonly property real actualVolumePercent: AudioService.sink && AudioService.sink.audio ? Math.round(AudioService.sink.audio.volume * 100) : 0
|
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: parent.width - (Theme.iconSize + Theme.spacingS * 2)
|
|
||||||
enabled: AudioService.sink && AudioService.sink.audio
|
|
||||||
minimum: 0
|
|
||||||
maximum: 100
|
|
||||||
value: AudioService.sink && AudioService.sink.audio ? Math.min(100, Math.round(AudioService.sink.audio.volume * 100)) : 0
|
|
||||||
showValue: true
|
|
||||||
unit: "%"
|
|
||||||
valueOverride: actualVolumePercent
|
|
||||||
thumbOutlineColor: Theme.surfaceVariant
|
|
||||||
|
|
||||||
onSliderValueChanged: function(newValue) {
|
|
||||||
if (AudioService.sink && AudioService.sink.audio) {
|
|
||||||
AudioService.sink.audio.volume = newValue / 100
|
|
||||||
if (newValue > 0 && AudioService.sink.audio.muted) {
|
|
||||||
AudioService.sink.audio.muted = false
|
|
||||||
}
|
|
||||||
AudioService.volumeChanged()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankFlickable {
|
|
||||||
id: audioContent
|
|
||||||
anchors.top: volumeSlider.visible ? volumeSlider.bottom : headerRow.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.margins: Theme.spacingM
|
|
||||||
anchors.topMargin: volumeSlider.visible ? Theme.spacingS : Theme.spacingM
|
|
||||||
contentHeight: audioColumn.height
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: audioColumn
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: Pipewire.nodes.values.filter(node => {
|
|
||||||
return node.audio && node.isSink && !node.isStream
|
|
||||||
})
|
|
||||||
|
|
||||||
delegate: Rectangle {
|
|
||||||
required property var modelData
|
|
||||||
required property int index
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: deviceMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, index % 2 === 0 ? 0.3 : 0.2)
|
|
||||||
border.color: modelData === AudioService.sink ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
|
||||||
border.width: modelData === AudioService.sink ? 2 : 1
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: {
|
|
||||||
if (modelData.name.includes("bluez"))
|
|
||||||
return "headset"
|
|
||||||
else if (modelData.name.includes("hdmi"))
|
|
||||||
return "tv"
|
|
||||||
else if (modelData.name.includes("usb"))
|
|
||||||
return "headset"
|
|
||||||
else
|
|
||||||
return "speaker"
|
|
||||||
}
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: modelData === AudioService.sink ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: parent.parent.width - parent.parent.anchors.leftMargin - parent.spacing - Theme.iconSize - Theme.spacingM
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: AudioService.displayName(modelData)
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: modelData === AudioService.sink ? Font.Medium : Font.Normal
|
|
||||||
elide: Text.ElideRight
|
|
||||||
width: parent.width
|
|
||||||
wrapMode: Text.NoWrap
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData === AudioService.sink ? "Active" : "Available"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
elide: Text.ElideRight
|
|
||||||
width: parent.width
|
|
||||||
wrapMode: Text.NoWrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: deviceMouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
if (modelData) {
|
|
||||||
Pipewire.preferredDefaultAudioSink = modelData
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation { duration: Theme.shortDuration }
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on border.color {
|
|
||||||
ColorAnimation { duration: Theme.shortDuration }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,476 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
import qs.Modals
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
implicitHeight: {
|
|
||||||
if (NetworkService.wifiToggling) {
|
|
||||||
return headerRow.height + wifiToggleContent.height + Theme.spacingM
|
|
||||||
}
|
|
||||||
if (NetworkService.wifiEnabled) {
|
|
||||||
return headerRow.height + wifiContent.height + Theme.spacingM
|
|
||||||
}
|
|
||||||
return headerRow.height + wifiOffContent.height + Theme.spacingM
|
|
||||||
}
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, Theme.getContentBackgroundAlpha() * 0.6)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
NetworkService.addRef()
|
|
||||||
if (NetworkService.wifiEnabled) {
|
|
||||||
NetworkService.scanWifi()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onDestruction: {
|
|
||||||
NetworkService.removeRef()
|
|
||||||
}
|
|
||||||
|
|
||||||
property var wifiPasswordModalRef: {
|
|
||||||
wifiPasswordModalLoader.active = true
|
|
||||||
return wifiPasswordModalLoader.item
|
|
||||||
}
|
|
||||||
property var networkInfoModalRef: {
|
|
||||||
networkInfoModalLoader.active = true
|
|
||||||
return networkInfoModalLoader.item
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: headerRow
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.rightMargin: Theme.spacingM
|
|
||||||
anchors.topMargin: Theme.spacingS
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: headerText
|
|
||||||
text: "Network Settings"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: Math.max(0, parent.width - headerText.implicitWidth - preferenceControls.width - Theme.spacingM)
|
|
||||||
height: parent.height
|
|
||||||
}
|
|
||||||
|
|
||||||
DankButtonGroup {
|
|
||||||
id: preferenceControls
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
visible: NetworkService.ethernetConnected && NetworkService.wifiConnected
|
|
||||||
|
|
||||||
property int currentPreferenceIndex: NetworkService.userPreference === "ethernet" ? 0 : 1
|
|
||||||
|
|
||||||
model: ["Ethernet", "WiFi"]
|
|
||||||
currentIndex: currentPreferenceIndex
|
|
||||||
selectionMode: "single"
|
|
||||||
onSelectionChanged: (index, selected) => {
|
|
||||||
if (!selected) return
|
|
||||||
NetworkService.setNetworkPreference(index === 0 ? "ethernet" : "wifi")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: wifiToggleContent
|
|
||||||
anchors.top: headerRow.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingM
|
|
||||||
anchors.topMargin: Theme.spacingM
|
|
||||||
visible: NetworkService.wifiToggling
|
|
||||||
height: visible ? 80 : 0
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
name: "sync"
|
|
||||||
size: 32
|
|
||||||
color: Theme.primary
|
|
||||||
|
|
||||||
RotationAnimation on rotation {
|
|
||||||
running: NetworkService.wifiToggling
|
|
||||||
loops: Animation.Infinite
|
|
||||||
from: 0
|
|
||||||
to: 360
|
|
||||||
duration: 1000
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
text: NetworkService.wifiEnabled ? "Disabling WiFi..." : "Enabling WiFi..."
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: wifiOffContent
|
|
||||||
anchors.top: headerRow.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingM
|
|
||||||
anchors.topMargin: Theme.spacingM
|
|
||||||
visible: !NetworkService.wifiEnabled && !NetworkService.wifiToggling
|
|
||||||
height: visible ? 120 : 0
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingL
|
|
||||||
width: parent.width
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
name: "wifi_off"
|
|
||||||
size: 48
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.5)
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
text: "WiFi is off"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
width: 120
|
|
||||||
height: 36
|
|
||||||
radius: 18
|
|
||||||
color: enableWifiButton.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08)
|
|
||||||
border.width: 1
|
|
||||||
border.color: Theme.primary
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "Enable WiFi"
|
|
||||||
color: Theme.primary
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: enableWifiButton
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: NetworkService.toggleWifiRadio()
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankFlickable {
|
|
||||||
id: wifiContent
|
|
||||||
anchors.top: headerRow.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.margins: Theme.spacingM
|
|
||||||
anchors.topMargin: Theme.spacingM
|
|
||||||
visible: NetworkService.wifiInterface && NetworkService.wifiEnabled && !NetworkService.wifiToggling
|
|
||||||
contentHeight: wifiColumn.height
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: wifiColumn
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: 200
|
|
||||||
visible: NetworkService.wifiInterface && NetworkService.wifiNetworks?.length < 1 && !NetworkService.wifiToggling
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "refresh"
|
|
||||||
size: 48
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r || 0.8, Theme.surfaceText.g || 0.8, Theme.surfaceText.b || 0.8, 0.3)
|
|
||||||
|
|
||||||
RotationAnimation on rotation {
|
|
||||||
running: true
|
|
||||||
loops: Animation.Infinite
|
|
||||||
from: 0
|
|
||||||
to: 360
|
|
||||||
duration: 1000
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: {
|
|
||||||
let networks = [...NetworkService.wifiNetworks]
|
|
||||||
networks.sort((a, b) => {
|
|
||||||
if (a.ssid === NetworkService.currentWifiSSID) return -1
|
|
||||||
if (b.ssid === NetworkService.currentWifiSSID) return 1
|
|
||||||
return b.signal - a.signal
|
|
||||||
})
|
|
||||||
return networks
|
|
||||||
}
|
|
||||||
delegate: Rectangle {
|
|
||||||
required property var modelData
|
|
||||||
required property int index
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: networkMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, index % 2 === 0 ? 0.3 : 0.2)
|
|
||||||
border.color: modelData.ssid === NetworkService.currentWifiSSID ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
|
||||||
border.width: modelData.ssid === NetworkService.currentWifiSSID ? 2 : 1
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: {
|
|
||||||
let strength = modelData.signal || 0
|
|
||||||
if (strength >= 50) return "wifi"
|
|
||||||
if (strength >= 25) return "wifi_2_bar"
|
|
||||||
return "wifi_1_bar"
|
|
||||||
}
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: modelData.ssid === NetworkService.currentWifiSSID ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: 200
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData.ssid || "Unknown Network"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: modelData.ssid === NetworkService.currentWifiSSID ? Font.Medium : Font.Normal
|
|
||||||
elide: Text.ElideRight
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData.ssid === NetworkService.currentWifiSSID ? "Connected" : (modelData.secured ? "Secured" : "Open")
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData.saved ? "• Saved" : ""
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.primary
|
|
||||||
visible: text.length > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "• " + modelData.signal + "%"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
id: optionsButton
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: Theme.spacingS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
iconName: "more_horiz"
|
|
||||||
buttonSize: 28
|
|
||||||
onClicked: {
|
|
||||||
if (networkContextMenu.visible) {
|
|
||||||
networkContextMenu.close()
|
|
||||||
} else {
|
|
||||||
networkContextMenu.currentSSID = modelData.ssid
|
|
||||||
networkContextMenu.currentSecured = modelData.secured
|
|
||||||
networkContextMenu.currentConnected = modelData.ssid === NetworkService.currentWifiSSID
|
|
||||||
networkContextMenu.currentSaved = modelData.saved
|
|
||||||
networkContextMenu.currentSignal = modelData.signal
|
|
||||||
networkContextMenu.popup(optionsButton, -networkContextMenu.width + optionsButton.width, optionsButton.height + Theme.spacingXS)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: networkMouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.rightMargin: optionsButton.width + Theme.spacingS
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: function(event) {
|
|
||||||
if (modelData.ssid !== NetworkService.currentWifiSSID) {
|
|
||||||
if (modelData.secured && !modelData.saved) {
|
|
||||||
if (wifiPasswordModalRef) {
|
|
||||||
wifiPasswordModalRef.show(modelData.ssid)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
NetworkService.connectToWifi(modelData.ssid)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation { duration: Theme.shortDuration }
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on border.color {
|
|
||||||
ColorAnimation { duration: Theme.shortDuration }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Menu {
|
|
||||||
id: networkContextMenu
|
|
||||||
width: 150
|
|
||||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
|
||||||
|
|
||||||
property string currentSSID: ""
|
|
||||||
property bool currentSecured: false
|
|
||||||
property bool currentConnected: false
|
|
||||||
property bool currentSaved: false
|
|
||||||
property int currentSignal: 0
|
|
||||||
|
|
||||||
background: Rectangle {
|
|
||||||
color: Theme.popupBackground()
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.width: 1
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuItem {
|
|
||||||
text: networkContextMenu.currentConnected ? "Disconnect" : "Connect"
|
|
||||||
height: 32
|
|
||||||
|
|
||||||
contentItem: StyledText {
|
|
||||||
text: parent.text
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
leftPadding: Theme.spacingS
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
background: Rectangle {
|
|
||||||
color: parent.hovered ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : "transparent"
|
|
||||||
radius: Theme.cornerRadius / 2
|
|
||||||
}
|
|
||||||
|
|
||||||
onTriggered: {
|
|
||||||
if (networkContextMenu.currentConnected) {
|
|
||||||
NetworkService.disconnectWifi()
|
|
||||||
} else {
|
|
||||||
if (networkContextMenu.currentSecured && !networkContextMenu.currentSaved) {
|
|
||||||
if (wifiPasswordModalRef) {
|
|
||||||
wifiPasswordModalRef.show(networkContextMenu.currentSSID)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
NetworkService.connectToWifi(networkContextMenu.currentSSID)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuItem {
|
|
||||||
text: "Network Info"
|
|
||||||
height: 32
|
|
||||||
|
|
||||||
contentItem: StyledText {
|
|
||||||
text: parent.text
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
leftPadding: Theme.spacingS
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
background: Rectangle {
|
|
||||||
color: parent.hovered ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : "transparent"
|
|
||||||
radius: Theme.cornerRadius / 2
|
|
||||||
}
|
|
||||||
|
|
||||||
onTriggered: {
|
|
||||||
if (networkInfoModalRef) {
|
|
||||||
let networkData = NetworkService.getNetworkInfo(networkContextMenu.currentSSID)
|
|
||||||
networkInfoModalRef.showNetworkInfo(networkContextMenu.currentSSID, networkData)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MenuItem {
|
|
||||||
text: "Forget Network"
|
|
||||||
height: networkContextMenu.currentSaved || networkContextMenu.currentConnected ? 32 : 0
|
|
||||||
visible: networkContextMenu.currentSaved || networkContextMenu.currentConnected
|
|
||||||
|
|
||||||
contentItem: StyledText {
|
|
||||||
text: parent.text
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.error
|
|
||||||
leftPadding: Theme.spacingS
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
background: Rectangle {
|
|
||||||
color: parent.hovered ? Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.08) : "transparent"
|
|
||||||
radius: Theme.cornerRadius / 2
|
|
||||||
}
|
|
||||||
|
|
||||||
onTriggered: {
|
|
||||||
NetworkService.forgetWifiNetwork(networkContextMenu.currentSSID)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: wifiPasswordModalLoader
|
|
||||||
active: false
|
|
||||||
|
|
||||||
WifiPasswordModal {
|
|
||||||
id: wifiPasswordModal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: networkInfoModalLoader
|
|
||||||
active: false
|
|
||||||
|
|
||||||
NetworkInfoModal {
|
|
||||||
id: networkInfoModal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import "../utils/widgets.js" as WidgetUtils
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
readonly property var baseWidgetDefinitions: [
|
|
||||||
{
|
|
||||||
"id": "nightMode",
|
|
||||||
"text": "Night Mode",
|
|
||||||
"description": "Blue light filter",
|
|
||||||
"icon": "nightlight",
|
|
||||||
"type": "toggle",
|
|
||||||
"enabled": DisplayService.automationAvailable,
|
|
||||||
"warning": !DisplayService.automationAvailable ? "Requires night mode support" : undefined
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "darkMode",
|
|
||||||
"text": "Dark Mode",
|
|
||||||
"description": "System theme toggle",
|
|
||||||
"icon": "contrast",
|
|
||||||
"type": "toggle",
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "doNotDisturb",
|
|
||||||
"text": "Do Not Disturb",
|
|
||||||
"description": "Block notifications",
|
|
||||||
"icon": "do_not_disturb_on",
|
|
||||||
"type": "toggle",
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "idleInhibitor",
|
|
||||||
"text": "Keep Awake",
|
|
||||||
"description": "Prevent screen timeout",
|
|
||||||
"icon": "motion_sensor_active",
|
|
||||||
"type": "toggle",
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "wifi",
|
|
||||||
"text": "Network",
|
|
||||||
"description": "Wi-Fi and Ethernet connection",
|
|
||||||
"icon": "wifi",
|
|
||||||
"type": "connection",
|
|
||||||
"enabled": NetworkService.wifiAvailable,
|
|
||||||
"warning": !NetworkService.wifiAvailable ? "Wi-Fi not available" : undefined
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "bluetooth",
|
|
||||||
"text": "Bluetooth",
|
|
||||||
"description": "Device connections",
|
|
||||||
"icon": "bluetooth",
|
|
||||||
"type": "connection",
|
|
||||||
"enabled": BluetoothService.available,
|
|
||||||
"warning": !BluetoothService.available ? "Bluetooth not available" : undefined
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "audioOutput",
|
|
||||||
"text": "Audio Output",
|
|
||||||
"description": "Speaker settings",
|
|
||||||
"icon": "volume_up",
|
|
||||||
"type": "connection",
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "audioInput",
|
|
||||||
"text": "Audio Input",
|
|
||||||
"description": "Microphone settings",
|
|
||||||
"icon": "mic",
|
|
||||||
"type": "connection",
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "volumeSlider",
|
|
||||||
"text": "Volume Slider",
|
|
||||||
"description": "Audio volume control",
|
|
||||||
"icon": "volume_up",
|
|
||||||
"type": "slider",
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "brightnessSlider",
|
|
||||||
"text": "Brightness Slider",
|
|
||||||
"description": "Display brightness control",
|
|
||||||
"icon": "brightness_6",
|
|
||||||
"type": "slider",
|
|
||||||
"enabled": DisplayService.brightnessAvailable,
|
|
||||||
"warning": !DisplayService.brightnessAvailable ? "Brightness control not available" : undefined
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "inputVolumeSlider",
|
|
||||||
"text": "Input Volume Slider",
|
|
||||||
"description": "Microphone volume control",
|
|
||||||
"icon": "mic",
|
|
||||||
"type": "slider",
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "battery",
|
|
||||||
"text": "Battery",
|
|
||||||
"description": "Battery and power management",
|
|
||||||
"icon": "battery_std",
|
|
||||||
"type": "action",
|
|
||||||
"enabled": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
function getWidgetForId(widgetId) {
|
|
||||||
return WidgetUtils.getWidgetForId(baseWidgetDefinitions, widgetId)
|
|
||||||
}
|
|
||||||
|
|
||||||
function addWidget(widgetId) {
|
|
||||||
WidgetUtils.addWidget(widgetId)
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeWidget(index) {
|
|
||||||
WidgetUtils.removeWidget(index)
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleWidgetSize(index) {
|
|
||||||
WidgetUtils.toggleWidgetSize(index)
|
|
||||||
}
|
|
||||||
|
|
||||||
function moveWidget(fromIndex, toIndex) {
|
|
||||||
WidgetUtils.moveWidget(fromIndex, toIndex)
|
|
||||||
}
|
|
||||||
|
|
||||||
function resetToDefault() {
|
|
||||||
WidgetUtils.resetToDefault()
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearAll() {
|
|
||||||
WidgetUtils.clearAll()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,310 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
PanelWindow {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool powerMenuVisible: false
|
|
||||||
signal powerActionRequested(string action, string title, string message)
|
|
||||||
|
|
||||||
visible: powerMenuVisible
|
|
||||||
implicitWidth: 400
|
|
||||||
implicitHeight: 320
|
|
||||||
WlrLayershell.layer: WlrLayershell.Overlay
|
|
||||||
WlrLayershell.exclusiveZone: -1
|
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
top: true
|
|
||||||
left: true
|
|
||||||
right: true
|
|
||||||
bottom: true
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {
|
|
||||||
powerMenuVisible = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: Math.min(320, parent.width - Theme.spacingL * 2)
|
|
||||||
height: 320 // Fixed height to prevent cropping
|
|
||||||
x: Math.max(Theme.spacingL, parent.width - width - Theme.spacingL)
|
|
||||||
y: Theme.barHeight + Theme.spacingXS
|
|
||||||
color: Theme.popupBackground()
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.08)
|
|
||||||
border.width: 1
|
|
||||||
opacity: powerMenuVisible ? 1 : 0
|
|
||||||
scale: powerMenuVisible ? 1 : 0.85
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Power Options"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width - 150
|
|
||||||
height: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
iconName: "close"
|
|
||||||
iconSize: Theme.iconSize - 4
|
|
||||||
iconColor: Theme.surfaceText
|
|
||||||
onClicked: {
|
|
||||||
powerMenuVisible = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: logoutArea.containsMouse ? Qt.rgba(Theme.primary.r,
|
|
||||||
Theme.primary.g,
|
|
||||||
Theme.primary.b,
|
|
||||||
0.08) : Qt.rgba(
|
|
||||||
Theme.surfaceVariant.r,
|
|
||||||
Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b,
|
|
||||||
0.08)
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "logout"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Log Out"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: logoutArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
powerMenuVisible = false
|
|
||||||
root.powerActionRequested(
|
|
||||||
"logout", "Log Out",
|
|
||||||
"Are you sure you want to log out?")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: suspendArea.containsMouse ? Qt.rgba(Theme.primary.r,
|
|
||||||
Theme.primary.g,
|
|
||||||
Theme.primary.b,
|
|
||||||
0.08) : Qt.rgba(
|
|
||||||
Theme.surfaceVariant.r,
|
|
||||||
Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b,
|
|
||||||
0.08)
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "bedtime"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Suspend"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: suspendArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
powerMenuVisible = false
|
|
||||||
root.powerActionRequested(
|
|
||||||
"suspend", "Suspend",
|
|
||||||
"Are you sure you want to suspend the system?")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: rebootArea.containsMouse ? Qt.rgba(Theme.warning.r,
|
|
||||||
Theme.warning.g,
|
|
||||||
Theme.warning.b,
|
|
||||||
0.08) : Qt.rgba(
|
|
||||||
Theme.surfaceVariant.r,
|
|
||||||
Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b,
|
|
||||||
0.08)
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "restart_alt"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: rebootArea.containsMouse ? Theme.warning : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Reboot"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: rebootArea.containsMouse ? Theme.warning : Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: rebootArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
powerMenuVisible = false
|
|
||||||
root.powerActionRequested(
|
|
||||||
"reboot", "Reboot",
|
|
||||||
"Are you sure you want to reboot the system?")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: powerOffArea.containsMouse ? Qt.rgba(Theme.error.r,
|
|
||||||
Theme.error.g,
|
|
||||||
Theme.error.b,
|
|
||||||
0.08) : Qt.rgba(
|
|
||||||
Theme.surfaceVariant.r,
|
|
||||||
Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b,
|
|
||||||
0.08)
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "power_settings_new"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: powerOffArea.containsMouse ? Theme.error : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Power Off"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: powerOffArea.containsMouse ? Theme.error : Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: powerOffArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
powerMenuVisible = false
|
|
||||||
root.powerActionRequested(
|
|
||||||
"poweroff", "Power Off",
|
|
||||||
"Are you sure you want to power off the system?")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on scale {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Services.Pipewire
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
import qs.Modules.ControlCenter.Widgets
|
|
||||||
|
|
||||||
CompoundPill {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property var defaultSource: AudioService.source
|
|
||||||
|
|
||||||
iconName: {
|
|
||||||
if (!defaultSource) return "mic_off"
|
|
||||||
|
|
||||||
let volume = defaultSource.audio.volume
|
|
||||||
let muted = defaultSource.audio.muted
|
|
||||||
|
|
||||||
if (muted || volume === 0.0) return "mic_off"
|
|
||||||
return "mic"
|
|
||||||
}
|
|
||||||
|
|
||||||
isActive: defaultSource && !defaultSource.audio.muted
|
|
||||||
|
|
||||||
primaryText: {
|
|
||||||
if (!defaultSource) {
|
|
||||||
return "No input device"
|
|
||||||
}
|
|
||||||
return defaultSource.description || "Audio Input"
|
|
||||||
}
|
|
||||||
|
|
||||||
secondaryText: {
|
|
||||||
if (!defaultSource) {
|
|
||||||
return "Select device"
|
|
||||||
}
|
|
||||||
if (defaultSource.audio.muted) {
|
|
||||||
return "Muted"
|
|
||||||
}
|
|
||||||
return Math.round(defaultSource.audio.volume * 100) + "%"
|
|
||||||
}
|
|
||||||
|
|
||||||
onToggled: {
|
|
||||||
if (defaultSource && defaultSource.audio) {
|
|
||||||
defaultSource.audio.muted = !defaultSource.audio.muted
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onWheelEvent: function (wheelEvent) {
|
|
||||||
if (!defaultSource || !defaultSource.audio) return
|
|
||||||
let delta = wheelEvent.angleDelta.y
|
|
||||||
let currentVolume = defaultSource.audio.volume * 100
|
|
||||||
let newVolume
|
|
||||||
if (delta > 0)
|
|
||||||
newVolume = Math.min(100, currentVolume + 5)
|
|
||||||
else
|
|
||||||
newVolume = Math.max(0, currentVolume - 5)
|
|
||||||
defaultSource.audio.muted = false
|
|
||||||
defaultSource.audio.volume = newVolume / 100
|
|
||||||
wheelEvent.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Services.Pipewire
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
import qs.Modules.ControlCenter.Widgets
|
|
||||||
|
|
||||||
CompoundPill {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property var defaultSink: AudioService.sink
|
|
||||||
|
|
||||||
iconName: {
|
|
||||||
if (!defaultSink) return "volume_off"
|
|
||||||
|
|
||||||
let volume = defaultSink.audio.volume
|
|
||||||
let muted = defaultSink.audio.muted
|
|
||||||
|
|
||||||
if (muted || volume === 0.0) return "volume_off"
|
|
||||||
if (volume <= 0.33) return "volume_down"
|
|
||||||
if (volume <= 0.66) return "volume_up"
|
|
||||||
return "volume_up"
|
|
||||||
}
|
|
||||||
|
|
||||||
isActive: defaultSink && !defaultSink.audio.muted
|
|
||||||
|
|
||||||
primaryText: {
|
|
||||||
if (!defaultSink) {
|
|
||||||
return "No output device"
|
|
||||||
}
|
|
||||||
return defaultSink.description || "Audio Output"
|
|
||||||
}
|
|
||||||
|
|
||||||
secondaryText: {
|
|
||||||
if (!defaultSink) {
|
|
||||||
return "Select device"
|
|
||||||
}
|
|
||||||
if (defaultSink.audio.muted) {
|
|
||||||
return "Muted"
|
|
||||||
}
|
|
||||||
return Math.round(defaultSink.audio.volume * 100) + "%"
|
|
||||||
}
|
|
||||||
|
|
||||||
onToggled: {
|
|
||||||
if (defaultSink && defaultSink.audio) {
|
|
||||||
defaultSink.audio.muted = !defaultSink.audio.muted
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onWheelEvent: function (wheelEvent) {
|
|
||||||
if (!defaultSink || !defaultSink.audio) return
|
|
||||||
let delta = wheelEvent.angleDelta.y
|
|
||||||
let currentVolume = defaultSink.audio.volume * 100
|
|
||||||
let newVolume
|
|
||||||
if (delta > 0)
|
|
||||||
newVolume = Math.min(100, currentVolume + 5)
|
|
||||||
else
|
|
||||||
newVolume = Math.max(0, currentVolume - 5)
|
|
||||||
defaultSink.audio.muted = false
|
|
||||||
defaultSink.audio.volume = newVolume / 100
|
|
||||||
AudioService.volumeChanged()
|
|
||||||
wheelEvent.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
import qs.Modules.ControlCenter.Widgets
|
|
||||||
|
|
||||||
CompoundPill {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property var primaryDevice: {
|
|
||||||
if (!BluetoothService.adapter || !BluetoothService.adapter.devices) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
let devices = [...BluetoothService.adapter.devices.values.filter(dev => dev && (dev.paired || dev.trusted))]
|
|
||||||
for (let device of devices) {
|
|
||||||
if (device && device.connected) {
|
|
||||||
return device
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
iconName: {
|
|
||||||
if (!BluetoothService.available) {
|
|
||||||
return "bluetooth_disabled"
|
|
||||||
}
|
|
||||||
if (!BluetoothService.adapter || !BluetoothService.adapter.enabled) {
|
|
||||||
return "bluetooth_disabled"
|
|
||||||
}
|
|
||||||
if (primaryDevice) {
|
|
||||||
return BluetoothService.getDeviceIcon(primaryDevice)
|
|
||||||
}
|
|
||||||
return "bluetooth"
|
|
||||||
}
|
|
||||||
|
|
||||||
isActive: !!(BluetoothService.available && BluetoothService.adapter && BluetoothService.adapter.enabled)
|
|
||||||
showExpandArea: BluetoothService.available
|
|
||||||
|
|
||||||
primaryText: {
|
|
||||||
if (!BluetoothService.available) {
|
|
||||||
return "Bluetooth"
|
|
||||||
}
|
|
||||||
if (!BluetoothService.adapter) {
|
|
||||||
return "No adapter"
|
|
||||||
}
|
|
||||||
if (!BluetoothService.adapter.enabled) {
|
|
||||||
return "Disabled"
|
|
||||||
}
|
|
||||||
return "Enabled"
|
|
||||||
}
|
|
||||||
|
|
||||||
secondaryText: {
|
|
||||||
if (!BluetoothService.available) {
|
|
||||||
return "No adapters"
|
|
||||||
}
|
|
||||||
if (!BluetoothService.adapter || !BluetoothService.adapter.enabled) {
|
|
||||||
return "Off"
|
|
||||||
}
|
|
||||||
if (primaryDevice) {
|
|
||||||
return primaryDevice.name || primaryDevice.alias || primaryDevice.deviceName || "Connected Device"
|
|
||||||
}
|
|
||||||
return "No devices"
|
|
||||||
}
|
|
||||||
|
|
||||||
onToggled: {
|
|
||||||
if (BluetoothService.available && BluetoothService.adapter) {
|
|
||||||
BluetoothService.adapter.enabled = !BluetoothService.adapter.enabled
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,144 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
height: 40
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: Theme.iconSize + Theme.spacingS * 2
|
|
||||||
height: Theme.iconSize + Theme.spacingS * 2
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
radius: (Theme.iconSize + Theme.spacingS * 2) / 2
|
|
||||||
color: iconArea.containsMouse
|
|
||||||
? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12)
|
|
||||||
: "transparent"
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation { duration: Theme.shortDuration }
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: iconArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
|
|
||||||
onClicked: function(event) {
|
|
||||||
if (DisplayService.devices.length > 1) {
|
|
||||||
if (deviceMenu.visible) {
|
|
||||||
deviceMenu.close()
|
|
||||||
} else {
|
|
||||||
deviceMenu.popup(iconArea, 0, iconArea.height + Theme.spacingXS)
|
|
||||||
}
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: {
|
|
||||||
if (!DisplayService.brightnessAvailable) return "brightness_low"
|
|
||||||
|
|
||||||
let brightness = DisplayService.brightnessLevel
|
|
||||||
if (brightness <= 33) return "brightness_low"
|
|
||||||
if (brightness <= 66) return "brightness_medium"
|
|
||||||
return "brightness_high"
|
|
||||||
}
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: DisplayService.brightnessAvailable && DisplayService.brightnessLevel > 0 ? Theme.primary : Theme.surfaceText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankSlider {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: parent.width - (Theme.iconSize + Theme.spacingS * 2)
|
|
||||||
enabled: DisplayService.brightnessAvailable
|
|
||||||
minimum: 1
|
|
||||||
maximum: 100
|
|
||||||
value: {
|
|
||||||
let level = DisplayService.brightnessLevel
|
|
||||||
if (level > 100) {
|
|
||||||
let deviceInfo = DisplayService.getCurrentDeviceInfo()
|
|
||||||
if (deviceInfo && deviceInfo.max > 0) {
|
|
||||||
return Math.round((level / deviceInfo.max) * 100)
|
|
||||||
}
|
|
||||||
return 50
|
|
||||||
}
|
|
||||||
return level
|
|
||||||
}
|
|
||||||
onSliderValueChanged: function(newValue) {
|
|
||||||
if (DisplayService.brightnessAvailable) {
|
|
||||||
DisplayService.setBrightness(newValue)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
thumbOutlineColor: Theme.surfaceContainer
|
|
||||||
trackColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, Theme.getContentBackgroundAlpha() * 0.60)
|
|
||||||
}
|
|
||||||
|
|
||||||
Menu {
|
|
||||||
id: deviceMenu
|
|
||||||
width: 200
|
|
||||||
closePolicy: Popup.CloseOnEscape
|
|
||||||
|
|
||||||
background: Rectangle {
|
|
||||||
color: Theme.popupBackground()
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.width: 1
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
|
||||||
}
|
|
||||||
|
|
||||||
Instantiator {
|
|
||||||
model: DisplayService.devices
|
|
||||||
delegate: MenuItem {
|
|
||||||
required property var modelData
|
|
||||||
required property int index
|
|
||||||
|
|
||||||
property string deviceName: modelData.name || ""
|
|
||||||
property string deviceClass: modelData.class || ""
|
|
||||||
|
|
||||||
text: deviceName
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
indicator: Rectangle {
|
|
||||||
visible: DisplayService.currentDevice === parent.deviceName
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
width: 4
|
|
||||||
height: parent.height - Theme.spacingS * 2
|
|
||||||
radius: 2
|
|
||||||
color: Theme.primary
|
|
||||||
}
|
|
||||||
|
|
||||||
contentItem: StyledText {
|
|
||||||
text: parent.text
|
|
||||||
font: parent.font
|
|
||||||
color: DisplayService.currentDevice === parent.deviceName ? Theme.primary : Theme.surfaceText
|
|
||||||
leftPadding: Theme.spacingL
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
background: Rectangle {
|
|
||||||
color: parent.hovered ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : "transparent"
|
|
||||||
radius: Theme.cornerRadius / 2
|
|
||||||
}
|
|
||||||
|
|
||||||
onTriggered: {
|
|
||||||
DisplayService.setCurrentDevice(deviceName, true)
|
|
||||||
deviceMenu.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onObjectAdded: (index, object) => deviceMenu.insertItem(index, object)
|
|
||||||
onObjectRemoved: (index, object) => deviceMenu.removeItem(object)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
import qs.Modules.ControlCenter.Widgets
|
|
||||||
|
|
||||||
CompoundPill {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
isActive: {
|
|
||||||
if (NetworkService.wifiToggling) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "ethernet") {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "wifi") {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return NetworkService.wifiEnabled
|
|
||||||
}
|
|
||||||
|
|
||||||
iconName: {
|
|
||||||
if (NetworkService.wifiToggling) {
|
|
||||||
return "sync"
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "ethernet") {
|
|
||||||
return "settings_ethernet"
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "wifi") {
|
|
||||||
return NetworkService.wifiSignalIcon
|
|
||||||
}
|
|
||||||
if (NetworkService.wifiEnabled) {
|
|
||||||
return "wifi_off"
|
|
||||||
}
|
|
||||||
return "wifi_off"
|
|
||||||
}
|
|
||||||
|
|
||||||
primaryText: {
|
|
||||||
if (NetworkService.wifiToggling) {
|
|
||||||
return NetworkService.wifiEnabled ? "Disabling WiFi..." : "Enabling WiFi..."
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "ethernet") {
|
|
||||||
return "Ethernet"
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "wifi" && NetworkService.currentWifiSSID) {
|
|
||||||
return NetworkService.currentWifiSSID
|
|
||||||
}
|
|
||||||
if (NetworkService.wifiEnabled) {
|
|
||||||
return "Not connected"
|
|
||||||
}
|
|
||||||
return "WiFi off"
|
|
||||||
}
|
|
||||||
|
|
||||||
secondaryText: {
|
|
||||||
if (NetworkService.wifiToggling) {
|
|
||||||
return "Please wait..."
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "ethernet") {
|
|
||||||
return "Connected"
|
|
||||||
}
|
|
||||||
if (NetworkService.networkStatus === "wifi") {
|
|
||||||
return NetworkService.wifiSignalStrength > 0 ? NetworkService.wifiSignalStrength + "%" : "Connected"
|
|
||||||
}
|
|
||||||
if (NetworkService.wifiEnabled) {
|
|
||||||
return "Select network"
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
onToggled: {
|
|
||||||
if (NetworkService.networkStatus !== "ethernet" && !NetworkService.wifiToggling) {
|
|
||||||
NetworkService.toggleWifiRadio()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
function setTriggerPosition(root, x, y, width, section, screen) {
|
|
||||||
root.triggerX = x
|
|
||||||
root.triggerY = y
|
|
||||||
root.triggerWidth = width
|
|
||||||
root.triggerSection = section
|
|
||||||
root.triggerScreen = screen
|
|
||||||
}
|
|
||||||
|
|
||||||
function openWithSection(root, section) {
|
|
||||||
if (root.shouldBeVisible) {
|
|
||||||
root.close()
|
|
||||||
} else {
|
|
||||||
root.expandedSection = section
|
|
||||||
root.open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleSection(root, section) {
|
|
||||||
if (root.expandedSection === section) {
|
|
||||||
root.expandedSection = ""
|
|
||||||
root.expandedWidgetIndex = -1
|
|
||||||
} else {
|
|
||||||
root.expandedSection = section
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,201 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Effects
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Services.Mpris
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
import qs.Modules.DankDash
|
|
||||||
|
|
||||||
DankPopout {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool dashVisible: false
|
|
||||||
property string triggerSection: "center"
|
|
||||||
property var triggerScreen: null
|
|
||||||
property int currentTabIndex: 0
|
|
||||||
|
|
||||||
function setTriggerPosition(x, y, width, section, screen) {
|
|
||||||
if (section === "center") {
|
|
||||||
const screenWidth = screen ? screen.width : Screen.width
|
|
||||||
triggerX = (screenWidth - popupWidth) / 2
|
|
||||||
triggerWidth = popupWidth
|
|
||||||
} else {
|
|
||||||
triggerX = x
|
|
||||||
triggerWidth = width
|
|
||||||
}
|
|
||||||
triggerY = y
|
|
||||||
triggerSection = section
|
|
||||||
triggerScreen = screen
|
|
||||||
}
|
|
||||||
|
|
||||||
popupWidth: 700
|
|
||||||
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 500
|
|
||||||
triggerX: Screen.width - 620 - Theme.spacingL
|
|
||||||
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingS
|
|
||||||
triggerWidth: 80
|
|
||||||
positioning: "center"
|
|
||||||
shouldBeVisible: dashVisible
|
|
||||||
visible: shouldBeVisible
|
|
||||||
|
|
||||||
|
|
||||||
onDashVisibleChanged: {
|
|
||||||
if (dashVisible) {
|
|
||||||
open()
|
|
||||||
} else {
|
|
||||||
close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onBackgroundClicked: {
|
|
||||||
dashVisible = false
|
|
||||||
}
|
|
||||||
|
|
||||||
content: Component {
|
|
||||||
Rectangle {
|
|
||||||
id: mainContainer
|
|
||||||
|
|
||||||
implicitHeight: contentColumn.height + Theme.spacingM * 2
|
|
||||||
color: Theme.surfaceContainer
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
focus: true
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (root.shouldBeVisible) {
|
|
||||||
forceActiveFocus()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onPressed: function(event) {
|
|
||||||
if (event.key === Qt.Key_Escape) {
|
|
||||||
root.dashVisible = false
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onShouldBeVisibleChanged() {
|
|
||||||
if (root.shouldBeVisible) {
|
|
||||||
Qt.callLater(function() {
|
|
||||||
mainContainer.forceActiveFocus()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
target: root
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
color: Qt.rgba(Theme.surfaceTint.r, Theme.surfaceTint.g, Theme.surfaceTint.b, 0.04)
|
|
||||||
radius: parent.radius
|
|
||||||
|
|
||||||
SequentialAnimation on opacity {
|
|
||||||
running: root.shouldBeVisible
|
|
||||||
loops: Animation.Infinite
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
to: 0.08
|
|
||||||
duration: Theme.extraLongDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
to: 0.02
|
|
||||||
duration: Theme.extraLongDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: contentColumn
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.margins: Theme.spacingM
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankTabBar {
|
|
||||||
id: tabBar
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
height: 48
|
|
||||||
currentIndex: root.currentTabIndex
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
equalWidthTabs: true
|
|
||||||
|
|
||||||
model: {
|
|
||||||
let tabs = [
|
|
||||||
{ icon: "dashboard", text: "Overview" },
|
|
||||||
{ icon: "music_note", text: "Media" }
|
|
||||||
]
|
|
||||||
|
|
||||||
if (SettingsData.weatherEnabled) {
|
|
||||||
tabs.push({ icon: "wb_sunny", text: "Weather" })
|
|
||||||
}
|
|
||||||
|
|
||||||
tabs.push({ icon: "settings", text: "Settings", isAction: true })
|
|
||||||
return tabs
|
|
||||||
}
|
|
||||||
|
|
||||||
onTabClicked: function(index) {
|
|
||||||
root.currentTabIndex = index
|
|
||||||
}
|
|
||||||
|
|
||||||
onActionTriggered: function(index) {
|
|
||||||
let settingsIndex = SettingsData.weatherEnabled ? 3 : 2
|
|
||||||
if (index === settingsIndex) {
|
|
||||||
dashVisible = false
|
|
||||||
settingsModal.show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: Theme.spacingXS
|
|
||||||
}
|
|
||||||
|
|
||||||
StackLayout {
|
|
||||||
id: pages
|
|
||||||
width: parent.width
|
|
||||||
implicitHeight: {
|
|
||||||
if (currentIndex === 0) return overviewTab.implicitHeight
|
|
||||||
if (currentIndex === 1) return mediaTab.implicitHeight
|
|
||||||
if (SettingsData.weatherEnabled && currentIndex === 2) return weatherTab.implicitHeight
|
|
||||||
return overviewTab.implicitHeight
|
|
||||||
}
|
|
||||||
currentIndex: root.currentTabIndex
|
|
||||||
|
|
||||||
OverviewTab {
|
|
||||||
id: overviewTab
|
|
||||||
|
|
||||||
onSwitchToWeatherTab: {
|
|
||||||
if (SettingsData.weatherEnabled) {
|
|
||||||
tabBar.currentIndex = 2
|
|
||||||
tabBar.tabClicked(2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onSwitchToMediaTab: {
|
|
||||||
tabBar.currentIndex = 1
|
|
||||||
tabBar.tabClicked(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MediaPlayerTab {
|
|
||||||
id: mediaTab
|
|
||||||
}
|
|
||||||
|
|
||||||
WeatherTab {
|
|
||||||
id: weatherTab
|
|
||||||
visible: SettingsData.weatherEnabled && root.currentTabIndex === 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,168 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Effects
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Card {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: avatarContainer
|
|
||||||
|
|
||||||
property bool hasImage: profileImageLoader.status === Image.Ready
|
|
||||||
|
|
||||||
width: 77
|
|
||||||
height: 77
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
radius: 36
|
|
||||||
color: Theme.primary
|
|
||||||
visible: !avatarContainer.hasImage
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: UserInfoService.username.length > 0 ? UserInfoService.username.charAt(0).toUpperCase() : "b"
|
|
||||||
font.pixelSize: Theme.fontSizeXLarge + 4
|
|
||||||
font.weight: Font.Bold
|
|
||||||
color: Theme.background
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Image {
|
|
||||||
id: profileImageLoader
|
|
||||||
|
|
||||||
source: {
|
|
||||||
if (PortalService.profileImage === "")
|
|
||||||
return ""
|
|
||||||
|
|
||||||
if (PortalService.profileImage.startsWith("/"))
|
|
||||||
return "file://" + PortalService.profileImage
|
|
||||||
|
|
||||||
return PortalService.profileImage
|
|
||||||
}
|
|
||||||
smooth: true
|
|
||||||
asynchronous: true
|
|
||||||
mipmap: true
|
|
||||||
cache: true
|
|
||||||
visible: false
|
|
||||||
}
|
|
||||||
|
|
||||||
MultiEffect {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: 2
|
|
||||||
source: profileImageLoader
|
|
||||||
maskEnabled: true
|
|
||||||
maskSource: circularMask
|
|
||||||
visible: avatarContainer.hasImage
|
|
||||||
maskThresholdMin: 0.5
|
|
||||||
maskSpreadAtMin: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: circularMask
|
|
||||||
width: 77 - 4
|
|
||||||
height: 77 - 4
|
|
||||||
layer.enabled: true
|
|
||||||
layer.smooth: true
|
|
||||||
visible: false
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
radius: width / 2
|
|
||||||
color: "black"
|
|
||||||
antialiasing: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "person"
|
|
||||||
size: Theme.iconSize + 8
|
|
||||||
color: Theme.error
|
|
||||||
visible: PortalService.profileImage !== "" && profileImageLoader.status === Image.Error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: UserInfoService.username || "brandon"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
elide: Text.ElideRight
|
|
||||||
width: parent.parent.parent.width - avatarContainer.width - Theme.spacingM * 3
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
SystemLogo {
|
|
||||||
width: 16
|
|
||||||
height: 16
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
colorOverride: Theme.primary
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: {
|
|
||||||
if (CompositorService.isNiri) return "on niri"
|
|
||||||
if (CompositorService.isHyprland) return "on Hyprland"
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.8)
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
elide: Text.ElideRight
|
|
||||||
width: parent.parent.parent.parent.width - avatarContainer.width - Theme.spacingM * 3 - 16 - Theme.spacingS
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "schedule"
|
|
||||||
size: 16
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: uptimeText
|
|
||||||
|
|
||||||
property real availableWidth: parent.parent.parent.parent.width - avatarContainer.width - Theme.spacingM * 3 - 16 - Theme.spacingS
|
|
||||||
property real longTextWidth: {
|
|
||||||
const fontSize = Math.round(Theme.fontSizeSmall || 12)
|
|
||||||
const testMetrics = Qt.createQmlObject('import QtQuick; TextMetrics { font.pixelSize: ' + fontSize + ' }', uptimeText)
|
|
||||||
testMetrics.text = UserInfoService.uptime || "up 1 hour, 23 minutes"
|
|
||||||
const result = testMetrics.width
|
|
||||||
testMetrics.destroy()
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
// Just using truncated is always true initially idk
|
|
||||||
property bool shouldUseShort: longTextWidth > availableWidth
|
|
||||||
|
|
||||||
text: shouldUseShort ? UserInfoService.shortUptime : UserInfoService.uptime || "up 1h 23m"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7)
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
elide: Text.ElideRight
|
|
||||||
width: availableWidth
|
|
||||||
wrapMode: Text.NoWrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,642 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Effects
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
implicitWidth: 700
|
|
||||||
implicitHeight: 410
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingL
|
|
||||||
visible: !WeatherService.weather.available || WeatherService.weather.temp === 0
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "cloud_off"
|
|
||||||
size: Theme.iconSize * 2
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.5)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "No Weather Data Available"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.fill: parent
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
visible: WeatherService.weather.available && WeatherService.weather.temp !== 0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: 70
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
id: refreshButton
|
|
||||||
name: "refresh"
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.4)
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: parent.top
|
|
||||||
|
|
||||||
property bool isRefreshing: false
|
|
||||||
enabled: !isRefreshing
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: parent.enabled ? Qt.PointingHandCursor : Qt.ForbiddenCursor
|
|
||||||
onClicked: {
|
|
||||||
refreshButton.isRefreshing = true
|
|
||||||
WeatherService.forceRefresh()
|
|
||||||
refreshTimer.restart()
|
|
||||||
}
|
|
||||||
enabled: parent.enabled
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: refreshTimer
|
|
||||||
interval: 2000
|
|
||||||
onTriggered: refreshButton.isRefreshing = false
|
|
||||||
}
|
|
||||||
|
|
||||||
NumberAnimation on rotation {
|
|
||||||
running: refreshButton.isRefreshing
|
|
||||||
from: 0
|
|
||||||
to: 360
|
|
||||||
duration: 1000
|
|
||||||
loops: Animation.Infinite
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
width: weatherIcon.width + tempColumn.width + sunriseColumn.width + Theme.spacingM * 2
|
|
||||||
height: 70
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
id: weatherIcon
|
|
||||||
name: WeatherService.getWeatherIcon(WeatherService.weather.wCode)
|
|
||||||
size: Theme.iconSize * 1.5
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
layer.enabled: true
|
|
||||||
layer.effect: MultiEffect {
|
|
||||||
shadowEnabled: true
|
|
||||||
shadowHorizontalOffset: 0
|
|
||||||
shadowVerticalOffset: 4
|
|
||||||
shadowBlur: 0.8
|
|
||||||
shadowColor: Qt.rgba(0, 0, 0, 0.2)
|
|
||||||
shadowOpacity: 0.2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: tempColumn
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
anchors.left: weatherIcon.right
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: tempText.width + unitText.width + Theme.spacingXS
|
|
||||||
height: tempText.height
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: tempText
|
|
||||||
text: (SettingsData.useFahrenheit ? WeatherService.weather.tempF : WeatherService.weather.temp) + "°"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge + 4
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Light
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: unitText
|
|
||||||
text: SettingsData.useFahrenheit ? "F" : "C"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7)
|
|
||||||
anchors.left: tempText.right
|
|
||||||
anchors.leftMargin: Theme.spacingXS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
if (WeatherService.weather.available) {
|
|
||||||
SettingsData.setTemperatureUnit(!SettingsData.useFahrenheit)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
enabled: WeatherService.weather.available
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: WeatherService.weather.city || ""
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7)
|
|
||||||
visible: text.length > 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: sunriseColumn
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
anchors.left: tempColumn.right
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
visible: WeatherService.weather.sunrise && WeatherService.weather.sunset
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: sunriseIcon.width + sunriseText.width + Theme.spacingXS
|
|
||||||
height: sunriseIcon.height
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
id: sunriseIcon
|
|
||||||
name: "wb_twilight"
|
|
||||||
size: Theme.iconSize - 6
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: sunriseText
|
|
||||||
text: WeatherService.weather.sunrise || ""
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
|
||||||
anchors.left: sunriseIcon.right
|
|
||||||
anchors.leftMargin: Theme.spacingXS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: sunsetIcon.width + sunsetText.width + Theme.spacingXS
|
|
||||||
height: sunsetIcon.height
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
id: sunsetIcon
|
|
||||||
name: "bedtime"
|
|
||||||
size: Theme.iconSize - 6
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: sunsetText
|
|
||||||
text: WeatherService.weather.sunset || ""
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
|
||||||
anchors.left: sunsetIcon.right
|
|
||||||
anchors.leftMargin: Theme.spacingXS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
|
|
||||||
}
|
|
||||||
|
|
||||||
GridLayout {
|
|
||||||
width: parent.width
|
|
||||||
height: 95
|
|
||||||
columns: 6
|
|
||||||
columnSpacing: Theme.spacingS
|
|
||||||
rowSpacing: 0
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 32
|
|
||||||
height: 32
|
|
||||||
radius: 16
|
|
||||||
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "device_thermostat"
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: Theme.primary
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Feels Like"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: (SettingsData.useFahrenheit ? (WeatherService.weather.feelsLikeF || WeatherService.weather.tempF) : (WeatherService.weather.feelsLike || WeatherService.weather.temp)) + "°"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall + 1
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 32
|
|
||||||
height: 32
|
|
||||||
radius: 16
|
|
||||||
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "humidity_low"
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: Theme.primary
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Humidity"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: WeatherService.weather.humidity ? WeatherService.weather.humidity + "%" : "--"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall + 1
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 32
|
|
||||||
height: 32
|
|
||||||
radius: 16
|
|
||||||
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "air"
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: Theme.primary
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Wind"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: WeatherService.weather.wind || "--"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall + 1
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 32
|
|
||||||
height: 32
|
|
||||||
radius: 16
|
|
||||||
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "speed"
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: Theme.primary
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Pressure"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: WeatherService.weather.pressure ? WeatherService.weather.pressure + " hPa" : "--"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall + 1
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 32
|
|
||||||
height: 32
|
|
||||||
radius: 16
|
|
||||||
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "rainy"
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: Theme.primary
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Rain Chance"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: WeatherService.weather.precipitationProbability ? WeatherService.weather.precipitationProbability + "%" : "0%"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall + 1
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 32
|
|
||||||
height: 32
|
|
||||||
radius: 16
|
|
||||||
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "wb_sunny"
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: Theme.primary
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Visibility"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Good"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall + 1
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height - 70 - 95 - Theme.spacingM * 3 - 2
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "7-Day Forecast"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height - Theme.fontSizeMedium - Theme.spacingS - Theme.spacingL
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: 7
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: (parent.width - Theme.spacingXS * 6) / 7
|
|
||||||
height: parent.height
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
|
|
||||||
property var dayDate: {
|
|
||||||
const date = new Date()
|
|
||||||
date.setDate(date.getDate() + index)
|
|
||||||
return date
|
|
||||||
}
|
|
||||||
property bool isToday: index === 0
|
|
||||||
property var forecastData: {
|
|
||||||
if (WeatherService.weather.forecast && WeatherService.weather.forecast.length > index) {
|
|
||||||
return WeatherService.weather.forecast[index]
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
color: isToday ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1) : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.1)
|
|
||||||
border.color: isToday ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3) : "transparent"
|
|
||||||
border.width: isToday ? 1 : 0
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: Qt.locale().dayName(dayDate.getDay(), Locale.ShortFormat)
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: isToday ? Theme.primary : Theme.surfaceText
|
|
||||||
font.weight: isToday ? Font.Medium : Font.Normal
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: forecastData ? WeatherService.getWeatherIcon(forecastData.wCode || 0) : "cloud"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: isToday ? Theme.primary : Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.8)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
spacing: 2
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: forecastData ? (SettingsData.useFahrenheit ? (forecastData.tempMaxF || forecastData.tempMax) : (forecastData.tempMax || 0)) + "°/" + (SettingsData.useFahrenheit ? (forecastData.tempMinF || forecastData.tempMin) : (forecastData.tempMin || 0)) + "°" : "--/--"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: isToday ? Theme.primary : Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
spacing: 1
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
visible: forecastData && forecastData.sunrise && forecastData.sunset
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: 2
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "wb_twilight"
|
|
||||||
size: 8
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: forecastData ? forecastData.sunrise : ""
|
|
||||||
font.pixelSize: Theme.fontSizeSmall - 2
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: 2
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "bedtime"
|
|
||||||
size: 8
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: forecastData ? forecastData.sunset : ""
|
|
||||||
font.pixelSize: Theme.fontSizeSmall - 2
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,193 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
PanelWindow {
|
|
||||||
id: dock
|
|
||||||
|
|
||||||
WlrLayershell.namespace: "quickshell:dock"
|
|
||||||
|
|
||||||
WlrLayershell.layer: WlrLayershell.Top
|
|
||||||
WlrLayershell.exclusiveZone: -1
|
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
|
||||||
|
|
||||||
property var modelData
|
|
||||||
property var contextMenu
|
|
||||||
property bool autoHide: SettingsData.dockAutoHide
|
|
||||||
property real backgroundTransparency: SettingsData.dockTransparency
|
|
||||||
|
|
||||||
property bool contextMenuOpen: (contextMenu && contextMenu.visible && contextMenu.screen === modelData)
|
|
||||||
property bool windowIsFullscreen: {
|
|
||||||
if (!ToplevelManager.activeToplevel) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const activeWindow = ToplevelManager.activeToplevel
|
|
||||||
const fullscreenApps = ["vlc", "mpv", "kodi", "steam", "lutris", "wine", "dosbox"]
|
|
||||||
return fullscreenApps.some(app => activeWindow.appId && activeWindow.appId.toLowerCase().includes(app))
|
|
||||||
}
|
|
||||||
property bool reveal: (!autoHide || dockMouseArea.containsMouse || dockApps.requestDockShow || contextMenuOpen) && !windowIsFullscreen
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: SettingsData
|
|
||||||
function onDockTransparencyChanged() {
|
|
||||||
dock.backgroundTransparency = SettingsData.dockTransparency
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
screen: modelData
|
|
||||||
visible: SettingsData.showDock
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
bottom: true
|
|
||||||
left: true
|
|
||||||
right: true
|
|
||||||
}
|
|
||||||
|
|
||||||
margins {
|
|
||||||
left: 0
|
|
||||||
right: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
implicitHeight: 100
|
|
||||||
exclusiveZone: autoHide ? -1 : 65 - 16
|
|
||||||
|
|
||||||
mask: Region {
|
|
||||||
item: dockMouseArea
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: dockMouseArea
|
|
||||||
property real currentScreen: modelData ? modelData : dock.screen
|
|
||||||
property real screenWidth: currentScreen ? currentScreen.geometry.width : 1920
|
|
||||||
property real maxDockWidth: Math.min(screenWidth * 0.8, 1200)
|
|
||||||
|
|
||||||
height: dock.reveal ? 65 : 20
|
|
||||||
width: dock.reveal ? Math.min(dockBackground.width + 32, maxDockWidth) : Math.min(Math.max(dockBackground.width + 64, 200), screenWidth * 0.5)
|
|
||||||
anchors {
|
|
||||||
bottom: parent.bottom
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
hoverEnabled: true
|
|
||||||
|
|
||||||
Behavior on height {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: 200
|
|
||||||
easing.type: Easing.OutCubic
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: dockContainer
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
transform: Translate {
|
|
||||||
id: dockSlide
|
|
||||||
y: dock.reveal ? 0 : 60
|
|
||||||
|
|
||||||
Behavior on y {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: 200
|
|
||||||
easing.type: Easing.OutCubic
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: dockBackground
|
|
||||||
objectName: "dockBackground"
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
bottom: parent.bottom
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
width: dockApps.implicitWidth + 12
|
|
||||||
height: parent.height - 8
|
|
||||||
|
|
||||||
anchors.topMargin: 4
|
|
||||||
anchors.bottomMargin: 1
|
|
||||||
|
|
||||||
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, backgroundTransparency)
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.width: 1
|
|
||||||
border.color: Theme.outlineMedium
|
|
||||||
layer.enabled: true
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
color: Qt.rgba(Theme.surfaceTint.r, Theme.surfaceTint.g, Theme.surfaceTint.b, 0.04)
|
|
||||||
radius: parent.radius
|
|
||||||
}
|
|
||||||
|
|
||||||
DockApps {
|
|
||||||
id: dockApps
|
|
||||||
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
anchors.topMargin: 4
|
|
||||||
anchors.bottomMargin: 4
|
|
||||||
|
|
||||||
contextMenu: dock.contextMenu
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: appTooltip
|
|
||||||
|
|
||||||
property var hoveredButton: {
|
|
||||||
if (!dockApps.children[0]) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
const row = dockApps.children[0]
|
|
||||||
let repeater = null
|
|
||||||
for (var i = 0; i < row.children.length; i++) {
|
|
||||||
const child = row.children[i]
|
|
||||||
if (child && typeof child.count !== "undefined" && typeof child.itemAt === "function") {
|
|
||||||
repeater = child
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!repeater || !repeater.itemAt) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
for (var i = 0; i < repeater.count; i++) {
|
|
||||||
const item = repeater.itemAt(i)
|
|
||||||
if (item && item.dockButton && item.dockButton.showTooltip) {
|
|
||||||
return item.dockButton
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
property string tooltipText: hoveredButton ? hoveredButton.tooltipText : ""
|
|
||||||
|
|
||||||
visible: hoveredButton !== null && tooltipText !== ""
|
|
||||||
width: tooltipLabel.implicitWidth + 24
|
|
||||||
height: tooltipLabel.implicitHeight + 12
|
|
||||||
|
|
||||||
color: Theme.surfaceContainer
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.width: 1
|
|
||||||
border.color: Theme.outlineMedium
|
|
||||||
|
|
||||||
y: -height - 8
|
|
||||||
x: hoveredButton ? hoveredButton.mapToItem(dockContainer, hoveredButton.width / 2, 0).x - width / 2 : 0
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: tooltipLabel
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: appTooltip.tooltipText
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,355 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
clip: false
|
|
||||||
property var appData
|
|
||||||
property var contextMenu: null
|
|
||||||
property var dockApps: null
|
|
||||||
property int index: -1
|
|
||||||
property bool longPressing: false
|
|
||||||
property bool dragging: false
|
|
||||||
property point dragStartPos: Qt.point(0, 0)
|
|
||||||
property point dragOffset: Qt.point(0, 0)
|
|
||||||
property int targetIndex: -1
|
|
||||||
property int originalIndex: -1
|
|
||||||
property bool showWindowTitle: false
|
|
||||||
property string windowTitle: ""
|
|
||||||
property bool isHovered: mouseArea.containsMouse && !dragging
|
|
||||||
property bool showTooltip: mouseArea.containsMouse && !dragging
|
|
||||||
property bool isWindowFocused: {
|
|
||||||
if (!appData || appData.type !== "window") {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const toplevel = getToplevelObject()
|
|
||||||
if (!toplevel) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return toplevel.activated
|
|
||||||
}
|
|
||||||
property string tooltipText: {
|
|
||||||
if (!appData) {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
if (appData.type === "window" && showWindowTitle) {
|
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(appData.appId)
|
|
||||||
const appName = desktopEntry && desktopEntry.name ? desktopEntry.name : appData.appId
|
|
||||||
return appName + (windowTitle ? " • " + windowTitle : "")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!appData.appId) {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(appData.appId)
|
|
||||||
return desktopEntry && desktopEntry.name ? desktopEntry.name : appData.appId
|
|
||||||
}
|
|
||||||
|
|
||||||
width: 40
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
function getToplevelObject() {
|
|
||||||
if (!appData || appData.type !== "window") {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
const sortedToplevels = CompositorService.sortedToplevels
|
|
||||||
if (!sortedToplevels) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
if (appData.uniqueId) {
|
|
||||||
for (var i = 0; i < sortedToplevels.length; i++) {
|
|
||||||
const toplevel = sortedToplevels[i]
|
|
||||||
const checkId = toplevel.title + "|" + (toplevel.appId || "") + "|" + i
|
|
||||||
if (checkId === appData.uniqueId) {
|
|
||||||
return toplevel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (appData.windowId !== undefined && appData.windowId !== null && appData.windowId >= 0) {
|
|
||||||
if (appData.windowId < sortedToplevels.length) {
|
|
||||||
return sortedToplevels[appData.windowId]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
onIsHoveredChanged: {
|
|
||||||
if (isHovered) {
|
|
||||||
exitAnimation.stop()
|
|
||||||
if (!bounceAnimation.running)
|
|
||||||
bounceAnimation.restart()
|
|
||||||
} else {
|
|
||||||
bounceAnimation.stop()
|
|
||||||
exitAnimation.restart()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SequentialAnimation {
|
|
||||||
id: bounceAnimation
|
|
||||||
|
|
||||||
running: false
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
target: translateY
|
|
||||||
property: "y"
|
|
||||||
to: -10
|
|
||||||
duration: Anims.durShort
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Anims.emphasizedAccel
|
|
||||||
}
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
target: translateY
|
|
||||||
property: "y"
|
|
||||||
to: -8
|
|
||||||
duration: Anims.durShort
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Anims.emphasizedDecel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
id: exitAnimation
|
|
||||||
|
|
||||||
running: false
|
|
||||||
target: translateY
|
|
||||||
property: "y"
|
|
||||||
to: 0
|
|
||||||
duration: Anims.durShort
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Anims.emphasizedDecel
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3)
|
|
||||||
border.width: 2
|
|
||||||
border.color: Theme.primary
|
|
||||||
visible: dragging
|
|
||||||
z: -1
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: longPressTimer
|
|
||||||
|
|
||||||
interval: 500
|
|
||||||
repeat: false
|
|
||||||
onTriggered: {
|
|
||||||
if (appData && appData.isPinned) {
|
|
||||||
longPressing = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: mouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.bottomMargin: -20
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: longPressing ? Qt.DragMoveCursor : Qt.PointingHandCursor
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
|
||||||
onPressed: mouse => {
|
|
||||||
if (mouse.button === Qt.LeftButton && appData && appData.isPinned) {
|
|
||||||
dragStartPos = Qt.point(mouse.x, mouse.y)
|
|
||||||
longPressTimer.start()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onReleased: mouse => {
|
|
||||||
longPressTimer.stop()
|
|
||||||
if (longPressing) {
|
|
||||||
if (dragging && targetIndex >= 0 && targetIndex !== originalIndex && dockApps) {
|
|
||||||
dockApps.movePinnedApp(originalIndex, targetIndex)
|
|
||||||
}
|
|
||||||
|
|
||||||
longPressing = false
|
|
||||||
dragging = false
|
|
||||||
dragOffset = Qt.point(0, 0)
|
|
||||||
targetIndex = -1
|
|
||||||
originalIndex = -1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onPositionChanged: mouse => {
|
|
||||||
if (longPressing && !dragging) {
|
|
||||||
const distance = Math.sqrt(Math.pow(mouse.x - dragStartPos.x, 2) + Math.pow(mouse.y - dragStartPos.y, 2))
|
|
||||||
if (distance > 5) {
|
|
||||||
dragging = true
|
|
||||||
targetIndex = index
|
|
||||||
originalIndex = index
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (dragging) {
|
|
||||||
dragOffset = Qt.point(mouse.x - dragStartPos.x, mouse.y - dragStartPos.y)
|
|
||||||
if (dockApps) {
|
|
||||||
const threshold = 40
|
|
||||||
let newTargetIndex = targetIndex
|
|
||||||
if (dragOffset.x > threshold && targetIndex < dockApps.pinnedAppCount - 1) {
|
|
||||||
newTargetIndex = targetIndex + 1
|
|
||||||
} else if (dragOffset.x < -threshold && targetIndex > 0) {
|
|
||||||
newTargetIndex = targetIndex - 1
|
|
||||||
}
|
|
||||||
if (newTargetIndex !== targetIndex) {
|
|
||||||
targetIndex = newTargetIndex
|
|
||||||
dragStartPos = Qt.point(mouse.x, mouse.y)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onClicked: mouse => {
|
|
||||||
if (!appData || longPressing) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mouse.button === Qt.LeftButton) {
|
|
||||||
if (appData.type === "pinned") {
|
|
||||||
if (appData && appData.appId) {
|
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(appData.appId)
|
|
||||||
if (desktopEntry) {
|
|
||||||
AppUsageHistoryData.addAppUsage({
|
|
||||||
"id": appData.appId,
|
|
||||||
"name": desktopEntry.name || appData.appId,
|
|
||||||
"icon": desktopEntry.icon || "",
|
|
||||||
"exec": desktopEntry.exec || "",
|
|
||||||
"comment": desktopEntry.comment || ""
|
|
||||||
})
|
|
||||||
}
|
|
||||||
SessionService.launchDesktopEntry(desktopEntry)
|
|
||||||
}
|
|
||||||
} else if (appData.type === "window") {
|
|
||||||
const toplevel = getToplevelObject()
|
|
||||||
if (toplevel) {
|
|
||||||
toplevel.activate()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (mouse.button === Qt.MiddleButton) {
|
|
||||||
if (appData && appData.appId) {
|
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(appData.appId)
|
|
||||||
if (desktopEntry) {
|
|
||||||
AppUsageHistoryData.addAppUsage({
|
|
||||||
"id": appData.appId,
|
|
||||||
"name": desktopEntry.name || appData.appId,
|
|
||||||
"icon": desktopEntry.icon || "",
|
|
||||||
"exec": desktopEntry.exec || "",
|
|
||||||
"comment": desktopEntry.comment || ""
|
|
||||||
})
|
|
||||||
}
|
|
||||||
SessionService.launchDesktopEntry(desktopEntry)
|
|
||||||
}
|
|
||||||
} else if (mouse.button === Qt.RightButton) {
|
|
||||||
if (contextMenu) {
|
|
||||||
contextMenu.showForButton(root, appData, 40)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IconImage {
|
|
||||||
id: iconImg
|
|
||||||
|
|
||||||
anchors.centerIn: parent
|
|
||||||
implicitSize: 40
|
|
||||||
source: {
|
|
||||||
if (appData.appId === "__SEPARATOR__") {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
const moddedId = Paths.moddedAppId(appData.appId)
|
|
||||||
if (moddedId.toLowerCase().includes("steam_app")) {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(moddedId)
|
|
||||||
return desktopEntry && desktopEntry.icon ? Quickshell.iconPath(desktopEntry.icon, true) : ""
|
|
||||||
}
|
|
||||||
mipmap: true
|
|
||||||
smooth: true
|
|
||||||
asynchronous: true
|
|
||||||
visible: status === Image.Ready
|
|
||||||
}
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
size: 40
|
|
||||||
name: "sports_esports"
|
|
||||||
color: Theme.surfaceText
|
|
||||||
visible: {
|
|
||||||
if (!appData || !appData.appId || appData.appId === "__SEPARATOR__") {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const moddedId = Paths.moddedAppId(appData.appId)
|
|
||||||
return moddedId.toLowerCase().includes("steam_app")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 40
|
|
||||||
height: 40
|
|
||||||
anchors.centerIn: parent
|
|
||||||
visible: iconImg.status !== Image.Ready
|
|
||||||
color: Theme.surfaceLight
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.width: 1
|
|
||||||
border.color: Theme.primarySelected
|
|
||||||
|
|
||||||
Text {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: {
|
|
||||||
if (!appData || !appData.appId) {
|
|
||||||
return "?"
|
|
||||||
}
|
|
||||||
|
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(appData.appId)
|
|
||||||
if (desktopEntry && desktopEntry.name) {
|
|
||||||
return desktopEntry.name.charAt(0).toUpperCase()
|
|
||||||
}
|
|
||||||
|
|
||||||
return appData.appId.charAt(0).toUpperCase()
|
|
||||||
}
|
|
||||||
font.pixelSize: 14
|
|
||||||
color: Theme.primary
|
|
||||||
font.weight: Font.Bold
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Indicator for running/focused state
|
|
||||||
Rectangle {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.bottomMargin: -2
|
|
||||||
width: 8
|
|
||||||
height: 2
|
|
||||||
radius: 1
|
|
||||||
visible: appData && (appData.isRunning || appData.type === "window")
|
|
||||||
color: {
|
|
||||||
if (!appData) {
|
|
||||||
return "transparent"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isWindowFocused) {
|
|
||||||
return Theme.primary
|
|
||||||
}
|
|
||||||
|
|
||||||
if (appData.isRunning || appData.type === "window") {
|
|
||||||
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
|
||||||
}
|
|
||||||
|
|
||||||
return "transparent"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
transform: Translate {
|
|
||||||
id: translateY
|
|
||||||
|
|
||||||
y: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property var contextMenu: null
|
|
||||||
property bool requestDockShow: false
|
|
||||||
property int pinnedAppCount: 0
|
|
||||||
|
|
||||||
implicitWidth: row.width
|
|
||||||
implicitHeight: row.height
|
|
||||||
|
|
||||||
function movePinnedApp(fromIndex, toIndex) {
|
|
||||||
if (fromIndex === toIndex) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const currentPinned = [...(SessionData.pinnedApps || [])]
|
|
||||||
if (fromIndex < 0 || fromIndex >= currentPinned.length || toIndex < 0 || toIndex >= currentPinned.length) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const movedApp = currentPinned.splice(fromIndex, 1)[0]
|
|
||||||
currentPinned.splice(toIndex, 0, movedApp)
|
|
||||||
|
|
||||||
SessionData.setPinnedApps(currentPinned)
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: row
|
|
||||||
spacing: 2
|
|
||||||
anchors.centerIn: parent
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
id: repeater
|
|
||||||
model: ListModel {
|
|
||||||
id: dockModel
|
|
||||||
|
|
||||||
Component.onCompleted: updateModel()
|
|
||||||
|
|
||||||
function updateModel() {
|
|
||||||
clear()
|
|
||||||
|
|
||||||
const items = []
|
|
||||||
const pinnedApps = [...(SessionData.pinnedApps || [])]
|
|
||||||
|
|
||||||
pinnedApps.forEach(appId => {
|
|
||||||
items.push({
|
|
||||||
"type": "pinned",
|
|
||||||
"appId": appId,
|
|
||||||
"windowId": -1,
|
|
||||||
"windowTitle": "",
|
|
||||||
"workspaceId": -1,
|
|
||||||
"isPinned": true,
|
|
||||||
"isRunning": false
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
root.pinnedAppCount = pinnedApps.length
|
|
||||||
|
|
||||||
const sortedToplevels = CompositorService.sortedToplevels
|
|
||||||
|
|
||||||
if (pinnedApps.length > 0 && sortedToplevels.length > 0) {
|
|
||||||
items.push({
|
|
||||||
"type": "separator",
|
|
||||||
"appId": "__SEPARATOR__",
|
|
||||||
"windowId": -1,
|
|
||||||
"windowTitle": "",
|
|
||||||
"workspaceId": -1,
|
|
||||||
"isPinned": false,
|
|
||||||
"isRunning": false,
|
|
||||||
"isFocused": false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
sortedToplevels.forEach((toplevel, index) => {
|
|
||||||
const title = toplevel.title || "(Unnamed)"
|
|
||||||
const truncatedTitle = title.length > 50 ? title.substring(0, 47) + "..." : title
|
|
||||||
const uniqueId = toplevel.title + "|" + (toplevel.appId || "") + "|" + index
|
|
||||||
|
|
||||||
items.push({
|
|
||||||
"type": "window",
|
|
||||||
"appId": toplevel.appId,
|
|
||||||
"windowId": index,
|
|
||||||
"windowTitle": truncatedTitle,
|
|
||||||
"workspaceId": -1,
|
|
||||||
"isPinned": false,
|
|
||||||
"isRunning": true,
|
|
||||||
"uniqueId": uniqueId
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
items.forEach(item => append(item))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: Item {
|
|
||||||
id: delegateItem
|
|
||||||
property alias dockButton: button
|
|
||||||
|
|
||||||
width: model.type === "separator" ? 16 : 40
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
visible: model.type === "separator"
|
|
||||||
width: 2
|
|
||||||
height: 20
|
|
||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.3)
|
|
||||||
radius: 1
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
|
|
||||||
DockAppButton {
|
|
||||||
id: button
|
|
||||||
visible: model.type !== "separator"
|
|
||||||
anchors.centerIn: parent
|
|
||||||
|
|
||||||
width: 40
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
appData: model
|
|
||||||
contextMenu: root.contextMenu
|
|
||||||
dockApps: root
|
|
||||||
index: model.index
|
|
||||||
|
|
||||||
// Override tooltip for windows to show window title
|
|
||||||
showWindowTitle: model.type === "window"
|
|
||||||
windowTitle: model.windowTitle || ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: CompositorService
|
|
||||||
function onSortedToplevelsChanged() {
|
|
||||||
dockModel.updateModel()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: SessionData
|
|
||||||
function onPinnedAppsChanged() {
|
|
||||||
dockModel.updateModel()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,258 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
PanelWindow {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool showContextMenu: false
|
|
||||||
property var appData: null
|
|
||||||
property var anchorItem: null
|
|
||||||
property real dockVisibleHeight: 40
|
|
||||||
property int margin: 10
|
|
||||||
|
|
||||||
function showForButton(button, data, dockHeight) {
|
|
||||||
anchorItem = button
|
|
||||||
appData = data
|
|
||||||
dockVisibleHeight = dockHeight || 40
|
|
||||||
|
|
||||||
const dockWindow = button.Window.window
|
|
||||||
if (dockWindow) {
|
|
||||||
for (var i = 0; i < Quickshell.screens.length; i++) {
|
|
||||||
const s = Quickshell.screens[i]
|
|
||||||
if (dockWindow.x >= s.x && dockWindow.x < s.x + s.width) {
|
|
||||||
root.screen = s
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
showContextMenu = true
|
|
||||||
}
|
|
||||||
function close() {
|
|
||||||
showContextMenu = false
|
|
||||||
}
|
|
||||||
|
|
||||||
screen: Quickshell.screens[0]
|
|
||||||
|
|
||||||
visible: showContextMenu
|
|
||||||
WlrLayershell.layer: WlrLayershell.Overlay
|
|
||||||
WlrLayershell.exclusiveZone: -1
|
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
|
||||||
color: "transparent"
|
|
||||||
anchors {
|
|
||||||
top: true
|
|
||||||
left: true
|
|
||||||
right: true
|
|
||||||
bottom: true
|
|
||||||
}
|
|
||||||
|
|
||||||
property point anchorPos: Qt.point(screen.width / 2, screen.height - 100)
|
|
||||||
|
|
||||||
onAnchorItemChanged: updatePosition()
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (visible) {
|
|
||||||
updatePosition()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updatePosition() {
|
|
||||||
if (!anchorItem) {
|
|
||||||
anchorPos = Qt.point(screen.width / 2, screen.height - 100)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const dockWindow = anchorItem.Window.window
|
|
||||||
if (!dockWindow) {
|
|
||||||
anchorPos = Qt.point(screen.width / 2, screen.height - 100)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const buttonPosInDock = anchorItem.mapToItem(dockWindow.contentItem, 0, 0)
|
|
||||||
let actualDockHeight = root.dockVisibleHeight
|
|
||||||
|
|
||||||
function findDockBackground(item) {
|
|
||||||
if (item.objectName === "dockBackground") {
|
|
||||||
return item
|
|
||||||
}
|
|
||||||
for (var i = 0; i < item.children.length; i++) {
|
|
||||||
const found = findDockBackground(item.children[i])
|
|
||||||
if (found) {
|
|
||||||
return found
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
const dockBackground = findDockBackground(dockWindow.contentItem)
|
|
||||||
if (dockBackground) {
|
|
||||||
actualDockHeight = dockBackground.height
|
|
||||||
}
|
|
||||||
|
|
||||||
const dockBottomMargin = 16
|
|
||||||
const buttonScreenY = root.screen.height - actualDockHeight - dockBottomMargin - 20
|
|
||||||
|
|
||||||
const dockContentWidth = dockWindow.width
|
|
||||||
const screenWidth = root.screen.width
|
|
||||||
const dockLeftMargin = Math.round((screenWidth - dockContentWidth) / 2)
|
|
||||||
const buttonScreenX = dockLeftMargin + buttonPosInDock.x + anchorItem.width / 2
|
|
||||||
|
|
||||||
anchorPos = Qt.point(buttonScreenX, buttonScreenY)
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: menuContainer
|
|
||||||
|
|
||||||
width: Math.min(400, Math.max(200, menuColumn.implicitWidth + Theme.spacingS * 2))
|
|
||||||
height: Math.max(60, menuColumn.implicitHeight + Theme.spacingS * 2)
|
|
||||||
|
|
||||||
x: {
|
|
||||||
const left = 10
|
|
||||||
const right = root.width - width - 10
|
|
||||||
const want = root.anchorPos.x - width / 2
|
|
||||||
return Math.max(left, Math.min(right, want))
|
|
||||||
}
|
|
||||||
y: Math.max(10, root.anchorPos.y - height + 30)
|
|
||||||
color: Theme.popupBackground()
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
|
||||||
border.width: 1
|
|
||||||
opacity: showContextMenu ? 1 : 0
|
|
||||||
scale: showContextMenu ? 1 : 0.85
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: 4
|
|
||||||
anchors.leftMargin: 2
|
|
||||||
anchors.rightMargin: -2
|
|
||||||
anchors.bottomMargin: -4
|
|
||||||
radius: parent.radius
|
|
||||||
color: Qt.rgba(0, 0, 0, 0.15)
|
|
||||||
z: parent.z - 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: menuColumn
|
|
||||||
width: parent.width - Theme.spacingS * 2
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: Theme.spacingS
|
|
||||||
spacing: 1
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 28
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: pinArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: Theme.spacingS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
text: root.appData && root.appData.isPinned ? "Unpin from Dock" : "Pin to Dock"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Normal
|
|
||||||
elide: Text.ElideRight
|
|
||||||
wrapMode: Text.NoWrap
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: pinArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
if (!root.appData) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (root.appData.isPinned) {
|
|
||||||
SessionData.removePinnedApp(root.appData.appId)
|
|
||||||
} else {
|
|
||||||
SessionData.addPinnedApp(root.appData.appId)
|
|
||||||
}
|
|
||||||
root.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
visible: root.appData && root.appData.type === "window"
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
visible: root.appData && root.appData.type === "window"
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
visible: root.appData && root.appData.type === "window"
|
|
||||||
width: parent.width
|
|
||||||
height: 28
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: closeArea.containsMouse ? Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12) : "transparent"
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: Theme.spacingS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
text: "Close Window"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: closeArea.containsMouse ? Theme.error : Theme.surfaceText
|
|
||||||
font.weight: Font.Normal
|
|
||||||
elide: Text.ElideRight
|
|
||||||
wrapMode: Text.NoWrap
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: closeArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
if (root.appData && root.appData.toplevelObject) {
|
|
||||||
root.appData.toplevelObject.close()
|
|
||||||
}
|
|
||||||
root.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on scale {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
z: -1
|
|
||||||
onClicked: {
|
|
||||||
root.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
id: customButtonKeyboard
|
|
||||||
circular: false
|
|
||||||
property string text: ""
|
|
||||||
width: 40
|
|
||||||
height: 40
|
|
||||||
property bool isShift: false
|
|
||||||
color: Theme.surface
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: contentItem
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: parent.text
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.pixelSize: Theme.fontSizeXLarge
|
|
||||||
font.weight: Font.Normal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,361 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: root
|
|
||||||
property Item target
|
|
||||||
height: 60 * 5
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
color: Theme.widgetBackground
|
|
||||||
|
|
||||||
property double rowSpacing: 0.01 * width // horizontal spacing between keyboard
|
|
||||||
property double columnSpacing: 0.02 * height // vertical spacing between keyboard
|
|
||||||
property bool shift: false //Boolean for the shift state
|
|
||||||
property bool symbols: false //Boolean for the symbol state
|
|
||||||
property double columns: 10 // Number of column
|
|
||||||
property double rows: 4 // Number of row
|
|
||||||
|
|
||||||
property string strShift: '\u2191' // UPWARDS ARROW unicode
|
|
||||||
property string strBackspace: "Backspace"
|
|
||||||
|
|
||||||
property var modelKeyboard: {
|
|
||||||
"row_1": [
|
|
||||||
{
|
|
||||||
text: 'q',
|
|
||||||
symbol: '1',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'w',
|
|
||||||
symbol: '2',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'e',
|
|
||||||
symbol: '3',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'r',
|
|
||||||
symbol: '4',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 't',
|
|
||||||
symbol: '5',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'y',
|
|
||||||
symbol: '6',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'u',
|
|
||||||
symbol: '7',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'i',
|
|
||||||
symbol: '8',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'o',
|
|
||||||
symbol: '9',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'p',
|
|
||||||
symbol: '0',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"row_2": [
|
|
||||||
{
|
|
||||||
text: 'a',
|
|
||||||
symbol: '-',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 's',
|
|
||||||
symbol: '/',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'd',
|
|
||||||
symbol: ':',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'f',
|
|
||||||
symbol: ';',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'g',
|
|
||||||
symbol: '(',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'h',
|
|
||||||
symbol: ')',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'j',
|
|
||||||
symbol: '€',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'k',
|
|
||||||
symbol: '&',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'l',
|
|
||||||
symbol: '@',
|
|
||||||
width: 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"row_3": [
|
|
||||||
{
|
|
||||||
text: strShift,
|
|
||||||
symbol: strShift,
|
|
||||||
width: 1.5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'z',
|
|
||||||
symbol: '.',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'x',
|
|
||||||
symbol: ',',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'c',
|
|
||||||
symbol: '?',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'v',
|
|
||||||
symbol: '!',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'b',
|
|
||||||
symbol: "'",
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'n',
|
|
||||||
symbol: "%",
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: 'm',
|
|
||||||
symbol: '"',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "'",
|
|
||||||
symbol: "*",
|
|
||||||
width: 1.5
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"row_4": [
|
|
||||||
{
|
|
||||||
text: '123',
|
|
||||||
symbol: 'ABC',
|
|
||||||
width: 1.5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: ' ',
|
|
||||||
symbol: ' ',
|
|
||||||
width: 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '.',
|
|
||||||
symbol: '.',
|
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: strBackspace,
|
|
||||||
symbol: strBackspace,
|
|
||||||
width: 1.5
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
//Here is the corresponding table between the ascii and the key event
|
|
||||||
property var tableKeyEvent: {
|
|
||||||
"_0": Qt.Key_0,
|
|
||||||
"_1": Qt.Key_1,
|
|
||||||
"_2": Qt.Key_2,
|
|
||||||
"_3": Qt.Key_3,
|
|
||||||
"_4": Qt.Key_4,
|
|
||||||
"_5": Qt.Key_5,
|
|
||||||
"_6": Qt.Key_6,
|
|
||||||
"_7": Qt.Key_7,
|
|
||||||
"_8": Qt.Key_8,
|
|
||||||
"_9": Qt.Key_9,
|
|
||||||
"_a": Qt.Key_A,
|
|
||||||
"_b": Qt.Key_B,
|
|
||||||
"_c": Qt.Key_C,
|
|
||||||
"_d": Qt.Key_D,
|
|
||||||
"_e": Qt.Key_E,
|
|
||||||
"_f": Qt.Key_F,
|
|
||||||
"_g": Qt.Key_G,
|
|
||||||
"_h": Qt.Key_H,
|
|
||||||
"_i": Qt.Key_I,
|
|
||||||
"_j": Qt.Key_J,
|
|
||||||
"_k": Qt.Key_K,
|
|
||||||
"_l": Qt.Key_L,
|
|
||||||
"_m": Qt.Key_M,
|
|
||||||
"_n": Qt.Key_N,
|
|
||||||
"_o": Qt.Key_O,
|
|
||||||
"_p": Qt.Key_P,
|
|
||||||
"_q": Qt.Key_Q,
|
|
||||||
"_r": Qt.Key_R,
|
|
||||||
"_s": Qt.Key_S,
|
|
||||||
"_t": Qt.Key_T,
|
|
||||||
"_u": Qt.Key_U,
|
|
||||||
"_v": Qt.Key_V,
|
|
||||||
"_w": Qt.Key_W,
|
|
||||||
"_x": Qt.Key_X,
|
|
||||||
"_y": Qt.Key_Y,
|
|
||||||
"_z": Qt.Key_Z,
|
|
||||||
"_\u2190": Qt.Key_Backspace,
|
|
||||||
"_return": Qt.Key_Return,
|
|
||||||
"_ ": Qt.Key_Space,
|
|
||||||
"_-": Qt.Key_Minus,
|
|
||||||
"_/": Qt.Key_Slash,
|
|
||||||
"_:": Qt.Key_Colon,
|
|
||||||
"_;": Qt.Key_Semicolon,
|
|
||||||
"_(": Qt.Key_BracketLeft,
|
|
||||||
"_)": Qt.Key_BracketRight,
|
|
||||||
"_€": parseInt("20ac", 16) // I didn't find the appropriate Qt event so I used the hex format
|
|
||||||
,
|
|
||||||
"_&": Qt.Key_Ampersand,
|
|
||||||
"_@": Qt.Key_At,
|
|
||||||
'_"': Qt.Key_QuoteDbl,
|
|
||||||
"_.": Qt.Key_Period,
|
|
||||||
"_,": Qt.Key_Comma,
|
|
||||||
"_?": Qt.Key_Question,
|
|
||||||
"_!": Qt.Key_Exclam,
|
|
||||||
"_'": Qt.Key_Apostrophe,
|
|
||||||
"_%": Qt.Key_Percent,
|
|
||||||
"_*": Qt.Key_Asterisk
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: keyboard_container
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: 5
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: 5
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.bottomMargin: 5
|
|
||||||
|
|
||||||
//One column which contains 5 rows
|
|
||||||
Column {
|
|
||||||
spacing: columnSpacing
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: row_1
|
|
||||||
spacing: rowSpacing
|
|
||||||
Repeater {
|
|
||||||
model: modelKeyboard["row_1"]
|
|
||||||
delegate: CustomButtonKeyboard {
|
|
||||||
text: symbols ? modelData.symbol : shift ? modelData.text.toUpperCase() : modelData.text
|
|
||||||
width: modelData.width * keyboard_container.width / columns - rowSpacing
|
|
||||||
height: keyboard_container.height / rows - columnSpacing
|
|
||||||
|
|
||||||
onClicked: root.clicked(text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Row {
|
|
||||||
id: row_2
|
|
||||||
spacing: rowSpacing
|
|
||||||
Repeater {
|
|
||||||
model: modelKeyboard["row_2"]
|
|
||||||
delegate: CustomButtonKeyboard {
|
|
||||||
text: symbols ? modelData.symbol : shift ? modelData.text.toUpperCase() : modelData.text
|
|
||||||
width: modelData.width * keyboard_container.width / columns - rowSpacing
|
|
||||||
height: keyboard_container.height / rows - columnSpacing
|
|
||||||
|
|
||||||
onClicked: root.clicked(text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Row {
|
|
||||||
id: row_3
|
|
||||||
spacing: rowSpacing
|
|
||||||
Repeater {
|
|
||||||
model: modelKeyboard["row_3"]
|
|
||||||
delegate: CustomButtonKeyboard {
|
|
||||||
text: symbols ? modelData.symbol : shift ? modelData.text.toUpperCase() : modelData.text
|
|
||||||
width: modelData.width * keyboard_container.width / columns - rowSpacing
|
|
||||||
height: keyboard_container.height / rows - columnSpacing
|
|
||||||
isShift: shift && text === strShift
|
|
||||||
|
|
||||||
onClicked: root.clicked(text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Row {
|
|
||||||
id: row_4
|
|
||||||
spacing: rowSpacing
|
|
||||||
Repeater {
|
|
||||||
model: modelKeyboard["row_4"]
|
|
||||||
delegate: CustomButtonKeyboard {
|
|
||||||
text: symbols ? modelData.symbol : shift ? modelData.text.toUpperCase() : modelData.text
|
|
||||||
width: modelData.width * keyboard_container.width / columns - rowSpacing
|
|
||||||
height: keyboard_container.height / rows - columnSpacing
|
|
||||||
|
|
||||||
onClicked: root.clicked(text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
signal clicked(string text)
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: root
|
|
||||||
function onClicked(text) {
|
|
||||||
if (!keyboard_controller.target)
|
|
||||||
return;
|
|
||||||
if (text === strShift) {
|
|
||||||
root.shift = !root.shift; // toggle shift
|
|
||||||
} else if (text === '123') {
|
|
||||||
root.symbols = true;
|
|
||||||
} else if (text === 'ABC') {
|
|
||||||
root.symbols = false;
|
|
||||||
} else {
|
|
||||||
// insert text into target
|
|
||||||
if (text === strBackspace) {
|
|
||||||
var current = keyboard_controller.target.text;
|
|
||||||
keyboard_controller.target.text = current.slice(0, current.length - 1);
|
|
||||||
} else {
|
|
||||||
// normal character
|
|
||||||
var charToInsert = root.symbols ? text : (root.shift ? text.toUpperCase() : text);
|
|
||||||
var current = keyboard_controller.target.text;
|
|
||||||
var cursorPos = keyboard_controller.target.cursorPosition;
|
|
||||||
keyboard_controller.target.text = current.slice(0, cursorPos) + charToInsert + current.slice(cursorPos);
|
|
||||||
keyboard_controller.target.cursorPosition = cursorPos + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// shift is momentary
|
|
||||||
if (root.shift && text !== strShift)
|
|
||||||
root.shift = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,175 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
property string sid: Quickshell.env("XDG_SESSION_ID") || "self"
|
|
||||||
property string sessionPath: ""
|
|
||||||
|
|
||||||
function activate() {
|
|
||||||
loader.activeAsync = true
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
getSessionPath.running = true
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onDestruction: {
|
|
||||||
lockStateMonitor.running = false
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: IdleService
|
|
||||||
function onLockRequested() {
|
|
||||||
console.log("Lock: Received lock request from IdleService")
|
|
||||||
activate()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: getSessionPath
|
|
||||||
command: ["gdbus", "call", "--system", "--dest", "org.freedesktop.login1", "--object-path", "/org/freedesktop/login1", "--method", "org.freedesktop.login1.Manager.GetSession", sid]
|
|
||||||
running: false
|
|
||||||
|
|
||||||
stdout: StdioCollector {
|
|
||||||
onStreamFinished: {
|
|
||||||
const match = text.match(/objectpath '([^']+)'/)
|
|
||||||
if (match) {
|
|
||||||
root.sessionPath = match[1]
|
|
||||||
console.log("Found session path:", root.sessionPath)
|
|
||||||
checkCurrentLockState.running = true
|
|
||||||
lockStateMonitor.running = true
|
|
||||||
} else {
|
|
||||||
console.warn("Could not determine session path")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onExited: (exitCode, exitStatus) => {
|
|
||||||
if (exitCode !== 0) {
|
|
||||||
console.warn("Failed to get session path, exit code:", exitCode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: checkCurrentLockState
|
|
||||||
command: root.sessionPath ? ["gdbus", "call", "--system", "--dest", "org.freedesktop.login1", "--object-path", root.sessionPath, "--method", "org.freedesktop.DBus.Properties.Get", "org.freedesktop.login1.Session", "LockedHint"] : []
|
|
||||||
running: false
|
|
||||||
|
|
||||||
stdout: StdioCollector {
|
|
||||||
onStreamFinished: {
|
|
||||||
if (text.includes("true")) {
|
|
||||||
console.log("Session is locked on startup, activating lock screen")
|
|
||||||
loader.activeAsync = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onExited: (exitCode, exitStatus) => {
|
|
||||||
if (exitCode !== 0) {
|
|
||||||
console.warn("Failed to check initial lock state, exit code:", exitCode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: lockStateMonitor
|
|
||||||
command: root.sessionPath ? ["gdbus", "monitor", "--system", "--dest", "org.freedesktop.login1"] : []
|
|
||||||
running: false
|
|
||||||
|
|
||||||
stdout: SplitParser {
|
|
||||||
splitMarker: "\n"
|
|
||||||
|
|
||||||
onRead: line => {
|
|
||||||
if (line.includes(root.sessionPath)) {
|
|
||||||
if (line.includes("org.freedesktop.login1.Session.Lock")) {
|
|
||||||
console.log("login1: Lock signal received -> show lock")
|
|
||||||
loader.activeAsync = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (line.includes("org.freedesktop.login1.Session.Unlock")) {
|
|
||||||
console.log("login1: Unlock signal received -> hide lock")
|
|
||||||
loader.active = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (line.includes("LockedHint") && line.includes("true")) {
|
|
||||||
console.log("login1: LockedHint=true -> show lock")
|
|
||||||
loader.activeAsync = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (line.includes("LockedHint") && line.includes("false")) {
|
|
||||||
console.log("login1: LockedHint=false -> hide lock")
|
|
||||||
loader.active = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (line.includes("PrepareForSleep") &&
|
|
||||||
line.includes("true") &&
|
|
||||||
SessionData.lockBeforeSuspend) {
|
|
||||||
loader.activeAsync = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onExited: (exitCode, exitStatus) => {
|
|
||||||
if (exitCode !== 0) {
|
|
||||||
console.warn("gdbus monitor failed, exit code:", exitCode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
|
||||||
id: loader
|
|
||||||
|
|
||||||
WlSessionLock {
|
|
||||||
id: sessionLock
|
|
||||||
|
|
||||||
property bool unlocked: false
|
|
||||||
property string sharedPasswordBuffer: ""
|
|
||||||
|
|
||||||
locked: true
|
|
||||||
|
|
||||||
onLockedChanged: {
|
|
||||||
if (!locked) {
|
|
||||||
loader.active = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LockSurface {
|
|
||||||
id: lockSurface
|
|
||||||
lock: sessionLock
|
|
||||||
sharedPasswordBuffer: sessionLock.sharedPasswordBuffer
|
|
||||||
onPasswordChanged: newPassword => {
|
|
||||||
sessionLock.sharedPasswordBuffer = newPassword
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LockScreenDemo {
|
|
||||||
id: demoWindow
|
|
||||||
}
|
|
||||||
|
|
||||||
IpcHandler {
|
|
||||||
target: "lock"
|
|
||||||
|
|
||||||
function lock() {
|
|
||||||
console.log("Lock screen requested via IPC")
|
|
||||||
loader.activeAsync = true
|
|
||||||
}
|
|
||||||
|
|
||||||
function demo() {
|
|
||||||
console.log("Lock screen DEMO mode requested via IPC")
|
|
||||||
demoWindow.showDemo()
|
|
||||||
}
|
|
||||||
|
|
||||||
function isLocked(): bool {
|
|
||||||
return loader.active
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,37 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import qs.Common
|
|
||||||
|
|
||||||
WlSessionLockSurface {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
required property WlSessionLock lock
|
|
||||||
required property string sharedPasswordBuffer
|
|
||||||
|
|
||||||
signal passwordChanged(string newPassword)
|
|
||||||
|
|
||||||
readonly property bool locked: lock && !lock.locked
|
|
||||||
|
|
||||||
function unlock(): void {
|
|
||||||
lock.locked = false
|
|
||||||
}
|
|
||||||
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
anchors.fill: parent
|
|
||||||
sourceComponent: LockScreenContent {
|
|
||||||
demoMode: false
|
|
||||||
passwordBuffer: root.sharedPasswordBuffer
|
|
||||||
screenName: root.screen?.name ?? ""
|
|
||||||
onUnlockRequested: root.unlock()
|
|
||||||
onPasswordBufferChanged: {
|
|
||||||
if (root.sharedPasswordBuffer !== passwordBuffer) {
|
|
||||||
root.passwordChanged(passwordBuffer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,137 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
DankListView {
|
|
||||||
id: listView
|
|
||||||
|
|
||||||
property var keyboardController: null
|
|
||||||
property bool keyboardActive: false
|
|
||||||
property bool autoScrollDisabled: false
|
|
||||||
property alias count: listView.count
|
|
||||||
property alias listContentHeight: listView.contentHeight
|
|
||||||
|
|
||||||
clip: true
|
|
||||||
model: NotificationService.groupedNotifications
|
|
||||||
spacing: Theme.spacingL
|
|
||||||
|
|
||||||
onIsUserScrollingChanged: {
|
|
||||||
if (isUserScrolling && keyboardController && keyboardController.keyboardNavigationActive) {
|
|
||||||
autoScrollDisabled = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function enableAutoScroll() {
|
|
||||||
autoScrollDisabled = false
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: positionPreservationTimer
|
|
||||||
interval: 200
|
|
||||||
running: keyboardController && keyboardController.keyboardNavigationActive && !autoScrollDisabled
|
|
||||||
repeat: true
|
|
||||||
onTriggered: {
|
|
||||||
if (keyboardController && keyboardController.keyboardNavigationActive && !autoScrollDisabled) {
|
|
||||||
keyboardController.ensureVisible()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NotificationEmptyState {
|
|
||||||
visible: listView.count === 0
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
|
|
||||||
onModelChanged: {
|
|
||||||
if (!keyboardController || !keyboardController.keyboardNavigationActive) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
keyboardController.rebuildFlatNavigation()
|
|
||||||
Qt.callLater(() => {
|
|
||||||
if (keyboardController && keyboardController.keyboardNavigationActive && !autoScrollDisabled) {
|
|
||||||
keyboardController.ensureVisible()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: Item {
|
|
||||||
required property var modelData
|
|
||||||
required property int index
|
|
||||||
|
|
||||||
readonly property bool isExpanded: (NotificationService.expandedGroups[modelData && modelData.key] || false)
|
|
||||||
|
|
||||||
width: ListView.view.width
|
|
||||||
height: notificationCard.height
|
|
||||||
|
|
||||||
NotificationCard {
|
|
||||||
id: notificationCard
|
|
||||||
width: parent.width
|
|
||||||
notificationGroup: modelData
|
|
||||||
keyboardNavigationActive: listView.keyboardActive
|
|
||||||
|
|
||||||
isGroupSelected: {
|
|
||||||
if (!keyboardController || !keyboardController.keyboardNavigationActive || !listView.keyboardActive) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
keyboardController.selectionVersion
|
|
||||||
const selection = keyboardController.getCurrentSelection()
|
|
||||||
return selection.type === "group" && selection.groupIndex === index
|
|
||||||
}
|
|
||||||
|
|
||||||
selectedNotificationIndex: {
|
|
||||||
if (!keyboardController || !keyboardController.keyboardNavigationActive || !listView.keyboardActive) {
|
|
||||||
return -1
|
|
||||||
}
|
|
||||||
keyboardController.selectionVersion
|
|
||||||
const selection = keyboardController.getCurrentSelection()
|
|
||||||
return (selection.type === "notification" && selection.groupIndex === index) ? selection.notificationIndex : -1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: NotificationService
|
|
||||||
|
|
||||||
function onGroupedNotificationsChanged() {
|
|
||||||
if (!keyboardController) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (keyboardController.isTogglingGroup) {
|
|
||||||
keyboardController.rebuildFlatNavigation()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
keyboardController.rebuildFlatNavigation()
|
|
||||||
|
|
||||||
if (keyboardController.keyboardNavigationActive) {
|
|
||||||
Qt.callLater(() => {
|
|
||||||
if (!autoScrollDisabled) {
|
|
||||||
keyboardController.ensureVisible()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onExpandedGroupsChanged() {
|
|
||||||
if (keyboardController && keyboardController.keyboardNavigationActive) {
|
|
||||||
Qt.callLater(() => {
|
|
||||||
if (!autoScrollDisabled) {
|
|
||||||
keyboardController.ensureVisible()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onExpandedMessagesChanged() {
|
|
||||||
if (keyboardController && keyboardController.keyboardNavigationActive) {
|
|
||||||
Qt.callLater(() => {
|
|
||||||
if (!autoScrollDisabled) {
|
|
||||||
keyboardController.ensureVisible()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,202 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Effects
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
import qs.Modules.Notifications.Center
|
|
||||||
|
|
||||||
DankPopout {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool notificationHistoryVisible: false
|
|
||||||
property string triggerSection: "right"
|
|
||||||
property var triggerScreen: null
|
|
||||||
|
|
||||||
NotificationKeyboardController {
|
|
||||||
id: keyboardController
|
|
||||||
listView: null
|
|
||||||
isOpen: notificationHistoryVisible
|
|
||||||
onClose: () => {
|
|
||||||
notificationHistoryVisible = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setTriggerPosition(x, y, width, section, screen) {
|
|
||||||
triggerX = x
|
|
||||||
triggerY = y
|
|
||||||
triggerWidth = width
|
|
||||||
triggerSection = section
|
|
||||||
triggerScreen = screen
|
|
||||||
}
|
|
||||||
|
|
||||||
popupWidth: 400
|
|
||||||
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 400
|
|
||||||
triggerX: Screen.width - 400 - Theme.spacingL
|
|
||||||
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.spacingXS
|
|
||||||
triggerWidth: 40
|
|
||||||
positioning: "center"
|
|
||||||
screen: triggerScreen
|
|
||||||
shouldBeVisible: notificationHistoryVisible
|
|
||||||
visible: shouldBeVisible
|
|
||||||
|
|
||||||
onNotificationHistoryVisibleChanged: {
|
|
||||||
if (notificationHistoryVisible) {
|
|
||||||
open()
|
|
||||||
} else {
|
|
||||||
close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onShouldBeVisibleChanged: {
|
|
||||||
if (shouldBeVisible) {
|
|
||||||
NotificationService.onOverlayOpen()
|
|
||||||
Qt.callLater(() => {
|
|
||||||
if (contentLoader.item) {
|
|
||||||
contentLoader.item.externalKeyboardController = keyboardController
|
|
||||||
|
|
||||||
const notificationList = findChild(contentLoader.item, "notificationList")
|
|
||||||
const notificationHeader = findChild(contentLoader.item, "notificationHeader")
|
|
||||||
|
|
||||||
if (notificationList) {
|
|
||||||
keyboardController.listView = notificationList
|
|
||||||
notificationList.keyboardController = keyboardController
|
|
||||||
}
|
|
||||||
if (notificationHeader) {
|
|
||||||
notificationHeader.keyboardController = keyboardController
|
|
||||||
}
|
|
||||||
|
|
||||||
keyboardController.reset()
|
|
||||||
keyboardController.rebuildFlatNavigation()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
NotificationService.onOverlayClose()
|
|
||||||
keyboardController.keyboardNavigationActive = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function findChild(parent, objectName) {
|
|
||||||
if (parent.objectName === objectName) {
|
|
||||||
return parent
|
|
||||||
}
|
|
||||||
for (let i = 0; i < parent.children.length; i++) {
|
|
||||||
const child = parent.children[i]
|
|
||||||
const result = findChild(child, objectName)
|
|
||||||
if (result) {
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
content: Component {
|
|
||||||
Rectangle {
|
|
||||||
id: notificationContent
|
|
||||||
|
|
||||||
property var externalKeyboardController: null
|
|
||||||
property real cachedHeaderHeight: 32
|
|
||||||
|
|
||||||
implicitHeight: {
|
|
||||||
let baseHeight = Theme.spacingL * 2
|
|
||||||
baseHeight += cachedHeaderHeight
|
|
||||||
baseHeight += (notificationSettings.expanded ? notificationSettings.contentHeight : 0)
|
|
||||||
baseHeight += Theme.spacingM * 2
|
|
||||||
let listHeight = notificationList.listContentHeight
|
|
||||||
if (NotificationService.groupedNotifications.length === 0) {
|
|
||||||
listHeight = 200
|
|
||||||
}
|
|
||||||
baseHeight += Math.min(listHeight, 600)
|
|
||||||
const maxHeight = root.screen ? root.screen.height * 0.8 : Screen.height * 0.8
|
|
||||||
return Math.max(300, Math.min(baseHeight, maxHeight))
|
|
||||||
}
|
|
||||||
|
|
||||||
color: Theme.popupBackground()
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
|
||||||
border.width: 1
|
|
||||||
focus: true
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (root.shouldBeVisible) {
|
|
||||||
forceActiveFocus()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onPressed: event => {
|
|
||||||
if (event.key === Qt.Key_Escape) {
|
|
||||||
root.close()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (externalKeyboardController) {
|
|
||||||
externalKeyboardController.handleKey(event)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onShouldBeVisibleChanged() {
|
|
||||||
if (root.shouldBeVisible) {
|
|
||||||
Qt.callLater(() => {
|
|
||||||
notificationContent.forceActiveFocus()
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
notificationContent.focus = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
target: root
|
|
||||||
}
|
|
||||||
|
|
||||||
FocusScope {
|
|
||||||
id: contentColumn
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
focus: true
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: contentColumnInner
|
|
||||||
anchors.fill: parent
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
NotificationHeader {
|
|
||||||
id: notificationHeader
|
|
||||||
objectName: "notificationHeader"
|
|
||||||
onHeightChanged: notificationContent.cachedHeaderHeight = height
|
|
||||||
}
|
|
||||||
|
|
||||||
NotificationSettings {
|
|
||||||
id: notificationSettings
|
|
||||||
expanded: notificationHeader.showSettings
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyboardNavigatedNotificationList {
|
|
||||||
id: notificationList
|
|
||||||
objectName: "notificationList"
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height - notificationContent.cachedHeaderHeight - notificationSettings.height - contentColumnInner.spacing * 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NotificationKeyboardHints {
|
|
||||||
id: keyboardHints
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
showHints: (externalKeyboardController && externalKeyboardController.showKeyboardHints) || false
|
|
||||||
z: 200
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: 180
|
|
||||||
easing.type: Easing.OutQuart
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property var keyboardController: null
|
|
||||||
property bool showSettings: false
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
height: 32
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Notifications"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
id: doNotDisturbButton
|
|
||||||
|
|
||||||
iconName: SessionData.doNotDisturb ? "notifications_off" : "notifications"
|
|
||||||
iconColor: SessionData.doNotDisturb ? Theme.error : Theme.surfaceText
|
|
||||||
buttonSize: 28
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
onClicked: SessionData.setDoNotDisturb(!SessionData.doNotDisturb)
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: doNotDisturbTooltip
|
|
||||||
|
|
||||||
width: tooltipText.contentWidth + Theme.spacingS * 2
|
|
||||||
height: tooltipText.contentHeight + Theme.spacingXS * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Theme.surfaceContainer
|
|
||||||
border.color: Theme.outline
|
|
||||||
border.width: 1
|
|
||||||
anchors.bottom: parent.top
|
|
||||||
anchors.bottomMargin: Theme.spacingS
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
visible: doNotDisturbButton.children[1].containsMouse
|
|
||||||
opacity: visible ? 1 : 0
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: tooltipText
|
|
||||||
|
|
||||||
text: "Do Not Disturb"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.centerIn: parent
|
|
||||||
font.hintingPreference: Font.PreferFullHinting
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
id: helpButton
|
|
||||||
iconName: "info"
|
|
||||||
iconColor: (keyboardController && keyboardController.showKeyboardHints) ? Theme.primary : Theme.surfaceText
|
|
||||||
buttonSize: 28
|
|
||||||
visible: keyboardController !== null
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
onClicked: {
|
|
||||||
if (keyboardController) {
|
|
||||||
keyboardController.showKeyboardHints = !keyboardController.showKeyboardHints
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
id: settingsButton
|
|
||||||
iconName: "settings"
|
|
||||||
iconColor: root.showSettings ? Theme.primary : Theme.surfaceText
|
|
||||||
buttonSize: 28
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
onClicked: root.showSettings = !root.showSettings
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: clearAllButton
|
|
||||||
|
|
||||||
width: 120
|
|
||||||
height: 28
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
visible: NotificationService.notifications.length > 0
|
|
||||||
color: clearArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: clearArea.containsMouse ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "delete_sweep"
|
|
||||||
size: Theme.iconSizeSmall
|
|
||||||
color: clearArea.containsMouse ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Clear All"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: clearArea.containsMouse ? Theme.primary : Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: clearArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: NotificationService.clearAllNotifications()
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on border.color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,459 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: controller
|
|
||||||
|
|
||||||
property var listView: null
|
|
||||||
property bool isOpen: false
|
|
||||||
property var onClose: null
|
|
||||||
|
|
||||||
property int selectionVersion: 0
|
|
||||||
|
|
||||||
property bool keyboardNavigationActive: false
|
|
||||||
property int selectedFlatIndex: 0
|
|
||||||
property var flatNavigation: []
|
|
||||||
property bool showKeyboardHints: false
|
|
||||||
|
|
||||||
property string selectedNotificationId: ""
|
|
||||||
property string selectedGroupKey: ""
|
|
||||||
property string selectedItemType: ""
|
|
||||||
property bool isTogglingGroup: false
|
|
||||||
property bool isRebuilding: false
|
|
||||||
|
|
||||||
function rebuildFlatNavigation() {
|
|
||||||
isRebuilding = true
|
|
||||||
|
|
||||||
const nav = []
|
|
||||||
const groups = NotificationService.groupedNotifications
|
|
||||||
|
|
||||||
for (let i = 0; i < groups.length; i++) {
|
|
||||||
const group = groups[i]
|
|
||||||
const isExpanded = NotificationService.expandedGroups[group.key] || false
|
|
||||||
|
|
||||||
nav.push({
|
|
||||||
"type": "group",
|
|
||||||
"groupIndex": i,
|
|
||||||
"notificationIndex": -1,
|
|
||||||
"groupKey": group.key,
|
|
||||||
"notificationId": ""
|
|
||||||
})
|
|
||||||
|
|
||||||
if (isExpanded) {
|
|
||||||
const notifications = group.notifications || []
|
|
||||||
for (let j = 0; j < notifications.length; j++) {
|
|
||||||
const notifId = String(notifications[j] && notifications[j].notification && notifications[j].notification.id ? notifications[j].notification.id : "")
|
|
||||||
nav.push({
|
|
||||||
"type": "notification",
|
|
||||||
"groupIndex": i,
|
|
||||||
"notificationIndex": j,
|
|
||||||
"groupKey": group.key,
|
|
||||||
"notificationId": notifId
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
flatNavigation = nav
|
|
||||||
updateSelectedIndexFromId()
|
|
||||||
isRebuilding = false
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateSelectedIndexFromId() {
|
|
||||||
if (!keyboardNavigationActive) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < flatNavigation.length; i++) {
|
|
||||||
const item = flatNavigation[i]
|
|
||||||
|
|
||||||
if (selectedItemType === "group" && item.type === "group" && item.groupKey === selectedGroupKey) {
|
|
||||||
selectedFlatIndex = i
|
|
||||||
selectionVersion++ // Trigger UI update
|
|
||||||
return
|
|
||||||
} else if (selectedItemType === "notification" && item.type === "notification" && String(item.notificationId) === String(selectedNotificationId)) {
|
|
||||||
selectedFlatIndex = i
|
|
||||||
selectionVersion++ // Trigger UI update
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If not found, try to find the same group but select the group header instead
|
|
||||||
if (selectedItemType === "notification") {
|
|
||||||
for (let j = 0; j < flatNavigation.length; j++) {
|
|
||||||
const groupItem = flatNavigation[j]
|
|
||||||
if (groupItem.type === "group" && groupItem.groupKey === selectedGroupKey) {
|
|
||||||
selectedFlatIndex = j
|
|
||||||
selectedItemType = "group"
|
|
||||||
selectedNotificationId = ""
|
|
||||||
selectionVersion++ // Trigger UI update
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If still not found, clamp to valid range and update
|
|
||||||
if (flatNavigation.length > 0) {
|
|
||||||
selectedFlatIndex = Math.min(selectedFlatIndex, flatNavigation.length - 1)
|
|
||||||
selectedFlatIndex = Math.max(selectedFlatIndex, 0)
|
|
||||||
updateSelectedIdFromIndex()
|
|
||||||
selectionVersion++ // Trigger UI update
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateSelectedIdFromIndex() {
|
|
||||||
if (selectedFlatIndex >= 0 && selectedFlatIndex < flatNavigation.length) {
|
|
||||||
const item = flatNavigation[selectedFlatIndex]
|
|
||||||
selectedItemType = item.type
|
|
||||||
selectedGroupKey = item.groupKey
|
|
||||||
selectedNotificationId = item.notificationId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function reset() {
|
|
||||||
selectedFlatIndex = 0
|
|
||||||
keyboardNavigationActive = false
|
|
||||||
showKeyboardHints = false
|
|
||||||
// Reset keyboardActive when modal is reset
|
|
||||||
if (listView) {
|
|
||||||
listView.keyboardActive = false
|
|
||||||
}
|
|
||||||
rebuildFlatNavigation()
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectNext() {
|
|
||||||
keyboardNavigationActive = true
|
|
||||||
if (flatNavigation.length === 0)
|
|
||||||
return
|
|
||||||
|
|
||||||
// Re-enable auto-scrolling when arrow keys are used
|
|
||||||
if (listView && listView.enableAutoScroll) {
|
|
||||||
listView.enableAutoScroll()
|
|
||||||
}
|
|
||||||
|
|
||||||
selectedFlatIndex = Math.min(selectedFlatIndex + 1, flatNavigation.length - 1)
|
|
||||||
updateSelectedIdFromIndex()
|
|
||||||
selectionVersion++
|
|
||||||
ensureVisible()
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectNextWrapping() {
|
|
||||||
keyboardNavigationActive = true
|
|
||||||
if (flatNavigation.length === 0)
|
|
||||||
return
|
|
||||||
|
|
||||||
// Re-enable auto-scrolling when arrow keys are used
|
|
||||||
if (listView && listView.enableAutoScroll) {
|
|
||||||
listView.enableAutoScroll()
|
|
||||||
}
|
|
||||||
|
|
||||||
selectedFlatIndex = (selectedFlatIndex + 1) % flatNavigation.length
|
|
||||||
updateSelectedIdFromIndex()
|
|
||||||
selectionVersion++
|
|
||||||
ensureVisible()
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectPrevious() {
|
|
||||||
keyboardNavigationActive = true
|
|
||||||
if (flatNavigation.length === 0)
|
|
||||||
return
|
|
||||||
|
|
||||||
// Re-enable auto-scrolling when arrow keys are used
|
|
||||||
if (listView && listView.enableAutoScroll) {
|
|
||||||
listView.enableAutoScroll()
|
|
||||||
}
|
|
||||||
|
|
||||||
selectedFlatIndex = Math.max(selectedFlatIndex - 1, 0)
|
|
||||||
updateSelectedIdFromIndex()
|
|
||||||
selectionVersion++
|
|
||||||
ensureVisible()
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleGroupExpanded() {
|
|
||||||
if (flatNavigation.length === 0 || selectedFlatIndex >= flatNavigation.length)
|
|
||||||
return
|
|
||||||
|
|
||||||
const currentItem = flatNavigation[selectedFlatIndex]
|
|
||||||
const groups = NotificationService.groupedNotifications
|
|
||||||
const group = groups[currentItem.groupIndex]
|
|
||||||
if (!group)
|
|
||||||
return
|
|
||||||
|
|
||||||
// Prevent expanding groups with < 2 notifications
|
|
||||||
const notificationCount = group.notifications ? group.notifications.length : 0
|
|
||||||
if (notificationCount < 2)
|
|
||||||
return
|
|
||||||
|
|
||||||
const wasExpanded = NotificationService.expandedGroups[group.key] || false
|
|
||||||
const groupIndex = currentItem.groupIndex
|
|
||||||
|
|
||||||
isTogglingGroup = true
|
|
||||||
NotificationService.toggleGroupExpansion(group.key)
|
|
||||||
rebuildFlatNavigation()
|
|
||||||
|
|
||||||
// Smart selection after toggle
|
|
||||||
if (!wasExpanded) {
|
|
||||||
// Just expanded - move to first notification in the group
|
|
||||||
for (let i = 0; i < flatNavigation.length; i++) {
|
|
||||||
if (flatNavigation[i].type === "notification" && flatNavigation[i].groupIndex === groupIndex) {
|
|
||||||
selectedFlatIndex = i
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Just collapsed - stay on the group header
|
|
||||||
for (let i = 0; i < flatNavigation.length; i++) {
|
|
||||||
if (flatNavigation[i].type === "group" && flatNavigation[i].groupIndex === groupIndex) {
|
|
||||||
selectedFlatIndex = i
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
isTogglingGroup = false
|
|
||||||
ensureVisible()
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleEnterKey() {
|
|
||||||
if (flatNavigation.length === 0 || selectedFlatIndex >= flatNavigation.length)
|
|
||||||
return
|
|
||||||
|
|
||||||
const currentItem = flatNavigation[selectedFlatIndex]
|
|
||||||
const groups = NotificationService.groupedNotifications
|
|
||||||
const group = groups[currentItem.groupIndex]
|
|
||||||
if (!group)
|
|
||||||
return
|
|
||||||
|
|
||||||
if (currentItem.type === "group") {
|
|
||||||
const notificationCount = group.notifications ? group.notifications.length : 0
|
|
||||||
if (notificationCount >= 2) {
|
|
||||||
toggleGroupExpanded()
|
|
||||||
} else {
|
|
||||||
executeAction(0)
|
|
||||||
}
|
|
||||||
} else if (currentItem.type === "notification") {
|
|
||||||
executeAction(0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleTextExpanded() {
|
|
||||||
if (flatNavigation.length === 0 || selectedFlatIndex >= flatNavigation.length)
|
|
||||||
return
|
|
||||||
|
|
||||||
const currentItem = flatNavigation[selectedFlatIndex]
|
|
||||||
const groups = NotificationService.groupedNotifications
|
|
||||||
const group = groups[currentItem.groupIndex]
|
|
||||||
if (!group)
|
|
||||||
return
|
|
||||||
|
|
||||||
let messageId = ""
|
|
||||||
|
|
||||||
if (currentItem.type === "group") {
|
|
||||||
messageId = group.latestNotification?.notification?.id + "_desc"
|
|
||||||
} else if (currentItem.type === "notification" && currentItem.notificationIndex >= 0 && currentItem.notificationIndex < group.notifications.length) {
|
|
||||||
messageId = group.notifications[currentItem.notificationIndex]?.notification?.id + "_desc"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (messageId) {
|
|
||||||
NotificationService.toggleMessageExpansion(messageId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function executeAction(actionIndex) {
|
|
||||||
if (flatNavigation.length === 0 || selectedFlatIndex >= flatNavigation.length)
|
|
||||||
return
|
|
||||||
|
|
||||||
const currentItem = flatNavigation[selectedFlatIndex]
|
|
||||||
const groups = NotificationService.groupedNotifications
|
|
||||||
const group = groups[currentItem.groupIndex]
|
|
||||||
if (!group)
|
|
||||||
return
|
|
||||||
|
|
||||||
let actions = []
|
|
||||||
|
|
||||||
if (currentItem.type === "group") {
|
|
||||||
actions = group.latestNotification?.actions || []
|
|
||||||
} else if (currentItem.type === "notification" && currentItem.notificationIndex >= 0 && currentItem.notificationIndex < group.notifications.length) {
|
|
||||||
actions = group.notifications[currentItem.notificationIndex]?.actions || []
|
|
||||||
}
|
|
||||||
|
|
||||||
if (actionIndex >= 0 && actionIndex < actions.length) {
|
|
||||||
const action = actions[actionIndex]
|
|
||||||
if (action.invoke) {
|
|
||||||
action.invoke()
|
|
||||||
if (onClose)
|
|
||||||
onClose()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearSelected() {
|
|
||||||
if (flatNavigation.length === 0 || selectedFlatIndex >= flatNavigation.length)
|
|
||||||
return
|
|
||||||
|
|
||||||
const currentItem = flatNavigation[selectedFlatIndex]
|
|
||||||
const groups = NotificationService.groupedNotifications
|
|
||||||
const group = groups[currentItem.groupIndex]
|
|
||||||
if (!group)
|
|
||||||
return
|
|
||||||
|
|
||||||
if (currentItem.type === "group") {
|
|
||||||
NotificationService.dismissGroup(group.key)
|
|
||||||
} else if (currentItem.type === "notification") {
|
|
||||||
const notification = group.notifications[currentItem.notificationIndex]
|
|
||||||
NotificationService.dismissNotification(notification)
|
|
||||||
}
|
|
||||||
|
|
||||||
rebuildFlatNavigation()
|
|
||||||
|
|
||||||
if (flatNavigation.length === 0) {
|
|
||||||
keyboardNavigationActive = false
|
|
||||||
if (listView) {
|
|
||||||
listView.keyboardActive = false
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
selectedFlatIndex = Math.min(selectedFlatIndex, flatNavigation.length - 1)
|
|
||||||
updateSelectedIdFromIndex()
|
|
||||||
ensureVisible()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function ensureVisible() {
|
|
||||||
if (flatNavigation.length === 0 || selectedFlatIndex >= flatNavigation.length || !listView)
|
|
||||||
return
|
|
||||||
|
|
||||||
const currentItem = flatNavigation[selectedFlatIndex]
|
|
||||||
|
|
||||||
if (keyboardNavigationActive && currentItem && currentItem.groupIndex >= 0) {
|
|
||||||
// Always center the selected item for better visibility
|
|
||||||
// This ensures the selected item stays in view even when new notifications arrive
|
|
||||||
if (currentItem.type === "notification") {
|
|
||||||
// For individual notifications, center on the group but bias towards the notification
|
|
||||||
listView.positionViewAtIndex(currentItem.groupIndex, ListView.Center)
|
|
||||||
} else {
|
|
||||||
// For group headers, center on the group
|
|
||||||
listView.positionViewAtIndex(currentItem.groupIndex, ListView.Center)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Force immediate update
|
|
||||||
listView.forceLayout()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleKey(event) {
|
|
||||||
if ((event.key === Qt.Key_Delete || event.key === Qt.Key_Backspace) && (event.modifiers & Qt.ShiftModifier)) {
|
|
||||||
NotificationService.clearAllNotifications()
|
|
||||||
rebuildFlatNavigation()
|
|
||||||
if (flatNavigation.length === 0) {
|
|
||||||
keyboardNavigationActive = false
|
|
||||||
if (listView) {
|
|
||||||
listView.keyboardActive = false
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
selectedFlatIndex = 0
|
|
||||||
updateSelectedIdFromIndex()
|
|
||||||
}
|
|
||||||
selectionVersion++
|
|
||||||
event.accepted = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.key === Qt.Key_Escape) {
|
|
||||||
if (keyboardNavigationActive) {
|
|
||||||
keyboardNavigationActive = false
|
|
||||||
event.accepted = true
|
|
||||||
} else {
|
|
||||||
if (onClose)
|
|
||||||
onClose()
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
} else if (event.key === Qt.Key_Down || event.key === 16777237) {
|
|
||||||
if (!keyboardNavigationActive) {
|
|
||||||
keyboardNavigationActive = true
|
|
||||||
rebuildFlatNavigation() // Ensure we have fresh navigation data
|
|
||||||
selectedFlatIndex = 0
|
|
||||||
updateSelectedIdFromIndex()
|
|
||||||
// Set keyboardActive on listView to show highlight
|
|
||||||
if (listView) {
|
|
||||||
listView.keyboardActive = true
|
|
||||||
}
|
|
||||||
selectionVersion++
|
|
||||||
ensureVisible()
|
|
||||||
event.accepted = true
|
|
||||||
} else {
|
|
||||||
selectNext()
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
} else if (event.key === Qt.Key_Up || event.key === 16777235) {
|
|
||||||
if (!keyboardNavigationActive) {
|
|
||||||
keyboardNavigationActive = true
|
|
||||||
rebuildFlatNavigation() // Ensure we have fresh navigation data
|
|
||||||
selectedFlatIndex = 0
|
|
||||||
updateSelectedIdFromIndex()
|
|
||||||
// Set keyboardActive on listView to show highlight
|
|
||||||
if (listView) {
|
|
||||||
listView.keyboardActive = true
|
|
||||||
}
|
|
||||||
selectionVersion++
|
|
||||||
ensureVisible()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (selectedFlatIndex === 0) {
|
|
||||||
keyboardNavigationActive = false
|
|
||||||
// Reset keyboardActive when navigation is disabled
|
|
||||||
if (listView) {
|
|
||||||
listView.keyboardActive = false
|
|
||||||
}
|
|
||||||
selectionVersion++
|
|
||||||
event.accepted = true
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
selectPrevious()
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
} else if (keyboardNavigationActive) {
|
|
||||||
if (event.key === Qt.Key_Space) {
|
|
||||||
toggleGroupExpanded()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
|
|
||||||
handleEnterKey()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_E) {
|
|
||||||
toggleTextExpanded()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Delete || event.key === Qt.Key_Backspace) {
|
|
||||||
clearSelected()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Tab) {
|
|
||||||
selectNextWrapping()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key >= Qt.Key_1 && event.key <= Qt.Key_9) {
|
|
||||||
const actionIndex = event.key - Qt.Key_1
|
|
||||||
executeAction(actionIndex)
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.key === Qt.Key_F10) {
|
|
||||||
showKeyboardHints = !showKeyboardHints
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get current selection info for UI
|
|
||||||
function getCurrentSelection() {
|
|
||||||
if (!keyboardNavigationActive || selectedFlatIndex < 0 || selectedFlatIndex >= flatNavigation.length) {
|
|
||||||
return {
|
|
||||||
"type": "",
|
|
||||||
"groupIndex": -1,
|
|
||||||
"notificationIndex": -1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const result = flatNavigation[selectedFlatIndex] || {
|
|
||||||
"type": "",
|
|
||||||
"groupIndex": -1,
|
|
||||||
"notificationIndex": -1
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,255 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool expanded: false
|
|
||||||
readonly property real contentHeight: contentColumn.height + Theme.spacingL * 2
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
height: expanded ? Math.min(contentHeight, 400) : 0
|
|
||||||
visible: expanded
|
|
||||||
clip: true
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Behavior on height {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Anims.durShort
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Anims.emphasized
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
opacity: expanded ? 1 : 0
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Anims.durShort
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Anims.emphasized
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
readonly property var timeoutOptions: [{
|
|
||||||
"text": "Never",
|
|
||||||
"value": 0
|
|
||||||
}, {
|
|
||||||
"text": "1 second",
|
|
||||||
"value": 1000
|
|
||||||
}, {
|
|
||||||
"text": "3 seconds",
|
|
||||||
"value": 3000
|
|
||||||
}, {
|
|
||||||
"text": "5 seconds",
|
|
||||||
"value": 5000
|
|
||||||
}, {
|
|
||||||
"text": "8 seconds",
|
|
||||||
"value": 8000
|
|
||||||
}, {
|
|
||||||
"text": "10 seconds",
|
|
||||||
"value": 10000
|
|
||||||
}, {
|
|
||||||
"text": "15 seconds",
|
|
||||||
"value": 15000
|
|
||||||
}, {
|
|
||||||
"text": "30 seconds",
|
|
||||||
"value": 30000
|
|
||||||
}, {
|
|
||||||
"text": "1 minute",
|
|
||||||
"value": 60000
|
|
||||||
}, {
|
|
||||||
"text": "2 minutes",
|
|
||||||
"value": 120000
|
|
||||||
}, {
|
|
||||||
"text": "5 minutes",
|
|
||||||
"value": 300000
|
|
||||||
}, {
|
|
||||||
"text": "10 minutes",
|
|
||||||
"value": 600000
|
|
||||||
}]
|
|
||||||
|
|
||||||
function getTimeoutText(value) {
|
|
||||||
if (value === undefined || value === null || isNaN(value)) {
|
|
||||||
return "5 seconds"
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < timeoutOptions.length; i++) {
|
|
||||||
if (timeoutOptions[i].value === value) {
|
|
||||||
return timeoutOptions[i].text
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (value === 0) {
|
|
||||||
return "Never"
|
|
||||||
}
|
|
||||||
if (value < 1000) {
|
|
||||||
return value + "ms"
|
|
||||||
}
|
|
||||||
if (value < 60000) {
|
|
||||||
return Math.round(value / 1000) + " seconds"
|
|
||||||
}
|
|
||||||
return Math.round(value / 60000) + " minutes"
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: contentColumn
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Notification Settings"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Bold
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: 36
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: SessionData.doNotDisturb ? "notifications_off" : "notifications"
|
|
||||||
size: Theme.iconSizeSmall
|
|
||||||
color: SessionData.doNotDisturb ? Theme.error : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Do Not Disturb"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankToggle {
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
checked: SessionData.doNotDisturb
|
|
||||||
onToggled: SessionData.setDoNotDisturb(!SessionData.doNotDisturb)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Notification Timeouts"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
DankDropdown {
|
|
||||||
width: parent.width
|
|
||||||
text: "Low Priority"
|
|
||||||
description: "Timeout for low priority notifications"
|
|
||||||
currentValue: getTimeoutText(SettingsData.notificationTimeoutLow)
|
|
||||||
options: timeoutOptions.map(opt => opt.text)
|
|
||||||
onValueChanged: value => {
|
|
||||||
for (let i = 0; i < timeoutOptions.length; i++) {
|
|
||||||
if (timeoutOptions[i].text === value) {
|
|
||||||
SettingsData.setNotificationTimeoutLow(timeoutOptions[i].value)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankDropdown {
|
|
||||||
width: parent.width
|
|
||||||
text: "Normal Priority"
|
|
||||||
description: "Timeout for normal priority notifications"
|
|
||||||
currentValue: getTimeoutText(SettingsData.notificationTimeoutNormal)
|
|
||||||
options: timeoutOptions.map(opt => opt.text)
|
|
||||||
onValueChanged: value => {
|
|
||||||
for (let i = 0; i < timeoutOptions.length; i++) {
|
|
||||||
if (timeoutOptions[i].text === value) {
|
|
||||||
SettingsData.setNotificationTimeoutNormal(timeoutOptions[i].value)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankDropdown {
|
|
||||||
width: parent.width
|
|
||||||
text: "Critical Priority"
|
|
||||||
description: "Timeout for critical priority notifications"
|
|
||||||
currentValue: getTimeoutText(SettingsData.notificationTimeoutCritical)
|
|
||||||
options: timeoutOptions.map(opt => opt.text)
|
|
||||||
onValueChanged: value => {
|
|
||||||
for (let i = 0; i < timeoutOptions.length; i++) {
|
|
||||||
if (timeoutOptions[i].text === value) {
|
|
||||||
SettingsData.setNotificationTimeoutCritical(timeoutOptions[i].value)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: 36
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "notifications_active"
|
|
||||||
size: Theme.iconSizeSmall
|
|
||||||
color: SettingsData.notificationOverlayEnabled ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
spacing: 2
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Notification Overlay"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Display all priorities over fullscreen apps"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall - 1
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankToggle {
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
checked: SettingsData.notificationOverlayEnabled
|
|
||||||
onToggled: toggled => SettingsData.setNotificationOverlayEnabled(toggled)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,574 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Effects
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import Quickshell.Services.Notifications
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
PanelWindow {
|
|
||||||
id: win
|
|
||||||
|
|
||||||
WlrLayershell.namespace: "quickshell:notification"
|
|
||||||
|
|
||||||
required property var notificationData
|
|
||||||
required property string notificationId
|
|
||||||
readonly property bool hasValidData: notificationData && notificationData.notification
|
|
||||||
property int screenY: 0
|
|
||||||
property bool exiting: false
|
|
||||||
property bool _isDestroying: false
|
|
||||||
property bool _finalized: false
|
|
||||||
|
|
||||||
signal entered
|
|
||||||
signal exitFinished
|
|
||||||
|
|
||||||
function startExit() {
|
|
||||||
if (exiting || _isDestroying) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
exiting = true
|
|
||||||
exitAnim.restart()
|
|
||||||
exitWatchdog.restart()
|
|
||||||
if (NotificationService.removeFromVisibleNotifications)
|
|
||||||
NotificationService.removeFromVisibleNotifications(win.notificationData)
|
|
||||||
}
|
|
||||||
|
|
||||||
function forceExit() {
|
|
||||||
if (_isDestroying) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_isDestroying = true
|
|
||||||
exiting = true
|
|
||||||
visible = false
|
|
||||||
exitWatchdog.stop()
|
|
||||||
finalizeExit("forced")
|
|
||||||
}
|
|
||||||
|
|
||||||
function finalizeExit(reason) {
|
|
||||||
if (_finalized) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
_finalized = true
|
|
||||||
_isDestroying = true
|
|
||||||
exitWatchdog.stop()
|
|
||||||
wrapperConn.enabled = false
|
|
||||||
wrapperConn.target = null
|
|
||||||
win.exitFinished()
|
|
||||||
}
|
|
||||||
|
|
||||||
visible: hasValidData
|
|
||||||
WlrLayershell.layer: {
|
|
||||||
if (!notificationData)
|
|
||||||
return WlrLayershell.Top
|
|
||||||
|
|
||||||
SettingsData.notificationOverlayEnabled
|
|
||||||
|
|
||||||
const shouldUseOverlay = (SettingsData.notificationOverlayEnabled) || (notificationData.urgency === NotificationUrgency.Critical)
|
|
||||||
|
|
||||||
return shouldUseOverlay ? WlrLayershell.Overlay : WlrLayershell.Top
|
|
||||||
}
|
|
||||||
WlrLayershell.exclusiveZone: -1
|
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
|
||||||
color: "transparent"
|
|
||||||
implicitWidth: 400
|
|
||||||
implicitHeight: 122
|
|
||||||
onScreenYChanged: margins.top = Theme.barHeight - 4 + SettingsData.topBarSpacing + 4 + screenY
|
|
||||||
onHasValidDataChanged: {
|
|
||||||
if (!hasValidData && !exiting && !_isDestroying) {
|
|
||||||
forceExit()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (hasValidData) {
|
|
||||||
Qt.callLater(() => enterX.restart())
|
|
||||||
} else {
|
|
||||||
forceExit()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onNotificationDataChanged: {
|
|
||||||
if (!_isDestroying) {
|
|
||||||
wrapperConn.target = win.notificationData || null
|
|
||||||
notificationConn.target = (win.notificationData && win.notificationData.notification && win.notificationData.notification.Retainable) || null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onEntered: {
|
|
||||||
if (!_isDestroying) {
|
|
||||||
enterDelay.start()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onDestruction: {
|
|
||||||
_isDestroying = true
|
|
||||||
exitWatchdog.stop()
|
|
||||||
if (notificationData && notificationData.timer) {
|
|
||||||
notificationData.timer.stop()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
top: true
|
|
||||||
right: true
|
|
||||||
}
|
|
||||||
|
|
||||||
margins {
|
|
||||||
top: Theme.barHeight - 4 + SettingsData.topBarSpacing + 4
|
|
||||||
right: 12
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: content
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
visible: win.hasValidData
|
|
||||||
layer.enabled: (enterX.running || exitAnim.running)
|
|
||||||
layer.smooth: true
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
property var shadowLayers: [shadowLayer1, shadowLayer2, shadowLayer3]
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: 4
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Theme.popupBackground()
|
|
||||||
border.color: notificationData && notificationData.urgency === NotificationUrgency.Critical ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3) : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
|
||||||
border.width: notificationData && notificationData.urgency === NotificationUrgency.Critical ? 2 : 1
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: shadowLayer1
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: -3
|
|
||||||
color: "transparent"
|
|
||||||
radius: parent.radius + 3
|
|
||||||
border.color: Qt.rgba(0, 0, 0, 0.05)
|
|
||||||
border.width: 1
|
|
||||||
z: -3
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: shadowLayer2
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: -2
|
|
||||||
color: "transparent"
|
|
||||||
radius: parent.radius + 2
|
|
||||||
border.color: Qt.rgba(0, 0, 0, 0.08)
|
|
||||||
border.width: 1
|
|
||||||
z: -2
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: shadowLayer3
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
color: "transparent"
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
|
||||||
border.width: 1
|
|
||||||
radius: parent.radius
|
|
||||||
z: -1
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
radius: parent.radius
|
|
||||||
visible: notificationData && notificationData.urgency === NotificationUrgency.Critical
|
|
||||||
opacity: 1
|
|
||||||
|
|
||||||
gradient: Gradient {
|
|
||||||
orientation: Gradient.Horizontal
|
|
||||||
|
|
||||||
GradientStop {
|
|
||||||
position: 0
|
|
||||||
color: Theme.primary
|
|
||||||
}
|
|
||||||
|
|
||||||
GradientStop {
|
|
||||||
position: 0.02
|
|
||||||
color: Theme.primary
|
|
||||||
}
|
|
||||||
|
|
||||||
GradientStop {
|
|
||||||
position: 0.021
|
|
||||||
color: "transparent"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: notificationContent
|
|
||||||
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.topMargin: 12
|
|
||||||
anchors.leftMargin: 16
|
|
||||||
anchors.rightMargin: 56
|
|
||||||
height: 98
|
|
||||||
|
|
||||||
DankCircularImage {
|
|
||||||
id: iconContainer
|
|
||||||
|
|
||||||
readonly property bool hasNotificationImage: notificationData && notificationData.image && notificationData.image !== ""
|
|
||||||
|
|
||||||
width: 63
|
|
||||||
height: 63
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
imageSource: {
|
|
||||||
if (!notificationData)
|
|
||||||
return ""
|
|
||||||
|
|
||||||
if (hasNotificationImage)
|
|
||||||
return notificationData.cleanImage || ""
|
|
||||||
|
|
||||||
if (notificationData.appIcon) {
|
|
||||||
const appIcon = notificationData.appIcon
|
|
||||||
if (appIcon.startsWith("file://") || appIcon.startsWith("http://") || appIcon.startsWith("https://"))
|
|
||||||
return appIcon
|
|
||||||
|
|
||||||
return Quickshell.iconPath(appIcon, true)
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
hasImage: hasNotificationImage
|
|
||||||
fallbackIcon: notificationData?.appIcon || "notifications"
|
|
||||||
fallbackText: {
|
|
||||||
if (hasNotificationImage || (notificationData?.appIcon && notificationData.appIcon !== ""))
|
|
||||||
return ""
|
|
||||||
const appName = notificationData?.appName || "?"
|
|
||||||
return appName.charAt(0).toUpperCase()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: textContainer
|
|
||||||
|
|
||||||
anchors.left: iconContainer.right
|
|
||||||
anchors.leftMargin: 12
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: 0
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.bottomMargin: 8
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: -2
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width
|
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
width: parent.width
|
|
||||||
text: {
|
|
||||||
if (!notificationData)
|
|
||||||
return ""
|
|
||||||
|
|
||||||
const appName = notificationData.appName || ""
|
|
||||||
const timeStr = notificationData.timeStr || ""
|
|
||||||
if (timeStr.length > 0)
|
|
||||||
return appName + " • " + timeStr
|
|
||||||
else
|
|
||||||
return appName
|
|
||||||
}
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
font.weight: Font.Medium
|
|
||||||
elide: Text.ElideRight
|
|
||||||
maximumLineCount: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: notificationData ? (notificationData.summary || "") : ""
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
width: parent.width
|
|
||||||
elide: Text.ElideRight
|
|
||||||
maximumLineCount: 1
|
|
||||||
visible: text.length > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: notificationData ? (notificationData.htmlBody || "") : ""
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
width: parent.width
|
|
||||||
elide: Text.ElideRight
|
|
||||||
maximumLineCount: 2
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
visible: text.length > 0
|
|
||||||
linkColor: Theme.primary
|
|
||||||
onLinkActivated: link => {
|
|
||||||
return Qt.openUrlExternally(link)
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: Qt.NoButton
|
|
||||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
id: closeButton
|
|
||||||
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: 12
|
|
||||||
anchors.rightMargin: 16
|
|
||||||
iconName: "close"
|
|
||||||
iconSize: 18
|
|
||||||
buttonSize: 28
|
|
||||||
z: 15
|
|
||||||
onClicked: {
|
|
||||||
if (notificationData && !win.exiting)
|
|
||||||
notificationData.popup = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.right: clearButton.left
|
|
||||||
anchors.rightMargin: 8
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.bottomMargin: 8
|
|
||||||
spacing: 8
|
|
||||||
z: 20
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: notificationData ? (notificationData.actions || []) : []
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
property bool isHovered: false
|
|
||||||
|
|
||||||
width: Math.max(actionText.implicitWidth + 12, 50)
|
|
||||||
height: 24
|
|
||||||
radius: 4
|
|
||||||
color: isHovered ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1) : "transparent"
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: actionText
|
|
||||||
|
|
||||||
text: modelData.text || "View"
|
|
||||||
color: parent.isHovered ? Theme.primary : Theme.surfaceVariantText
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.centerIn: parent
|
|
||||||
elide: Text.ElideRight
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
acceptedButtons: Qt.LeftButton
|
|
||||||
onEntered: parent.isHovered = true
|
|
||||||
onExited: parent.isHovered = false
|
|
||||||
onClicked: {
|
|
||||||
if (modelData && modelData.invoke)
|
|
||||||
modelData.invoke()
|
|
||||||
|
|
||||||
if (notificationData && !win.exiting)
|
|
||||||
notificationData.popup = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: clearButton
|
|
||||||
|
|
||||||
property bool isHovered: false
|
|
||||||
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: 16
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.bottomMargin: 8
|
|
||||||
width: Math.max(clearText.implicitWidth + 12, 50)
|
|
||||||
height: 24
|
|
||||||
radius: 4
|
|
||||||
color: isHovered ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1) : "transparent"
|
|
||||||
z: 20
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: clearText
|
|
||||||
|
|
||||||
text: "Clear"
|
|
||||||
color: clearButton.isHovered ? Theme.primary : Theme.surfaceVariantText
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
acceptedButtons: Qt.LeftButton
|
|
||||||
onEntered: clearButton.isHovered = true
|
|
||||||
onExited: clearButton.isHovered = false
|
|
||||||
onClicked: {
|
|
||||||
if (notificationData && !win.exiting)
|
|
||||||
NotificationService.dismissNotification(notificationData)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: cardHoverArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
acceptedButtons: Qt.LeftButton
|
|
||||||
propagateComposedEvents: true
|
|
||||||
z: -1
|
|
||||||
onEntered: {
|
|
||||||
if (notificationData && notificationData.timer)
|
|
||||||
notificationData.timer.stop()
|
|
||||||
}
|
|
||||||
onExited: {
|
|
||||||
if (notificationData && notificationData.popup && notificationData.timer)
|
|
||||||
notificationData.timer.restart()
|
|
||||||
}
|
|
||||||
onClicked: {
|
|
||||||
if (notificationData && !win.exiting)
|
|
||||||
notificationData.popup = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
transform: Translate {
|
|
||||||
id: tx
|
|
||||||
|
|
||||||
x: Anims.slidePx
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
id: enterX
|
|
||||||
|
|
||||||
target: tx
|
|
||||||
property: "x"
|
|
||||||
from: Anims.slidePx
|
|
||||||
to: 0
|
|
||||||
duration: Anims.durMed
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Anims.emphasizedDecel
|
|
||||||
onStopped: {
|
|
||||||
if (!win.exiting && !win._isDestroying && Math.abs(tx.x) < 0.5) {
|
|
||||||
win.entered()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ParallelAnimation {
|
|
||||||
id: exitAnim
|
|
||||||
|
|
||||||
onStopped: finalizeExit("animStopped")
|
|
||||||
|
|
||||||
PropertyAnimation {
|
|
||||||
target: tx
|
|
||||||
property: "x"
|
|
||||||
from: 0
|
|
||||||
to: Anims.slidePx
|
|
||||||
duration: Anims.durShort
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Anims.emphasizedAccel
|
|
||||||
}
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
target: content
|
|
||||||
property: "opacity"
|
|
||||||
from: 1
|
|
||||||
to: 0
|
|
||||||
duration: Anims.durShort
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Anims.standardAccel
|
|
||||||
}
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
target: content
|
|
||||||
property: "scale"
|
|
||||||
from: 1
|
|
||||||
to: 0.98
|
|
||||||
duration: Anims.durShort
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Anims.emphasizedAccel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
id: wrapperConn
|
|
||||||
|
|
||||||
function onPopupChanged() {
|
|
||||||
if (!win.notificationData || win._isDestroying)
|
|
||||||
return
|
|
||||||
|
|
||||||
if (!win.notificationData.popup && !win.exiting)
|
|
||||||
startExit()
|
|
||||||
}
|
|
||||||
|
|
||||||
target: win.notificationData || null
|
|
||||||
ignoreUnknownSignals: true
|
|
||||||
enabled: !win._isDestroying
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
id: notificationConn
|
|
||||||
|
|
||||||
function onDropped() {
|
|
||||||
if (!win._isDestroying && !win.exiting)
|
|
||||||
forceExit()
|
|
||||||
}
|
|
||||||
|
|
||||||
target: (win.notificationData && win.notificationData.notification && win.notificationData.notification.Retainable) || null
|
|
||||||
ignoreUnknownSignals: true
|
|
||||||
enabled: !win._isDestroying
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: enterDelay
|
|
||||||
|
|
||||||
interval: 160
|
|
||||||
repeat: false
|
|
||||||
onTriggered: {
|
|
||||||
if (notificationData && notificationData.timer && !exiting && !_isDestroying)
|
|
||||||
notificationData.timer.start()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: exitWatchdog
|
|
||||||
|
|
||||||
interval: 600
|
|
||||||
repeat: false
|
|
||||||
onTriggered: finalizeExit("watchdog")
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on screenY {
|
|
||||||
id: screenYAnim
|
|
||||||
|
|
||||||
enabled: !exiting && !_isDestroying
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Anims.durShort
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Anims.standardDecel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,271 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: manager
|
|
||||||
|
|
||||||
property var modelData
|
|
||||||
property int topMargin: 0
|
|
||||||
property int baseNotificationHeight: 120
|
|
||||||
property int maxTargetNotifications: 4
|
|
||||||
property var popupWindows: [] // strong refs to windows (live until exitFinished)
|
|
||||||
property var destroyingWindows: new Set()
|
|
||||||
property Component popupComponent
|
|
||||||
|
|
||||||
popupComponent: Component {
|
|
||||||
NotificationPopup {
|
|
||||||
onEntered: manager._onPopupEntered(this)
|
|
||||||
onExitFinished: manager._onPopupExitFinished(this)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
property Connections notificationConnections
|
|
||||||
|
|
||||||
notificationConnections: Connections {
|
|
||||||
function onVisibleNotificationsChanged() {
|
|
||||||
manager._sync(NotificationService.visibleNotifications)
|
|
||||||
}
|
|
||||||
|
|
||||||
target: NotificationService
|
|
||||||
}
|
|
||||||
|
|
||||||
property Timer sweeper
|
|
||||||
|
|
||||||
sweeper: Timer {
|
|
||||||
interval: 500
|
|
||||||
running: false
|
|
||||||
repeat: true
|
|
||||||
onTriggered: {
|
|
||||||
const toRemove = []
|
|
||||||
for (const p of popupWindows) {
|
|
||||||
if (!p) {
|
|
||||||
toRemove.push(p)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
const isZombie = p.status === Component.Null || (!p.visible && !p.exiting) || (!p.notificationData && !p._isDestroying) || (!p.hasValidData && !p._isDestroying)
|
|
||||||
if (isZombie) {
|
|
||||||
toRemove.push(p)
|
|
||||||
if (p.forceExit) {
|
|
||||||
p.forceExit()
|
|
||||||
} else if (p.destroy) {
|
|
||||||
try {
|
|
||||||
p.destroy()
|
|
||||||
} catch (e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (toRemove.length) {
|
|
||||||
popupWindows = popupWindows.filter(p => toRemove.indexOf(p) === -1)
|
|
||||||
const survivors = _active().sort((a, b) => a.screenY - b.screenY)
|
|
||||||
for (let k = 0; k < survivors.length; ++k) {
|
|
||||||
survivors[k].screenY = topMargin + k * baseNotificationHeight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (popupWindows.length === 0) {
|
|
||||||
sweeper.stop()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _hasWindowFor(w) {
|
|
||||||
return popupWindows.some(p => p && p.notificationData === w && !p._isDestroying && p.status !== Component.Null)
|
|
||||||
}
|
|
||||||
|
|
||||||
function _isValidWindow(p) {
|
|
||||||
return p && p.status !== Component.Null && !p._isDestroying && p.hasValidData
|
|
||||||
}
|
|
||||||
|
|
||||||
function _canMakeRoomFor(wrapper) {
|
|
||||||
const activeWindows = _active()
|
|
||||||
if (activeWindows.length < maxTargetNotifications) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if (!wrapper || !wrapper.notification) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const incomingUrgency = wrapper.notification.urgency || 0
|
|
||||||
for (const p of activeWindows) {
|
|
||||||
if (!p.notificationData || !p.notificationData.notification) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
const existingUrgency = p.notificationData.notification.urgency || 0
|
|
||||||
if (existingUrgency < incomingUrgency) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if (existingUrgency === incomingUrgency) {
|
|
||||||
const timer = p.notificationData.timer
|
|
||||||
if (timer && !timer.running) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
function _makeRoomForNew(wrapper) {
|
|
||||||
const activeWindows = _active()
|
|
||||||
if (activeWindows.length < maxTargetNotifications) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const toRemove = _selectPopupToRemove(activeWindows, wrapper)
|
|
||||||
if (toRemove && !toRemove.exiting) {
|
|
||||||
toRemove.notificationData.removedByLimit = true
|
|
||||||
toRemove.notificationData.popup = false
|
|
||||||
if (toRemove.notificationData.timer) {
|
|
||||||
toRemove.notificationData.timer.stop()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _selectPopupToRemove(activeWindows, incomingWrapper) {
|
|
||||||
const incomingUrgency = (incomingWrapper && incomingWrapper.notification) ? incomingWrapper.notification.urgency || 0 : 0
|
|
||||||
const sortedWindows = activeWindows.slice().sort((a, b) => {
|
|
||||||
const aUrgency = (a.notificationData && a.notificationData.notification) ? a.notificationData.notification.urgency || 0 : 0
|
|
||||||
const bUrgency = (b.notificationData && b.notificationData.notification) ? b.notificationData.notification.urgency || 0 : 0
|
|
||||||
if (aUrgency !== bUrgency) {
|
|
||||||
return aUrgency - bUrgency
|
|
||||||
}
|
|
||||||
const aTimer = a.notificationData && a.notificationData.timer
|
|
||||||
const bTimer = b.notificationData && b.notificationData.timer
|
|
||||||
const aRunning = aTimer && aTimer.running
|
|
||||||
const bRunning = bTimer && bTimer.running
|
|
||||||
if (aRunning !== bRunning) {
|
|
||||||
return aRunning ? 1 : -1
|
|
||||||
}
|
|
||||||
return b.screenY - a.screenY
|
|
||||||
})
|
|
||||||
return sortedWindows[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
function _sync(newWrappers) {
|
|
||||||
for (const w of newWrappers) {
|
|
||||||
if (w && !_hasWindowFor(w)) {
|
|
||||||
insertNewestAtTop(w)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (const p of popupWindows.slice()) {
|
|
||||||
if (!_isValidWindow(p)) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if (p.notificationData && newWrappers.indexOf(p.notificationData) === -1 && !p.exiting) {
|
|
||||||
p.notificationData.removedByLimit = true
|
|
||||||
p.notificationData.popup = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function insertNewestAtTop(wrapper) {
|
|
||||||
if (!wrapper) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for (const p of popupWindows) {
|
|
||||||
if (!_isValidWindow(p)) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if (p.exiting) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
p.screenY = p.screenY + baseNotificationHeight
|
|
||||||
}
|
|
||||||
const notificationId = wrapper && wrapper.notification ? wrapper.notification.id : ""
|
|
||||||
const win = popupComponent.createObject(null, {
|
|
||||||
"notificationData": wrapper,
|
|
||||||
"notificationId": notificationId,
|
|
||||||
"screenY": topMargin,
|
|
||||||
"screen": manager.modelData
|
|
||||||
})
|
|
||||||
if (!win) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!win.hasValidData) {
|
|
||||||
win.destroy()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
popupWindows.push(win)
|
|
||||||
if (!sweeper.running) {
|
|
||||||
sweeper.start()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _active() {
|
|
||||||
return popupWindows.filter(p => _isValidWindow(p) && p.notificationData && p.notificationData.popup && !p.exiting)
|
|
||||||
}
|
|
||||||
|
|
||||||
function _bottom() {
|
|
||||||
let b = null
|
|
||||||
let maxY = -1
|
|
||||||
for (const p of _active()) {
|
|
||||||
if (p.screenY > maxY) {
|
|
||||||
maxY = p.screenY
|
|
||||||
b = p
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return b
|
|
||||||
}
|
|
||||||
|
|
||||||
function _onPopupEntered(p) {}
|
|
||||||
|
|
||||||
function _onPopupExitFinished(p) {
|
|
||||||
if (!p) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const windowId = p.toString()
|
|
||||||
if (destroyingWindows.has(windowId)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
destroyingWindows.add(windowId)
|
|
||||||
const i = popupWindows.indexOf(p)
|
|
||||||
if (i !== -1) {
|
|
||||||
popupWindows.splice(i, 1)
|
|
||||||
popupWindows = popupWindows.slice()
|
|
||||||
}
|
|
||||||
if (NotificationService.releaseWrapper && p.notificationData) {
|
|
||||||
NotificationService.releaseWrapper(p.notificationData)
|
|
||||||
}
|
|
||||||
Qt.callLater(() => {
|
|
||||||
if (p && p.destroy) {
|
|
||||||
try {
|
|
||||||
p.destroy()
|
|
||||||
} catch (e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Qt.callLater(() => destroyingWindows.delete(windowId))
|
|
||||||
})
|
|
||||||
const survivors = _active().sort((a, b) => a.screenY - b.screenY)
|
|
||||||
for (let k = 0; k < survivors.length; ++k) {
|
|
||||||
survivors[k].screenY = topMargin + k * baseNotificationHeight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function cleanupAllWindows() {
|
|
||||||
sweeper.stop()
|
|
||||||
for (const p of popupWindows.slice()) {
|
|
||||||
if (p) {
|
|
||||||
try {
|
|
||||||
if (p.forceExit) {
|
|
||||||
p.forceExit()
|
|
||||||
} else if (p.destroy) {
|
|
||||||
p.destroy()
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
popupWindows = []
|
|
||||||
destroyingWindows.clear()
|
|
||||||
}
|
|
||||||
|
|
||||||
onPopupWindowsChanged: {
|
|
||||||
if (popupWindows.length > 0 && !sweeper.running) {
|
|
||||||
sweeper.start()
|
|
||||||
} else if (popupWindows.length === 0 && sweeper.running) {
|
|
||||||
sweeper.stop()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
DankOSD {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
osdWidth: Math.min(260, Screen.width - Theme.spacingM * 2)
|
|
||||||
osdHeight: 40 + Theme.spacingS * 2
|
|
||||||
autoHideInterval: 3000
|
|
||||||
enableMouseInteraction: true
|
|
||||||
|
|
||||||
property var brightnessDebounceTimer: Timer {
|
|
||||||
property int pendingValue: 0
|
|
||||||
|
|
||||||
interval: {
|
|
||||||
const deviceInfo = DisplayService.getCurrentDeviceInfo()
|
|
||||||
return (deviceInfo && deviceInfo.class === "ddc") ? 200 : 50
|
|
||||||
}
|
|
||||||
repeat: false
|
|
||||||
onTriggered: {
|
|
||||||
DisplayService.setBrightnessInternal(pendingValue, DisplayService.lastIpcDevice)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: DisplayService
|
|
||||||
function onBrightnessChanged() {
|
|
||||||
root.show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
content: Item {
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
Item {
|
|
||||||
property int gap: Theme.spacingS
|
|
||||||
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width - Theme.spacingS * 2
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: Theme.iconSize
|
|
||||||
height: Theme.iconSize
|
|
||||||
radius: Theme.iconSize / 2
|
|
||||||
color: "transparent"
|
|
||||||
x: parent.gap
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: {
|
|
||||||
const deviceInfo = DisplayService.getCurrentDeviceInfo()
|
|
||||||
if (!deviceInfo || deviceInfo.class === "backlight" || deviceInfo.class === "ddc") {
|
|
||||||
return "brightness_medium"
|
|
||||||
} else if (deviceInfo.name.includes("kbd")) {
|
|
||||||
return "keyboard"
|
|
||||||
} else {
|
|
||||||
return "lightbulb"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankSlider {
|
|
||||||
id: brightnessSlider
|
|
||||||
|
|
||||||
width: parent.width - Theme.iconSize - parent.gap * 3
|
|
||||||
height: 40
|
|
||||||
x: parent.gap * 2 + Theme.iconSize
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
minimum: 1
|
|
||||||
maximum: 100
|
|
||||||
enabled: DisplayService.brightnessAvailable
|
|
||||||
showValue: true
|
|
||||||
unit: "%"
|
|
||||||
thumbOutlineColor: Theme.surfaceContainer
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (DisplayService.brightnessAvailable) {
|
|
||||||
value = DisplayService.brightnessLevel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onSliderValueChanged: newValue => {
|
|
||||||
if (DisplayService.brightnessAvailable) {
|
|
||||||
root.brightnessDebounceTimer.pendingValue = newValue
|
|
||||||
root.brightnessDebounceTimer.restart()
|
|
||||||
resetHideTimer()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onContainsMouseChanged: {
|
|
||||||
setChildHovered(containsMouse)
|
|
||||||
}
|
|
||||||
|
|
||||||
onSliderDragFinished: finalValue => {
|
|
||||||
if (DisplayService.brightnessAvailable) {
|
|
||||||
root.brightnessDebounceTimer.stop()
|
|
||||||
DisplayService.setBrightnessInternal(finalValue, DisplayService.lastIpcDevice)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: DisplayService
|
|
||||||
|
|
||||||
function onBrightnessChanged() {
|
|
||||||
if (!brightnessSlider.pressed) {
|
|
||||||
brightnessSlider.value = DisplayService.brightnessLevel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onDeviceSwitched() {
|
|
||||||
if (!brightnessSlider.pressed) {
|
|
||||||
brightnessSlider.value = DisplayService.brightnessLevel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onOsdShown: {
|
|
||||||
if (DisplayService.brightnessAvailable && contentLoader.item) {
|
|
||||||
const slider = contentLoader.item.children[0].children[1]
|
|
||||||
if (slider) {
|
|
||||||
slider.value = DisplayService.brightnessLevel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
DankOSD {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
osdWidth: Math.min(260, Screen.width - Theme.spacingM * 2)
|
|
||||||
osdHeight: 40 + Theme.spacingS * 2
|
|
||||||
autoHideInterval: 3000
|
|
||||||
enableMouseInteraction: true
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: AudioService
|
|
||||||
|
|
||||||
function onVolumeChanged() {
|
|
||||||
root.show()
|
|
||||||
}
|
|
||||||
|
|
||||||
function onSinkChanged() {
|
|
||||||
if (root.shouldBeVisible) {
|
|
||||||
root.show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
content: Item {
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
Item {
|
|
||||||
property int gap: Theme.spacingS
|
|
||||||
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width - Theme.spacingS * 2
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: Theme.iconSize
|
|
||||||
height: Theme.iconSize
|
|
||||||
radius: Theme.iconSize / 2
|
|
||||||
color: "transparent"
|
|
||||||
x: parent.gap
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: AudioService.sink && AudioService.sink.audio && AudioService.sink.audio.muted ? "volume_off" : "volume_up"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: muteButton.containsMouse ? Theme.primary : Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: muteButton
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
AudioService.toggleMute()
|
|
||||||
}
|
|
||||||
onContainsMouseChanged: {
|
|
||||||
setChildHovered(containsMouse || volumeSlider.containsMouse)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankSlider {
|
|
||||||
id: volumeSlider
|
|
||||||
|
|
||||||
readonly property real actualVolumePercent: AudioService.sink && AudioService.sink.audio ? Math.round(AudioService.sink.audio.volume * 100) : 0
|
|
||||||
readonly property real displayPercent: actualVolumePercent
|
|
||||||
|
|
||||||
width: parent.width - Theme.iconSize - parent.gap * 3
|
|
||||||
height: 40
|
|
||||||
x: parent.gap * 2 + Theme.iconSize
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
minimum: 0
|
|
||||||
maximum: 100
|
|
||||||
enabled: AudioService.sink && AudioService.sink.audio
|
|
||||||
showValue: true
|
|
||||||
unit: "%"
|
|
||||||
thumbOutlineColor: Theme.surfaceContainer
|
|
||||||
valueOverride: displayPercent
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (AudioService.sink && AudioService.sink.audio) {
|
|
||||||
value = Math.min(100, Math.round(AudioService.sink.audio.volume * 100))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onSliderValueChanged: newValue => {
|
|
||||||
if (AudioService.sink && AudioService.sink.audio) {
|
|
||||||
AudioService.sink.audio.volume = newValue / 100
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onContainsMouseChanged: {
|
|
||||||
setChildHovered(containsMouse || muteButton.containsMouse)
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: AudioService.sink && AudioService.sink.audio ? AudioService.sink.audio : null
|
|
||||||
|
|
||||||
function onVolumeChanged() {
|
|
||||||
if (volumeSlider && !volumeSlider.pressed) {
|
|
||||||
volumeSlider.value = Math.min(100, Math.round(AudioService.sink.audio.volume * 100))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onOsdShown: {
|
|
||||||
if (AudioService.sink && AudioService.sink.audio && contentLoader.item) {
|
|
||||||
const slider = contentLoader.item.children[0].children[1]
|
|
||||||
if (slider) {
|
|
||||||
slider.value = Math.min(100, Math.round(AudioService.sink.audio.volume * 100))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,535 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Effects
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: aboutTab
|
|
||||||
|
|
||||||
property bool isHyprland: CompositorService.isHyprland
|
|
||||||
|
|
||||||
DankFlickable {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: Theme.spacingL
|
|
||||||
clip: true
|
|
||||||
contentHeight: mainColumn.height
|
|
||||||
contentWidth: width
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: mainColumn
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingXL
|
|
||||||
|
|
||||||
// ASCII Art Header
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: asciiSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: asciiSection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: asciiText.implicitHeight
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: asciiText
|
|
||||||
|
|
||||||
text: "██████╗ █████╗ ███╗ ██╗██╗ ██╗\n██╔══██╗██╔══██╗████╗ ██║██║ ██╔╝\n██║ ██║███████║██╔██╗ ██║█████╔╝ \n██║ ██║██╔══██║██║╚██╗██║██╔═██╗ \n██████╔╝██║ ██║██║ ╚████║██║ ██╗\n╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝"
|
|
||||||
isMonospace: true
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "DankMaterialShell"
|
|
||||||
font.pixelSize: Theme.fontSizeXLarge
|
|
||||||
font.weight: Font.Bold
|
|
||||||
color: Theme.surfaceText
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: communityIcons
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
height: 24
|
|
||||||
width: {
|
|
||||||
if (isHyprland) {
|
|
||||||
return compositorButton.width + discordButton.width + Theme.spacingM + redditButton.width + Theme.spacingM
|
|
||||||
} else {
|
|
||||||
return compositorButton.width + matrixButton.width + 4 + discordButton.width + Theme.spacingM + redditButton.width + Theme.spacingM
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Compositor logo (Niri or Hyprland)
|
|
||||||
Item {
|
|
||||||
id: compositorButton
|
|
||||||
width: 24
|
|
||||||
height: 24
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.verticalCenterOffset: -2
|
|
||||||
x: 0
|
|
||||||
|
|
||||||
property bool hovered: false
|
|
||||||
property string tooltipText: isHyprland ? "Hyprland Website" : "niri GitHub"
|
|
||||||
|
|
||||||
Image {
|
|
||||||
anchors.fill: parent
|
|
||||||
source: Qt.resolvedUrl(".").toString().replace(
|
|
||||||
"file://", "").replace(
|
|
||||||
"/Modules/Settings/",
|
|
||||||
"") + (isHyprland ? "/assets/hyprland.svg" : "/assets/niri.svg")
|
|
||||||
sourceSize: Qt.size(24, 24)
|
|
||||||
smooth: true
|
|
||||||
fillMode: Image.PreserveAspectFit
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
hoverEnabled: true
|
|
||||||
onEntered: parent.hovered = true
|
|
||||||
onExited: parent.hovered = false
|
|
||||||
onClicked: Qt.openUrlExternally(
|
|
||||||
isHyprland ? "https://hypr.land" : "https://github.com/YaLTeR/niri")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Matrix button (only for Niri)
|
|
||||||
Item {
|
|
||||||
id: matrixButton
|
|
||||||
width: 30
|
|
||||||
height: 24
|
|
||||||
x: compositorButton.x + compositorButton.width + 4
|
|
||||||
visible: !isHyprland
|
|
||||||
|
|
||||||
property bool hovered: false
|
|
||||||
property string tooltipText: "niri Matrix Chat"
|
|
||||||
|
|
||||||
Image {
|
|
||||||
anchors.fill: parent
|
|
||||||
source: Qt.resolvedUrl(".").toString().replace(
|
|
||||||
"file://", "").replace(
|
|
||||||
"/Modules/Settings/",
|
|
||||||
"") + "/assets/matrix-logo-white.svg"
|
|
||||||
sourceSize: Qt.size(28, 18)
|
|
||||||
smooth: true
|
|
||||||
fillMode: Image.PreserveAspectFit
|
|
||||||
layer.enabled: true
|
|
||||||
|
|
||||||
layer.effect: MultiEffect {
|
|
||||||
colorization: 1
|
|
||||||
colorizationColor: Theme.surfaceText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
hoverEnabled: true
|
|
||||||
onEntered: parent.hovered = true
|
|
||||||
onExited: parent.hovered = false
|
|
||||||
onClicked: Qt.openUrlExternally(
|
|
||||||
"https://matrix.to/#/#niri:matrix.org")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Discord button
|
|
||||||
Item {
|
|
||||||
id: discordButton
|
|
||||||
width: 20
|
|
||||||
height: 20
|
|
||||||
x: isHyprland ? compositorButton.x + compositorButton.width + Theme.spacingM : matrixButton.x + matrixButton.width + Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
property bool hovered: false
|
|
||||||
property string tooltipText: isHyprland ? "Hyprland Discord Server" : "niri Discord Server"
|
|
||||||
|
|
||||||
Image {
|
|
||||||
anchors.fill: parent
|
|
||||||
source: Qt.resolvedUrl(".").toString().replace(
|
|
||||||
"file://", "").replace(
|
|
||||||
"/Modules/Settings/",
|
|
||||||
"") + "/assets/discord.svg"
|
|
||||||
sourceSize: Qt.size(20, 20)
|
|
||||||
smooth: true
|
|
||||||
fillMode: Image.PreserveAspectFit
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
hoverEnabled: true
|
|
||||||
onEntered: parent.hovered = true
|
|
||||||
onExited: parent.hovered = false
|
|
||||||
onClicked: Qt.openUrlExternally(
|
|
||||||
isHyprland ? "https://discord.com/invite/hQ9XvMUjjr" : "https://discord.gg/vT8Sfjy7sx")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reddit button
|
|
||||||
Item {
|
|
||||||
id: redditButton
|
|
||||||
width: 20
|
|
||||||
height: 20
|
|
||||||
x: discordButton.x + discordButton.width + Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
property bool hovered: false
|
|
||||||
property string tooltipText: isHyprland ? "r/hyprland Subreddit" : "r/niri Subreddit"
|
|
||||||
|
|
||||||
Image {
|
|
||||||
anchors.fill: parent
|
|
||||||
source: Qt.resolvedUrl(".").toString().replace(
|
|
||||||
"file://", "").replace(
|
|
||||||
"/Modules/Settings/",
|
|
||||||
"") + "/assets/reddit.svg"
|
|
||||||
sourceSize: Qt.size(20, 20)
|
|
||||||
smooth: true
|
|
||||||
fillMode: Image.PreserveAspectFit
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
hoverEnabled: true
|
|
||||||
onEntered: parent.hovered = true
|
|
||||||
onExited: parent.hovered = false
|
|
||||||
onClicked: Qt.openUrlExternally(
|
|
||||||
isHyprland ? "https://reddit.com/r/hyprland" : "https://reddit.com/r/niri")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Project Information
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: projectSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: projectSection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "info"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "About"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: `DankMaterialShell is a modern desktop with a <a href="https://m3.material.io/" style="text-decoration:none; color:${Theme.primary};">material</a>-ish design.
|
|
||||||
<br /><br/>The goal is to provide a high level of functionality and customization so that it can be a suitable replacement for complete desktop environments like Gnome, KDE, or Cosmic.
|
|
||||||
`
|
|
||||||
textFormat: Text.RichText
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
linkColor: Theme.primary
|
|
||||||
onLinkActivated: url => Qt.openUrlExternally(url)
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
width: parent.width
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
||||||
acceptedButtons: Qt.NoButton
|
|
||||||
propagateComposedEvents: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Technical Details
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: techSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: techSection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "code"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Technical Details"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Grid {
|
|
||||||
width: parent.width
|
|
||||||
columns: 2
|
|
||||||
columnSpacing: Theme.spacingL
|
|
||||||
rowSpacing: Theme.spacingS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Framework:"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: `<a href="https://quickshell.org" style="text-decoration:none; color:${Theme.primary};">Quickshell</a>`
|
|
||||||
linkColor: Theme.primary
|
|
||||||
textFormat: Text.RichText
|
|
||||||
onLinkActivated: url => Qt.openUrlExternally(url)
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
||||||
acceptedButtons: Qt.NoButton
|
|
||||||
propagateComposedEvents: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Language:"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "QML (Qt Modeling Language)"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Compositor:"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: 4
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: `<a href="https://github.com/YaLTeR/niri" style="text-decoration:none; color:${Theme.primary};">niri</a>`
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
linkColor: Theme.primary
|
|
||||||
textFormat: Text.RichText
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
onLinkActivated: url => Qt.openUrlExternally(url)
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
||||||
acceptedButtons: Qt.NoButton
|
|
||||||
propagateComposedEvents: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "&"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: `<a href="https://github.com/hyprwm/Hyprland" style="text-decoration:none; color:${Theme.primary};">hyprland</a>`
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
linkColor: Theme.primary
|
|
||||||
textFormat: Text.RichText
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
onLinkActivated: url => Qt.openUrlExternally(url)
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
||||||
acceptedButtons: Qt.NoButton
|
|
||||||
propagateComposedEvents: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Github:"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: 4
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: `<a href="https://github.com/AvengeMedia/DankMaterialShell" style="text-decoration:none; color:${Theme.primary};">DankMaterialShell</a>`
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
linkColor: Theme.primary
|
|
||||||
textFormat: Text.RichText
|
|
||||||
onLinkActivated: url => Qt.openUrlExternally(url)
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
||||||
acceptedButtons: Qt.NoButton
|
|
||||||
propagateComposedEvents: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "- Support Us With a Star ⭐"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "System Monitoring:"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: 4
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: `<a href="https://github.com/AvengeMedia/dgop" style="text-decoration:none; color:${Theme.primary};">dgop</a>`
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
linkColor: Theme.primary
|
|
||||||
textFormat: Text.RichText
|
|
||||||
onLinkActivated: url => Qt.openUrlExternally(url)
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
||||||
acceptedButtons: Qt.NoButton
|
|
||||||
propagateComposedEvents: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "- Stateless System Monitoring"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Community tooltip - positioned absolutely above everything
|
|
||||||
Rectangle {
|
|
||||||
id: communityTooltip
|
|
||||||
parent: aboutTab
|
|
||||||
z: 1000
|
|
||||||
|
|
||||||
property var hoveredButton: {
|
|
||||||
if (compositorButton.hovered) return compositorButton
|
|
||||||
if (matrixButton.visible && matrixButton.hovered) return matrixButton
|
|
||||||
if (discordButton.hovered) return discordButton
|
|
||||||
if (redditButton.hovered) return redditButton
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
property string tooltipText: hoveredButton ? hoveredButton.tooltipText : ""
|
|
||||||
|
|
||||||
visible: hoveredButton !== null && tooltipText !== ""
|
|
||||||
width: tooltipLabel.implicitWidth + 24
|
|
||||||
height: tooltipLabel.implicitHeight + 12
|
|
||||||
|
|
||||||
color: Theme.surfaceContainer
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.width: 1
|
|
||||||
border.color: Theme.outlineMedium
|
|
||||||
|
|
||||||
x: hoveredButton ? hoveredButton.mapToItem(aboutTab, hoveredButton.width / 2, 0).x - width / 2 : 0
|
|
||||||
y: hoveredButton ? communityIcons.mapToItem(aboutTab, 0, 0).y - height - 8 : 0
|
|
||||||
|
|
||||||
layer.enabled: true
|
|
||||||
layer.effect: MultiEffect {
|
|
||||||
shadowEnabled: true
|
|
||||||
shadowOpacity: 0.15
|
|
||||||
shadowVerticalOffset: 2
|
|
||||||
shadowBlur: 0.5
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: tooltipLabel
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: communityTooltip.tooltipText
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,369 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: displaysTab
|
|
||||||
|
|
||||||
property var variantComponents: [{
|
|
||||||
"id": "topBar",
|
|
||||||
"name": "Top Bar",
|
|
||||||
"description": "System bar with widgets and system information",
|
|
||||||
"icon": "toolbar"
|
|
||||||
}, {
|
|
||||||
"id": "dock",
|
|
||||||
"name": "Application Dock",
|
|
||||||
"description": "Bottom dock for pinned and running applications",
|
|
||||||
"icon": "dock"
|
|
||||||
}, {
|
|
||||||
"id": "notifications",
|
|
||||||
"name": "Notification Popups",
|
|
||||||
"description": "Notification toast popups",
|
|
||||||
"icon": "notifications"
|
|
||||||
}, {
|
|
||||||
"id": "wallpaper",
|
|
||||||
"name": "Wallpaper",
|
|
||||||
"description": "Desktop background images",
|
|
||||||
"icon": "wallpaper"
|
|
||||||
}, {
|
|
||||||
"id": "osd",
|
|
||||||
"name": "On-Screen Displays",
|
|
||||||
"description": "Volume, brightness, and other system OSDs",
|
|
||||||
"icon": "picture_in_picture"
|
|
||||||
}, {
|
|
||||||
"id": "toast",
|
|
||||||
"name": "Toast Messages",
|
|
||||||
"description": "System toast notifications",
|
|
||||||
"icon": "campaign"
|
|
||||||
}, {
|
|
||||||
"id": "notepad",
|
|
||||||
"name": "Notepad Slideout",
|
|
||||||
"description": "Quick note-taking slideout panel",
|
|
||||||
"icon": "sticky_note_2"
|
|
||||||
}, {
|
|
||||||
"id": "systemTray",
|
|
||||||
"name": "System Tray",
|
|
||||||
"description": "System tray icons",
|
|
||||||
"icon": "notifications"
|
|
||||||
}]
|
|
||||||
|
|
||||||
function getScreenPreferences(componentId) {
|
|
||||||
return SettingsData.screenPreferences && SettingsData.screenPreferences[componentId] || ["all"];
|
|
||||||
}
|
|
||||||
|
|
||||||
function setScreenPreferences(componentId, screenNames) {
|
|
||||||
var prefs = SettingsData.screenPreferences || {
|
|
||||||
};
|
|
||||||
prefs[componentId] = screenNames;
|
|
||||||
SettingsData.setScreenPreferences(prefs);
|
|
||||||
}
|
|
||||||
|
|
||||||
DankFlickable {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: Theme.spacingL
|
|
||||||
anchors.bottomMargin: Theme.spacingS
|
|
||||||
clip: true
|
|
||||||
contentHeight: mainColumn.height
|
|
||||||
contentWidth: width
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: mainColumn
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingXL
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: screensInfoSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: screensInfoSection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "monitor"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width - Theme.iconSize - Theme.spacingM
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Connected Displays"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Configure which displays show shell components"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Available Screens (" + Quickshell.screens.length + ")"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: Quickshell.screens
|
|
||||||
|
|
||||||
delegate: Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: screenRow.implicitHeight + Theme.spacingS * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Theme.surfaceContainerHigh
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.3)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: screenRow
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingS
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "desktop_windows"
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width - Theme.iconSize - Theme.spacingM * 2
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingXS / 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData.name
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData.width + "×" + modelData.height
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "•"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData.model || "Unknown Model"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingL
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: displaysTab.variantComponents
|
|
||||||
|
|
||||||
delegate: StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: componentSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: componentSection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: modelData.icon
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width - Theme.iconSize - Theme.spacingM
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData.name
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData.description
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Show on screens:"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
property string componentId: modelData.id
|
|
||||||
property var selectedScreens: displaysTab.getScreenPreferences(componentId)
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
DankToggle {
|
|
||||||
width: parent.width
|
|
||||||
text: "All displays"
|
|
||||||
description: "Show on all connected displays"
|
|
||||||
checked: parent.selectedScreens.includes("all")
|
|
||||||
onToggled: (checked) => {
|
|
||||||
if (checked)
|
|
||||||
displaysTab.setScreenPreferences(parent.componentId, ["all"]);
|
|
||||||
else
|
|
||||||
displaysTab.setScreenPreferences(parent.componentId, []);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Theme.outline
|
|
||||||
opacity: 0.2
|
|
||||||
visible: !parent.selectedScreens.includes("all")
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
visible: !parent.selectedScreens.includes("all")
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: Quickshell.screens
|
|
||||||
|
|
||||||
delegate: DankToggle {
|
|
||||||
property string screenName: modelData.name
|
|
||||||
property string componentId: parent.parent.componentId
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
text: screenName
|
|
||||||
description: modelData.width + "×" + modelData.height + " • " + (modelData.model || "Unknown Model")
|
|
||||||
checked: {
|
|
||||||
var prefs = displaysTab.getScreenPreferences(componentId);
|
|
||||||
return !prefs.includes("all") && prefs.includes(screenName);
|
|
||||||
}
|
|
||||||
onToggled: (checked) => {
|
|
||||||
var currentPrefs = displaysTab.getScreenPreferences(componentId);
|
|
||||||
if (currentPrefs.includes("all"))
|
|
||||||
currentPrefs = [];
|
|
||||||
|
|
||||||
var newPrefs = currentPrefs.slice();
|
|
||||||
if (checked) {
|
|
||||||
if (!newPrefs.includes(screenName))
|
|
||||||
newPrefs.push(screenName);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
var index = newPrefs.indexOf(screenName);
|
|
||||||
if (index > -1)
|
|
||||||
newPrefs.splice(index, 1);
|
|
||||||
|
|
||||||
}
|
|
||||||
displaysTab.setScreenPreferences(componentId, newPrefs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,224 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: dockTab
|
|
||||||
|
|
||||||
DankFlickable {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: Theme.spacingL
|
|
||||||
clip: true
|
|
||||||
contentHeight: mainColumn.height
|
|
||||||
contentWidth: width
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: mainColumn
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingXL
|
|
||||||
|
|
||||||
// Enable Dock
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: enableDockSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: enableDockSection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "dock_to_bottom"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width - Theme.iconSize - Theme.spacingM
|
|
||||||
- enableToggle.width - Theme.spacingM
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Show Dock"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Display a dock at the bottom of the screen with pinned and running applications"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankToggle {
|
|
||||||
id: enableToggle
|
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
checked: SettingsData.showDock
|
|
||||||
onToggled: checked => {
|
|
||||||
SettingsData.setShowDock(checked)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Auto-hide Dock
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: autoHideSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
visible: SettingsData.showDock
|
|
||||||
opacity: visible ? 1 : 0
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: autoHideSection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "visibility_off"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width - Theme.iconSize - Theme.spacingM
|
|
||||||
- autoHideToggle.width - Theme.spacingM
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Auto-hide Dock"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Hide the dock when not in use and reveal it when hovering near the bottom of the screen"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankToggle {
|
|
||||||
id: autoHideToggle
|
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
checked: SettingsData.dockAutoHide
|
|
||||||
onToggled: checked => {
|
|
||||||
SettingsData.setDockAutoHide(checked)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dock Transparency Section
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: transparencySection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
visible: SettingsData.showDock
|
|
||||||
opacity: visible ? 1 : 0
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: transparencySection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "opacity"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Dock Transparency"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankSlider {
|
|
||||||
width: parent.width
|
|
||||||
height: 32
|
|
||||||
value: Math.round(SettingsData.dockTransparency * 100)
|
|
||||||
minimum: 0
|
|
||||||
maximum: 100
|
|
||||||
unit: "%"
|
|
||||||
showValue: true
|
|
||||||
wheelEnabled: false
|
|
||||||
onSliderValueChanged: newValue => {
|
|
||||||
SettingsData.setDockTransparency(
|
|
||||||
newValue / 100)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,302 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: recentAppsTab
|
|
||||||
|
|
||||||
DankFlickable {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: Theme.spacingL
|
|
||||||
clip: true
|
|
||||||
contentHeight: mainColumn.height
|
|
||||||
contentWidth: width
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: mainColumn
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingXL
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: launchPrefixSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: launchPrefixSection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "terminal"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Launch Prefix"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
width: parent.width
|
|
||||||
text: "Add a custom prefix to all application launches. This can be used for things like 'uwsm-app', 'systemd-run', or other command wrappers."
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
|
|
||||||
DankTextField {
|
|
||||||
width: parent.width
|
|
||||||
text: SessionData.launchPrefix
|
|
||||||
placeholderText: "Enter launch prefix (e.g., 'uwsm-app')"
|
|
||||||
onTextEdited: {
|
|
||||||
SessionData.setLaunchPrefix(text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: recentlyUsedSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: recentlyUsedSection
|
|
||||||
|
|
||||||
property var rankedAppsModel: {
|
|
||||||
var apps = []
|
|
||||||
for (var appId in (AppUsageHistoryData.appUsageRanking
|
|
||||||
|| {})) {
|
|
||||||
var appData = (AppUsageHistoryData.appUsageRanking
|
|
||||||
|| {})[appId]
|
|
||||||
apps.push({
|
|
||||||
"id": appId,
|
|
||||||
"name": appData.name,
|
|
||||||
"exec": appData.exec,
|
|
||||||
"icon": appData.icon,
|
|
||||||
"comment": appData.comment,
|
|
||||||
"usageCount": appData.usageCount,
|
|
||||||
"lastUsed": appData.lastUsed
|
|
||||||
})
|
|
||||||
}
|
|
||||||
apps.sort(function (a, b) {
|
|
||||||
if (a.usageCount !== b.usageCount)
|
|
||||||
return b.usageCount - a.usageCount
|
|
||||||
|
|
||||||
return a.name.localeCompare(b.name)
|
|
||||||
})
|
|
||||||
return apps.slice(0, 20)
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "history"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Recently Used Apps"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width - parent.children[0].width
|
|
||||||
- parent.children[1].width
|
|
||||||
- clearAllButton.width - Theme.spacingM * 3
|
|
||||||
height: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
id: clearAllButton
|
|
||||||
|
|
||||||
iconName: "delete_sweep"
|
|
||||||
iconSize: Theme.iconSize - 2
|
|
||||||
iconColor: Theme.error
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
onClicked: {
|
|
||||||
AppUsageHistoryData.appUsageRanking = {}
|
|
||||||
SettingsData.saveSettings()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
width: parent.width
|
|
||||||
text: "Apps are ordered by usage frequency, then last used, then alphabetically."
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: rankedAppsList
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: recentlyUsedSection.rankedAppsModel
|
|
||||||
|
|
||||||
delegate: Rectangle {
|
|
||||||
width: rankedAppsList.width
|
|
||||||
height: 48
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceContainer.r,
|
|
||||||
Theme.surfaceContainer.g,
|
|
||||||
Theme.surfaceContainer.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r,
|
|
||||||
Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.1)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: (index + 1).toString()
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.primary
|
|
||||||
width: 20
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Image {
|
|
||||||
width: 24
|
|
||||||
height: 24
|
|
||||||
source: modelData.icon ? "image://icon/" + modelData.icon : "image://icon/application-x-executable"
|
|
||||||
sourceSize.width: 24
|
|
||||||
sourceSize.height: 24
|
|
||||||
fillMode: Image.PreserveAspectFit
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
onStatusChanged: {
|
|
||||||
if (status === Image.Error)
|
|
||||||
source = "image://icon/application-x-executable"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData.name
|
|
||||||
|| "Unknown App"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: {
|
|
||||||
if (!modelData.lastUsed)
|
|
||||||
return "Never used"
|
|
||||||
|
|
||||||
var date = new Date(modelData.lastUsed)
|
|
||||||
var now = new Date()
|
|
||||||
var diffMs = now - date
|
|
||||||
var diffMins = Math.floor(
|
|
||||||
diffMs / (1000 * 60))
|
|
||||||
var diffHours = Math.floor(
|
|
||||||
diffMs / (1000 * 60 * 60))
|
|
||||||
var diffDays = Math.floor(
|
|
||||||
diffMs / (1000 * 60 * 60 * 24))
|
|
||||||
if (diffMins < 1)
|
|
||||||
return "Last launched just now"
|
|
||||||
|
|
||||||
if (diffMins < 60)
|
|
||||||
return "Last launched " + diffMins + " minute"
|
|
||||||
+ (diffMins === 1 ? "" : "s") + " ago"
|
|
||||||
|
|
||||||
if (diffHours < 24)
|
|
||||||
return "Last launched " + diffHours + " hour"
|
|
||||||
+ (diffHours === 1 ? "" : "s") + " ago"
|
|
||||||
|
|
||||||
if (diffDays < 7)
|
|
||||||
return "Last launched " + diffDays + " day"
|
|
||||||
+ (diffDays === 1 ? "" : "s") + " ago"
|
|
||||||
|
|
||||||
return "Last launched " + date.toLocaleDateString()
|
|
||||||
}
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
circular: true
|
|
||||||
iconName: "close"
|
|
||||||
iconSize: 16
|
|
||||||
iconColor: Theme.error
|
|
||||||
onClicked: {
|
|
||||||
var currentRanking = Object.assign(
|
|
||||||
{},
|
|
||||||
AppUsageHistoryData.appUsageRanking
|
|
||||||
|| {})
|
|
||||||
delete currentRanking[modelData.id]
|
|
||||||
AppUsageHistoryData.appUsageRanking = currentRanking
|
|
||||||
SettingsData.saveSettings()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
width: parent.width
|
|
||||||
text: recentlyUsedSection.rankedAppsModel.length
|
|
||||||
=== 0 ? "No apps have been launched yet." : ""
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
visible: recentlyUsedSection.rankedAppsModel.length === 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,106 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property string title: ""
|
|
||||||
property string iconName: ""
|
|
||||||
property alias content: contentLoader.sourceComponent
|
|
||||||
property bool expanded: false
|
|
||||||
property bool collapsible: true
|
|
||||||
property bool lazyLoad: true
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
spacing: expanded ? Theme.spacingM : 0
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (!collapsible)
|
|
||||||
expanded = true
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
width: parent.width
|
|
||||||
height: headerRow.height
|
|
||||||
enabled: collapsible
|
|
||||||
hoverEnabled: collapsible
|
|
||||||
onClicked: {
|
|
||||||
if (collapsible)
|
|
||||||
expanded = !expanded
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
color: parent.containsMouse ? Qt.rgba(Theme.primary.r,
|
|
||||||
Theme.primary.g,
|
|
||||||
Theme.primary.b,
|
|
||||||
0.08) : "transparent"
|
|
||||||
radius: Theme.radiusS
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: headerRow
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
topPadding: Theme.spacingS
|
|
||||||
bottomPadding: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: root.collapsible ? (root.expanded ? "expand_less" : "expand_more") : root.iconName
|
|
||||||
size: Theme.iconSize - 2
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
Behavior on rotation {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Appearance.anim.durations.fast
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.standard
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: root.iconName
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
visible: root.collapsible
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: root.title
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
|
||||||
visible: expanded || !collapsible
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: contentLoader
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
active: lazyLoad ? expanded || !collapsible : true
|
|
||||||
visible: expanded || !collapsible
|
|
||||||
asynchronous: true
|
|
||||||
opacity: visible ? 1 : 0
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Appearance.anim.durations.normal
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Appearance.anim.curves.standard
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,384 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: timeTab
|
|
||||||
|
|
||||||
DankFlickable {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: Theme.spacingL
|
|
||||||
clip: true
|
|
||||||
contentHeight: mainColumn.height
|
|
||||||
contentWidth: width
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: mainColumn
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingXL
|
|
||||||
|
|
||||||
// Time Format
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: timeSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: timeSection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "schedule"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width - Theme.iconSize - Theme.spacingM
|
|
||||||
- toggle.width - Theme.spacingM
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "24-Hour Format"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Use 24-hour time format instead of 12-hour AM/PM"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankToggle {
|
|
||||||
id: toggle
|
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
checked: SettingsData.use24HourClock
|
|
||||||
onToggled: checked => {
|
|
||||||
return SettingsData.setClockFormat(
|
|
||||||
checked)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Date Format Section
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: dateSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: dateSection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "calendar_today"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Date Format"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankDropdown {
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
text: "Top Bar Format"
|
|
||||||
description: "Preview: " + (SettingsData.clockDateFormat ? new Date().toLocaleDateString(Qt.locale(), SettingsData.clockDateFormat) : new Date().toLocaleDateString(Qt.locale(), "ddd d"))
|
|
||||||
currentValue: {
|
|
||||||
if (!SettingsData.clockDateFormat || SettingsData.clockDateFormat.length === 0) {
|
|
||||||
return "System Default"
|
|
||||||
}
|
|
||||||
// Find matching preset or show "Custom"
|
|
||||||
const presets = [{
|
|
||||||
"format": "ddd d",
|
|
||||||
"label": "Day Date"
|
|
||||||
}, {
|
|
||||||
"format": "ddd MMM d",
|
|
||||||
"label": "Day Month Date"
|
|
||||||
}, {
|
|
||||||
"format": "MMM d",
|
|
||||||
"label": "Month Date"
|
|
||||||
}, {
|
|
||||||
"format": "M/d",
|
|
||||||
"label": "Numeric (M/D)"
|
|
||||||
}, {
|
|
||||||
"format": "d/M",
|
|
||||||
"label": "Numeric (D/M)"
|
|
||||||
}, {
|
|
||||||
"format": "ddd d MMM yyyy",
|
|
||||||
"label": "Full with Year"
|
|
||||||
}, {
|
|
||||||
"format": "yyyy-MM-dd",
|
|
||||||
"label": "ISO Date"
|
|
||||||
}, {
|
|
||||||
"format": "dddd, MMMM d",
|
|
||||||
"label": "Full Day & Month"
|
|
||||||
}]
|
|
||||||
const match = presets.find(p => {
|
|
||||||
return p.format
|
|
||||||
=== SettingsData.clockDateFormat
|
|
||||||
})
|
|
||||||
return match ? match.label : "Custom: " + SettingsData.clockDateFormat
|
|
||||||
}
|
|
||||||
options: ["System Default", "Day Date", "Day Month Date", "Month Date", "Numeric (M/D)", "Numeric (D/M)", "Full with Year", "ISO Date", "Full Day & Month", "Custom..."]
|
|
||||||
onValueChanged: value => {
|
|
||||||
const formatMap = {
|
|
||||||
"System Default": "",
|
|
||||||
"Day Date": "ddd d",
|
|
||||||
"Day Month Date": "ddd MMM d",
|
|
||||||
"Month Date": "MMM d",
|
|
||||||
"Numeric (M/D)": "M/d",
|
|
||||||
"Numeric (D/M)": "d/M",
|
|
||||||
"Full with Year": "ddd d MMM yyyy",
|
|
||||||
"ISO Date": "yyyy-MM-dd",
|
|
||||||
"Full Day & Month": "dddd, MMMM d"
|
|
||||||
}
|
|
||||||
if (value === "Custom...") {
|
|
||||||
customFormatInput.visible = true
|
|
||||||
} else {
|
|
||||||
customFormatInput.visible = false
|
|
||||||
SettingsData.setClockDateFormat(
|
|
||||||
formatMap[value])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankDropdown {
|
|
||||||
width: parent.width
|
|
||||||
height: 50
|
|
||||||
text: "Lock Screen Format"
|
|
||||||
description: "Preview: " + (SettingsData.lockDateFormat ? new Date().toLocaleDateString(Qt.locale(), SettingsData.lockDateFormat) : new Date().toLocaleDateString(Qt.locale(), Locale.LongFormat))
|
|
||||||
currentValue: {
|
|
||||||
if (!SettingsData.lockDateFormat || SettingsData.lockDateFormat.length === 0) {
|
|
||||||
return "System Default"
|
|
||||||
}
|
|
||||||
// Find matching preset or show "Custom"
|
|
||||||
const presets = [{
|
|
||||||
"format": "ddd d",
|
|
||||||
"label": "Day Date"
|
|
||||||
}, {
|
|
||||||
"format": "ddd MMM d",
|
|
||||||
"label": "Day Month Date"
|
|
||||||
}, {
|
|
||||||
"format": "MMM d",
|
|
||||||
"label": "Month Date"
|
|
||||||
}, {
|
|
||||||
"format": "M/d",
|
|
||||||
"label": "Numeric (M/D)"
|
|
||||||
}, {
|
|
||||||
"format": "d/M",
|
|
||||||
"label": "Numeric (D/M)"
|
|
||||||
}, {
|
|
||||||
"format": "ddd d MMM yyyy",
|
|
||||||
"label": "Full with Year"
|
|
||||||
}, {
|
|
||||||
"format": "yyyy-MM-dd",
|
|
||||||
"label": "ISO Date"
|
|
||||||
}, {
|
|
||||||
"format": "dddd, MMMM d",
|
|
||||||
"label": "Full Day & Month"
|
|
||||||
}]
|
|
||||||
const match = presets.find(p => {
|
|
||||||
return p.format
|
|
||||||
=== SettingsData.lockDateFormat
|
|
||||||
})
|
|
||||||
return match ? match.label : "Custom: " + SettingsData.lockDateFormat
|
|
||||||
}
|
|
||||||
options: ["System Default", "Day Date", "Day Month Date", "Month Date", "Numeric (M/D)", "Numeric (D/M)", "Full with Year", "ISO Date", "Full Day & Month", "Custom..."]
|
|
||||||
onValueChanged: value => {
|
|
||||||
const formatMap = {
|
|
||||||
"System Default": "",
|
|
||||||
"Day Date": "ddd d",
|
|
||||||
"Day Month Date": "ddd MMM d",
|
|
||||||
"Month Date": "MMM d",
|
|
||||||
"Numeric (M/D)": "M/d",
|
|
||||||
"Numeric (D/M)": "d/M",
|
|
||||||
"Full with Year": "ddd d MMM yyyy",
|
|
||||||
"ISO Date": "yyyy-MM-dd",
|
|
||||||
"Full Day & Month": "dddd, MMMM d"
|
|
||||||
}
|
|
||||||
if (value === "Custom...") {
|
|
||||||
customLockFormatInput.visible = true
|
|
||||||
} else {
|
|
||||||
customLockFormatInput.visible = false
|
|
||||||
SettingsData.setLockDateFormat(
|
|
||||||
formatMap[value])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankTextField {
|
|
||||||
id: customFormatInput
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
visible: false
|
|
||||||
placeholderText: "Enter custom top bar format (e.g., ddd MMM d)"
|
|
||||||
text: SettingsData.clockDateFormat
|
|
||||||
onTextChanged: {
|
|
||||||
if (visible && text)
|
|
||||||
SettingsData.setClockDateFormat(text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankTextField {
|
|
||||||
id: customLockFormatInput
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
visible: false
|
|
||||||
placeholderText: "Enter custom lock screen format (e.g., dddd, MMMM d)"
|
|
||||||
text: SettingsData.lockDateFormat
|
|
||||||
onTextChanged: {
|
|
||||||
if (visible && text)
|
|
||||||
SettingsData.setLockDateFormat(text)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: formatHelp.implicitHeight + Theme.spacingM * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r,
|
|
||||||
Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.2)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.1)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: formatHelp
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingM
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Format Legend"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.primary
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingL
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: (parent.width - Theme.spacingL) / 2
|
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "• d - Day (1-31)"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "• dd - Day (01-31)"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "• ddd - Day name (Mon)"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "• dddd - Day name (Monday)"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "• M - Month (1-12)"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: (parent.width - Theme.spacingL) / 2
|
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "• MM - Month (01-12)"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "• MMM - Month (Jan)"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "• MMMM - Month (January)"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "• yy - Year (24)"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "• yyyy - Year (2024)"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,393 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: weatherTab
|
|
||||||
|
|
||||||
DankFlickable {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: Theme.spacingL
|
|
||||||
clip: true
|
|
||||||
contentHeight: mainColumn.height
|
|
||||||
contentWidth: width
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: mainColumn
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingXL
|
|
||||||
|
|
||||||
// Enable Weather
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: enableWeatherSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: enableWeatherSection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "cloud"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width - Theme.iconSize - Theme.spacingM
|
|
||||||
- enableToggle.width - Theme.spacingM
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Enable Weather"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Show weather information in top bar and control center"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankToggle {
|
|
||||||
id: enableToggle
|
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
checked: SettingsData.weatherEnabled
|
|
||||||
onToggled: checked => {
|
|
||||||
return SettingsData.setWeatherEnabled(
|
|
||||||
checked)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Temperature Unit
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: temperatureSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
visible: SettingsData.weatherEnabled
|
|
||||||
opacity: visible ? 1 : 0
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: temperatureSection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "thermostat"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width - Theme.iconSize - Theme.spacingM
|
|
||||||
- temperatureToggle.width - Theme.spacingM
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Use Fahrenheit"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Use Fahrenheit instead of Celsius for temperature"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankToggle {
|
|
||||||
id: temperatureToggle
|
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
checked: SettingsData.useFahrenheit
|
|
||||||
onToggled: checked => {
|
|
||||||
return SettingsData.setTemperatureUnit(
|
|
||||||
checked)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Location Settings
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: locationSection.implicitHeight + Theme.spacingL * 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b, 0.3)
|
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: 1
|
|
||||||
visible: SettingsData.weatherEnabled
|
|
||||||
opacity: visible ? 1 : 0
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: locationSection
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "location_on"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width - Theme.iconSize - Theme.spacingM
|
|
||||||
- autoLocationToggle.width - Theme.spacingM
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Auto Location"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Automatically determine your location using your IP address"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankToggle {
|
|
||||||
id: autoLocationToggle
|
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
checked: SettingsData.useAutoLocation
|
|
||||||
onToggled: checked => {
|
|
||||||
return SettingsData.setAutoLocation(
|
|
||||||
checked)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
visible: !SettingsData.useAutoLocation
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Theme.outline
|
|
||||||
opacity: 0.2
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Custom Location"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: (parent.width - Theme.spacingM) / 2
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Latitude"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
DankTextField {
|
|
||||||
id: latitudeInput
|
|
||||||
width: parent.width
|
|
||||||
height: 48
|
|
||||||
placeholderText: "40.7128"
|
|
||||||
backgroundColor: Theme.surfaceVariant
|
|
||||||
normalBorderColor: Theme.primarySelected
|
|
||||||
focusedBorderColor: Theme.primary
|
|
||||||
keyNavigationTab: longitudeInput
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (SettingsData.weatherCoordinates) {
|
|
||||||
const coords = SettingsData.weatherCoordinates.split(',')
|
|
||||||
if (coords.length > 0) {
|
|
||||||
text = coords[0].trim()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: SettingsData
|
|
||||||
function onWeatherCoordinatesChanged() {
|
|
||||||
if (SettingsData.weatherCoordinates) {
|
|
||||||
const coords = SettingsData.weatherCoordinates.split(',')
|
|
||||||
if (coords.length > 0) {
|
|
||||||
latitudeInput.text = coords[0].trim()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onTextEdited: {
|
|
||||||
if (text && longitudeInput.text) {
|
|
||||||
const coords = text + "," + longitudeInput.text
|
|
||||||
SettingsData.weatherCoordinates = coords
|
|
||||||
SettingsData.saveSettings()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: (parent.width - Theme.spacingM) / 2
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Longitude"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
DankTextField {
|
|
||||||
id: longitudeInput
|
|
||||||
width: parent.width
|
|
||||||
height: 48
|
|
||||||
placeholderText: "-74.0060"
|
|
||||||
backgroundColor: Theme.surfaceVariant
|
|
||||||
normalBorderColor: Theme.primarySelected
|
|
||||||
focusedBorderColor: Theme.primary
|
|
||||||
keyNavigationTab: locationSearchInput
|
|
||||||
keyNavigationBacktab: latitudeInput
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (SettingsData.weatherCoordinates) {
|
|
||||||
const coords = SettingsData.weatherCoordinates.split(',')
|
|
||||||
if (coords.length > 1) {
|
|
||||||
text = coords[1].trim()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: SettingsData
|
|
||||||
function onWeatherCoordinatesChanged() {
|
|
||||||
if (SettingsData.weatherCoordinates) {
|
|
||||||
const coords = SettingsData.weatherCoordinates.split(',')
|
|
||||||
if (coords.length > 1) {
|
|
||||||
longitudeInput.text = coords[1].trim()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onTextEdited: {
|
|
||||||
if (text && latitudeInput.text) {
|
|
||||||
const coords = latitudeInput.text + "," + text
|
|
||||||
SettingsData.weatherCoordinates = coords
|
|
||||||
SettingsData.saveSettings()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Location Search"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
DankLocationSearch {
|
|
||||||
id: locationSearchInput
|
|
||||||
width: parent.width
|
|
||||||
currentLocation: ""
|
|
||||||
placeholderText: "New York, NY"
|
|
||||||
keyNavigationBacktab: longitudeInput
|
|
||||||
onLocationSelected: (displayName, coordinates) => {
|
|
||||||
SettingsData.setWeatherLocation(displayName, coordinates)
|
|
||||||
|
|
||||||
const coords = coordinates.split(',')
|
|
||||||
if (coords.length >= 2) {
|
|
||||||
latitudeInput.text = coords[0].trim()
|
|
||||||
longitudeInput.text = coords[1].trim()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.mediumDuration
|
|
||||||
easing.type: Theme.emphasizedEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,315 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Popup {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property var allWidgets: []
|
|
||||||
property string targetSection: ""
|
|
||||||
property bool isOpening: false
|
|
||||||
property string searchQuery: ""
|
|
||||||
property var filteredWidgets: []
|
|
||||||
property int selectedIndex: -1
|
|
||||||
property bool keyboardNavigationActive: false
|
|
||||||
|
|
||||||
signal widgetSelected(string widgetId, string targetSection)
|
|
||||||
|
|
||||||
function updateFilteredWidgets() {
|
|
||||||
if (!searchQuery || searchQuery.length === 0) {
|
|
||||||
filteredWidgets = allWidgets.slice()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
var filtered = []
|
|
||||||
var query = searchQuery.toLowerCase()
|
|
||||||
|
|
||||||
for (var i = 0; i < allWidgets.length; i++) {
|
|
||||||
var widget = allWidgets[i]
|
|
||||||
var text = widget.text ? widget.text.toLowerCase() : ""
|
|
||||||
var description = widget.description ? widget.description.toLowerCase() : ""
|
|
||||||
var id = widget.id ? widget.id.toLowerCase() : ""
|
|
||||||
|
|
||||||
if (text.indexOf(query) !== -1 ||
|
|
||||||
description.indexOf(query) !== -1 ||
|
|
||||||
id.indexOf(query) !== -1) {
|
|
||||||
filtered.push(widget)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
filteredWidgets = filtered
|
|
||||||
selectedIndex = -1
|
|
||||||
keyboardNavigationActive = false
|
|
||||||
}
|
|
||||||
|
|
||||||
onAllWidgetsChanged: {
|
|
||||||
updateFilteredWidgets()
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectNext() {
|
|
||||||
if (filteredWidgets.length === 0) return
|
|
||||||
keyboardNavigationActive = true
|
|
||||||
selectedIndex = Math.min(selectedIndex + 1, filteredWidgets.length - 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectPrevious() {
|
|
||||||
if (filteredWidgets.length === 0) return
|
|
||||||
keyboardNavigationActive = true
|
|
||||||
selectedIndex = Math.max(selectedIndex - 1, -1)
|
|
||||||
if (selectedIndex === -1) {
|
|
||||||
keyboardNavigationActive = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function selectWidget() {
|
|
||||||
if (selectedIndex >= 0 && selectedIndex < filteredWidgets.length) {
|
|
||||||
var widget = filteredWidgets[selectedIndex]
|
|
||||||
root.widgetSelected(widget.id, root.targetSection)
|
|
||||||
root.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function safeOpen() {
|
|
||||||
if (!isOpening && !visible) {
|
|
||||||
isOpening = true
|
|
||||||
open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
width: 500
|
|
||||||
height: 550
|
|
||||||
modal: true
|
|
||||||
focus: true
|
|
||||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
|
||||||
onOpened: {
|
|
||||||
isOpening = false
|
|
||||||
Qt.callLater(() => {
|
|
||||||
contentItem.forceActiveFocus()
|
|
||||||
searchField.forceActiveFocus()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
onClosed: {
|
|
||||||
isOpening = false
|
|
||||||
allWidgets = []
|
|
||||||
targetSection = ""
|
|
||||||
searchQuery = ""
|
|
||||||
filteredWidgets = []
|
|
||||||
selectedIndex = -1
|
|
||||||
keyboardNavigationActive = false
|
|
||||||
}
|
|
||||||
|
|
||||||
background: Rectangle {
|
|
||||||
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g,
|
|
||||||
Theme.surfaceContainer.b, 1)
|
|
||||||
border.color: Theme.primarySelected
|
|
||||||
border.width: 1
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
}
|
|
||||||
|
|
||||||
contentItem: Item {
|
|
||||||
anchors.fill: parent
|
|
||||||
focus: true
|
|
||||||
|
|
||||||
Keys.onPressed: event => {
|
|
||||||
if (event.key === Qt.Key_Escape) {
|
|
||||||
root.close()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Down) {
|
|
||||||
root.selectNext()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Up) {
|
|
||||||
root.selectPrevious()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
|
|
||||||
if (root.keyboardNavigationActive) {
|
|
||||||
root.selectWidget()
|
|
||||||
} else if (root.filteredWidgets.length > 0) {
|
|
||||||
var firstWidget = root.filteredWidgets[0]
|
|
||||||
root.widgetSelected(firstWidget.id, root.targetSection)
|
|
||||||
root.close()
|
|
||||||
}
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.text && event.text.length > 0 && event.text.match(/[a-zA-Z0-9\\s]/)) {
|
|
||||||
if (!searchField.activeFocus) {
|
|
||||||
searchField.forceActiveFocus()
|
|
||||||
}
|
|
||||||
searchField.insertText(event.text)
|
|
||||||
event.accepted = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
iconName: "close"
|
|
||||||
iconSize: Theme.iconSize - 2
|
|
||||||
iconColor: Theme.outline
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: Theme.spacingM
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: Theme.spacingM
|
|
||||||
onClicked: root.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: contentColumn
|
|
||||||
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
anchors.topMargin: Theme.spacingL + 30 // Space for close button
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "add_circle"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Add Widget to " + root.targetSection + " Section"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Select a widget to add to the " + root.targetSection.toLowerCase(
|
|
||||||
) + " section of the top bar. You can add multiple instances of the same widget if needed."
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.outline
|
|
||||||
width: parent.width
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
|
|
||||||
DankTextField {
|
|
||||||
id: searchField
|
|
||||||
width: parent.width
|
|
||||||
height: 48
|
|
||||||
cornerRadius: Theme.cornerRadius
|
|
||||||
backgroundColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
|
|
||||||
normalBorderColor: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
|
||||||
focusedBorderColor: Theme.primary
|
|
||||||
leftIconName: "search"
|
|
||||||
leftIconSize: Theme.iconSize - 2
|
|
||||||
leftIconColor: Theme.outline
|
|
||||||
leftIconFocusedColor: Theme.primary
|
|
||||||
showClearButton: true
|
|
||||||
textColor: Theme.surfaceText
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
placeholderText: "Search widgets..."
|
|
||||||
text: root.searchQuery
|
|
||||||
ignoreLeftRightKeys: true
|
|
||||||
keyForwardTargets: [root.contentItem]
|
|
||||||
onTextEdited: {
|
|
||||||
root.searchQuery = text
|
|
||||||
updateFilteredWidgets()
|
|
||||||
}
|
|
||||||
Keys.onPressed: event => {
|
|
||||||
if (event.key === Qt.Key_Escape) {
|
|
||||||
root.close()
|
|
||||||
event.accepted = true
|
|
||||||
} else if (event.key === Qt.Key_Down || event.key === Qt.Key_Up ||
|
|
||||||
((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && text.length === 0)) {
|
|
||||||
event.accepted = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankListView {
|
|
||||||
id: widgetList
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height - y
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
model: root.filteredWidgets
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
delegate: Rectangle {
|
|
||||||
width: widgetList.width
|
|
||||||
height: 60
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
property bool isSelected: root.keyboardNavigationActive && index === root.selectedIndex
|
|
||||||
color: isSelected ? Theme.primarySelected :
|
|
||||||
widgetArea.containsMouse ? Theme.primaryHover : Qt.rgba(
|
|
||||||
Theme.surfaceVariant.r,
|
|
||||||
Theme.surfaceVariant.g,
|
|
||||||
Theme.surfaceVariant.b,
|
|
||||||
0.3)
|
|
||||||
border.color: isSelected ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g,
|
|
||||||
Theme.outline.b, 0.2)
|
|
||||||
border.width: isSelected ? 2 : 1
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingM
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: modelData.icon
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: 2
|
|
||||||
width: parent.width - Theme.iconSize - Theme.spacingM * 3
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData.text
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
elide: Text.ElideRight
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData.description
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.outline
|
|
||||||
elide: Text.ElideRight
|
|
||||||
width: parent.width
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "add"
|
|
||||||
size: Theme.iconSize - 4
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: widgetArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
root.widgetSelected(modelData.id,
|
|
||||||
root.targetSection)
|
|
||||||
root.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user