Compare commits
208 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
37896620eb | |
|
|
6dc76c881f | |
|
|
4b78e39af7 | |
|
|
7f97dc884f | |
|
|
9806027e19 | |
|
|
066f033a91 | |
|
|
1591466a8d | |
|
|
901c18520e | |
|
|
e39085aa2b | |
|
|
48d58f61d2 | |
|
|
8691cf99d2 | |
|
|
80bfb177be | |
|
|
20743f91eb | |
|
|
5cf7b986f3 | |
|
|
3d71746ff2 | |
|
|
c7b16c5713 | |
|
|
ed1d708802 | |
|
|
557a0775c3 | |
|
|
2309f89701 | |
|
|
cdd658d4ea | |
|
|
ec2e0501c1 | |
|
|
f30c650bba | |
|
|
45af52ddf9 | |
|
|
10b14794ed | |
|
|
6b81f07cc8 | |
|
|
9734955ebb | |
|
|
dd3108d423 | |
|
|
bf7276b2dd | |
|
|
90c4567505 | |
|
|
6cddb43b0f | |
|
|
f3732c7087 | |
|
|
07bd841bc6 | |
|
|
9986b71b26 | |
|
|
16446f7808 | |
|
|
5615186654 | |
|
|
244822ffb3 | |
|
|
266b0fd507 | |
|
|
0d8937ff80 | |
|
|
c59e195d94 | |
|
|
994dffc4fb | |
|
|
701e41296b | |
|
|
b0dba25f36 | |
|
|
1bee41aea9 | |
|
|
2035d9ba76 | |
|
|
24e3099b7b | |
|
|
aee5bf69da | |
|
|
62881c08b3 | |
|
|
0c87d47ce6 | |
|
|
47bb5ab7a2 | |
|
|
e5e798b599 | |
|
|
68daa5b3df | |
|
|
f2dcdcc6c3 | |
|
|
a3460fbe70 | |
|
|
7f822b6787 | |
|
|
1d8b22d992 | |
|
|
1238808d87 | |
|
|
26f5be36b6 | |
|
|
0c1b0906c1 | |
|
|
5eb258e310 | |
|
|
bec00c6f48 | |
|
|
db1675d399 | |
|
|
18f99b5daf | |
|
|
543f157895 | |
|
|
8ad31cfa28 | |
|
|
80277e0c12 | |
|
|
0a4fc34fac | |
|
|
e035fb9d27 | |
|
|
97fcde1a3b | |
|
|
c16c403966 | |
|
|
d5148e2107 | |
|
|
0f6f344c97 | |
|
|
41c6f43a3c | |
|
|
f44c4b78bc | |
|
|
5420efa4d3 | |
|
|
89f43b95ef | |
|
|
00bc179655 | |
|
|
a4115f5e4b | |
|
|
6c896bb956 | |
|
|
d9c8689c18 | |
|
|
5df6ce93f8 | |
|
|
ee4bb5ca29 | |
|
|
b89ae4726c | |
|
|
b0bbc25083 | |
|
|
635df298fe | |
|
|
786847cc2f | |
|
|
d9f89faf33 | |
|
|
769978560e | |
|
|
bebc39e766 | |
|
|
bb15a4e867 | |
|
|
84015c7972 | |
|
|
f2c34fba8f | |
|
|
1a74eb1507 | |
|
|
6b3f8a7b42 | |
|
|
ad78fdab24 | |
|
|
12ceebec6d | |
|
|
6f9ca5b3b7 | |
|
|
c54b211872 | |
|
|
cb899235b4 | |
|
|
a83af3d833 | |
|
|
e8c8a67fc0 | |
|
|
2b4a0b6a0d | |
|
|
5ffa5e59bf | |
|
|
ed8ca1e068 | |
|
|
f21776b123 | |
|
|
ab3f873a38 | |
|
|
de6047107e | |
|
|
39152b8548 | |
|
|
b517afc379 | |
|
|
b84d565b1e | |
|
|
46f3a54203 | |
|
|
4afaa6d048 | |
|
|
26f078d512 | |
|
|
124d817752 | |
|
|
2ddb419676 | |
|
|
841241a7e6 | |
|
|
c902f0cd44 | |
|
|
756c42609d | |
|
|
4fc439abe2 | |
|
|
9685576272 | |
|
|
d2f01c06ec | |
|
|
94c36076af | |
|
|
a4134030fe | |
|
|
ebacbf175a | |
|
|
6c987b4492 | |
|
|
8acb2236bd | |
|
|
5dae6f8387 | |
|
|
5ab242f8e0 | |
|
|
fcbb5fab73 | |
|
|
f9a57e58bb | |
|
|
d713302d0d | |
|
|
d398e6fb5a | |
|
|
903a6b351c | |
|
|
b3e09b330f | |
|
|
c63089b944 | |
|
|
ca770c1c05 | |
|
|
ac65bca05a | |
|
|
e61fd66210 | |
|
|
1dc7d4340c | |
|
|
a22bb2bf1a | |
|
|
e1c72fa446 | |
|
|
676a96b2cd | |
|
|
4821123c73 | |
|
|
32c8b7ae62 | |
|
|
d97bbfc796 | |
|
|
19083cfd83 | |
|
|
2c60196ead | |
|
|
b17de39ef0 | |
|
|
46e54db969 | |
|
|
554029aacf | |
|
|
a5146e0396 | |
|
|
6960652379 | |
|
|
3ec1dd7f4e | |
|
|
157c88127f | |
|
|
18e628f083 | |
|
|
ab83d44a5e | |
|
|
fa6492a422 | |
|
|
160e84120d | |
|
|
c222c25ddf | |
|
|
ee8391a45f | |
|
|
3ac6f70725 | |
|
|
d23b058d0e | |
|
|
37fde4c642 | |
|
|
2ade8c542e | |
|
|
03a1f449b5 | |
|
|
7b3a2a1e48 | |
|
|
dabd122a1d | |
|
|
0181119393 | |
|
|
2e1d07abc2 | |
|
|
fe61319fc2 | |
|
|
da644c97d3 | |
|
|
b67914b956 | |
|
|
e4caa1d6d4 | |
|
|
ea62be8ad7 | |
|
|
6ab1db9a76 | |
|
|
cd0d49eaf6 | |
|
|
a97ee2cee2 | |
|
|
9d43068271 | |
|
|
c7ebb7492e | |
|
|
c5356724fd | |
|
|
d02efc2657 | |
|
|
40cd532134 | |
|
|
869c0ba5e2 | |
|
|
fd24060d7b | |
|
|
1318f23947 | |
|
|
d2385fd3b2 | |
|
|
7059a85742 | |
|
|
2e5dcd62c1 | |
|
|
72e64ad965 | |
|
|
0e004e7b3f | |
|
|
91bc46defe | |
|
|
b8f266ea6a | |
|
|
a33d4ec9d0 | |
|
|
4c3500ea16 | |
|
|
bc1c993e17 | |
|
|
3889c9d2ea | |
|
|
8eda46fb5e | |
|
|
a0451408aa | |
|
|
84d4fb7cc2 | |
|
|
b48320c7bc | |
|
|
ce5191ddd1 | |
|
|
37e3ab1bda | |
|
|
6b98d5f188 | |
|
|
f059c5668a | |
|
|
e7fc7be950 | |
|
|
6136fae885 | |
|
|
9505352f37 | |
|
|
07cb0e7ab8 | |
|
|
285f6db134 |
|
|
@ -0,0 +1 @@
|
||||||
|
open_collective: wayvr-org
|
||||||
|
|
@ -22,25 +22,28 @@ If this is a regression, please mention which version was working previously.
|
||||||
**Kernel version**:
|
**Kernel version**:
|
||||||
|
|
||||||
**VR Runtime**:
|
**VR Runtime**:
|
||||||
- [ ] Monado/WiVRn
|
- [ ] Monado
|
||||||
- [ ] SteamVR/ALVR
|
- [ ] WiVRn
|
||||||
|
- [ ] ALVR
|
||||||
|
- [ ] SteamLink
|
||||||
|
- [ ] SteamVR (not SteamLink)
|
||||||
|
|
||||||
<!-- Run `vulkaninfo --summary` and paste the devices section from the bottom. -->
|
<!-- Run `vulkaninfo --summary` and paste the devices section from the bottom. -->
|
||||||
**GPU models and driver versions**:
|
**GPU models and driver versions**:
|
||||||
|
|
||||||
## Overlay Logs
|
## Overlay Logs
|
||||||
|
|
||||||
<!-- Start the overlay once more with the following environment variables:
|
<!-- Start the overlay from terminal, with additional environment variables:
|
||||||
RUST_BACKTRACE=full
|
|
||||||
RUST_LOG=debug
|
|
||||||
If your issue is graphical or crash or freeze, also add:
|
|
||||||
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation
|
|
||||||
|
|
||||||
Next, create the empty log file: echo > /tmp/wlx.log
|
AppImage:
|
||||||
|
RUST_BACKTRACE=full RUST_LOG=debug /path/to/WayVR.AppImage
|
||||||
|
|
||||||
Be sure to go and reproduce the issue once more, after these have been set.
|
System or AUR package:
|
||||||
|
RUST_BACKTRACE=full RUST_LOG=debug wayvr
|
||||||
|
|
||||||
Upload the log file from: /tmp/wlx.log
|
Reproduce the issue once more, while WayVR is running from the terminal.
|
||||||
|
|
||||||
|
Upload the log file from: /tmp/wayvr.log
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ./wayvr
|
working-directory: ./wayvr
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_appimage:
|
build_appimage:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ./wayvr
|
working-directory: ./wayvr
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ./wayvr
|
working-directory: ./wayvr
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ./wayvr
|
working-directory: ./wayvr
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ./wayvr
|
working-directory: ./wayvr
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ./wayvr
|
working-directory: ./wayvr
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ./wayvr
|
working-directory: ./wayvr
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
make_release:
|
make_release:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ./wayvr
|
working-directory: ./wayvr
|
||||||
|
|
@ -36,10 +36,9 @@ jobs:
|
||||||
cargo build --release
|
cargo build --release
|
||||||
- name: Make tarball
|
- name: Make tarball
|
||||||
run: |
|
run: |
|
||||||
pip install portage pycargoebuild
|
cargo vendor > vendor-config.toml
|
||||||
wget https://github.com/gentoo/gentoo/raw/refs/heads/master/metadata/license-mapping.conf
|
mv vendor-config.toml vendor
|
||||||
mkdir dist
|
tar --xz -cf vendor.tar.xz vendor
|
||||||
pycargoebuild --distdir dist --license-mapping license-mapping.conf --crate-tarball --crate-tarball-path wayvr-crates.tar.xz
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
|
|
@ -81,12 +80,12 @@ jobs:
|
||||||
asset_name: WayVR-${{ github.ref_name }}-x86_64.AppImage
|
asset_name: WayVR-${{ github.ref_name }}-x86_64.AppImage
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
- name: Upload crates tarball
|
- name: Upload vendor tarball
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.RELEASE_KEY }}
|
GITHUB_TOKEN: ${{ secrets.RELEASE_KEY }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
asset_path: ./wayvr/wayvr-crates.tar.xz
|
asset_path: ./wayvr/vendor.tar.xz
|
||||||
asset_name: WayVR-${{ github.ref_name }}-crates.tar.xz
|
asset_name: vendor.tar.xz
|
||||||
asset_content_type: application/x-gtar
|
asset_content_type: application/x-gtar
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
sudo add-apt-repository -syn universe
|
|
||||||
sudo add-apt-repository -syn ppa:pipewire-debian/pipewire-upstream || sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 25088A0359807596
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y fuse cmake pkg-config fontconfig libasound2-dev libxkbcommon-dev libxkbcommon-x11-0 libxkbcommon-x11-dev libopenxr-dev libfontconfig-dev libdbus-1-dev libpipewire-0.3-0 libpipewire-0.3-dev libspa-0.2-dev libx11-6 libxext6 libxrandr2 libx11-dev libxext-dev libxrandr-dev libopenvr-dev libopenvr-api1 libwayland-dev libegl-dev libxcb-glx0 libxcb-glx0-dev
|
sudo apt-get install -y fuse cmake pkg-config fontconfig libasound2-dev libxkbcommon-dev libxkbcommon-x11-0 libxkbcommon-x11-dev libopenxr-dev libfontconfig-dev libdbus-1-dev libpipewire-0.3-0 libpipewire-0.3-dev libspa-0.2-dev libx11-6 libxext6 libxrandr2 libx11-dev libxext-dev libxrandr-dev libopenvr-dev libopenvr-api1 libwayland-dev libegl-dev libxcb-glx0 libxcb-glx0-dev
|
||||||
rustup update
|
rustup update
|
||||||
|
|
|
||||||
75
Cargo.toml
|
|
@ -1,3 +1,42 @@
|
||||||
|
[workspace]
|
||||||
|
resolver = "3"
|
||||||
|
members = [
|
||||||
|
"dash-frontend",
|
||||||
|
"scripts/prost_build",
|
||||||
|
"uidev",
|
||||||
|
"wayvr",
|
||||||
|
"wayvr-ipc",
|
||||||
|
"wayvrctl",
|
||||||
|
"wgui",
|
||||||
|
"wlx-capture",
|
||||||
|
"wlx-common",
|
||||||
|
]
|
||||||
|
|
||||||
|
[workspace.dependencies]
|
||||||
|
anyhow = "1.0.100"
|
||||||
|
clap = { version = "4.5.53", features = ["derive"] }
|
||||||
|
glam = { version = "0.30.9", features = ["mint", "serde"] }
|
||||||
|
idmap = "0.2.2"
|
||||||
|
idmap-derive = "0.2.22"
|
||||||
|
log = "0.4.29"
|
||||||
|
regex = "1.12.2"
|
||||||
|
rust-embed = "8.9.0"
|
||||||
|
serde = { version = "1", features = ["derive"] }
|
||||||
|
serde_json = "1.0.145"
|
||||||
|
slotmap = "1.1.1"
|
||||||
|
smol = "2.0.2"
|
||||||
|
strum = { version = "0.27.2", features = ["derive"] }
|
||||||
|
uuid = { version = "1.19.0", features = ["fast-rng", "v4", "serde"] }
|
||||||
|
vulkano = { version = "0.35.2", default-features = false, features = [
|
||||||
|
"macros",
|
||||||
|
] }
|
||||||
|
vulkano-shaders = "0.35.0"
|
||||||
|
wayland-client = { version = "0.31.11" }
|
||||||
|
xdg = "3.0.0"
|
||||||
|
|
||||||
|
[patch.crates-io]
|
||||||
|
vulkano = { git = "https://github.com/galister/vulkano.git", rev = "cf7f92867928a56ce16b376037c1120f2b167678" }
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
opt-level = 1
|
opt-level = 1
|
||||||
debug = true
|
debug = true
|
||||||
|
|
@ -19,39 +58,3 @@ incremental = true
|
||||||
[profile.release-with-debug]
|
[profile.release-with-debug]
|
||||||
inherits = "release"
|
inherits = "release"
|
||||||
debug = true
|
debug = true
|
||||||
|
|
||||||
[workspace]
|
|
||||||
members = [
|
|
||||||
"uidev",
|
|
||||||
"wgui",
|
|
||||||
"wlx-common",
|
|
||||||
"wayvr",
|
|
||||||
"wlx-capture",
|
|
||||||
"dash-frontend",
|
|
||||||
"wayvr-ipc",
|
|
||||||
"wayvrctl",
|
|
||||||
]
|
|
||||||
resolver = "3"
|
|
||||||
|
|
||||||
[patch.crates-io]
|
|
||||||
vulkano = { git = "https://github.com/galister/vulkano.git", rev = "cf7f92867928a56ce16b376037c1120f2b167678" }
|
|
||||||
|
|
||||||
[workspace.dependencies]
|
|
||||||
anyhow = "1.0.100"
|
|
||||||
glam = { version = "0.30.9", features = ["mint", "serde"] }
|
|
||||||
clap = { version = "4.5.53", features = ["derive"] }
|
|
||||||
xdg = "3.0.0"
|
|
||||||
idmap = "0.2.2"
|
|
||||||
idmap-derive = "0.2.22"
|
|
||||||
log = "0.4.29"
|
|
||||||
regex = "1.12.2"
|
|
||||||
rust-embed = "8.9.0"
|
|
||||||
serde = { version = "1", features = ["derive"] }
|
|
||||||
serde_json = "1.0.145"
|
|
||||||
slotmap = "1.1.1"
|
|
||||||
strum = { version = "0.27.2", features = ["derive"] }
|
|
||||||
vulkano = { version = "0.35.2", default-features = false, features = [
|
|
||||||
"macros",
|
|
||||||
] }
|
|
||||||
vulkano-shaders = "0.35.0"
|
|
||||||
wayland-client = { version = "0.31.11" }
|
|
||||||
|
|
|
||||||
86
README.md
|
|
@ -1,20 +1,20 @@
|
||||||

|

|
||||||
|
|
||||||
# WayVR (previously WlxOverlay-S)
|
# WayVR (previously WlxOverlay-S)
|
||||||
|
|
||||||
A lightweight OpenXR/OpenVR overlay for Wayland and X11 desktops.
|
A lightweight OpenXR/OpenVR overlay for Wayland and X11 desktops.
|
||||||
|
|
||||||
WayVR lets you to access your desktop screens while in VR, and even launch apps directly in VR.
|
WayVR lets you access your desktop screens while in VR, and even launch apps directly in VR.
|
||||||
|
|
||||||
In comparison to similar overlays, WayVR aims to run alongside VR games and experiences while having as little performance impact as possible. The UI appearance and rendering techniques are kept as simple and efficient as possible, while still allowing a high degree of customizability.
|
In comparison to similar overlays, WayVR aims to run alongside VR games and experiences while having as little performance impact as possible. The UI appearance and rendering techniques are kept as simple and efficient as possible, while still allowing a high degree of customizability.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Join the Linux VR Community
|
## Join the Linux VR Community
|
||||||
|
|
||||||
We are available on either **Discord** or **Matrix space**:
|
We are available on either **Discord** or **Matrix space**:
|
||||||
|
|
||||||
[](https://discord.gg/EHAYe3tTYa) [](https://matrix.to/#/#linux-vr-adventures:matrix.org)
|
[](https://discord.gg/EHAYe3tTYa) [](https://matrix.to/#/#linux-vr-adventures:matrix.org)
|
||||||
|
|
||||||
Questions/issues specific to WayVR will be handled in the `wayvr` chat room. Feel free to ask anything.
|
Questions/issues specific to WayVR will be handled in the `wayvr` chat room. Feel free to ask anything.
|
||||||
|
|
||||||
|
|
@ -24,14 +24,10 @@ Questions/issues specific to WayVR will be handled in the `wayvr` chat room. Fee
|
||||||
|
|
||||||
There are multiple ways to install WayVR:
|
There are multiple ways to install WayVR:
|
||||||
|
|
||||||
1. AppImage: Download from [Releases](https://github.com/wlx-team/wayvr/releases)
|
1. AppImage: Download from [Releases](https://github.com/wayvr-org/wayvr/releases)
|
||||||
1. AUR package: [wayvr](https://aur.archlinux.org/packages/wayvr) or [wayvr-git](https://aur.archlinux.org/packages/wayvr-git)
|
1. AUR package: [wayvr](https://aur.archlinux.org/packages/wayvr) or [wayvr-git](https://aur.archlinux.org/packages/wayvr-git)
|
||||||
1. Homebrew:
|
1. Nix package: [wayvr](https://search.nixos.org/packages?channel=unstable&show=wayvr&query=wayvr) or [unstable package from nixpkgs-xr](https://github.com/nix-community/nixpkgs-xr)
|
||||||
|
1. [Docs: Building from source](https://wayvr.org/docs/basics/building-from-source/).
|
||||||
- Add AtomicXR tap: `brew tap matrixfurry.com/atomicxr https://tangled.sh/@matrixfurry.com/homebrew-atomicxr`
|
|
||||||
- Install WayVR: `brew install wlx-overlay-s`
|
|
||||||
|
|
||||||
1. [Building from source](https://github.com/wlx-team/wayvr/wiki/Building-from-Source).
|
|
||||||
|
|
||||||
### General Setup
|
### General Setup
|
||||||
|
|
||||||
|
|
@ -44,7 +40,7 @@ There are multiple ways to install WayVR:
|
||||||
|
|
||||||
For users specifically running **SteamVR via Steam Flatpak**, follow these steps:
|
For users specifically running **SteamVR via Steam Flatpak**, follow these steps:
|
||||||
|
|
||||||
1. Grab the latest AppImage from [Releases](https://github.com/wlx-team/wayvr/releases).
|
1. Grab the latest AppImage from [Releases](https://github.com/wayvr-org/wayvr/releases).
|
||||||
1. `WayVR-*.AppImage --appimage-extract`
|
1. `WayVR-*.AppImage --appimage-extract`
|
||||||
1. `chmod +x squashfs-root/AppRun`
|
1. `chmod +x squashfs-root/AppRun`
|
||||||
1. Move the newly created `squashfs-root` folder to a location accessible by the Steam Flatpak.
|
1. Move the newly created `squashfs-root` folder to a location accessible by the Steam Flatpak.
|
||||||
|
|
@ -60,15 +56,15 @@ For users specifically running **SteamVR via Steam Flatpak**, follow these steps
|
||||||
In case screens were selected in the wrong order:
|
In case screens were selected in the wrong order:
|
||||||
|
|
||||||
- Go to Settings and press `Clear PipeWire tokens` and then `Restart software`
|
- Go to Settings and press `Clear PipeWire tokens` and then `Restart software`
|
||||||
- Pay attention to your notifications, it tells you in which order to pick the screens.
|
- Pay attention to your notifications, which tell you in which order to pick the screens.
|
||||||
- If notifications don't show, try start WayVR from the terminal and look for instructions in there.
|
- If notifications don't show, try starting WayVR from the terminal and look for instructions in there.
|
||||||
|
|
||||||
**WiVRn users**: Select WayVR from the `Application` drop-down. If there's no such entry, select `Custom` and browse to your WayVR executable or AppImage.
|
**WiVRn users**: Select WayVR from the `Application` drop-down. If there's no such entry, select `Custom` and browse to your WayVR executable or AppImage.
|
||||||
|
|
||||||
**Envision users**: Go to the Plugins menu and select the WayVR plugin. This will download and run the AppImage version of the overlay.
|
**Envision users**: Go to the Plugins menu and select the WayVR plugin. This will download and run the AppImage version of the overlay.
|
||||||
In order to run a standalone installation (for instance from the AUR), create a bash script containing `wayvr --openxr --show` and then set this bash script as a custom Envision plugin.
|
To run a standalone installation (for instance, from the AUR), create a bash script containing `wayvr --openxr --show` and then set this bash script as a custom Envision plugin.
|
||||||
|
|
||||||
This will show a home environment with headset passthrough by default or a [customizable background](https://github.com/wlx-team/wayvr/wiki/OpenXR-Skybox)!
|
This will show a home environment with headset passthrough enabled by default or a [customizable background](https://wayvr.org/docs/various/openxr-skybox/)!
|
||||||
|
|
||||||
**SteamVR users**: WayVR will register itself for auto-start, so there is no need to start it every time. Disclaimer: SteamVR will sometimes disregard this and not start WayVR anyway.
|
**SteamVR users**: WayVR will register itself for auto-start, so there is no need to start it every time. Disclaimer: SteamVR will sometimes disregard this and not start WayVR anyway.
|
||||||
|
|
||||||
|
|
@ -78,7 +74,7 @@ This will show a home environment with headset passthrough by default or a [cust
|
||||||
|
|
||||||
### Working Set
|
### Working Set
|
||||||
|
|
||||||
The working set consists of all currently selected overlays; screens, mirrors, keyboard, etc.
|
The working set consists of all currently selected overlays: screens, mirrors, keyboard, etc.
|
||||||
|
|
||||||
The working set appears in front of the headset when shown, and can be re-centered by hiding and showing again.
|
The working set appears in front of the headset when shown, and can be re-centered by hiding and showing again.
|
||||||
|
|
||||||
|
|
@ -108,17 +104,17 @@ Check your left wrist for the watch. The watch is the primary tool for controlli
|
||||||
|
|
||||||
The top of the watch shows device batteries, and the bottom shows your overlay controls.
|
The top of the watch shows device batteries, and the bottom shows your overlay controls.
|
||||||
|
|
||||||
Enter edit mode (leftmost button on bottom) to edit your overlay sets.
|
Enter edit mode (the leftmost button at the bottom) to edit your overlay sets.
|
||||||
|
|
||||||
While in edit mode, the watch can also be grabbed, and passed between your hands.
|
While in edit mode, the watch can also be grabbed and passed between your hands.
|
||||||
|
|
||||||
After grabbing, the watch will automatically attach to the hand that's opposite from the one that held it.
|
After grabbing, the watch will automatically attach to the hand that's opposite from the one that held it.
|
||||||
|
|
||||||
In edit mode, try hovering other overlays to see their advanced options!
|
In edit mode, try hovering over other overlays to see their advanced options!
|
||||||
|
|
||||||
### The screens
|
### The screens
|
||||||
|
|
||||||
Hovering a pointer over a screen will move the mouse. If there are more than one pointers hovering a screen, the pointer that was last used to click will take precedence.
|
Hovering a pointer over a screen will move the mouse. If more than one pointer is hovering over a screen, the pointer that was last used to click will take precedence.
|
||||||
|
|
||||||
The click type depends on the laser color:
|
The click type depends on the laser color:
|
||||||
|
|
||||||
|
|
@ -132,29 +128,45 @@ The click type depends on the laser color:
|
||||||
Typing
|
Typing
|
||||||
|
|
||||||
- Use the BLUE laser when typing regularly.
|
- Use the BLUE laser when typing regularly.
|
||||||
- While using ORANGE laser, all keystrokes will have SHIFT applied.
|
- While using the ORANGE laser, all keystrokes will have SHIFT applied.
|
||||||
- Purple laser is customizable via the settings, no modifier by default.
|
- Purple laser is customizable via the settings, no modifier by default.
|
||||||
|
|
||||||
**Modifier Keys** are sticky. They will remain pressed until a non-modifier key is pressed, the modifier gets toggled off, or the keyboard gets hidden.
|
**Modifier Keys are sticky**. They will remain pressed until either:
|
||||||
|
|
||||||
|
- a non-modifier key is pressed
|
||||||
|
- the modifier is toggled off by clicking again
|
||||||
|
- the keyboard is hidden (including via show-hide)
|
||||||
|
|
||||||
### Default Bindings
|
### Default Bindings
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
To customize bindings on OpenXR, refer to the [OpenXR Bindings wiki page](https://github.com/wlx-team/wayvr/wiki/OpenXR-Bindings).
|
### Changing Bindings
|
||||||
|
|
||||||
If your bindings are not supported, please reach out. \
|
SteamVR: Simply change the bindings from the SteamVR bindings section. If WayVR doesn't show up on the list, select any other title and then press back on the top left. (SteamVR is weird like that sometimes)
|
||||||
|
|
||||||
|
OpenXR (Monado/WiVRn): See [Docs: OpenXR Bindings](https://wayvr.org/docs/various/openxr-bindings/)
|
||||||
|
|
||||||
|
If your controllers are not supported, please reach out. \
|
||||||
We would like to work with you and include additional bindings.
|
We would like to work with you and include additional bindings.
|
||||||
|
|
||||||
|
## Customization
|
||||||
|
|
||||||
|
See these relevant wiki pages:
|
||||||
|
|
||||||
|
- For all available config options, check [Docs: Configuration](https://wayvr.org/docs/basics/configuration/)
|
||||||
|
- Looking to customize look & feel, or add functionality? See [Docs: Customization](https://wayvr.org/docs/basics/customization/)
|
||||||
|
- Looking to change the OpenXR background? See [Docs: OpenXR Skybox](https://wayvr.org/docs/various/openxr-skybox/)
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
When an error is detected, we often print tips for fixing into the log file.
|
When an error is detected, we often print tips for fixing it into the log file.
|
||||||
|
|
||||||
Logs will be at `/tmp/wayvr.log` for most distros.
|
Logs will be at `/tmp/wayvr.log` for most distros.
|
||||||
|
|
||||||
Check [here](https://github.com/wlx-team/wayvr/wiki/Troubleshooting) for tips.
|
Check [here](https://wayvr.org/docs/various/troubleshooting/) for tips.
|
||||||
|
|
||||||
## Known Issues
|
## Known Issues
|
||||||
|
|
||||||
|
|
@ -163,8 +175,8 @@ Check [here](https://github.com/wlx-team/wayvr/wiki/Troubleshooting) for tips.
|
||||||
If the mouse is moving on a completely different screen, the screens were likely selected in the wrong order:
|
If the mouse is moving on a completely different screen, the screens were likely selected in the wrong order:
|
||||||
|
|
||||||
- Go to Settings and press `Clear PipeWire tokens` and then `Restart software`
|
- Go to Settings and press `Clear PipeWire tokens` and then `Restart software`
|
||||||
- Pay attention to your notifications, it tells you in which order to pick the screens.
|
- Pay attention to your notifications, which tell you in which order to pick the screens.
|
||||||
- If notifications don't show, try start WayVR from the terminal and look for instructions in there.
|
- If notifications don't show, try starting WayVR from the terminal and look for instructions in there.
|
||||||
|
|
||||||
COSMIC desktop:
|
COSMIC desktop:
|
||||||
|
|
||||||
|
|
@ -176,23 +188,23 @@ X11 users:
|
||||||
- DPI scaling is not supported and will mess with the mouse.
|
- DPI scaling is not supported and will mess with the mouse.
|
||||||
- Upright screens are not supported and will mess with the mouse.
|
- Upright screens are not supported and will mess with the mouse.
|
||||||
|
|
||||||
### Screens are blank or black or frozen on Steam Link
|
### Screens are blank or black or frozen on SteamVR 2.14+
|
||||||
|
|
||||||
As of SteamVR version 2.14.x, PipeWire capture no longer works when using Steam Link.
|
As of SteamVR version 2.14.x, PipeWire capture no longer works when using Steam Link.
|
||||||
|
|
||||||
We're unable to completely troubleshoot how and why Steam Link interferes with PipeWire, so consider the following workarounds for the time being:
|
We're unable to completely troubleshoot how and why SteamVR interferes with PipeWire, so consider the following workarounds for the time being:
|
||||||
|
|
||||||
- Use another streamer, such as WiVRn or ALVR
|
- Use another streamer, such as WiVRn or ALVR. Note that SteamVR on Linux is considered experimental by Valve themselves [disclaimer](https://github.com/ValveSoftware/SteamVR-for-Linux?tab=readme-ov-file#steamvr-release-notes-and-known-issues).
|
||||||
- If your desktop [supports ScreenCopy](https://wayland.app/protocols/wlr-screencopy-unstable-v1#compositor-support), go to Settings and set `Wayland capture method` to `ScreenCopy`
|
- If your desktop [supports ScreenCopy](https://wayland.app/protocols/wlr-screencopy-unstable-v1#compositor-support), go to Settings and set `Wayland capture method` to `ScreenCopy`
|
||||||
- If your desktop has an X11 mode, try using that
|
- If your desktop has an X11 mode, try using that
|
||||||
|
|
||||||
### Modifiers get stuck
|
### Modifiers get stuck
|
||||||
|
|
||||||
Hiding the keyboard will un-press all of its buttons. Alternatively, go to Settings and use the `Restart software` button.
|
Hiding the keyboard will unpress all of its buttons. Alternatively, go to Settings and use the `Restart software` button.
|
||||||
|
|
||||||
### X11 limitations
|
### X11 limitations
|
||||||
|
|
||||||
- X11 capture can generally seem slow. This is because zero-copy GPU capture is not supported on the general X11 desktop. Consider trying Wayland.
|
- X11 capture can generally seem slow. This is because zero-copy GPU capture is not supported on the general X11 desktop. Consider trying Wayland.
|
||||||
- DPI scaling is not supported and may cause the mouse to not follow the laser properly.
|
- DPI scaling is not supported and may cause the mouse to not follow the laser properly.
|
||||||
- Upright screens are not supported and can cause the mouse to not follow the laser properly.
|
- Upright screens are not supported and can cause the mouse to not follow the laser properly.
|
||||||
- Screen changes (connecting / disconnecting a display, resolution changes, etc) are not handled at runtime. Restart the overlay for these to take effect.
|
- Screen changes (connecting/disconnecting a display, resolution changes, etc) are not handled at runtime. Restart the overlay for these to take effect.
|
||||||
|
|
|
||||||
|
|
@ -8,27 +8,26 @@ authors = ["galister", "oo8dev"]
|
||||||
repository = "https://github.com/wlx-team/wayvr"
|
repository = "https://github.com/wlx-team/wayvr"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wayvr-ipc = { path = "../wayvr-ipc", default-features = false }
|
|
||||||
wgui = { path = "../wgui/" }
|
|
||||||
wlx-common = { path = "../wlx-common" }
|
|
||||||
|
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
|
async-native-tls = "0.5.0"
|
||||||
|
chrono = "0.4.42"
|
||||||
glam = { workspace = true, features = ["mint", "serde"] }
|
glam = { workspace = true, features = ["mint", "serde"] }
|
||||||
|
http-body-util = "0.1.3"
|
||||||
|
hyper = { version = "1.8.1", features = ["client", "http1", "http2"] }
|
||||||
|
keyvalues-parser = { git = "https://codeberg.org/CosmicHarper/vdf-rs.git", rev = "fc6dcbea9eb13cacb98dea40063f6f56cde6e145" }
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
xdg.workspace = true
|
|
||||||
rust-embed.workspace = true
|
rust-embed.workspace = true
|
||||||
serde = { workspace = true, features = ["rc"] }
|
serde = { workspace = true, features = ["rc"] }
|
||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
strum.workspace = true
|
smol = { workspace = true }
|
||||||
|
|
||||||
chrono = "0.4.42"
|
|
||||||
keyvalues-parser = { git = "https://github.com/CosmicHorrorDev/vdf-rs.git", rev = "fc6dcbea9eb13cacb98dea40063f6f56cde6e145" }
|
|
||||||
smol = "2.0.2"
|
|
||||||
hyper = { version = "1.8.1", features = ["client", "http1", "http2"] }
|
|
||||||
http-body-util = "0.1.3"
|
|
||||||
async-native-tls = "0.5.0"
|
|
||||||
smol-hyper = "0.1.1"
|
smol-hyper = "0.1.1"
|
||||||
|
strum.workspace = true
|
||||||
|
uuid.workspace = true
|
||||||
|
wayvr-ipc = { path = "../wayvr-ipc", default-features = false }
|
||||||
|
wgui = { path = "../wgui/" }
|
||||||
|
wlx-common = { path = "../wlx-common" }
|
||||||
|
xdg.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["monado" ]
|
default = ["monado"]
|
||||||
monado = []
|
monado = []
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE -->
|
||||||
|
<path fill="currentColor" d="m10 18l-6-6l6-6l1.4 1.45L7.85 11H20v2H7.85l3.55 3.55z" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 294 B |
|
|
@ -0,0 +1,3 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE -->
|
||||||
|
<path fill="currentColor" d="m14 18l-1.4-1.45L16.15 13H4v-2h12.15L12.6 7.45L14 6l6 6z" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 297 B |
|
After Width: | Height: | Size: 9.8 KiB |
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE --><path fill="#33FF99" d="m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"/></svg>
|
||||||
|
After Width: | Height: | Size: 295 B |
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE --><path fill="currentColor" d="m12 16l-5-5l1.4-1.45l2.6 2.6V4h2v8.15l2.6-2.6L17 11zm-6 4q-.825 0-1.412-.587T4 18v-3h2v3h12v-3h2v3q0 .825-.587 1.413T18 20z"/></svg>
|
||||||
|
After Width: | Height: | Size: 360 B |
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE --><path fill="currentColor" d="m12 22l-4.25-4.25l1.425-1.425L11 18.15V13H5.875L7.7 14.8l-1.45 1.45L2 12l4.225-4.225L7.65 9.2L5.85 11H11V5.85L9.175 7.675L7.75 6.25L12 2l4.25 4.25l-1.425 1.425L13 5.85V11h5.125L16.3 9.2l1.45-1.45L22 12l-4.25 4.25l-1.425-1.425L18.15 13H13v5.125l1.8-1.825l1.45 1.45z"/></svg>
|
||||||
|
After Width: | Height: | Size: 500 B |
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE --><path fill="#FF4455" d="M12 17q.425 0 .713-.288T13 16t-.288-.712T12 15t-.712.288T11 16t.288.713T12 17m-1-4h2V7h-2zm1 9q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8"/></svg>
|
||||||
|
After Width: | Height: | Size: 574 B |
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
width="32"
|
||||||
|
height="32"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
version="1.1"
|
||||||
|
id="svg1"
|
||||||
|
sodipodi:docname="gravity.svg"
|
||||||
|
inkscape:version="1.4.4 (dcaf3e7d9e, 2026-05-05)"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#000000"
|
||||||
|
borderopacity="0.25"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:zoom="23.234375"
|
||||||
|
inkscape:cx="17.861466"
|
||||||
|
inkscape:cy="22.488231"
|
||||||
|
inkscape:window-width="1582"
|
||||||
|
inkscape:window-height="1302"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:current-layer="svg1" />
|
||||||
|
<defs
|
||||||
|
id="defs1" />
|
||||||
|
<!-- Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE -->
|
||||||
|
<!-- Modified it a little bit, there's no "space gravity" icon available. -->
|
||||||
|
<path
|
||||||
|
fill="currentColor"
|
||||||
|
d="m 15.76786,18.274928 -1.391472,0.295932 -0.674684,-2.9751 -3.051267,-0.735557 -2.4062791,-3.292082 -0.8846145,1.824345 1.561484,2.213127 -1.1706157,0.808349 -1.9932655,-2.862487 1.752944,-3.7745856 Q 7.740355,9.2978686 8.2693798,9.1366908 8.7984057,8.9755132 9.3446883,8.9671549 9.9537305,8.9704882 10.547911,8.8283107 11.142091,8.6861403 11.667399,8.364791 12.192707,8.0434408 12.541821,7.5511898 12.890935,7.0589389 13.170167,6.5208564 l 1.228561,0.6477209 q -0.321651,0.575352 -0.696034,1.1164692 -0.374382,0.5411172 -0.890945,0.9726251 -0.466314,0.3718768 -0.998843,0.6112737 -0.532529,0.2393967 -1.117089,0.3386867 L 12,12 l 2.176682,-1.469824 4.352172,0.934365 -0.326914,1.35612 -3.582453,-0.734464 -2.11263,1.442217 2.281549,0.535655 z M 7.5517982,8.9044443 Q 7.0233673,9.1322023 6.4853273,8.9182692 5.9472884,8.7043353 5.7186139,8.1755407 5.4899403,7.6467461 5.7054294,7.108795 5.9209195,6.5708439 6.4475175,6.3423563 6.9741154,6.1138698 7.5149037,6.3288971 8.0556931,6.5439235 8.2807018,7.07126 8.5057095,7.5985974 8.2948017,8.1383704 8.0838948,8.6781445 7.5517982,8.9044443"
|
||||||
|
id="path1"
|
||||||
|
style="stroke-width:0.697484" />
|
||||||
|
<path
|
||||||
|
id="path2"
|
||||||
|
style="fill:none;stroke:currentColor;stroke-width:2.43525;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:0, 7.30575"
|
||||||
|
d="M 22.480952,12 C 22.480952,17.78847 17.78847,22.480952 12,22.480952 6.2115299,22.480952 1.5190477,17.78847 1.5190477,12 1.5190475,6.2115298 6.2115298,1.5190477 12,1.5190477 c 0.653263,0 1.292568,0.059766 1.912744,0.1741274 C 18.787854,2.5921561 22.480952,6.8647934 22.480952,12 Z"
|
||||||
|
sodipodi:nodetypes="ssssss" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.8 KiB |
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Material Design Icons by Pictogrammers - https://github.com/Templarian/MaterialDesign/blob/master/LICENSE --><path fill="currentColor" d="M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8"/></svg>
|
||||||
|
After Width: | Height: | Size: 286 B |
|
|
@ -0,0 +1,3 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE -->
|
||||||
|
<path fill="currentColor" d="M12 19q1.65 0 2.825-1.175T16 15v-4q0-1.65-1.175-2.825T12 7T9.175 8.175T8 11v4q0 1.65 1.175 2.825T12 19m-2-3h4v-2h-4zm0-4h4v-2h-4zm2 9q-1.625 0-3.012-.8T6.8 18H4v-2h2.1q-.075-.5-.088-1T6 14H4v-2h2q0-.5.012-1t.088-1H4V8h2.8q.35-.575.788-1.075T8.6 6.05L7 4.4L8.4 3l2.15 2.15q.7-.225 1.425-.225t1.425.225L15.6 3L17 4.4l-1.65 1.65q.575.375 1.038.862T17.2 8H20v2h-2.1q.075.5.088 1T18 12h2v2h-2q0 .5-.013 1t-.087 1H20v2h-2.8q-.8 1.4-2.187 2.2T12 21" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 682 B |
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE --><path fill="currentColor" d="M7 21q-.825 0-1.412-.587T5 19V6H4V4h5V3h6v1h5v2h-1v13q0 .825-.587 1.413T17 21zM17 6H7v13h10zM9 17h2V8H9zm4 0h2V8h-2zM7 6v13z"/></svg>
|
||||||
|
After Width: | Height: | Size: 360 B |
|
After Width: | Height: | Size: 22 KiB |
|
|
@ -1,110 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
width="30"
|
|
||||||
height="30"
|
|
||||||
viewBox="0 0 7.9375004 7.9375004"
|
|
||||||
version="1.1"
|
|
||||||
id="svg1"
|
|
||||||
inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
|
|
||||||
sodipodi:docname="dashboard_logo.svg"
|
|
||||||
inkscape:export-filename="dashboard_logo.png"
|
|
||||||
inkscape:export-xdpi="409.60001"
|
|
||||||
inkscape:export-ydpi="409.60001"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg">
|
|
||||||
<sodipodi:namedview
|
|
||||||
id="namedview1"
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#000000"
|
|
||||||
borderopacity="0.25"
|
|
||||||
inkscape:showpageshadow="2"
|
|
||||||
inkscape:pageopacity="0.0"
|
|
||||||
inkscape:pagecheckerboard="true"
|
|
||||||
inkscape:deskcolor="#d1d1d1"
|
|
||||||
inkscape:document-units="mm"
|
|
||||||
inkscape:zoom="16"
|
|
||||||
inkscape:cx="11.8125"
|
|
||||||
inkscape:cy="16.78125"
|
|
||||||
inkscape:window-width="1836"
|
|
||||||
inkscape:window-height="1185"
|
|
||||||
inkscape:window-x="0"
|
|
||||||
inkscape:window-y="0"
|
|
||||||
inkscape:window-maximized="0"
|
|
||||||
inkscape:current-layer="layer1"
|
|
||||||
showgrid="true"
|
|
||||||
showguides="false">
|
|
||||||
<inkscape:grid
|
|
||||||
id="grid2"
|
|
||||||
units="mm"
|
|
||||||
originx="0"
|
|
||||||
originy="0"
|
|
||||||
spacingx="0.26458333"
|
|
||||||
spacingy="0.26458333"
|
|
||||||
empcolor="#0099e5"
|
|
||||||
empopacity="0.30196078"
|
|
||||||
color="#0099e5"
|
|
||||||
opacity="0.14901961"
|
|
||||||
empspacing="5"
|
|
||||||
enabled="true"
|
|
||||||
visible="true" />
|
|
||||||
</sodipodi:namedview>
|
|
||||||
<defs
|
|
||||||
id="defs1">
|
|
||||||
<linearGradient
|
|
||||||
id="linearGradient1"
|
|
||||||
inkscape:collect="always">
|
|
||||||
<stop
|
|
||||||
style="stop-color:#ad70ff;stop-opacity:1;"
|
|
||||||
offset="0"
|
|
||||||
id="stop1" />
|
|
||||||
<stop
|
|
||||||
style="stop-color:#00ffff;stop-opacity:1;"
|
|
||||||
offset="0.99844205"
|
|
||||||
id="stop2" />
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient
|
|
||||||
inkscape:collect="always"
|
|
||||||
xlink:href="#linearGradient1"
|
|
||||||
id="linearGradient2"
|
|
||||||
x1="0"
|
|
||||||
y1="8.4666653"
|
|
||||||
x2="8.4664993"
|
|
||||||
y2="0"
|
|
||||||
gradientUnits="userSpaceOnUse"
|
|
||||||
gradientTransform="scale(0.93751843,0.93750002)" />
|
|
||||||
</defs>
|
|
||||||
<g
|
|
||||||
inkscape:label="back"
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer1">
|
|
||||||
<rect
|
|
||||||
style="font-variation-settings:'wght' 700;fill:url(#linearGradient2);stroke-width:0.468754;stroke-linecap:round;stroke-linejoin:round"
|
|
||||||
id="rect1"
|
|
||||||
width="7.9380002"
|
|
||||||
height="7.9375"
|
|
||||||
x="0"
|
|
||||||
y="0"
|
|
||||||
rx="1.5874999"
|
|
||||||
ry="1.5874999" />
|
|
||||||
<path
|
|
||||||
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.05833;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 1.5874998,3.7041664 v 1.3229167 h 1.3229166 v 1.3229165 l 1.3229165,-1e-7"
|
|
||||||
id="path3"
|
|
||||||
sodipodi:nodetypes="ccccc" />
|
|
||||||
<path
|
|
||||||
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:1.05833;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="M 1.5874998,2.6458332 V 1.5875 c 3.1749997,-2e-7 4.7624995,1.5874997 4.7624995,4.7624995 H 5.2916661"
|
|
||||||
id="path4"
|
|
||||||
sodipodi:nodetypes="cccc" />
|
|
||||||
</g>
|
|
||||||
<g
|
|
||||||
inkscape:groupmode="layer"
|
|
||||||
id="layer2"
|
|
||||||
inkscape:label="front"
|
|
||||||
style="stroke-width:2.11667;stroke-dasharray:none" />
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 3.4 KiB |
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
<theme>
|
<theme>
|
||||||
<var key="side_size" value="48" />
|
<var key="side_size" value="48" />
|
||||||
|
<var key="top_size" value="40" />
|
||||||
<var key="side_sprite_size" value="26" />
|
<var key="side_sprite_size" value="26" />
|
||||||
<var key="side_button_size" value="48" />
|
<var key="side_button_size" value="48" />
|
||||||
</theme>
|
</theme>
|
||||||
|
|
@ -25,13 +26,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<elements>
|
<elements>
|
||||||
<div position="absolute" width="100%" justify_content="space_between">
|
|
||||||
<div />
|
|
||||||
<div padding="6">
|
|
||||||
<Button id="btn_close" sprite_src_builtin="dashboard/close.svg" color="#000000" border="2" border_color="~color_faded" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- left/right separator (menu and rest) -->
|
<!-- left/right separator (menu and rest) -->
|
||||||
<div flex_direction="row" gap="8" width="100%" height="100%" padding="4" interactable="0">
|
<div flex_direction="row" gap="8" width="100%" height="100%" padding="4" interactable="0">
|
||||||
<!-- LEFT MENU -->
|
<!-- LEFT MENU -->
|
||||||
|
|
@ -55,21 +49,34 @@
|
||||||
<SideButton id="btn_side_apps" src_builtin="dashboard/apps.svg" tooltip="APPLICATIONS" tooltip_side="right" />
|
<SideButton id="btn_side_apps" src_builtin="dashboard/apps.svg" tooltip="APPLICATIONS" tooltip_side="right" />
|
||||||
<SideButton id="btn_side_games" src_builtin="dashboard/games.svg" tooltip="GAMES" tooltip_side="right" />
|
<SideButton id="btn_side_games" src_builtin="dashboard/games.svg" tooltip="GAMES" tooltip_side="right" />
|
||||||
<SideButton id="btn_side_monado" src_builtin="dashboard/monado.svg" tooltip="MONADO_RUNTIME" tooltip_side="right" />
|
<SideButton id="btn_side_monado" src_builtin="dashboard/monado.svg" tooltip="MONADO_RUNTIME" tooltip_side="right" />
|
||||||
<!-- SideButton id="btn_side_processes" src_builtin="dashboard/window.svg" tooltip="PROCESSES" tooltip_side="right" /-->
|
|
||||||
<rectangle height="2" color="#FFFFFF33" width="~side_sprite_size" />
|
<rectangle height="2" color="#FFFFFF33" width="~side_sprite_size" />
|
||||||
<SideButton id="btn_side_settings" src_builtin="dashboard/settings.svg" tooltip="SETTINGS" tooltip_side="right" />
|
<SideButton id="btn_side_settings" src_builtin="dashboard/settings.svg" tooltip="SETTINGS" tooltip_side="right" />
|
||||||
</rectangle>
|
</rectangle>
|
||||||
</div>
|
</div>
|
||||||
<!-- REST -->
|
<!-- REST -->
|
||||||
<!-- content/bottom panel separator -->
|
<!-- top/content/bottom panel separator -->
|
||||||
<div
|
<div
|
||||||
flex_direction="column"
|
flex_direction="column"
|
||||||
gap="8"
|
gap="8"
|
||||||
width="100%"
|
width="100%"
|
||||||
height="100%"
|
height="100%"
|
||||||
overflow_x="scroll">
|
overflow_x="scroll">
|
||||||
<!-- CONTENT -->
|
<!-- TOP PANEL -->
|
||||||
|
<div position="relative" width="100%" height="~top_size" min_height="~top_size" max_height="~top_size" justify_content="end">
|
||||||
|
<!-- Title bar -->
|
||||||
|
<div width="100%" align_items="center" justify_content="center">
|
||||||
|
<rectangle min_width="300" height="100%" consume_mouse_events="1" round="100%" color="~color_top_panel" align_items="center" justify_content="center" gap="8">
|
||||||
|
<sprite id="sprite_titlebar_icon" width="24" height="24" />
|
||||||
|
<label id="label_titlebar_title" weight="bold" size="16" text="Title" />
|
||||||
|
</rectangle>
|
||||||
|
</div>
|
||||||
|
<!-- Close button -->
|
||||||
|
<Button position="absolute" id="btn_close" color="~color_top_panel" round="100%" width="~top_size" height="~top_size" tooltip="CLOSE_WINDOW" tooltip_side="left">
|
||||||
|
<sprite src_builtin="dashboard/close.svg" width="32" height="32" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- CONTENT -->
|
||||||
<!-- color and color2 alpha will be modified at runtime -->
|
<!-- color and color2 alpha will be modified at runtime -->
|
||||||
<rectangle
|
<rectangle
|
||||||
id="rect_content"
|
id="rect_content"
|
||||||
|
|
@ -79,29 +86,26 @@
|
||||||
round="8"
|
round="8"
|
||||||
flex_grow="1"
|
flex_grow="1"
|
||||||
width="100%"
|
width="100%"
|
||||||
overflow_y="scroll"
|
overflow="scroll"
|
||||||
|
position="relative"
|
||||||
>
|
>
|
||||||
<!-- radial gradient -->
|
<!-- radial gradient -->
|
||||||
<rectangle
|
<rectangle
|
||||||
position="absolute" width="100%" height="100%"
|
position="absolute" width="100%" height="100%"
|
||||||
gradient="radial" color="#44BBFF11" color2="#00000000" />
|
gradient="radial" color="#44BBFF11" color2="#00000000" />
|
||||||
|
|
||||||
<div
|
<div overflow_x="scroll" overflow_y="scroll" width="100%" height="100%">
|
||||||
id="content"
|
<div
|
||||||
flex_direction="column"
|
id="content"
|
||||||
overflow_x="scroll"
|
flex_direction="column"
|
||||||
overflow_y="scroll"
|
padding="16"
|
||||||
padding_top="8"
|
gap="8"
|
||||||
padding_bottom="8"
|
width="100%"
|
||||||
padding_left="16"
|
height="100%"
|
||||||
padding_right="16"
|
>
|
||||||
gap="8"
|
<!-- filled-in at runtime -->
|
||||||
width="100%"
|
</div>
|
||||||
min_height="100%"
|
|
||||||
>
|
|
||||||
<!-- filled-in at runtime -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div position="absolute" id="popup_manager" width="100%" height="100%" />
|
<div position="absolute" id="popup_manager" width="100%" height="100%" />
|
||||||
</rectangle>
|
</rectangle>
|
||||||
<!-- BOTTOM PANEL -->
|
<!-- BOTTOM PANEL -->
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@
|
||||||
gap="8"
|
gap="8"
|
||||||
round="8" />
|
round="8" />
|
||||||
|
|
||||||
<!-- src, text, translation -->
|
<!-- src_builtin, text, translation -->
|
||||||
<template name="GroupBoxTitle">
|
<template name="GroupBoxTitle">
|
||||||
<div flex_direction="row" align_items="center" gap="8">
|
<div flex_direction="row" align_items="center" gap="8">
|
||||||
<sprite src="${src}" src_builtin="${src_builtin}" width="24" height="24" />
|
<sprite src_builtin="${src_builtin}" width="24" height="24" />
|
||||||
<label text="${text}" translation="${translation}" weight="bold" size="18" />
|
<label text="${text}" translation="${translation}" weight="bold" size="18" />
|
||||||
</div>
|
</div>
|
||||||
<rectangle color="#FFFFFF44" width="100%" height="2" />
|
<rectangle color="#FFFFFF44" width="100%" height="2" />
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
<layout>
|
||||||
|
<template name="LoadingWithText">
|
||||||
|
<div id="root" width="100%" height="100%" align_items="center" justify_content="center">
|
||||||
|
<div flex_direction="row" gap="8" align_items="center" >
|
||||||
|
<sprite id="sprite_loading" src_builtin="dashboard/loading.svg" width="32" height="32"/>
|
||||||
|
<label translation="LOADING" weight="bold"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template name="LoadingWithoutText">
|
||||||
|
<div id="root" width="100%" height="100%" align_items="center" justify_content="center">
|
||||||
|
<sprite id="sprite_loading" src_builtin="dashboard/loading.svg" width="32" height="32"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</layout>
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
<layout>
|
<layout>
|
||||||
<include src="t_tab_title.xml" />
|
|
||||||
<include src="../theme.xml" />
|
<include src="../theme.xml" />
|
||||||
|
|
||||||
<template name="AppEntry">
|
<template name="AppEntry">
|
||||||
|
|
@ -25,7 +24,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<elements>
|
<elements>
|
||||||
<TabTitle translation="APPLICATIONS" icon="dashboard/apps.svg" />
|
|
||||||
<!-- placeholders for now -->
|
<!-- placeholders for now -->
|
||||||
<!--
|
<!--
|
||||||
<div gap="4" align_items="center">
|
<div gap="4" align_items="center">
|
||||||
|
|
@ -46,7 +44,6 @@
|
||||||
flex_direction="row"
|
flex_direction="row"
|
||||||
flex_wrap="wrap"
|
flex_wrap="wrap"
|
||||||
gap="4"
|
gap="4"
|
||||||
overflow_y="scroll"
|
|
||||||
/>
|
/>
|
||||||
</elements>
|
</elements>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
<layout>
|
<layout>
|
||||||
<include src="t_tab_title.xml" />
|
|
||||||
|
|
||||||
<elements>
|
<elements>
|
||||||
<TabTitle translation="GAMES" icon="dashboard/games.svg" />
|
<div id="running_games_list_parent" align_self="center" />
|
||||||
<div id="game_list_parent" align_items="center" />
|
<div id="game_list_parent" align_items="center" flex_direction="column" gap="8" />
|
||||||
</elements>
|
</elements>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
align_items="center"
|
align_items="center"
|
||||||
flex_grow="1"
|
flex_grow="1"
|
||||||
gap="24">
|
gap="24">
|
||||||
<sprite src_builtin="dashboard/wayvr_dashboard.svg" width="96" height="96" />
|
<sprite src_builtin="dashboard/wayvr_dashboard.png" width="96" height="96" />
|
||||||
<label id="label_hello" size="32" weight="bold" />
|
<label id="label_hello" size="32" weight="bold" />
|
||||||
|
|
||||||
<!-- main button list -->
|
<!-- main button list -->
|
||||||
|
|
@ -16,9 +16,8 @@
|
||||||
<MenuButton id="btn_apps" icon="dashboard/apps.svg" translation="APPLICATIONS" />
|
<MenuButton id="btn_apps" icon="dashboard/apps.svg" translation="APPLICATIONS" />
|
||||||
<MenuButton id="btn_games" icon="dashboard/games.svg" translation="GAMES" />
|
<MenuButton id="btn_games" icon="dashboard/games.svg" translation="GAMES" />
|
||||||
<MenuButton id="btn_monado" icon="dashboard/monado.svg" text="Monado" />
|
<MenuButton id="btn_monado" icon="dashboard/monado.svg" text="Monado" />
|
||||||
<!--MenuButton id="btn_processes" icon="dashboard/window.svg" translation="PROCESSES" /-->
|
|
||||||
<MenuButton id="btn_settings" icon="dashboard/settings.svg" translation="SETTINGS" />
|
<MenuButton id="btn_settings" icon="dashboard/settings.svg" translation="SETTINGS" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</elements>
|
</elements>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -1,40 +1,14 @@
|
||||||
<layout>
|
<layout>
|
||||||
<include src="t_tab_title.xml" />
|
|
||||||
<include src="../t_group_box.xml" />
|
|
||||||
|
|
||||||
|
|
||||||
<!-- key: str, value: str -->
|
|
||||||
<template name="BoolFlag">
|
|
||||||
<div flex_direction="row" gap="4">
|
|
||||||
<label text="${key}" />
|
|
||||||
<label weight="bold" text="${value}" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<!-- name, checked, flag_* -->
|
|
||||||
<template name="Cell">
|
|
||||||
<rectangle macro="group_box">
|
|
||||||
<CheckBox id="checkbox" text="${name}" checked="${checked}" />
|
|
||||||
<div flex_direction="row" gap="8">
|
|
||||||
<BoolFlag key="Active:" value="${flag_active}" />
|
|
||||||
<BoolFlag key="Focused:" value="${flag_focused}" />
|
|
||||||
<BoolFlag key="IO active:" value="${flag_io_active}" />
|
|
||||||
<BoolFlag key="Overlay:" value="${flag_overlay}" />
|
|
||||||
<BoolFlag key="Primary:" value="${flag_primary}" />
|
|
||||||
<BoolFlag key="Visible:" value="${flag_visible}" />
|
|
||||||
</div>
|
|
||||||
</rectangle>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<elements>
|
<elements>
|
||||||
<TabTitle translation="MONADO_RUNTIME" icon="dashboard/monado.svg" />
|
<div gap="4">
|
||||||
<label translation="DISPLAY_BRIGHTNESS" />
|
<Tabs id="tabs">
|
||||||
<Slider id="slider_brightness" width="300" height="24" min_value="0" max_value="140" />
|
<Tab name="general_settings" translation="GENERAL_SETTINGS" sprite_src_builtin="dashboard/settings.svg" />
|
||||||
|
<Tab name="process_list" translation="PROCESS_LIST" sprite_src_builtin="dashboard/cpu.svg" />
|
||||||
<label translation="LIST_OF_PROCESSES" />
|
<Tab name="debug_timings" translation="DEBUG_INFO" sprite_src_builtin="dashboard/not_a_bug.svg" />
|
||||||
<div id="list_parent" flex_direction="column" gap="8">
|
</Tabs>
|
||||||
<!-- filled at runtime -->
|
<div gap="4" id="content" width="100%">
|
||||||
|
<!-- filled-in at runtime -->
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</elements>
|
</elements>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
<layout>
|
||||||
|
<include src="../t_group_box.xml" />
|
||||||
|
|
||||||
|
<!-- name, limit_min, limit_max -->
|
||||||
|
<template name="DebugGraph">
|
||||||
|
<rectangle flex_direction="column" align_items="center" gap="8" border="2" color="#ffffff11" color2="#ffffff22" gradient="vertical" border_color="#ffffff33" round="4" padding="4">
|
||||||
|
<label text="${name}" size="9" weight="bold" />
|
||||||
|
<BarGraph id="graph" width="180" height="70" unit="ms" limit_min="${limit_min}" limit_max="${limit_max}" capacity="50" />
|
||||||
|
</rectangle>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- text -->
|
||||||
|
<template name="SessionButton">
|
||||||
|
<Button id="button" text="${text}" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<elements>
|
||||||
|
<rectangle macro="group_box">
|
||||||
|
<GroupBoxTitle src_builtin="dashboard/apps.svg" text="Sessions" />
|
||||||
|
<div id="session_list_parent" flex_wrap="wrap" flex_direction="row" gap="8" />
|
||||||
|
<GroupBoxTitle src_builtin="dashboard/not_a_bug.svg" text="Debug timings" />
|
||||||
|
<div id="timings_parent" flex_wrap="wrap" flex_direction="row" gap="8">
|
||||||
|
<label text="Please select which session you want to monitor" />
|
||||||
|
</div>
|
||||||
|
</rectangle>
|
||||||
|
</elements>
|
||||||
|
</layout>
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
<layout>
|
||||||
|
<include src="../t_group_box.xml" />
|
||||||
|
|
||||||
|
<macro name="slider" width="100%" height="24"/>
|
||||||
|
|
||||||
|
<theme>
|
||||||
|
<var key="s_width" value="500"/>
|
||||||
|
</theme>
|
||||||
|
|
||||||
|
<elements>
|
||||||
|
<div flex_direction="column" gap="8">
|
||||||
|
<rectangle macro="group_box">
|
||||||
|
<GroupBoxTitle src_builtin="dashboard/settings.svg" translation="GENERAL_SETTINGS" />
|
||||||
|
|
||||||
|
<label translation="DISPLAY_BRIGHTNESS" />
|
||||||
|
<Slider id="slider_brightness" width="300" height="24" min_value="0" max_value="140" />
|
||||||
|
</rectangle>
|
||||||
|
<rectangle macro="group_box">
|
||||||
|
<GroupBoxTitle src_builtin="dashboard/settings.svg" translation="APP_SETTINGS.COLOR_KEYING" />
|
||||||
|
<div gap="8" width="~s_width">
|
||||||
|
<div gap="8" flex_direction="column" width="100%">
|
||||||
|
<label text="Color"/>
|
||||||
|
<ColorSelector id="cs_keying" height="24" width="100%"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div gap="8" flex_direction="column" width="100%">
|
||||||
|
<label text="Despill"/>
|
||||||
|
<Slider id="slider_keying_despill" min_value="0" max_value="100" macro="slider"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div gap="8" flex_direction="column" width="100%">
|
||||||
|
<label text="Curve (0 = disabled)"/>
|
||||||
|
<Slider id="slider_keying_curve" min_value="0" max_value="100" macro="slider"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div gap="8" width="~s_width">
|
||||||
|
<div gap="8" flex_direction="column" width="100%">
|
||||||
|
<label text="Hue range"/>
|
||||||
|
<Slider id="slider_keying_hue_range" min_value="0" max_value="100" macro="slider"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div gap="8" flex_direction="column" width="100%">
|
||||||
|
<label text="Saturation range"/>
|
||||||
|
<Slider id="slider_keying_saturation_range" min_value="0" max_value="100" macro="slider"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div gap="8" flex_direction="column" width="100%">
|
||||||
|
<label text="Value range"/>
|
||||||
|
<Slider id="slider_keying_value_range" min_value="0" max_value="100" macro="slider"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</rectangle>
|
||||||
|
</div>
|
||||||
|
</elements>
|
||||||
|
</layout>
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
<layout>
|
||||||
|
<include src="../t_group_box.xml" />
|
||||||
|
|
||||||
|
<!-- key: str, value: str -->
|
||||||
|
<template name="BoolFlag">
|
||||||
|
<div flex_direction="row" gap="4">
|
||||||
|
<label text="${key}" />
|
||||||
|
<label weight="bold" text="${value}" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- name, checked, flag_* -->
|
||||||
|
<template name="Cell">
|
||||||
|
<rectangle macro="group_box">
|
||||||
|
<CheckBox id="checkbox" text="${name}" checked="${checked}" />
|
||||||
|
<div flex_direction="row" gap="8" flex_wrap="wrap">
|
||||||
|
<BoolFlag key="Active:" value="${flag_active}" />
|
||||||
|
<BoolFlag key="Focused:" value="${flag_focused}" />
|
||||||
|
<BoolFlag key="IO active:" value="${flag_io_active}" />
|
||||||
|
<BoolFlag key="Overlay:" value="${flag_overlay}" />
|
||||||
|
<BoolFlag key="Primary:" value="${flag_primary}" />
|
||||||
|
<BoolFlag key="Visible:" value="${flag_visible}" />
|
||||||
|
</div>
|
||||||
|
</rectangle>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<elements>
|
||||||
|
<rectangle macro="group_box">
|
||||||
|
<GroupBoxTitle src_builtin="dashboard/cpu.svg" translation="PROCESS_LIST" />
|
||||||
|
<div id="list_parent" flex_direction="column" gap="8">
|
||||||
|
<!-- filled at runtime -->
|
||||||
|
</div>
|
||||||
|
</rectangle>
|
||||||
|
</elements>
|
||||||
|
</layout>
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
<layout>
|
|
||||||
<include src="t_tab_title.xml" />
|
|
||||||
|
|
||||||
<elements>
|
|
||||||
<TabTitle translation="LIST_OF_WINDOWS" icon="dashboard/window.svg" />
|
|
||||||
<div id="window_list_parent" />
|
|
||||||
<TabTitle translation="LIST_OF_PROCESSES" icon="dashboard/cpu.svg" />
|
|
||||||
<div id="process_list_parent" />
|
|
||||||
</elements>
|
|
||||||
</layout>
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
<layout>
|
<layout>
|
||||||
<include src="t_tab_title.xml" />
|
|
||||||
<include src="../t_group_box.xml" />
|
<include src="../t_group_box.xml" />
|
||||||
<include src="../t_dropdown_button.xml" />
|
<include src="../t_dropdown_button.xml" />
|
||||||
|
|
||||||
|
|
@ -14,8 +13,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template name="SliderSetting">
|
<template name="SliderSetting">
|
||||||
<label text="${text}" translation="${translation}" />
|
<Slider id="${id}" width="200" height="24" min_value="${min}" max_value="${max}" step="${step}" value="${value}" tooltip="${tooltip}" />
|
||||||
<Slider id="${id}" width="250" height="24" min_value="${min}" max_value="${max}" step="${step}" value="${value}" tooltip="${tooltip}" />
|
<label text="${text}" weight="bold" translation="${translation}" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template name="RangeSetting">
|
||||||
|
<Slider id="${id}" width="200" height="24" min_value="${min}" max_value="${max}" step="${step}" value="${value}" value2="${value2}" tooltip="${tooltip}" />
|
||||||
|
<label text="${text}" weight="bold" translation="${translation}" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template name="SelectSetting">
|
<template name="SelectSetting">
|
||||||
|
|
@ -28,7 +32,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template name="DangerButton">
|
<template name="DangerButton">
|
||||||
<Button id="${id}" color="#AA3333" height="32" tooltip="${translation}_HELP" padding="4" gap="8" >
|
<Button id="${id}" color="#AA3333" height="32" tooltip="${translation}_HELP" padding="4" gap="8">
|
||||||
<sprite src_builtin="${icon}" height="24" width="24" />
|
<sprite src_builtin="${icon}" height="24" width="24" />
|
||||||
<label align="left" translation="${translation}" weight="bold" min_width="200" />
|
<label align="left" translation="${translation}" weight="bold" min_width="200" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -36,17 +40,30 @@
|
||||||
|
|
||||||
<template name="AutostartApp">
|
<template name="AutostartApp">
|
||||||
<div id="${id}_root" flex_direction="row">
|
<div id="${id}_root" flex_direction="row">
|
||||||
<Button id="${id}" color="#AA3333" height="24" padding="4" margin_top="-2" margin_bottom="-2" >
|
<Button id="${id}" color="#AA3333" height="24" padding="4" margin_top="-2" margin_bottom="-2">
|
||||||
<sprite src_builtin="dashboard/close.svg" height="20" width="20" />
|
<sprite src_builtin="dashboard/close.svg" height="20" width="20" />
|
||||||
</Button>
|
</Button>
|
||||||
<div padding_left="8" >
|
<div padding_left="8">
|
||||||
<label align="left" text="${text}" weight="bold" overflow="hidden"/>
|
<label align="left" text="${text}" weight="bold" overflow="hidden" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<elements>
|
<elements>
|
||||||
<TabTitle translation="SETTINGS" icon="dashboard/settings.svg" />
|
<div gap="4">
|
||||||
<div flex_wrap="wrap" justify_content="stretch" gap="4" id="settings_root" />
|
<Tabs id="tabs">
|
||||||
|
<Tab name="look_and_feel" translation="APP_SETTINGS.LOOK_AND_FEEL" sprite_src_builtin="dashboard/palette.svg" />
|
||||||
|
<Tab name="skybox" translation="APP_SETTINGS.SKYBOX" sprite_src_builtin="dashboard/globe.svg" />
|
||||||
|
<Tab name="features" translation="APP_SETTINGS.FEATURES" sprite_src_builtin="dashboard/options.svg" />
|
||||||
|
<Tab name="controls" translation="APP_SETTINGS.CONTROLS" sprite_src_builtin="dashboard/controller.svg" />
|
||||||
|
<Tab name="space_drag" translation="APP_SETTINGS.SPACE_DRAG" sprite_src_builtin="dashboard/drag.svg" />
|
||||||
|
<Tab name="misc" translation="APP_SETTINGS.MISC" sprite_src_builtin="dashboard/blocks.svg" />
|
||||||
|
<Tab name="autostart_apps" translation="APP_SETTINGS.AUTOSTART_APPS" sprite_src_builtin="dashboard/apps.svg" />
|
||||||
|
<Tab name="troubleshooting" translation="APP_SETTINGS.TROUBLESHOOTING" sprite_src_builtin="dashboard/cpu.svg" />
|
||||||
|
</Tabs>
|
||||||
|
<div flex_wrap="wrap" justify_content="stretch" gap="4" id="settings_root" width="100%">
|
||||||
|
<!-- filled-in at runtime -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</elements>
|
</elements>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
<layout>
|
||||||
|
<include src="../t_group_box.xml" />
|
||||||
|
|
||||||
|
<elements>
|
||||||
|
<div id="common_options_parent" flex_direction="column" gap="8"/>
|
||||||
|
<rectangle macro="group_box">
|
||||||
|
<GroupBoxTitle src_builtin="dashboard/gravity.svg" translation="APP_SETTINGS.SPACE_GRAVITY_GRAVITY" />
|
||||||
|
<div id="gravity_enabled_parent"/>
|
||||||
|
<div id="space_gravity_parent" flex_direction="column" gap="8">
|
||||||
|
<!-- filled-in at runtime -->
|
||||||
|
</div>
|
||||||
|
</rectangle>
|
||||||
|
</elements>
|
||||||
|
</layout>
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
<layout>
|
|
||||||
<!-- translation, icon -->
|
|
||||||
<template name="TabTitle">
|
|
||||||
<div gap="8" align_items="center">
|
|
||||||
<sprite src_builtin="${icon}" width="24" height="24" />
|
|
||||||
<label translation="${translation}" size="18" weight="bold" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</layout>
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
<theme>
|
<theme>
|
||||||
<var key="color_menu_dark" value="#0A0A0ACC" />
|
<var key="color_menu_dark" value="#0A0A0ACC" />
|
||||||
<var key="color_accent" value="#008cff" />
|
<var key="color_accent" value="#008cff" />
|
||||||
|
<var key="color_top_panel" value="#00000099" />
|
||||||
<var key="color_bottom_panel" value="#141e28" />
|
<var key="color_bottom_panel" value="#141e28" />
|
||||||
</theme>
|
</theme>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -37,18 +37,18 @@
|
||||||
<Separator />
|
<Separator />
|
||||||
<label translation="APP_LAUNCHER.ASPECT_TITLE" />
|
<label translation="APP_LAUNCHER.ASPECT_TITLE" />
|
||||||
<RadioGroup id="radio_orientation" flex_direction="row" gap="16">
|
<RadioGroup id="radio_orientation" flex_direction="row" gap="16">
|
||||||
<RadioBox translation="APP_LAUNCHER.ASPECT.WIDE" value="Wide" tooltip="16:9" checked="1" />
|
<RadioBox translation="APP_LAUNCHER.ASPECT.WIDE" value="Wide" tooltip_str="16:9" checked="1" />
|
||||||
<RadioBox translation="APP_LAUNCHER.ASPECT.SEMI_WIDE" value="SemiWide" tooltip="3:2" />
|
<RadioBox translation="APP_LAUNCHER.ASPECT.SEMI_WIDE" value="SemiWide" tooltip_str="3:2" />
|
||||||
<RadioBox translation="APP_LAUNCHER.ASPECT.SQUARE" value="Square" tooltip="1:1" />
|
<RadioBox translation="APP_LAUNCHER.ASPECT.SQUARE" value="Square" tooltip_str="1:1" />
|
||||||
<RadioBox translation="APP_LAUNCHER.ASPECT.SEMI_TALL" value="SemiTall" tooltip="2:3" />
|
<RadioBox translation="APP_LAUNCHER.ASPECT.SEMI_TALL" value="SemiTall" tooltip_str="2:3" />
|
||||||
<RadioBox translation="APP_LAUNCHER.ASPECT.TALL" value="Tall" tooltip="9:16" />
|
<RadioBox translation="APP_LAUNCHER.ASPECT.TALL" value="Tall" tooltip_str="9:16" />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
<!-- Separator /> // saved settings override this, so let's hide it for now
|
<!-- Separator /> // saved settings override this, so let's hide it for now
|
||||||
<label translation="APP_LAUNCHER.POS_TITLE" />
|
<label translation="APP_LAUNCHER.POS_TITLE" />
|
||||||
<RadioGroup id="radio_pos" flex_direction="row" gap="16">
|
<RadioGroup id="radio_pos" flex_direction="row" gap="16">
|
||||||
<RadioBox translation="APP_LAUNCHER.POS.FLOATING" value="Floating" tooltip="APP_LAUNCHER.POS.FLOATING_HELP" />
|
<RadioBox translation="APP_LAUNCHER.POS.FLOATING" value="Floating" tooltip_str="APP_LAUNCHER.POS.FLOATING_HELP" />
|
||||||
<RadioBox translation="APP_LAUNCHER.POS.ANCHORED" value="Anchored" tooltip="APP_LAUNCHER.POS.ANCHORED_HELP" checked="1" />
|
<RadioBox translation="APP_LAUNCHER.POS.ANCHORED" value="Anchored" tooltip_str="APP_LAUNCHER.POS.ANCHORED_HELP" checked="1" />
|
||||||
<RadioBox translation="APP_LAUNCHER.POS.STATIC" value="Static" tooltip="APP_LAUNCHER.POS.STATIC_HELP" />
|
<RadioBox translation="APP_LAUNCHER.POS.STATIC" value="Static" tooltip_str="APP_LAUNCHER.POS.STATIC_HELP" />
|
||||||
</RadioGroup -->
|
</RadioGroup -->
|
||||||
<Separator />
|
<Separator />
|
||||||
<div flex_direction="row" justify_content="space_between" gap="16">
|
<div flex_direction="row" justify_content="space_between" gap="16">
|
||||||
|
|
@ -61,4 +61,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</elements>
|
</elements>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
<layout>
|
<layout>
|
||||||
<include src="../t_group_box.xml" />
|
<include src_builtin="../t_group_box.xml" />
|
||||||
|
|
||||||
<!-- device_name, device_icon -->
|
<!-- device_name, device_icon -->
|
||||||
<template name="DeviceSlider">
|
<template name="DeviceSlider">
|
||||||
<rectangle macro="group_box">
|
<rectangle macro="group_box">
|
||||||
<div width="100%" align_items="center" justify_content="center" gap="8">
|
<div width="100%" align_items="center" justify_content="center" gap="8">
|
||||||
<sprite src="${device_icon}" width="16" height="16" />
|
<sprite src_builtin="${device_icon}" width="16" height="16" />
|
||||||
<label text="${device_name}" margin_right="8" size="12" weight="bold" />
|
<label text="${device_name}" margin_right="8" size="12" weight="bold" />
|
||||||
</div>
|
</div>
|
||||||
<div width="100%" align_items="center">
|
<div width="100%" align_items="center">
|
||||||
<CheckBox id="checkbox" />
|
<CheckBox id="checkbox" />
|
||||||
<Button sprite_src="${volume_icon}" id="btn_mute" width="32" />
|
<Button sprite_src_builtin="${volume_icon}" id="btn_mute" width="32" />
|
||||||
<Slider id="slider" flex_grow="1" height="16" min_value="0" max_value="150" margin_left="8" />
|
<Slider id="slider" flex_grow="1" height="16" min_value="0" max_value="150" margin_left="8" />
|
||||||
</div>
|
</div>
|
||||||
</rectangle>
|
</rectangle>
|
||||||
|
|
@ -41,28 +41,30 @@
|
||||||
flex_grow="1"
|
flex_grow="1"
|
||||||
id="${id}"
|
id="${id}"
|
||||||
translation="${translation}"
|
translation="${translation}"
|
||||||
sprite_src="${src}">
|
sprite_src_builtin="${src}">
|
||||||
</Button>
|
</Button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<elements>
|
<elements>
|
||||||
<div id="devices" flex_direction="column" gap="4">
|
<div flex_direction="column" gap="4">
|
||||||
|
<div id="devices" flex_direction="column" gap="4" max_height="400" overflow_y="scroll">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- bottom buttons -->
|
<!-- bottom buttons -->
|
||||||
<div flex_direction="row" gap="4">
|
<div flex_direction="row" gap="4">
|
||||||
<Button
|
<Button
|
||||||
id="btn_auto"
|
id="btn_auto"
|
||||||
sprite_src_builtin="dashboard/magic_wand.svg"
|
sprite_src_builtin="dashboard/magic_wand.svg"
|
||||||
min_width="32"
|
min_width="32"
|
||||||
tooltip="AUDIO.AUTO_SWITCH_TO_VR_AUDIO"
|
tooltip="AUDIO.AUTO_SWITCH_TO_VR_AUDIO"
|
||||||
color="~color_accent"
|
color="~color_accent"
|
||||||
tooltip_side="right" />
|
tooltip_side="right" />
|
||||||
|
|
||||||
<BottomButton id="btn_sinks" src_builtin="dashboard/volume.svg" translation="AUDIO.SPEAKERS" />
|
<BottomButton id="btn_sinks" src_builtin="dashboard/volume.svg" translation="AUDIO.SPEAKERS" />
|
||||||
<BottomButton id="btn_sources" src_builtin="dashboard/microphone.svg" translation="AUDIO.MICROPHONES" />
|
<BottomButton id="btn_sources" src_builtin="dashboard/microphone.svg" translation="AUDIO.MICROPHONES" />
|
||||||
<BottomButton id="btn_cards" src_builtin="dashboard/cpu.svg" translation="AUDIO.CARDS" />
|
<BottomButton id="btn_cards" src_builtin="dashboard/cpu.svg" translation="AUDIO.CARDS" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</elements>
|
</elements>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
<layout>
|
||||||
|
<template name="DialogBoxButton">
|
||||||
|
<Button id="btn" translation="CLOSE_WINDOW" align_self="start" sprite_src_builtin="${icon}"/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<elements>
|
||||||
|
<div flex_direction="column" align_items="center" justify_content="center" width="100%" gap="32">
|
||||||
|
<label id="label_message" size="18" weight="bold"/>
|
||||||
|
|
||||||
|
<div id="buttons" gap="8">
|
||||||
|
<!-- filled-in at runtime -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</elements>
|
||||||
|
</layout>
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
<layout>
|
||||||
|
<include src="../t_separator.xml"/>
|
||||||
|
|
||||||
|
<template name="btn_close">
|
||||||
|
<Button id="btn" translation="CLOSE_WINDOW" align_self="start" sprite_src_builtin="dashboard/check.svg"/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<elements>
|
||||||
|
<div align_items="center" justify_content="center" width="100%">
|
||||||
|
<div id="content" flex_direction="column" gap="8" width="100%">
|
||||||
|
<label translation="DOWNLOADING_FILE" size="24" weight="bold"/>
|
||||||
|
<Separator/>
|
||||||
|
<label id="label_target_path" color="~color_text_translucent" />
|
||||||
|
|
||||||
|
<div gap="8" align_items="center">
|
||||||
|
<div id="loading_parent"/>
|
||||||
|
<label id="label_status"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</elements>
|
||||||
|
</layout>
|
||||||
|
|
@ -1,7 +1,12 @@
|
||||||
<layout>
|
<layout>
|
||||||
<include src="../t_group_box.xml" />
|
|
||||||
|
|
||||||
<elements>
|
<elements>
|
||||||
<div id="list_parent" gap="8" flex_direction="row" flex_wrap="wrap" justify_content="center" />
|
<div flex_direction="column" padding_top="8" padding_bottom="8">
|
||||||
|
<div id="list_parent" gap="8" flex_direction="row" flex_wrap="wrap" justify_content="center" />
|
||||||
|
</div>
|
||||||
|
<div align_items="center" justify_content="center" gap="16">
|
||||||
|
<Button id="btn_prev" sprite_src_builtin="dashboard/arrow_left.svg" width="32" height="32" />
|
||||||
|
<label id="label_page" text="Page X" weight="bold" />
|
||||||
|
<Button id="btn_next" sprite_src_builtin="dashboard/arrow_right.svg" width="32" height="32" />
|
||||||
|
</div>
|
||||||
</elements>
|
</elements>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
width="100%"
|
width="100%"
|
||||||
height="100%"
|
height="100%"
|
||||||
flex_direction="column"
|
flex_direction="column"
|
||||||
|
position="absolute"
|
||||||
>
|
>
|
||||||
<!-- Top black bar -->
|
<!-- Top black bar -->
|
||||||
<rectangle
|
<rectangle
|
||||||
|
|
@ -32,14 +33,18 @@
|
||||||
</div>
|
</div>
|
||||||
</rectangle>
|
</rectangle>
|
||||||
|
|
||||||
<!-- Content -->
|
<rectangle
|
||||||
<rectangle height="100%"
|
width="100%"
|
||||||
|
height="100%"
|
||||||
color="#010310fe"
|
color="#010310fe"
|
||||||
color2="#051c55fc"
|
color2="#051c55fc"
|
||||||
gradient="vertical"
|
gradient="vertical"
|
||||||
padding="16"
|
position="relative"
|
||||||
id="content">
|
>
|
||||||
|
<div id="content" padding="16" width="100%" height="100%" position="absolute" overflow_y="scroll">
|
||||||
|
<!-- Content, filled-in at runtime -->
|
||||||
|
</div>
|
||||||
</rectangle>
|
</rectangle>
|
||||||
</div>
|
</div>
|
||||||
</elements>
|
</elements>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
<layout>
|
|
||||||
<include src="../t_group_box.xml" />
|
|
||||||
|
|
||||||
<elements>
|
|
||||||
<rectangle macro="group_box" flex_direction="row" align_items="center">
|
|
||||||
<div id="list_parent" gap="8" flex_direction="column" flex_wrap="wrap" flex_grow="1" />
|
|
||||||
</rectangle>
|
|
||||||
</elements>
|
|
||||||
</layout>
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
<layout>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
parameters:
|
||||||
|
"text"
|
||||||
|
"sprite"
|
||||||
|
|
||||||
|
ids:
|
||||||
|
"button"
|
||||||
|
-->
|
||||||
|
<template name="ResolutionButton">
|
||||||
|
<Button id="button" sprite_src_builtin="${sprite}" text="${text}"/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<include src="../t_separator.xml"/>
|
||||||
|
|
||||||
|
<elements>
|
||||||
|
<div gap="8" flex_direction="column" min_width="100%" overflow_y="scroll">
|
||||||
|
<div gap="8" flex_direction="column" align_items="center">
|
||||||
|
<div id="resolution_buttons" gap="8" flex_direction="row">
|
||||||
|
<!-- filled-in at runtime -->
|
||||||
|
</div>
|
||||||
|
<image id="image" width="400" height="200" round="8" border="2" border_color="~color_accent"/>
|
||||||
|
<label id="label_author" weight="bold"/>
|
||||||
|
<label id="label_description" wrap="1"/>
|
||||||
|
<Separator/>
|
||||||
|
<!-- nerdy stuff below -->
|
||||||
|
<div gap="24" justify_content="center">
|
||||||
|
<label size="10" id="label_creation_date"/>
|
||||||
|
<label size="10" id="label_modification_date"/>
|
||||||
|
<label size="10" id="label_version"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</elements>
|
||||||
|
</layout>
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
<layout>
|
||||||
|
<elements>
|
||||||
|
<div id="list" gap="8" flex_wrap="wrap" align_self="baseline">
|
||||||
|
<!-- filled-in at runtime -->
|
||||||
|
</div>
|
||||||
|
</elements>
|
||||||
|
</layout>
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
<layout>
|
||||||
|
<include src="../t_group_box.xml" />
|
||||||
|
|
||||||
|
<template name="RunningGameCell">
|
||||||
|
<rectangle macro="group_box" flex_direction="row">
|
||||||
|
<Button id="btn_stop" sprite_src_builtin="dashboard/remove_circle.svg" tooltip="PROCESS.STOP" />
|
||||||
|
<Button id="btn_kill" sprite_src_builtin="dashboard/knife.svg" tooltip="PROCESS.FORCE_KILL" />
|
||||||
|
<label id="label_name" weight="bold" />
|
||||||
|
</rectangle>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<elements>
|
||||||
|
<div align_items="center" gap="8">
|
||||||
|
<Button id="btn_refresh" tooltip="REFRESH" width="32" height="32" sprite_src_builtin="dashboard/refresh.svg" />
|
||||||
|
<sprite src_builtin="dashboard/cpu.svg" width="24" height="24" />
|
||||||
|
<label translation="GAME_LIST.RUNNING_GAMES_LIST" />
|
||||||
|
</div>
|
||||||
|
<div id="list_parent" gap="8" />
|
||||||
|
</elements>
|
||||||
|
</layout>
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
<layout>
|
||||||
|
<elements>
|
||||||
|
<div flex_direction="column" gap="8" width="100%" align_items="center">
|
||||||
|
<div flex_direction="row" gap="4" align_self="end">
|
||||||
|
<Button id="btn_refresh" tooltip="RELOAD_FROM_DISK" width="32" height="32" sprite_src_builtin="dashboard/refresh.svg" />
|
||||||
|
<Button id="btn_download_skymaps" height="32" translation="APP_SETTINGS.BROWSE_ONLINE_CATALOG" sprite_src_builtin="dashboard/download.svg"/>
|
||||||
|
</div>
|
||||||
|
<div id="list_parent" gap="8" flex_direction="row" flex_wrap="wrap" />
|
||||||
|
</div>
|
||||||
|
</elements>
|
||||||
|
</layout>
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
<layout>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
ids:
|
||||||
|
"button"
|
||||||
|
"image_preview"
|
||||||
|
"label_title"
|
||||||
|
"label_desc"
|
||||||
|
-->
|
||||||
|
<template name="Cell">
|
||||||
|
<Button
|
||||||
|
id="button"
|
||||||
|
padding="8"
|
||||||
|
round="8"
|
||||||
|
flex_direction="column"
|
||||||
|
gap="4"
|
||||||
|
width="256"
|
||||||
|
align_items="center"
|
||||||
|
align_self="start">
|
||||||
|
<image id="image_preview" width="100%" height="128" round="6">
|
||||||
|
<!-- new_pass is required, because we need to render rectangles at the top of the image. Sorry. -->
|
||||||
|
<div new_pass="1" id="resolution_pips" gap="4" margin="6"/>
|
||||||
|
</image>
|
||||||
|
<label id="label_title" wrap="1" weight="bold"/>
|
||||||
|
<label id="label_author" wrap="1"/>
|
||||||
|
</Button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
|
||||||
|
params:
|
||||||
|
"color"
|
||||||
|
"text"
|
||||||
|
-->
|
||||||
|
<template name="ResolutionPip">
|
||||||
|
<rectangle color="${color}" padding_left="4" padding_right="4" padding_top="2" padding_bottom="2" round="3" align_self="start">
|
||||||
|
<label text="${text}" weight="bold" size="12" shadow="#000000" shadow_x="2" shadow_y="2"/>
|
||||||
|
</rectangle>
|
||||||
|
</template>
|
||||||
|
</layout>
|
||||||
|
|
@ -1,153 +1,162 @@
|
||||||
{
|
{
|
||||||
"HOME_SCREEN": "Startbildschirm",
|
"HOME_SCREEN": "Startbildschirm",
|
||||||
"MONADO_RUNTIME": "Monado-Laufzeitumgebung",
|
"MONADO_RUNTIME": "Monado-Laufzeitumgebung",
|
||||||
"APPLICATIONS": "Anwendungen",
|
"APPLICATIONS": "Anwendungen",
|
||||||
"GAMES": "Spiele",
|
"GAMES": "Spiele",
|
||||||
"SETTINGS": "Einstellungen",
|
"SETTINGS": "Einstellungen",
|
||||||
"PROCESSES": "Prozesse",
|
"HELLO_USER": "Hallo, {USER}!",
|
||||||
"HELLO_USER": "Hallo, {USER}!",
|
"GENERAL_SETTINGS": "Allgemeine Einstellungen",
|
||||||
"GENERAL_SETTINGS": "Allgemeine Einstellungen",
|
"APPLICATION_LAUNCHER": "Anwendung Launcher",
|
||||||
"APPLICATION_LAUNCHER": "Anwendung Launcher",
|
"APP_SETTINGS": {
|
||||||
"APP_SETTINGS": {
|
"HIDE_USERNAME": "Benutzernamen ausblenden",
|
||||||
"HIDE_USERNAME": "Benutzernamen ausblenden",
|
"OPAQUE_BACKGROUND": "Undurchsichtiger Hintergrund",
|
||||||
"OPAQUE_BACKGROUND": "Undurchsichtiger Hintergrund",
|
"LOOK_AND_FEEL": "Aussehen und Verhalten",
|
||||||
"WLX": {},
|
"HIDE_GRAB_HELP": "Greif-Hilfe ausblenden",
|
||||||
"LOOK_AND_FEEL": "Aussehen und Verhalten",
|
"ANIMATION_SPEED": "UI-Animationsgeschwindigkeit",
|
||||||
"HIDE_GRAB_HELP": "Greif-Hilfe ausblenden",
|
"ROUND_MULTIPLIER": "UI-Kantenrundung",
|
||||||
"ANIMATION_SPEED": "UI-Animationsgeschwindigkeit",
|
"USE_SKYBOX": "Skybox aktivieren",
|
||||||
"ROUND_MULTIPLIER": "UI-Kantenrundung",
|
"USE_PASSTHROUGH": "Passthrough aktivieren",
|
||||||
"USE_SKYBOX": "Skybox aktivieren",
|
"CLOCK_12H": "12-Stunden-Uhr",
|
||||||
"USE_PASSTHROUGH": "Passthrough aktivieren",
|
"FEATURES": "Funktionen",
|
||||||
"CLOCK_12H": "12-Stunden-Uhr",
|
"NOTIFICATIONS_ENABLED": "Benachrichtigungen aktivieren",
|
||||||
"FEATURES": "Funktionen",
|
"NOTIFICATIONS_SOUND_ENABLED": "Benachrichtigungstöne",
|
||||||
"NOTIFICATIONS_ENABLED": "Benachrichtigungen aktivieren",
|
"KEYBOARD_SOUND_ENABLED": "Tastengeräusche",
|
||||||
"NOTIFICATIONS_SOUND_ENABLED": "Benachrichtigungstöne",
|
"SPACE_DRAG_MULTIPLIER": "Raum-Drag-Multiplikator",
|
||||||
"KEYBOARD_SOUND_ENABLED": "Tastengeräusche",
|
"SPACE_DRAG_UNLOCKED": "Erlaube Space-Drag auf allen Achsen",
|
||||||
"SPACE_DRAG_MULTIPLIER": "Raum-Drag-Multiplikator",
|
"SPACE_ROTATE_UNLOCKED": "Erlaube Drehungen in allen Achsen",
|
||||||
"SPACE_DRAG_UNLOCKED": "Erlaube Space-Drag auf allen Achsen",
|
"BLOCK_GAME_INPUT": "Spieleingabe blockieren",
|
||||||
"SPACE_ROTATE_UNLOCKED": "Erlaube Drehungen in allen Achsen",
|
"BLOCK_GAME_INPUT_IGNORE_WATCH": "Ignoriere Watch beim Blockieren der Eingabe",
|
||||||
"BLOCK_GAME_INPUT": "Spieleingabe blockieren",
|
"CONTROLS": "Steuerung",
|
||||||
"BLOCK_GAME_INPUT_IGNORE_WATCH": "Ignoriere Watch beim Blockieren der Eingabe",
|
"FOCUS_FOLLOWS_MOUSE_MODE": "Mausbewegung bei Triggerberührung",
|
||||||
"CONTROLS": "Steuerung",
|
"LEFT_HANDED_MOUSE": "Linkshändige Maus",
|
||||||
"FOCUS_FOLLOWS_MOUSE_MODE": "Mausbewegung bei Triggerberührung",
|
"ALLOW_SLIDING": "Stabinteraktion während des Greifens",
|
||||||
"LEFT_HANDED_MOUSE": "Linkshändige Maus",
|
"INVERT_SCROLL_DIRECTION_X": "Horizontale Scrollrichtung umkehren",
|
||||||
"ALLOW_SLIDING": "Stabinteraktion während des Greifens",
|
"INVERT_SCROLL_DIRECTION_Y": "Vertikale Bildlaufrichtung umkehren",
|
||||||
"INVERT_SCROLL_DIRECTION_X": "Horizontale Scrollrichtung umkehren",
|
"SCROLL_SPEED": "Scrollgeschwindigkeit",
|
||||||
"INVERT_SCROLL_DIRECTION_Y": "Vertikale Bildlaufrichtung umkehren",
|
"LONG_PRESS_DURATION": "Dauer für lange Drückvorgänge",
|
||||||
"SCROLL_SPEED": "Scrollgeschwindigkeit",
|
"POINTER_LERP_FACTOR": "Zeigerglättung",
|
||||||
"LONG_PRESS_DURATION": "Dauer für lange Drückvorgänge",
|
"CLICK_FREEZE_TIME_MS": "Klick-Freeze-Zeit (ms)",
|
||||||
"POINTER_LERP_FACTOR": "Zeigerglättung",
|
"MISC": "Verschiedenes",
|
||||||
"XR_CLICK_SENSITIVITY": "XR-Klicksensitivität",
|
"XWAYLAND_BY_DEFAULT": "Standardmäßig Apps im Kompatibilitätsmodus ausführen",
|
||||||
"XR_CLICK_SENSITIVITY_RELEASE": "XR-Loslassempfindlichkeit",
|
"UPRIGHT_SCREEN_FIX": "Bildschirm-Drehkorrektur",
|
||||||
"CLICK_FREEZE_TIME_MS": "Klick-Freeze-Zeit (ms)",
|
"DOUBLE_CURSOR_FIX": "Doppelter Cursor Fix",
|
||||||
"MISC": "Verschiedenes",
|
"SCREEN_RENDER_DOWN": "Bildschirm bei niedrigerer Auflösung rendern",
|
||||||
"XWAYLAND_BY_DEFAULT": "Standardmäßig Apps im Kompatibilitätsmodus ausführen",
|
"UPRIGHT_SCREEN_FIX_HELP": "Behebt hochstehende Bildschirme auf einigen Desktops",
|
||||||
"UPRIGHT_SCREEN_FIX": "Bildschirm-Drehkorrektur",
|
"DOUBLE_CURSOR_FIX_HELP": "Aktivieren Sie dies, wenn Sie 2 Cursor sehen",
|
||||||
"DOUBLE_CURSOR_FIX": "Doppelter Cursor Fix",
|
"CLICK_FREEZE_TIME_MS_HELP": "Hilft bei der Präzision von Doppelklicks",
|
||||||
"SCREEN_RENDER_DOWN": "Bildschirm bei niedrigerer Auflösung rendern",
|
"LEFT_HANDED_MOUSE_HELP": "Verwenden Sie diese Option, wenn die Maustasten vertauscht sind",
|
||||||
"UPRIGHT_SCREEN_FIX_HELP": "Behebt hochstehende Bildschirme auf einigen Desktops",
|
"BLOCK_GAME_INPUT_HELP": "Blockiert alle Eingaben, wenn ein Overlay angefahren wird",
|
||||||
"DOUBLE_CURSOR_FIX_HELP": "Aktivieren Sie dies, wenn Sie 2 Cursor sehen",
|
"BLOCK_GAME_INPUT_IGNORE_WATCH_HELP": "Blockiere die Eingabe nicht, wenn die Überwachung aktiviert ist",
|
||||||
"XR_CLICK_SENSITIVITY_HELP": "Analoge Trigger-Empfindlichkeit",
|
"USE_SKYBOX_HELP": "Zeige einen Skybox, wenn keine Szenen-App oder Passthrough vorhanden ist",
|
||||||
"XR_CLICK_SENSITIVITY_RELEASE_HELP": "Muss niedriger als Klick sein",
|
"USE_PASSTHROUGH_HELP": "Aktiviere Passthrough, falls die XR-Laufzeitumgebung dies unterstützt",
|
||||||
"CLICK_FREEZE_TIME_MS_HELP": "Hilft bei der Präzision von Doppelklicks",
|
"SCREEN_RENDER_DOWN_HELP": "Hilft bei Aliasing auf hochauflösenden Bildschirmen",
|
||||||
"LEFT_HANDED_MOUSE_HELP": "Verwenden Sie diese Option, wenn die Maustasten vertauscht sind",
|
"SETS_ON_WATCH": "Sets auf der Watch",
|
||||||
"BLOCK_GAME_INPUT_HELP": "Blockiert alle Eingaben, wenn ein Overlay angefahren wird",
|
"TROUBLESHOOTING": "Fehlerbehebung",
|
||||||
"BLOCK_GAME_INPUT_IGNORE_WATCH_HELP": "Blockiere die Eingabe nicht, wenn die Überwachung aktiviert ist",
|
"CLEAR_SAVED_STATE": "Gespeicherten Zustand löschen",
|
||||||
"USE_SKYBOX_HELP": "Zeige einen Skybox, wenn keine Szenen-App oder Passthrough vorhanden ist",
|
"CLEAR_PIPEWIRE_TOKENS": "PipeWire Tokens löschen",
|
||||||
"USE_PASSTHROUGH_HELP": "Aktiviere Passthrough, falls die XR-Laufzeitumgebung dies unterstützt",
|
"DELETE_ALL_CONFIGS": "Konfiguration löschen",
|
||||||
"SCREEN_RENDER_DOWN_HELP": "Hilft bei Aliasing auf hochauflösenden Bildschirmen",
|
"RESTART_SOFTWARE": "Software neu starten",
|
||||||
"SETS_ON_WATCH": "Sets auf der Watch",
|
"CLEAR_SAVED_STATE_HELP": "Sets und Overlay-Positionen zurücksetzen",
|
||||||
"TROUBLESHOOTING": "Fehlerbehebung",
|
"CLEAR_PIPEWIRE_TOKENS_HELP": "Bildschirmauswahl beim nächsten Start abfragen",
|
||||||
"CLEAR_SAVED_STATE": "Gespeicherten Zustand löschen",
|
"DELETE_ALL_CONFIGS_HELP": "Entfernen Sie alle Konfigurationsdateien aus conf.d",
|
||||||
"CLEAR_PIPEWIRE_TOKENS": "PipeWire Tokens löschen",
|
"RESTART_SOFTWARE_HELP": "Einstellungen anwenden, die einen Neustart erfordern",
|
||||||
"DELETE_ALL_CONFIGS": "Konfiguration löschen",
|
"CAPTURE_METHOD": "Wayland-Bildschirmaufnahme",
|
||||||
"RESTART_SOFTWARE": "Software neu starten",
|
"CAPTURE_METHOD_HELP": "Versuchen Sie, dies zu ändern, wenn Sie\nschwarze oder fehlerhafte Bildschirme erleben",
|
||||||
"CLEAR_SAVED_STATE_HELP": "Sets und Overlay-Positionen zurücksetzen",
|
"KEYBOARD_MIDDLE_CLICK": "Keyboard-Mittelklick",
|
||||||
"CLEAR_PIPEWIRE_TOKENS_HELP": "Bildschirmauswahl beim nächsten Start abfragen",
|
"KEYBOARD_MIDDLE_CLICK_HELP": "Modifikator bei Eingabe mit violettem Laser",
|
||||||
"DELETE_ALL_CONFIGS_HELP": "Entfernen Sie alle Konfigurationsdateien aus conf.d",
|
"OPTION": {
|
||||||
"RESTART_SOFTWARE_HELP": "Einstellungen anwenden, die einen Neustart erfordern",
|
"AUTO": "Automatisch",
|
||||||
"CAPTURE_METHOD": "Wayland-Bildschirmaufnahme",
|
"AUTO_HELP": "Bildschirmkopie GPU falls unterstützt,\nansonsten PipeWire GPU.",
|
||||||
"CAPTURE_METHOD_HELP": "Versuchen Sie, dies zu ändern, wenn Sie\nschwarze oder fehlerhafte Bildschirme erleben",
|
"PIPEWIRE_HELP": "Schnelle GPU-Erfassung,\nStandard auf allen Desktops.",
|
||||||
"KEYBOARD_MIDDLE_CLICK": "Keyboard-Mittelklick",
|
"PW_FALLBACK_HELP": "Langsame Methode mit hoher CPU-Auslastung.\nVersuchen Sie es, falls PipeWire GPU nicht funktioniert.",
|
||||||
"KEYBOARD_MIDDLE_CLICK_HELP": "Modifikator bei Eingabe mit violettem Laser",
|
"SCREENCOPY_GPU_HELP": "Schnell, keine Bildschirmfreigabe-Popups.\nFunktioniert mit: Hyprland, Niri, River, Sway",
|
||||||
"OPTION": {
|
"SCREENCOPY_HELP": "Langsam, keine Bildschirmfreigabe-Popups.\nFunktioniert mit: Hyprland, Niri, River, Sway",
|
||||||
"AUTO": "Automatisch",
|
"NONE": "Keine",
|
||||||
"AUTO_HELP": "Bildschirmkopie GPU falls unterstützt,\nansonsten PipeWire GPU.",
|
"HMD_PINCH": "HMD + Kneifen",
|
||||||
"PIPEWIRE_HELP": "Schnelle GPU-Erfassung,\nStandard auf allen Desktops.",
|
"EYE_PINCH": "Auge + Kneifen",
|
||||||
"PW_FALLBACK_HELP": "Langsame Methode mit hoher CPU-Auslastung.\nVersuchen Sie es, falls PipeWire GPU nicht funktioniert.",
|
"EYE_ONLY": "Nur Auge",
|
||||||
"SCREENCOPY_GPU_HELP": "Schnell, keine Bildschirmfreigabe-Popups.\nFunktioniert mit: Hyprland, Niri, River, Sway",
|
"HMD_ONLY": "Nur HMD"
|
||||||
"SCREENCOPY_HELP": "Langsam, keine Bildschirmfreigabe-Popups.\nFunktioniert mit: Hyprland, Niri, River, Sway"
|
},
|
||||||
},
|
"AUTOSTART_APPS": "Anwendungen, die beim Start ausgeführt werden sollen",
|
||||||
"AUTOSTART_APPS": "Anwendungen, die beim Start ausgeführt werden sollen"
|
"HANDSFREE_POINTER": "Freihändige Modus",
|
||||||
},
|
"HANDSFREE_POINTER_HELP": "Eingabe, die bei Bewegung\nder Controller verwendet wird, wenn diese nicht verfügbar sind.\nLinkes Kneifen greift, rechtes klickt.",
|
||||||
"HELLO": "Hallo!",
|
"UI_GRADIENT_INTENSITY": "UI-Verlaufsintensität",
|
||||||
"AUDIO": {
|
"RESET_PLAYSPACE": "Spielbereich zurücksetzen",
|
||||||
"VOLUME": "Lautstärke",
|
"RESET_PLAYSPACE_HELP": "Den Abstand des Spielbereichs zurücksetzen.",
|
||||||
"SETTINGS": "Audioeinstellungen",
|
"BLOCK_POSES_ON_KBD_INTERACTION": "Posen beim Interagieren mit der Tastatur blockieren",
|
||||||
"AUTO_SWITCH_TO_VR_AUDIO": "Automatisch auf VR-Audio umschalten",
|
"BLOCK_POSES_ON_KBD_INTERACTION_HELP": "Verhindert, dass das Spiel Posen empfängt, wenn die Tastatur angefahren wird und „Spieleingabe blockieren“ aktiviert ist",
|
||||||
"SPEAKERS": "Lautsprecher",
|
"LANGUAGE": "Sprache",
|
||||||
"MICROPHONES": "Mikrofone",
|
"REQUIRES_RESTART": "Erfordert Neustart",
|
||||||
"CARDS": "Sound-Karten",
|
"GRID_OPACITY": "Bodenraster-Undurchsichtigkeit",
|
||||||
"SELECT_AUDIO_CARD_PROFILE": "Wählen Sie das Sound-Kartenprofil",
|
"GRID_OPACITY_HELP": "Undurchsichtigkeit des Bodenrasters, wenn der Skybox aktiviert ist"
|
||||||
"NO_VR_SPEAKERS_FOUND_SWITCH_MANUALLY": "Keine VR-Lautsprecher gefunden. Schalten Sie diese manuell um.",
|
},
|
||||||
"NO_VR_MICROPHONE_SWITCH_MANUALLY": "Kein VR-Mikrofon gefunden. Schalten Sie es manuell um.",
|
"HELLO": "Hallo!",
|
||||||
"FAILED_TO_SWITCH_MICROPHONE": "Fehler beim Wechseln des Mikrofons",
|
"AUDIO": {
|
||||||
"MICROPHONE_SET_SUCCESSFULLY": "Mikrofon erfolgreich umgeschaltet",
|
"VOLUME": "Lautstärke",
|
||||||
"SPEAKERS_SET_SUCCESSFULLY": "Lautsprecher erfolgreich umgeschaltet"
|
"SETTINGS": "Audioeinstellungen",
|
||||||
},
|
"AUTO_SWITCH_TO_VR_AUDIO": "Automatisch auf VR-Audio umschalten",
|
||||||
"ACTIONS": {
|
"SPEAKERS": "Lautsprecher",
|
||||||
"RECENTER_PLAYSPACE": "Playspace neu zentrieren"
|
"MICROPHONES": "Mikrofone",
|
||||||
},
|
"CARDS": "Sound-Karten",
|
||||||
"LIST_OF_PROCESSES": "Prozessliste",
|
"SELECT_AUDIO_CARD_PROFILE": "Wählen Sie das Sound-Kartenprofil",
|
||||||
"POPUP_ADD_DISPLAY": {
|
"NO_VR_SPEAKERS_FOUND_SWITCH_MANUALLY": "Keine VR-Lautsprecher gefunden. Schalten Sie diese manuell um.",
|
||||||
"RESOLUTION": "Auflösung"
|
"NO_VR_MICROPHONE_SWITCH_MANUALLY": "Kein VR-Mikrofon gefunden. Schalten Sie es manuell um.",
|
||||||
},
|
"FAILED_TO_SWITCH_MICROPHONE": "Fehler beim Wechseln des Mikrofons",
|
||||||
"WIDTH": "Breite",
|
"MICROPHONE_SET_SUCCESSFULLY": "Mikrofon erfolgreich umgeschaltet",
|
||||||
"HEIGHT": "Höhe",
|
"SPEAKERS_SET_SUCCESSFULLY": "Lautsprecher erfolgreich umgeschaltet"
|
||||||
"HIDE": "Verbergen",
|
},
|
||||||
"REMOVE": "Entfernen",
|
"ACTIONS": {
|
||||||
"SHOW": "Anzeigen",
|
"RECENTER_PLAYSPACE": "Playspace neu zentrieren"
|
||||||
"PROCESS_LIST": {
|
},
|
||||||
"NO_PROCESSES_FOUND": "Keine Prozesse gefunden",
|
"POPUP_ADD_DISPLAY": {
|
||||||
"LOCATED_ON": "auf",
|
"RESOLUTION": "Auflösung"
|
||||||
"TERMINATE_PROCESS_NAMED_X": "Prozess \"{PROCESS_NAME}\" beenden"
|
},
|
||||||
},
|
"WIDTH": "Breite",
|
||||||
"FAILED_TO_LAUNCH_APPLICATION": "Fehler beim Starten der Anwendung:",
|
"HEIGHT": "Höhe",
|
||||||
"NO_WINDOWS_FOUND": "Keine Fenster gefunden",
|
"HIDE": "Verbergen",
|
||||||
"WINDOW_OPTIONS": "Fensteroptionen",
|
"REMOVE": "Entfernen",
|
||||||
"APPLICATION_STARTED": "Anwendung gestartet",
|
"SHOW": "Anzeigen",
|
||||||
"LIST_OF_WINDOWS": "Fensterliste",
|
"FAILED_TO_LAUNCH_APPLICATION": "Fehler beim Starten der Anwendung:",
|
||||||
"CLOSE_WINDOW": "Fenster schließen",
|
"APPLICATION_STARTED": "Anwendung gestartet",
|
||||||
"GAME_LIST": {
|
"CLOSE_WINDOW": "Fenster schließen",
|
||||||
"NO_GAMES_FOUND": "Keine Spiele gefunden"
|
"GAME_LIST": {
|
||||||
},
|
"NO_GAMES_FOUND": "Keine Spiele gefunden",
|
||||||
"TERMINATE_PROCESS": "Prozess beenden",
|
"RUNNING_GAMES_LIST": "Liste der laufenden Spiele"
|
||||||
"GAME_LAUNCHED": "Spiel gestartet",
|
},
|
||||||
"APP_LAUNCHER": {
|
"TERMINATE_PROCESS": "Prozess beenden",
|
||||||
"MODE": {
|
"GAME_LAUNCHED": "Spiel gestartet",
|
||||||
"NATIVE": "Nativer Modus",
|
"APP_LAUNCHER": {
|
||||||
"CAGE": "Kompatibilitätsmodus (Cage)"
|
"MODE": {
|
||||||
},
|
"NATIVE": "Nativer Modus",
|
||||||
"RES_TITLE": "Auflösung",
|
"CAGE": "Kompatibilitätsmodus (Cage)"
|
||||||
"ASPECT_TITLE": "Seitenverhältnis",
|
},
|
||||||
"ASPECT": {
|
"RES_TITLE": "Auflösung",
|
||||||
"WIDE": "Breit",
|
"ASPECT_TITLE": "Seitenverhältnis",
|
||||||
"SEMI_WIDE": "Halb-breit",
|
"ASPECT": {
|
||||||
"SQUARE": "Quadratisch",
|
"WIDE": "Breit",
|
||||||
"SEMI_TALL": "Halbhoch",
|
"SEMI_WIDE": "Halb-breit",
|
||||||
"TALL": "Hoch"
|
"SQUARE": "Quadratisch",
|
||||||
},
|
"SEMI_TALL": "Halbhoch",
|
||||||
"POS_TITLE": "Positionierung",
|
"TALL": "Hoch"
|
||||||
"POS": {
|
},
|
||||||
"FLOATING": "Schwebend",
|
"POS_TITLE": "Positionierung",
|
||||||
"ANCHORED": "Verankert",
|
"POS": {
|
||||||
"STATIC": "Statisch",
|
"FLOATING": "Schwebend",
|
||||||
"FLOATING_HELP": "Bewegt sich unabhängig, zentriert sich bei Anzeige neu.",
|
"ANCHORED": "Verankert",
|
||||||
"ANCHORED_HELP": "Bleibt relativ zur Mittelmarkierung an Ort und Stelle.",
|
"STATIC": "Statisch",
|
||||||
"STATIC_HELP": "Keine Set zugeordnet. Wird nicht zentriert."
|
"FLOATING_HELP": "Bewegt sich unabhängig, zentriert sich bei Anzeige neu.",
|
||||||
},
|
"ANCHORED_HELP": "Bleibt relativ zur Mittelmarkierung an Ort und Stelle.",
|
||||||
"AUTOSTART": "Automatisch beim Start ausführen",
|
"STATIC_HELP": "Keine Set zugeordnet. Wird nicht zentriert."
|
||||||
"LAUNCH": "Starten"
|
},
|
||||||
},
|
"AUTOSTART": "Automatisch beim Start ausführen",
|
||||||
"DISPLAY_BRIGHTNESS": "Bildschirmhelligkeit"
|
"LAUNCH": "Starten"
|
||||||
}
|
},
|
||||||
|
"DISPLAY_BRIGHTNESS": "Bildschirmhelligkeit",
|
||||||
|
"PROCESS_LIST": "Prozessliste",
|
||||||
|
"REFRESH": "Aktualisieren",
|
||||||
|
"PROCESS": {
|
||||||
|
"STOP": "Stopp",
|
||||||
|
"FORCE_KILL": "Erzwinge Beenden"
|
||||||
|
},
|
||||||
|
"DEBUG_INFO": "Debug-Informationen"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,12 +31,18 @@
|
||||||
"APP_SETTINGS": {
|
"APP_SETTINGS": {
|
||||||
"ALLOW_SLIDING": "Stick interaction during grab",
|
"ALLOW_SLIDING": "Stick interaction during grab",
|
||||||
"ANIMATION_SPEED": "UI Animation speed",
|
"ANIMATION_SPEED": "UI Animation speed",
|
||||||
|
"AUTOSTART_APPS": "Apps to run on startup",
|
||||||
"BLOCK_GAME_INPUT": "Block game input",
|
"BLOCK_GAME_INPUT": "Block game input",
|
||||||
"BLOCK_GAME_INPUT_HELP": "Blocks all input when an overlay is hovered",
|
"BLOCK_GAME_INPUT_HELP": "Blocks all input when an overlay is hovered",
|
||||||
"BLOCK_GAME_INPUT_IGNORE_WATCH": "Ignore watch when blocking input",
|
"BLOCK_GAME_INPUT_IGNORE_WATCH": "Ignore watch when blocking input",
|
||||||
"BLOCK_GAME_INPUT_IGNORE_WATCH_HELP": "Do not block input when watch is hovered",
|
"BLOCK_GAME_INPUT_IGNORE_WATCH_HELP": "Do not block input when watch is hovered",
|
||||||
|
"BLOCK_POSES_ON_KBD_INTERACTION": "Block poses when interacting with keyboard",
|
||||||
|
"BLOCK_POSES_ON_KBD_INTERACTION_HELP": "Blocks the game from receiving poses when the keyboard is hovered and 'Block game input' is enabled",
|
||||||
|
"BROWSE_ONLINE_CATALOG": "Browse online catalog...",
|
||||||
|
"BROWSE_SKYMAPS": "Browse skymaps",
|
||||||
"CAPTURE_METHOD": "Wayland screen capture",
|
"CAPTURE_METHOD": "Wayland screen capture",
|
||||||
"CAPTURE_METHOD_HELP": "Try changing this if you are\nexperiencing black or glitchy screens",
|
"CAPTURE_METHOD_HELP": "Try changing this if you are\nexperiencing black or glitchy screens",
|
||||||
|
"COLOR_KEYING": "Color keying",
|
||||||
"CLEAR_PIPEWIRE_TOKENS": "Clear PipeWire tokens",
|
"CLEAR_PIPEWIRE_TOKENS": "Clear PipeWire tokens",
|
||||||
"CLEAR_PIPEWIRE_TOKENS_HELP": "Prompt for screen selection on next start",
|
"CLEAR_PIPEWIRE_TOKENS_HELP": "Prompt for screen selection on next start",
|
||||||
"CLEAR_SAVED_STATE": "Clear saved state",
|
"CLEAR_SAVED_STATE": "Clear saved state",
|
||||||
|
|
@ -49,8 +55,11 @@
|
||||||
"DELETE_ALL_CONFIGS_HELP": "Remove all configuration files from conf.d",
|
"DELETE_ALL_CONFIGS_HELP": "Remove all configuration files from conf.d",
|
||||||
"DOUBLE_CURSOR_FIX": "Double cursor fix",
|
"DOUBLE_CURSOR_FIX": "Double cursor fix",
|
||||||
"DOUBLE_CURSOR_FIX_HELP": "Enable this if you see 2 cursors",
|
"DOUBLE_CURSOR_FIX_HELP": "Enable this if you see 2 cursors",
|
||||||
|
"ENABLED": "Enabled",
|
||||||
"FEATURES": "Features",
|
"FEATURES": "Features",
|
||||||
"FOCUS_FOLLOWS_MOUSE_MODE": "Mouse move on trigger touch",
|
"FOCUS_FOLLOWS_MOUSE_MODE": "Mouse move on trigger touch",
|
||||||
|
"HANDSFREE_POINTER": "Handsfree mode",
|
||||||
|
"HANDSFREE_POINTER_HELP": "Input to use when motion\ncontrollers are unavailable.\nLeft pinch is grab, right is click.",
|
||||||
"HIDE_GRAB_HELP": "Hide grab help",
|
"HIDE_GRAB_HELP": "Hide grab help",
|
||||||
"HIDE_USERNAME": "Hide username",
|
"HIDE_USERNAME": "Hide username",
|
||||||
"INVERT_SCROLL_DIRECTION_X": "Invert horizontal scroll direction",
|
"INVERT_SCROLL_DIRECTION_X": "Invert horizontal scroll direction",
|
||||||
|
|
@ -58,6 +67,7 @@
|
||||||
"KEYBOARD_MIDDLE_CLICK": "Keyboard middle click",
|
"KEYBOARD_MIDDLE_CLICK": "Keyboard middle click",
|
||||||
"KEYBOARD_MIDDLE_CLICK_HELP": "Modifier to use when typing\nwith purple laser",
|
"KEYBOARD_MIDDLE_CLICK_HELP": "Modifier to use when typing\nwith purple laser",
|
||||||
"KEYBOARD_SOUND_ENABLED": "Keyboard sounds",
|
"KEYBOARD_SOUND_ENABLED": "Keyboard sounds",
|
||||||
|
"LANGUAGE": "Language",
|
||||||
"LEFT_HANDED_MOUSE": "Left-handed mouse",
|
"LEFT_HANDED_MOUSE": "Left-handed mouse",
|
||||||
"LEFT_HANDED_MOUSE_HELP": "Use this if mouse buttons are swapped",
|
"LEFT_HANDED_MOUSE_HELP": "Use this if mouse buttons are swapped",
|
||||||
"LONG_PRESS_DURATION": "Long press duration",
|
"LONG_PRESS_DURATION": "Long press duration",
|
||||||
|
|
@ -65,39 +75,66 @@
|
||||||
"MISC": "Miscellaneous",
|
"MISC": "Miscellaneous",
|
||||||
"NOTIFICATIONS_ENABLED": "Enable notifications",
|
"NOTIFICATIONS_ENABLED": "Enable notifications",
|
||||||
"NOTIFICATIONS_SOUND_ENABLED": "Notification sounds",
|
"NOTIFICATIONS_SOUND_ENABLED": "Notification sounds",
|
||||||
|
"NOT_SUPPORTED": "Not supported",
|
||||||
|
"NO_SKYMAPS_FOUND": "No skymaps found",
|
||||||
"OPAQUE_BACKGROUND": "Opaque background",
|
"OPAQUE_BACKGROUND": "Opaque background",
|
||||||
"OPTION": {
|
"OPTION": {
|
||||||
"AUTO": "Automatic",
|
"AUTO": "Automatic",
|
||||||
"AUTO_HELP": "ScreenCopy GPU if supported,\notherwise PipeWire GPU.",
|
"AUTO_HELP": "ScreenCopy GPU if supported,\notherwise PipeWire GPU.",
|
||||||
|
"EYE_ONLY": "Eye only",
|
||||||
|
"EYE_PINCH": "Eye + pinch",
|
||||||
|
"HMD_ONLY": "HMD only",
|
||||||
|
"HMD_PINCH": "HMD + pinch",
|
||||||
|
"NONE": "None",
|
||||||
"PIPEWIRE_HELP": "Fast GPU capture,\nstandard on all desktops.",
|
"PIPEWIRE_HELP": "Fast GPU capture,\nstandard on all desktops.",
|
||||||
"PW_FALLBACK_HELP": "Slow method with high CPU usage.\nTry in case PipeWire GPU doesn't work",
|
"PW_FALLBACK_HELP": "Slow method with high CPU usage.\nTry in case PipeWire GPU doesn't work",
|
||||||
"SCREENCOPY_GPU_HELP": "Fast, no screen share popups.\nWorks on: Hyprland, Niri, River, Sway",
|
"SCREENCOPY_GPU_HELP": "Fast, no screen share popups.\nWorks on: Hyprland, Niri, River, Sway",
|
||||||
"SCREENCOPY_HELP": "Slow, no screen share popups.\nWorks on: Hyprland, Niri, River, Sway"
|
"SCREENCOPY_HELP": "Slow, no screen share popups.\nWorks on: Hyprland, Niri, River, Sway"
|
||||||
},
|
},
|
||||||
"POINTER_LERP_FACTOR": "Pointer smoothing",
|
"POINTER_LERP_FACTOR": "Pointer smoothing",
|
||||||
|
"REQUIRES_RESTART": "Requires restart",
|
||||||
|
"RESET_PLAYSPACE": "Reset playspace",
|
||||||
|
"RESET_PLAYSPACE_HELP": "Clear the stage space offset.",
|
||||||
"RESTART_SOFTWARE": "Restart software",
|
"RESTART_SOFTWARE": "Restart software",
|
||||||
"RESTART_SOFTWARE_HELP": "Apply settings that require a restart",
|
"RESTART_SOFTWARE_HELP": "Apply settings that require a restart",
|
||||||
"ROUND_MULTIPLIER": "UI Edge roundness",
|
"ROUND_MULTIPLIER": "UI Edge roundness",
|
||||||
"SCREEN_RENDER_DOWN": "Render screen at lower resolution",
|
"SCREEN_RENDER_DOWN": "Render screen at lower resolution",
|
||||||
"SCREEN_RENDER_DOWN_HELP": "Helps with aliasing on high-res screens",
|
"SCREEN_RENDER_DOWN_HELP": "Helps with aliasing on high-res screens",
|
||||||
"SCROLL_SPEED": "Scroll speed",
|
"SCROLL_SPEED": "Scroll speed",
|
||||||
|
"SELECT_VARIANT": "Select variant",
|
||||||
|
"ENABLE_WATCH": "Enable watch",
|
||||||
"SETS_ON_WATCH": "Sets on watch",
|
"SETS_ON_WATCH": "Sets on watch",
|
||||||
|
"SKYBOX": "Skybox",
|
||||||
|
"SKYMAP_ALREADY_DOWNLOADED": "This skymap is already downloaded. Select desired action.",
|
||||||
|
"SPACE_DRAG": "Space drag",
|
||||||
"SPACE_DRAG_MULTIPLIER": "Space drag multiplier",
|
"SPACE_DRAG_MULTIPLIER": "Space drag multiplier",
|
||||||
"SPACE_DRAG_UNLOCKED": "Allow space drag on all axes",
|
"SPACE_DRAG_UNLOCKED": "Allow space drag on all axes",
|
||||||
|
"SPACE_GRAVITY_DAMPING": "Damping",
|
||||||
|
"SPACE_GRAVITY_DAMPING_HELP": "Artificial drag to slow down movement. 0.1 - high drag, 1.0 - no drag",
|
||||||
|
"SPACE_GRAVITY_FLING_STRENGTH": "Fling strength",
|
||||||
|
"SPACE_GRAVITY_FLING_STRENGTH_HELP": "Intensity multiplier of gravitational launch force after space-drag.\n0.0 - no movement at all, 2.0 - double intensity",
|
||||||
|
"SPACE_GRAVITY_GRAVITY": "Gravity",
|
||||||
|
"SPACE_GRAVITY_GRAVITY_HELP": "Amount of downwards force. 0.0 - no gravity",
|
||||||
|
"SPACE_GRAVITY_GROUND_FRICTION": "Ground friction",
|
||||||
|
"SPACE_GRAVITY_GROUND_FRICTION_HELP": "Amount of friction slowing you down if you're touching the ground.\n0.0 - no friction (just like on ice), 1.0 - rough surface",
|
||||||
|
"SPACE_GRAVITY_FLOOR_HEIGHT": "Floor height",
|
||||||
|
"SPACE_GRAVITY_FLOOR_HEIGHT_HELP": "The Y position where the floor is. Gravity stops when you reach this height.",
|
||||||
"SPACE_ROTATE_UNLOCKED": "Allow space rotate on all axes",
|
"SPACE_ROTATE_UNLOCKED": "Allow space rotate on all axes",
|
||||||
"TROUBLESHOOTING": "Troubleshooting",
|
"TROUBLESHOOTING": "Troubleshooting",
|
||||||
|
"UI_GRADIENT_INTENSITY": "UI Gradient intensity",
|
||||||
"UPRIGHT_SCREEN_FIX": "Upright screen fix",
|
"UPRIGHT_SCREEN_FIX": "Upright screen fix",
|
||||||
"UPRIGHT_SCREEN_FIX_HELP": "Fixes upright screens on some desktops",
|
"UPRIGHT_SCREEN_FIX_HELP": "Fixes upright screens on some desktops",
|
||||||
"USE_PASSTHROUGH": "Enable passthrough",
|
"USE_PASSTHROUGH": "Enable passthrough",
|
||||||
"USE_PASSTHROUGH_HELP": "Allow passthrough if the XR runtime supports it",
|
"USE_PASSTHROUGH_HELP": "Allow passthrough if the XR runtime supports it",
|
||||||
"USE_SKYBOX": "Enable skybox",
|
"USE_SKYBOX": "Enable skybox",
|
||||||
"USE_SKYBOX_HELP": "Show a skybox if there's no scene app or passthrough",
|
"USE_SKYBOX_HELP": "Show a skybox if there's no scene app or passthrough",
|
||||||
"XR_CLICK_SENSITIVITY": "XR click sensitivity",
|
"WATCH_VIEW_ANGLE": "Watch view angles",
|
||||||
"XR_CLICK_SENSITIVITY_HELP": "Analog trigger sensitivity",
|
"WATCH_VIEW_ANGLE_HELP": "Control how the watch fades away",
|
||||||
"XR_CLICK_SENSITIVITY_RELEASE": "XR release sensitivity",
|
"GRID_OPACITY": "Floor grid opacity",
|
||||||
"XR_CLICK_SENSITIVITY_RELEASE_HELP": "Must be lower than click",
|
"GRID_OPACITY_HELP": "Opacity of the floor grid when the skybox is enabled",
|
||||||
"XWAYLAND_BY_DEFAULT": "Run apps in Compatibility mode by default",
|
"XR_CLICK_SENSITIVITY": "XR trigger sensitivity",
|
||||||
"AUTOSTART_APPS": "Apps to run on startup"
|
"XR_CLICK_SENSITIVITY_HELP": "Press and release values for analog triggers",
|
||||||
|
"XWAYLAND_BY_DEFAULT": "Run apps in Compatibility mode by default"
|
||||||
},
|
},
|
||||||
"APPLICATION_LAUNCHER": "Application launcher",
|
"APPLICATION_LAUNCHER": "Application launcher",
|
||||||
"APPLICATION_STARTED": "Application started",
|
"APPLICATION_STARTED": "Application started",
|
||||||
|
|
@ -117,11 +154,17 @@
|
||||||
"VOLUME": "Volume"
|
"VOLUME": "Volume"
|
||||||
},
|
},
|
||||||
"CLOSE_WINDOW": "Close window",
|
"CLOSE_WINDOW": "Close window",
|
||||||
|
"CREATION_DATE": "Creation date",
|
||||||
|
"DEBUG_INFO": "Debug info",
|
||||||
"DISPLAY_BRIGHTNESS": "Display brightness",
|
"DISPLAY_BRIGHTNESS": "Display brightness",
|
||||||
|
"DOWNLOADER": "Downloader",
|
||||||
|
"DOWNLOAD_AGAIN": "Download again",
|
||||||
|
"DOWNLOADING_FILE": "Downloading file...",
|
||||||
"FAILED_TO_LAUNCH_APPLICATION": "Failed to launch a application:",
|
"FAILED_TO_LAUNCH_APPLICATION": "Failed to launch a application:",
|
||||||
"GAME_LAUNCHED": "Game launched",
|
"GAME_LAUNCHED": "Game launched",
|
||||||
"GAME_LIST": {
|
"GAME_LIST": {
|
||||||
"NO_GAMES_FOUND": "No games found"
|
"NO_GAMES_FOUND": "No games found",
|
||||||
|
"RUNNING_GAMES_LIST": "List of running games"
|
||||||
},
|
},
|
||||||
"GAMES": "Games",
|
"GAMES": "Games",
|
||||||
"GENERAL_SETTINGS": "General settings",
|
"GENERAL_SETTINGS": "General settings",
|
||||||
|
|
@ -130,23 +173,25 @@
|
||||||
"HELLO_USER": "Hello, {USER}!",
|
"HELLO_USER": "Hello, {USER}!",
|
||||||
"HIDE": "Hide",
|
"HIDE": "Hide",
|
||||||
"HOME_SCREEN": "Home",
|
"HOME_SCREEN": "Home",
|
||||||
"LIST_OF_PROCESSES": "Process list",
|
"MODIFICATION_DATE": "Modification date",
|
||||||
"LIST_OF_WINDOWS": "Window list",
|
|
||||||
"MONADO_RUNTIME": "Monado runtime",
|
"MONADO_RUNTIME": "Monado runtime",
|
||||||
"NO_WINDOWS_FOUND": "No windows found",
|
"LOADING": "Loading...",
|
||||||
"POPUP_ADD_DISPLAY": {
|
"POPUP_ADD_DISPLAY": {
|
||||||
"RESOLUTION": "Resolution"
|
"RESOLUTION": "Resolution"
|
||||||
},
|
},
|
||||||
"PROCESS_LIST": {
|
"PROCESS": {
|
||||||
"LOCATED_ON": "on",
|
"FORCE_KILL": "Force-kill",
|
||||||
"NO_PROCESSES_FOUND": "No processes found",
|
"STOP": "Stop"
|
||||||
"TERMINATE_PROCESS_NAMED_X": "Terminate process \"{PROCESS_NAME}\""
|
|
||||||
},
|
},
|
||||||
"PROCESSES": "Processes",
|
"PROCESS_LIST": "Process list",
|
||||||
|
"REFRESH": "Refresh",
|
||||||
"REMOVE": "Remove",
|
"REMOVE": "Remove",
|
||||||
|
"APPLY": "Apply",
|
||||||
|
"RELOAD_FROM_DISK": "Reload from disk",
|
||||||
"SETTINGS": "Settings",
|
"SETTINGS": "Settings",
|
||||||
"SHOW": "Show",
|
"SHOW": "Show",
|
||||||
|
"TARGET_PATH": "Target path",
|
||||||
"TERMINATE_PROCESS": "Terminate process",
|
"TERMINATE_PROCESS": "Terminate process",
|
||||||
"WIDTH": "Width",
|
"VERSION": "Version",
|
||||||
"WINDOW_OPTIONS": "Window options"
|
"WIDTH": "Width"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,153 +1,162 @@
|
||||||
{
|
{
|
||||||
"HOME_SCREEN": "Inicio",
|
"HOME_SCREEN": "Inicio",
|
||||||
"MONADO_RUNTIME": "Monado tiempo de ejecución",
|
"MONADO_RUNTIME": "Monado tiempo de ejecución",
|
||||||
"APPLICATIONS": "Aplicaciones",
|
"APPLICATIONS": "Aplicaciones",
|
||||||
"GAMES": "Juegos",
|
"GAMES": "Juegos",
|
||||||
"SETTINGS": "Ajustes",
|
"SETTINGS": "Ajustes",
|
||||||
"PROCESSES": "Procesos",
|
"HELLO_USER": "¡Hola, {USER}!",
|
||||||
"HELLO_USER": "¡Hola, {USER}!",
|
"GENERAL_SETTINGS": "Ajustes generales",
|
||||||
"GENERAL_SETTINGS": "Ajustes generales",
|
"APPLICATION_LAUNCHER": "Lanzador de aplicaciones",
|
||||||
"APPLICATION_LAUNCHER": "Lanzador de aplicaciones",
|
"APP_SETTINGS": {
|
||||||
"APP_SETTINGS": {
|
"HIDE_USERNAME": "Ocultar nombre de usuario",
|
||||||
"HIDE_USERNAME": "Ocultar nombre de usuario",
|
"OPAQUE_BACKGROUND": "Fondo opaco",
|
||||||
"OPAQUE_BACKGROUND": "Fondo opaco",
|
"LOOK_AND_FEEL": "Apariencia y estilo",
|
||||||
"WLX": {},
|
"HIDE_GRAB_HELP": "Ocultar ayuda para agarrar",
|
||||||
"LOOK_AND_FEEL": "Apariencia y estilo",
|
"ANIMATION_SPEED": "Velocidad de animación de la IU",
|
||||||
"HIDE_GRAB_HELP": "Ocultar ayuda para agarrar",
|
"ROUND_MULTIPLIER": "Redondeo de bordes de la IU",
|
||||||
"ANIMATION_SPEED": "Velocidad de animación de la IU",
|
"USE_SKYBOX": "Activar skybox",
|
||||||
"ROUND_MULTIPLIER": "Redondeo de bordes de la IU",
|
"USE_PASSTHROUGH": "Activar passthrough",
|
||||||
"USE_SKYBOX": "Activar skybox",
|
"CLOCK_12H": "Reloj de 12 horas",
|
||||||
"USE_PASSTHROUGH": "Activar passthrough",
|
"FEATURES": "Funciones",
|
||||||
"CLOCK_12H": "Reloj de 12 horas",
|
"NOTIFICATIONS_ENABLED": "Habilitar notificaciones",
|
||||||
"FEATURES": "Funciones",
|
"NOTIFICATIONS_SOUND_ENABLED": "Sonidos de notificación",
|
||||||
"NOTIFICATIONS_ENABLED": "Habilitar notificaciones",
|
"KEYBOARD_SOUND_ENABLED": "Sonidos del teclado",
|
||||||
"NOTIFICATIONS_SOUND_ENABLED": "Sonidos de notificación",
|
"SPACE_DRAG_MULTIPLIER": "Multiplicador de arrastre espacial",
|
||||||
"KEYBOARD_SOUND_ENABLED": "Sonidos del teclado",
|
"SPACE_DRAG_UNLOCKED": "Permitir arrastre del espacio en todos los ejes",
|
||||||
"SPACE_DRAG_MULTIPLIER": "Multiplicador de arrastre espacial",
|
"SPACE_ROTATE_UNLOCKED": "Permitir rotación espacial en todos los ejes",
|
||||||
"SPACE_DRAG_UNLOCKED": "Permitir arrastre del espacio en todos los ejes",
|
"BLOCK_GAME_INPUT": "Bloquear entrada del juego",
|
||||||
"SPACE_ROTATE_UNLOCKED": "Permitir rotación espacial en todos los ejes",
|
"BLOCK_GAME_INPUT_IGNORE_WATCH": "Ignorar watch al bloquear la entrada",
|
||||||
"BLOCK_GAME_INPUT": "Bloquear entrada del juego",
|
"CONTROLS": "Controles",
|
||||||
"BLOCK_GAME_INPUT_IGNORE_WATCH": "Ignorar watch al bloquear la entrada",
|
"FOCUS_FOLLOWS_MOUSE_MODE": "El movimiento del ratón en el disparador",
|
||||||
"CONTROLS": "Controles",
|
"LEFT_HANDED_MOUSE": "Ratón para zurdos",
|
||||||
"FOCUS_FOLLOWS_MOUSE_MODE": "El movimiento del ratón en el disparador",
|
"ALLOW_SLIDING": "Interacción con el stick durante el agarre",
|
||||||
"LEFT_HANDED_MOUSE": "Ratón para zurdos",
|
"INVERT_SCROLL_DIRECTION_X": "Invertir dirección de desplazamiento horizontal",
|
||||||
"ALLOW_SLIDING": "Interacción con el stick durante el agarre",
|
"INVERT_SCROLL_DIRECTION_Y": "Invertir la dirección del desplazamiento vertical",
|
||||||
"INVERT_SCROLL_DIRECTION_X": "Invertir dirección de desplazamiento horizontal",
|
"SCROLL_SPEED": "Velocidad de desplazamiento",
|
||||||
"INVERT_SCROLL_DIRECTION_Y": "Invertir la dirección del desplazamiento vertical",
|
"LONG_PRESS_DURATION": "Duración de la pulsación larga",
|
||||||
"SCROLL_SPEED": "Velocidad de desplazamiento",
|
"POINTER_LERP_FACTOR": "Suavizado del puntero",
|
||||||
"LONG_PRESS_DURATION": "Duración de la pulsación larga",
|
"CLICK_FREEZE_TIME_MS": "Tiempo de congelación al hacer clic (ms)",
|
||||||
"POINTER_LERP_FACTOR": "Suavizado del puntero",
|
"MISC": "Miscelánea",
|
||||||
"XR_CLICK_SENSITIVITY": "Sensibilidad del clic XR",
|
"XWAYLAND_BY_DEFAULT": "Ejecutar aplicaciones en modo de compatibilidad por defecto",
|
||||||
"XR_CLICK_SENSITIVITY_RELEASE": "Sensibilidad de liberación de OpenXR",
|
"UPRIGHT_SCREEN_FIX": "Corrección de pantalla vertical",
|
||||||
"CLICK_FREEZE_TIME_MS": "Tiempo de congelación al hacer clic (ms)",
|
"DOUBLE_CURSOR_FIX": "Solución de doble cursor",
|
||||||
"MISC": "Miscelánea",
|
"SCREEN_RENDER_DOWN": "Renderizar pantalla a menor resolución",
|
||||||
"XWAYLAND_BY_DEFAULT": "Ejecutar aplicaciones en modo de compatibilidad por defecto",
|
"UPRIGHT_SCREEN_FIX_HELP": "Corrige pantallas en posición vertical en algunos escritorios",
|
||||||
"UPRIGHT_SCREEN_FIX": "Corrección de pantalla vertical",
|
"DOUBLE_CURSOR_FIX_HELP": "Habilita esto si ves 2 cursores",
|
||||||
"DOUBLE_CURSOR_FIX": "Solución de doble cursor",
|
"CLICK_FREEZE_TIME_MS_HELP": "Ayuda con la precisión de los dobles clics",
|
||||||
"SCREEN_RENDER_DOWN": "Renderizar pantalla a menor resolución",
|
"LEFT_HANDED_MOUSE_HELP": "Utilice esto si los botones del ratón están intercambiados",
|
||||||
"UPRIGHT_SCREEN_FIX_HELP": "Corrige pantallas en posición vertical en algunos escritorios",
|
"BLOCK_GAME_INPUT_HELP": "Bloquea toda la entrada cuando se pasa el cursor sobre un overlay",
|
||||||
"DOUBLE_CURSOR_FIX_HELP": "Habilita esto si ves 2 cursores",
|
"BLOCK_GAME_INPUT_IGNORE_WATCH_HELP": "No bloquear la entrada cuando el cursor está sobre la ventana",
|
||||||
"XR_CLICK_SENSITIVITY_HELP": "Sensibilidad del gatillo analógico",
|
"USE_SKYBOX_HELP": "Mostrar una skybox si no hay una aplicación de escena o passthrough",
|
||||||
"XR_CLICK_SENSITIVITY_RELEASE_HELP": "Debe ser inferior a 'click'",
|
"USE_PASSTHROUGH_HELP": "Permitir passthrough si el entorno de ejecución XR lo admite",
|
||||||
"CLICK_FREEZE_TIME_MS_HELP": "Ayuda con la precisión de los dobles clics",
|
"SCREEN_RENDER_DOWN_HELP": "Ayuda a reducir el aliasing en pantallas de alta resolución",
|
||||||
"LEFT_HANDED_MOUSE_HELP": "Utilice esto si los botones del ratón están intercambiados",
|
"SETS_ON_WATCH": "Conjuntos en el reloj",
|
||||||
"BLOCK_GAME_INPUT_HELP": "Bloquea toda la entrada cuando se pasa el cursor sobre un overlay",
|
"TROUBLESHOOTING": "Solución de problemas",
|
||||||
"BLOCK_GAME_INPUT_IGNORE_WATCH_HELP": "No bloquear la entrada cuando el cursor está sobre la ventana",
|
"CLEAR_SAVED_STATE": "Borrar estado guardado",
|
||||||
"USE_SKYBOX_HELP": "Mostrar una skybox si no hay una aplicación de escena o passthrough",
|
"CLEAR_PIPEWIRE_TOKENS": "Limpiar tokens de PipeWire",
|
||||||
"USE_PASSTHROUGH_HELP": "Permitir passthrough si el entorno de ejecución XR lo admite",
|
"DELETE_ALL_CONFIGS": "Borrar configuración",
|
||||||
"SCREEN_RENDER_DOWN_HELP": "Ayuda a reducir el aliasing en pantallas de alta resolución",
|
"RESTART_SOFTWARE": "Reiniciar software",
|
||||||
"SETS_ON_WATCH": "Conjuntos en el reloj",
|
"CLEAR_SAVED_STATE_HELP": "Restablecer sets y posiciones de superposición",
|
||||||
"TROUBLESHOOTING": "Solución de problemas",
|
"CLEAR_PIPEWIRE_TOKENS_HELP": "Solicitar la selección de pantalla al iniciar la próxima vez",
|
||||||
"CLEAR_SAVED_STATE": "Borrar estado guardado",
|
"DELETE_ALL_CONFIGS_HELP": "Eliminar todos los archivos de configuración de conf.d",
|
||||||
"CLEAR_PIPEWIRE_TOKENS": "Limpiar tokens de PipeWire",
|
"RESTART_SOFTWARE_HELP": "Aplicar la configuración que requiere un reinicio",
|
||||||
"DELETE_ALL_CONFIGS": "Borrar configuración",
|
"CAPTURE_METHOD": "Captura de pantalla de Wayland",
|
||||||
"RESTART_SOFTWARE": "Reiniciar software",
|
"CAPTURE_METHOD_HELP": "Intente cambiar esta opción si\nexperimenta pantallas negras o con fallos",
|
||||||
"CLEAR_SAVED_STATE_HELP": "Restablecer sets y posiciones de superposición",
|
"KEYBOARD_MIDDLE_CLICK": "Clic del botón central del teclado",
|
||||||
"CLEAR_PIPEWIRE_TOKENS_HELP": "Solicitar la selección de pantalla al iniciar la próxima vez",
|
"KEYBOARD_MIDDLE_CLICK_HELP": "Modificador para usar al escribir\ncon láser púrpura",
|
||||||
"DELETE_ALL_CONFIGS_HELP": "Eliminar todos los archivos de configuración de conf.d",
|
"OPTION": {
|
||||||
"RESTART_SOFTWARE_HELP": "Aplicar la configuración que requiere un reinicio",
|
"AUTO": "Automático",
|
||||||
"CAPTURE_METHOD": "Captura de pantalla de Wayland",
|
"AUTO_HELP": "Copiar pantalla usando la GPU si es compatible,\nde lo contrario, GPU de PipeWire.",
|
||||||
"CAPTURE_METHOD_HELP": "Intente cambiar esta opción si\nexperimenta pantallas negras o con fallos",
|
"PIPEWIRE_HELP": "Captura de GPU rápida,\nestándar en todos los escritorios.",
|
||||||
"KEYBOARD_MIDDLE_CLICK": "Clic del botón central del teclado",
|
"PW_FALLBACK_HELP": "Método lento con alto uso de CPU.\nPruébalo si PipeWire GPU no funciona",
|
||||||
"KEYBOARD_MIDDLE_CLICK_HELP": "Modificador para usar al escribir\ncon láser púrpura",
|
"SCREENCOPY_GPU_HELP": "Rápido, sin ventanas emergentes de uso compartido de pantalla.\nFunciona en: Hyprland, Niri, River, Sway",
|
||||||
"OPTION": {
|
"SCREENCOPY_HELP": "Lento, sin ventanas emergentes de uso compartido de pantalla.\nFunciona en: Hyprland, Niri, River, Sway",
|
||||||
"AUTO": "Automático",
|
"NONE": "Ninguno",
|
||||||
"AUTO_HELP": "Copiar pantalla usando la GPU si es compatible,\nde lo contrario, GPU de PipeWire.",
|
"HMD_PINCH": "HMD + pellizco",
|
||||||
"PIPEWIRE_HELP": "Captura de GPU rápida,\nestándar en todos los escritorios.",
|
"EYE_PINCH": "Ojo + pellizco",
|
||||||
"PW_FALLBACK_HELP": "Método lento con alto uso de CPU.\nPruébalo si PipeWire GPU no funciona",
|
"EYE_ONLY": "Solo ojo",
|
||||||
"SCREENCOPY_GPU_HELP": "Rápido, sin ventanas emergentes de uso compartido de pantalla.\nFunciona en: Hyprland, Niri, River, Sway",
|
"HMD_ONLY": "Solo HMD"
|
||||||
"SCREENCOPY_HELP": "Lento, sin ventanas emergentes de uso compartido de pantalla.\nFunciona en: Hyprland, Niri, River, Sway"
|
},
|
||||||
},
|
"AUTOSTART_APPS": "Aplicaciones a ejecutar al inicio",
|
||||||
"AUTOSTART_APPS": "Aplicaciones a ejecutar al inicio"
|
"HANDSFREE_POINTER": "Modo manos libres",
|
||||||
},
|
"HANDSFREE_POINTER_HELP": "Entrada a utilizar cuando no\nestén disponibles los mandos de movimiento.\nPellizco con la izquierda para agarrar, con la derecha para hacer clic.",
|
||||||
"HELLO": "¡Hola!",
|
"UI_GRADIENT_INTENSITY": "Intensidad del degradado de la IU",
|
||||||
"AUDIO": {
|
"RESET_PLAYSPACE": "Restablecer espacio de juego",
|
||||||
"VOLUME": "Volumen",
|
"RESET_PLAYSPACE_HELP": "Borrar el desplazamiento del espacio de juego.",
|
||||||
"SETTINGS": "Configuración de audio",
|
"BLOCK_POSES_ON_KBD_INTERACTION": "Bloquear poses al interactuar con el teclado",
|
||||||
"AUTO_SWITCH_TO_VR_AUDIO": "Conmutar automáticamente al audio VR",
|
"BLOCK_POSES_ON_KBD_INTERACTION_HELP": "Bloquea que el juego reciba poses cuando el teclado está sobre él y 'Bloquear entrada del juego' está habilitado",
|
||||||
"SPEAKERS": "Altavoces",
|
"LANGUAGE": "Idioma",
|
||||||
"MICROPHONES": "Micrófonos",
|
"REQUIRES_RESTART": "Requiere reinicio",
|
||||||
"CARDS": "Tarjetas",
|
"GRID_OPACITY": "Opacidad de la cuadrícula del suelo",
|
||||||
"SELECT_AUDIO_CARD_PROFILE": "Seleccionar perfil de tarjeta de audio",
|
"GRID_OPACITY_HELP": "Opacidad de la cuadrícula del suelo cuando el skybox está habilitado"
|
||||||
"NO_VR_SPEAKERS_FOUND_SWITCH_MANUALLY": "No se encontraron altavoces VR. Actívelos manualmente.",
|
},
|
||||||
"NO_VR_MICROPHONE_SWITCH_MANUALLY": "No se encontró micrófono VR. Actívelo manualmente.",
|
"HELLO": "¡Hola!",
|
||||||
"FAILED_TO_SWITCH_MICROPHONE": "No se pudo cambiar el micrófono",
|
"AUDIO": {
|
||||||
"MICROPHONE_SET_SUCCESSFULLY": "Micrófono configurado correctamente",
|
"VOLUME": "Volumen",
|
||||||
"SPEAKERS_SET_SUCCESSFULLY": "Altavoces configurados correctamente"
|
"SETTINGS": "Configuración de audio",
|
||||||
},
|
"AUTO_SWITCH_TO_VR_AUDIO": "Conmutar automáticamente al audio VR",
|
||||||
"ACTIONS": {
|
"SPEAKERS": "Altavoces",
|
||||||
"RECENTER_PLAYSPACE": "Re-centrar espacio de juego"
|
"MICROPHONES": "Micrófonos",
|
||||||
},
|
"CARDS": "Tarjetas",
|
||||||
"LIST_OF_PROCESSES": "Lista de procesos",
|
"SELECT_AUDIO_CARD_PROFILE": "Seleccionar perfil de tarjeta de audio",
|
||||||
"POPUP_ADD_DISPLAY": {
|
"NO_VR_SPEAKERS_FOUND_SWITCH_MANUALLY": "No se encontraron altavoces VR. Actívelos manualmente.",
|
||||||
"RESOLUTION": "Resolución"
|
"NO_VR_MICROPHONE_SWITCH_MANUALLY": "No se encontró micrófono VR. Actívelo manualmente.",
|
||||||
},
|
"FAILED_TO_SWITCH_MICROPHONE": "No se pudo cambiar el micrófono",
|
||||||
"WIDTH": "Ancho",
|
"MICROPHONE_SET_SUCCESSFULLY": "Micrófono configurado correctamente",
|
||||||
"HEIGHT": "Altura",
|
"SPEAKERS_SET_SUCCESSFULLY": "Altavoces configurados correctamente"
|
||||||
"HIDE": "Ocultar",
|
},
|
||||||
"REMOVE": "Eliminar",
|
"ACTIONS": {
|
||||||
"SHOW": "Mostrar",
|
"RECENTER_PLAYSPACE": "Re-centrar espacio de juego"
|
||||||
"PROCESS_LIST": {
|
},
|
||||||
"NO_PROCESSES_FOUND": "No se encontraron procesos",
|
"POPUP_ADD_DISPLAY": {
|
||||||
"LOCATED_ON": "en",
|
"RESOLUTION": "Resolución"
|
||||||
"TERMINATE_PROCESS_NAMED_X": "Terminar proceso \"{PROCESS_NAME}\""
|
},
|
||||||
},
|
"WIDTH": "Ancho",
|
||||||
"FAILED_TO_LAUNCH_APPLICATION": "No se pudo iniciar la aplicación:",
|
"HEIGHT": "Altura",
|
||||||
"NO_WINDOWS_FOUND": "No se encontraron ventanas",
|
"HIDE": "Ocultar",
|
||||||
"WINDOW_OPTIONS": "Opciones de ventana",
|
"REMOVE": "Eliminar",
|
||||||
"APPLICATION_STARTED": "Aplicación iniciada",
|
"SHOW": "Mostrar",
|
||||||
"LIST_OF_WINDOWS": "Lista de ventanas",
|
"FAILED_TO_LAUNCH_APPLICATION": "No se pudo iniciar la aplicación:",
|
||||||
"CLOSE_WINDOW": "Cerrar ventana",
|
"APPLICATION_STARTED": "Aplicación iniciada",
|
||||||
"GAME_LIST": {
|
"CLOSE_WINDOW": "Cerrar ventana",
|
||||||
"NO_GAMES_FOUND": "No se encontraron juegos"
|
"GAME_LIST": {
|
||||||
},
|
"NO_GAMES_FOUND": "No se encontraron juegos",
|
||||||
"TERMINATE_PROCESS": "Finalizar proceso",
|
"RUNNING_GAMES_LIST": "Lista de juegos en ejecución"
|
||||||
"GAME_LAUNCHED": "Juego lanzado",
|
},
|
||||||
"APP_LAUNCHER": {
|
"TERMINATE_PROCESS": "Finalizar proceso",
|
||||||
"MODE": {
|
"GAME_LAUNCHED": "Juego lanzado",
|
||||||
"NATIVE": "Modo nativo",
|
"APP_LAUNCHER": {
|
||||||
"CAGE": "Modo de compatibilidad (Cage)"
|
"MODE": {
|
||||||
},
|
"NATIVE": "Modo nativo",
|
||||||
"RES_TITLE": "Resolución",
|
"CAGE": "Modo de compatibilidad (Cage)"
|
||||||
"ASPECT_TITLE": "Aspecto",
|
},
|
||||||
"ASPECT": {
|
"RES_TITLE": "Resolución",
|
||||||
"WIDE": "Ancho",
|
"ASPECT_TITLE": "Aspecto",
|
||||||
"SEMI_WIDE": "Semi-ancho",
|
"ASPECT": {
|
||||||
"SQUARE": "Cuadrado",
|
"WIDE": "Ancho",
|
||||||
"SEMI_TALL": "Semi alto",
|
"SEMI_WIDE": "Semi-ancho",
|
||||||
"TALL": "Alto"
|
"SQUARE": "Cuadrado",
|
||||||
},
|
"SEMI_TALL": "Semi alto",
|
||||||
"POS_TITLE": "Posicionamiento",
|
"TALL": "Alto"
|
||||||
"POS": {
|
},
|
||||||
"FLOATING": "Flotante",
|
"POS_TITLE": "Posicionamiento",
|
||||||
"ANCHORED": "Anclado",
|
"POS": {
|
||||||
"STATIC": "Estático",
|
"FLOATING": "Flotante",
|
||||||
"FLOATING_HELP": "Se mueve independientemente, se recentra al mostrarse.",
|
"ANCHORED": "Anclado",
|
||||||
"ANCHORED_HELP": "Se mantiene en su lugar con respecto al marcador central.",
|
"STATIC": "Estático",
|
||||||
"STATIC_HELP": "No pertenece a ningún conjunto. No se recentra."
|
"FLOATING_HELP": "Se mueve independientemente, se recentra al mostrarse.",
|
||||||
},
|
"ANCHORED_HELP": "Se mantiene en su lugar con respecto al marcador central.",
|
||||||
"AUTOSTART": "Ejecutar automáticamente al inicio",
|
"STATIC_HELP": "No pertenece a ningún conjunto. No se recentra."
|
||||||
"LAUNCH": "Iniciar"
|
},
|
||||||
},
|
"AUTOSTART": "Ejecutar automáticamente al inicio",
|
||||||
"DISPLAY_BRIGHTNESS": "Brillo de la pantalla"
|
"LAUNCH": "Iniciar"
|
||||||
}
|
},
|
||||||
|
"DISPLAY_BRIGHTNESS": "Brillo de la pantalla",
|
||||||
|
"PROCESS_LIST": "Lista de procesos",
|
||||||
|
"REFRESH": "Actualizar",
|
||||||
|
"PROCESS": {
|
||||||
|
"STOP": "Detener",
|
||||||
|
"FORCE_KILL": "Forzar cierre"
|
||||||
|
},
|
||||||
|
"DEBUG_INFO": "Información de depuración"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,162 @@
|
||||||
|
{
|
||||||
|
"ACTIONS": {
|
||||||
|
"RECENTER_PLAYSPACE": "Recentra lo spazio di gioco"
|
||||||
|
},
|
||||||
|
"APP_LAUNCHER": {
|
||||||
|
"ASPECT": {
|
||||||
|
"SEMI_TALL": "Semi-alto",
|
||||||
|
"SEMI_WIDE": "Semi-ampio",
|
||||||
|
"SQUARE": "Quadrato",
|
||||||
|
"TALL": "Alto",
|
||||||
|
"WIDE": "Ampio"
|
||||||
|
},
|
||||||
|
"ASPECT_TITLE": "Proporzioni",
|
||||||
|
"AUTOSTART": "Avvia automaticamente all'avvio",
|
||||||
|
"LAUNCH": "Avvia",
|
||||||
|
"MODE": {
|
||||||
|
"CAGE": "Modalità compatibilità (Cage)",
|
||||||
|
"NATIVE": "Modalità nativa"
|
||||||
|
},
|
||||||
|
"POS": {
|
||||||
|
"ANCHORED": "Ancorato",
|
||||||
|
"ANCHORED_HELP": "Rimane fermo rispetto al marcatore centrale.",
|
||||||
|
"FLOATING": "Fluttuante",
|
||||||
|
"FLOATING_HELP": "Si muove in modo indipendente, si recentra quando viene mostrato.",
|
||||||
|
"STATIC": "Statico",
|
||||||
|
"STATIC_HELP": "Non fa parte di alcun set. Non recentra."
|
||||||
|
},
|
||||||
|
"POS_TITLE": "Posizionamento",
|
||||||
|
"RES_TITLE": "Risoluzione"
|
||||||
|
},
|
||||||
|
"APP_SETTINGS": {
|
||||||
|
"ALLOW_SLIDING": "Interazione tramite stick durante l'afferrare",
|
||||||
|
"ANIMATION_SPEED": "Velocità dell'animazione dell'interfaccia utente",
|
||||||
|
"BLOCK_GAME_INPUT": "Blocca l'input di gioco",
|
||||||
|
"BLOCK_GAME_INPUT_HELP": "Blocca tutti gli input quando il cursore è sopra un overlay",
|
||||||
|
"BLOCK_GAME_INPUT_IGNORE_WATCH": "Ignora il Watch quando si blocca l'input",
|
||||||
|
"BLOCK_GAME_INPUT_IGNORE_WATCH_HELP": "Non bloccare l'input quando il watch è evidenziato",
|
||||||
|
"CAPTURE_METHOD": "Acquisizione dello schermo Wayland",
|
||||||
|
"CAPTURE_METHOD_HELP": "Prova a modificare questa impostazione se riscontri schermate nere o con artefatti.",
|
||||||
|
"CLEAR_PIPEWIRE_TOKENS": "Cancella i token PipeWire",
|
||||||
|
"CLEAR_PIPEWIRE_TOKENS_HELP": "Richiedi la selezione dello schermo all'avvio successivo",
|
||||||
|
"CLEAR_SAVED_STATE": "Cancella stato salvato",
|
||||||
|
"CLEAR_SAVED_STATE_HELP": "Ripristina set e posizioni degli overlay",
|
||||||
|
"CLICK_FREEZE_TIME_MS": "Tempo di congelamento del click (ms)",
|
||||||
|
"CLICK_FREEZE_TIME_MS_HELP": "Aiuta con la precisione dei doppi clic",
|
||||||
|
"CLOCK_12H": "Orologio a 12 ore",
|
||||||
|
"CONTROLS": "Controlli",
|
||||||
|
"DELETE_ALL_CONFIGS": "Elimina configurazione",
|
||||||
|
"DELETE_ALL_CONFIGS_HELP": "Rimuovi tutti i file di configurazione da conf.d",
|
||||||
|
"DOUBLE_CURSOR_FIX": "Correzione doppio cursore",
|
||||||
|
"DOUBLE_CURSOR_FIX_HELP": "Abilita questa opzione se vedi 2 cursori",
|
||||||
|
"FEATURES": "Funzionalità",
|
||||||
|
"FOCUS_FOLLOWS_MOUSE_MODE": "Movimento del mouse al tocco del grilletto",
|
||||||
|
"HIDE_GRAB_HELP": "Nascondi l'aiuto per l'afferrare",
|
||||||
|
"HIDE_USERNAME": "Nascondi nome utente",
|
||||||
|
"INVERT_SCROLL_DIRECTION_X": "Inverti direzione dello scorrimento orizzontale",
|
||||||
|
"INVERT_SCROLL_DIRECTION_Y": "Inverti direzione dello scorrimento verticale",
|
||||||
|
"KEYBOARD_MIDDLE_CLICK": "Click centrale del tasto",
|
||||||
|
"KEYBOARD_MIDDLE_CLICK_HELP": "Modificatore da usare durante la digitazione\ncon laser viola",
|
||||||
|
"KEYBOARD_SOUND_ENABLED": "Suoni della tastiera",
|
||||||
|
"LEFT_HANDED_MOUSE": "Mouse per mancini",
|
||||||
|
"LEFT_HANDED_MOUSE_HELP": "Usalo se i pulsanti del mouse sono invertiti",
|
||||||
|
"LONG_PRESS_DURATION": "Durata pressione prolungata",
|
||||||
|
"LOOK_AND_FEEL": "Aspetto",
|
||||||
|
"MISC": "Varie",
|
||||||
|
"NOTIFICATIONS_ENABLED": "Abilita notifiche",
|
||||||
|
"NOTIFICATIONS_SOUND_ENABLED": "Suoni di notifica",
|
||||||
|
"OPAQUE_BACKGROUND": "Sfondo opaco",
|
||||||
|
"OPTION": {
|
||||||
|
"AUTO": "Automatico",
|
||||||
|
"AUTO_HELP": "Copia dello schermo tramite GPU se supportata,\naltrimenti tramite GPU PipeWire.",
|
||||||
|
"PIPEWIRE_HELP": "Acquisizione GPU veloce,\nstandard su tutti i desktop.",
|
||||||
|
"PW_FALLBACK_HELP": "Metodo lento con elevato utilizzo della CPU.\nProva in caso PipeWire GPU non funzioni",
|
||||||
|
"SCREENCOPY_GPU_HELP": "Veloce, senza popup di condivisione schermo.\nFunziona su: Hyprland, Niri, River, Sway",
|
||||||
|
"SCREENCOPY_HELP": "Lento, nessuna finestra pop-up per la condivisione dello schermo.\nFunziona su: Hyprland, Niri, River, Sway",
|
||||||
|
"NONE": "Nessuno",
|
||||||
|
"HMD_PINCH": "HMD + pizzico",
|
||||||
|
"EYE_PINCH": "Occhio + pizzico",
|
||||||
|
"EYE_ONLY": "Solo occhio",
|
||||||
|
"HMD_ONLY": "Solo HMD"
|
||||||
|
},
|
||||||
|
"POINTER_LERP_FACTOR": "Smussamento puntatore",
|
||||||
|
"RESTART_SOFTWARE": "Riavvia il software",
|
||||||
|
"RESTART_SOFTWARE_HELP": "Applica impostazioni che richiedono un riavvio",
|
||||||
|
"ROUND_MULTIPLIER": "Arrotondamento bordi UI",
|
||||||
|
"SCREEN_RENDER_DOWN": "Rendering dello schermo a risoluzione inferiore",
|
||||||
|
"SCREEN_RENDER_DOWN_HELP": "Aiuta a ridurre l'aliasing su schermi ad alta risoluzione",
|
||||||
|
"SCROLL_SPEED": "Velocità di scorrimento",
|
||||||
|
"SETS_ON_WATCH": "Set sul Watch",
|
||||||
|
"SPACE_DRAG_MULTIPLIER": "Moltiplicatore space-drag",
|
||||||
|
"SPACE_DRAG_UNLOCKED": "Consenti lo space-drag su tutti gli assi",
|
||||||
|
"SPACE_ROTATE_UNLOCKED": "Consenti la rotazione dello spazio su tutti gli assi",
|
||||||
|
"TROUBLESHOOTING": "Risoluzione dei problemi",
|
||||||
|
"UPRIGHT_SCREEN_FIX": "Correzione schermo verticale",
|
||||||
|
"UPRIGHT_SCREEN_FIX_HELP": "Corregge schermi verticali su alcuni desktop",
|
||||||
|
"USE_PASSTHROUGH": "Abilita passthrough",
|
||||||
|
"USE_PASSTHROUGH_HELP": "Consenti il passthrough se supportato dal runtime XR",
|
||||||
|
"USE_SKYBOX": "Abilita skybox",
|
||||||
|
"USE_SKYBOX_HELP": "Mostra uno skybox se non c'è un'app di scena o passthrough",
|
||||||
|
"XWAYLAND_BY_DEFAULT": "Esegui le app in modalità Compatibilità per impostazione predefinita",
|
||||||
|
"AUTOSTART_APPS": "App da avviare all'avvio",
|
||||||
|
"HANDSFREE_POINTER": "Modalità a mani libere",
|
||||||
|
"HANDSFREE_POINTER_HELP": "Input da usare quando i\ncontroller di movimento non sono disponibili.\nPizzico sinistro per afferrare, destro per cliccare.",
|
||||||
|
"UI_GRADIENT_INTENSITY": "Intensità gradiente dell'interfaccia utente",
|
||||||
|
"RESET_PLAYSPACE": "Ripristina playspace",
|
||||||
|
"RESET_PLAYSPACE_HELP": "Cancella l'offset dello spazio di gioco.",
|
||||||
|
"BLOCK_POSES_ON_KBD_INTERACTION": "Blocca le pose durante l'interazione con la tastiera",
|
||||||
|
"BLOCK_POSES_ON_KBD_INTERACTION_HELP": "Impedisce al gioco di ricevere pose quando la tastiera è evidenziata e 'Blocca input di gioco' è abilitato",
|
||||||
|
"LANGUAGE": "Lingua",
|
||||||
|
"REQUIRES_RESTART": "Richiede riavvio",
|
||||||
|
"GRID_OPACITY": "Opacità della griglia del pavimento",
|
||||||
|
"GRID_OPACITY_HELP": "Opacità della griglia del pavimento quando lo skybox è abilitato"
|
||||||
|
},
|
||||||
|
"APPLICATION_LAUNCHER": "Lanciatore applicazioni",
|
||||||
|
"APPLICATION_STARTED": "Applicazione avviata",
|
||||||
|
"APPLICATIONS": "Applicazioni",
|
||||||
|
"AUDIO": {
|
||||||
|
"AUTO_SWITCH_TO_VR_AUDIO": "Passa automaticamente all'audio VR",
|
||||||
|
"CARDS": "Schede",
|
||||||
|
"FAILED_TO_SWITCH_MICROPHONE": "Impossibile cambiare microfono",
|
||||||
|
"MICROPHONE_SET_SUCCESSFULLY": "Microfono impostato con successo",
|
||||||
|
"MICROPHONES": "Microfoni",
|
||||||
|
"NO_VR_MICROPHONE_SWITCH_MANUALLY": "Nessun microfono VR trovato. Attivalo manualmente.",
|
||||||
|
"NO_VR_SPEAKERS_FOUND_SWITCH_MANUALLY": "Nessun altoparlante VR trovato. Selezionali manualmente.",
|
||||||
|
"SELECT_AUDIO_CARD_PROFILE": "Seleziona profilo scheda audio",
|
||||||
|
"SETTINGS": "Impostazioni audio",
|
||||||
|
"SPEAKERS": "Altoparlanti",
|
||||||
|
"SPEAKERS_SET_SUCCESSFULLY": "Altoparlanti impostati correttamente",
|
||||||
|
"VOLUME": "Volume"
|
||||||
|
},
|
||||||
|
"CLOSE_WINDOW": "Chiudi finestra",
|
||||||
|
"DISPLAY_BRIGHTNESS": "Luminosità display",
|
||||||
|
"FAILED_TO_LAUNCH_APPLICATION": "Impossibile avviare l'applicazione:",
|
||||||
|
"GAME_LAUNCHED": "Gioco lanciato",
|
||||||
|
"GAME_LIST": {
|
||||||
|
"NO_GAMES_FOUND": "Nessun gioco trovato",
|
||||||
|
"RUNNING_GAMES_LIST": "Lista dei giochi in esecuzione"
|
||||||
|
},
|
||||||
|
"GAMES": "Giochi",
|
||||||
|
"GENERAL_SETTINGS": "Impostazioni generali",
|
||||||
|
"HEIGHT": "Altezza",
|
||||||
|
"HELLO": "Ciao!",
|
||||||
|
"HELLO_USER": "Ciao, {USER}!",
|
||||||
|
"HIDE": "Nascondi",
|
||||||
|
"HOME_SCREEN": "Home",
|
||||||
|
"MONADO_RUNTIME": "Runtime Monado",
|
||||||
|
"POPUP_ADD_DISPLAY": {
|
||||||
|
"RESOLUTION": "Risoluzione"
|
||||||
|
},
|
||||||
|
"REMOVE": "Rimuovi",
|
||||||
|
"SETTINGS": "Impostazioni",
|
||||||
|
"SHOW": "Mostra",
|
||||||
|
"TERMINATE_PROCESS": "Termina processo",
|
||||||
|
"WIDTH": "Larghezza",
|
||||||
|
"PROCESS_LIST": "Elenco processi",
|
||||||
|
"REFRESH": "Aggiorna",
|
||||||
|
"PROCESS": {
|
||||||
|
"STOP": "Interrompi",
|
||||||
|
"FORCE_KILL": "Uccidi forzatamente"
|
||||||
|
},
|
||||||
|
"DEBUG_INFO": "Informazioni di debug"
|
||||||
|
}
|
||||||
|
|
@ -1,153 +1,162 @@
|
||||||
{
|
{
|
||||||
"HOME_SCREEN": "ホーム",
|
"HOME_SCREEN": "ホーム",
|
||||||
"MONADO_RUNTIME": "「Monado」ランタイム",
|
"MONADO_RUNTIME": "「Monado」ランタイム",
|
||||||
"APPLICATIONS": "アプリ",
|
"APPLICATIONS": "アプリ",
|
||||||
"GAMES": "ゲーム",
|
"GAMES": "ゲーム",
|
||||||
"SETTINGS": "設定",
|
"SETTINGS": "設定",
|
||||||
"PROCESSES": "プロセス",
|
"HELLO_USER": "こんにちは、{USER}!",
|
||||||
"HELLO_USER": "こんにちは、{USER}!",
|
"GENERAL_SETTINGS": "全般設定",
|
||||||
"GENERAL_SETTINGS": "全般設定",
|
"APPLICATION_LAUNCHER": "アプリケーションランチャー",
|
||||||
"APPLICATION_LAUNCHER": "アプリケーションランチャー",
|
"APP_SETTINGS": {
|
||||||
"APP_SETTINGS": {
|
"HIDE_USERNAME": "ユーザー名を非表示",
|
||||||
"HIDE_USERNAME": "ユーザー名を非表示",
|
"OPAQUE_BACKGROUND": "不透明な背景",
|
||||||
"OPAQUE_BACKGROUND": "不透明な背景",
|
"LOOK_AND_FEEL": "外観",
|
||||||
"WLX": {},
|
"HIDE_GRAB_HELP": "グリップ動作中にのヘルプを非表示",
|
||||||
"LOOK_AND_FEEL": "外観",
|
"ANIMATION_SPEED": "UIアニメーション速度",
|
||||||
"HIDE_GRAB_HELP": "グリップ動作中にのヘルプを非表示",
|
"ROUND_MULTIPLIER": "UI の丸み",
|
||||||
"ANIMATION_SPEED": "UIアニメーション速度",
|
"USE_SKYBOX": "スカイボックスを有効",
|
||||||
"ROUND_MULTIPLIER": "UI の丸み",
|
"USE_PASSTHROUGH": "パススルーを有効",
|
||||||
"USE_SKYBOX": "スカイボックスを有効",
|
"CLOCK_12H": "12時間制",
|
||||||
"USE_PASSTHROUGH": "パススルーを有効",
|
"FEATURES": "機能",
|
||||||
"CLOCK_12H": "12時間制",
|
"NOTIFICATIONS_ENABLED": "通知を有効にする",
|
||||||
"FEATURES": "機能",
|
"NOTIFICATIONS_SOUND_ENABLED": "通知音",
|
||||||
"NOTIFICATIONS_ENABLED": "通知を有効にする",
|
"KEYBOARD_SOUND_ENABLED": "キーボード音",
|
||||||
"NOTIFICATIONS_SOUND_ENABLED": "通知音",
|
"SPACE_DRAG_MULTIPLIER": "スペースドラッグ倍率",
|
||||||
"KEYBOARD_SOUND_ENABLED": "キーボード音",
|
"SPACE_DRAG_UNLOCKED": "全軸のスペースドラッグ",
|
||||||
"SPACE_DRAG_MULTIPLIER": "スペースドラッグ倍率",
|
"SPACE_ROTATE_UNLOCKED": "全軸のスペース回転",
|
||||||
"SPACE_DRAG_UNLOCKED": "全軸のスペースドラッグ",
|
"BLOCK_GAME_INPUT": "ゲームの入力をブロック",
|
||||||
"SPACE_ROTATE_UNLOCKED": "全軸のスペース回転",
|
"BLOCK_GAME_INPUT_IGNORE_WATCH": "入力ブロック時に監視を無視",
|
||||||
"BLOCK_GAME_INPUT": "ゲームの入力をブロック",
|
"CONTROLS": "コントロール",
|
||||||
"BLOCK_GAME_INPUT_IGNORE_WATCH": "入力ブロック時に監視を無視",
|
"FOCUS_FOLLOWS_MOUSE_MODE": "トリガータッチでマウス移動",
|
||||||
"CONTROLS": "コントロール",
|
"LEFT_HANDED_MOUSE": "左利きマウス",
|
||||||
"FOCUS_FOLLOWS_MOUSE_MODE": "トリガータッチでマウス移動",
|
"ALLOW_SLIDING": "グリップ動作中にスティックを有効",
|
||||||
"LEFT_HANDED_MOUSE": "左利きマウス",
|
"INVERT_SCROLL_DIRECTION_X": "水平スクロール方向を反転",
|
||||||
"ALLOW_SLIDING": "グリップ動作中にスティックを有効",
|
"INVERT_SCROLL_DIRECTION_Y": "垂直スクロール方向を反転",
|
||||||
"INVERT_SCROLL_DIRECTION_X": "水平スクロール方向を反転",
|
"SCROLL_SPEED": "スクロール速度",
|
||||||
"INVERT_SCROLL_DIRECTION_Y": "垂直スクロール方向を反転",
|
"LONG_PRESS_DURATION": "長押し時間",
|
||||||
"SCROLL_SPEED": "スクロール速度",
|
"POINTER_LERP_FACTOR": "ポインターのスムージング",
|
||||||
"LONG_PRESS_DURATION": "長押し時間",
|
"CLICK_FREEZE_TIME_MS": "クリックで一時停止時間 (ms)",
|
||||||
"POINTER_LERP_FACTOR": "ポインターのスムージング",
|
"MISC": "その他",
|
||||||
"XR_CLICK_SENSITIVITY": "XRクリック感度",
|
"XWAYLAND_BY_DEFAULT": "アプリ実行のデフォルトは互換モード",
|
||||||
"XR_CLICK_SENSITIVITY_RELEASE": "XRリリース感度",
|
"UPRIGHT_SCREEN_FIX": "画面の縦向き修正",
|
||||||
"CLICK_FREEZE_TIME_MS": "クリックで一時停止時間 (ms)",
|
"DOUBLE_CURSOR_FIX": "ダブルカーソル修正",
|
||||||
"MISC": "その他",
|
"SCREEN_RENDER_DOWN": "画面の解像度を縮小",
|
||||||
"XWAYLAND_BY_DEFAULT": "アプリ実行のデフォルトは互換モード",
|
"UPRIGHT_SCREEN_FIX_HELP": "一部のデスクトップで縦向きの画面を修正",
|
||||||
"UPRIGHT_SCREEN_FIX": "画面の縦向き修正",
|
"DOUBLE_CURSOR_FIX_HELP": "2つのカーソルが表示される場合は、これを有効にします",
|
||||||
"DOUBLE_CURSOR_FIX": "ダブルカーソル修正",
|
"CLICK_FREEZE_TIME_MS_HELP": "ダブルクリックの精度向上に役立ちます",
|
||||||
"SCREEN_RENDER_DOWN": "画面の解像度を縮小",
|
"LEFT_HANDED_MOUSE_HELP": "マウスボタンが入れ替わっている場合に有効にします",
|
||||||
"UPRIGHT_SCREEN_FIX_HELP": "一部のデスクトップで縦向きの画面を修正",
|
"BLOCK_GAME_INPUT_HELP": "オーバーレイ上にマウスカーソルがあるときに入力をブロックします",
|
||||||
"DOUBLE_CURSOR_FIX_HELP": "2つのカーソルが表示される場合は、これを有効にします",
|
"BLOCK_GAME_INPUT_IGNORE_WATCH_HELP": "ウォッチがホバーされているときは入力をブロックしない",
|
||||||
"XR_CLICK_SENSITIVITY_HELP": "アナログトリガの感度",
|
"USE_SKYBOX_HELP": "シーンアプリまたはパススルーがない場合にスカイボックスを表示します",
|
||||||
"XR_CLICK_SENSITIVITY_RELEASE_HELP": "クリックより低くする必要があります",
|
"USE_PASSTHROUGH_HELP": "XRランタイムがサポートしていれば、パススルーを有効にします",
|
||||||
"CLICK_FREEZE_TIME_MS_HELP": "ダブルクリックの精度向上に役立ちます",
|
"SCREEN_RENDER_DOWN_HELP": "高解像度スクリーンでのエイリアシングを軽減します",
|
||||||
"LEFT_HANDED_MOUSE_HELP": "マウスボタンが入れ替わっている場合に有効にします",
|
"SETS_ON_WATCH": "ウォッチのセット",
|
||||||
"BLOCK_GAME_INPUT_HELP": "オーバーレイ上にマウスカーソルがあるときに入力をブロックします",
|
"TROUBLESHOOTING": "トラブルシューティング",
|
||||||
"BLOCK_GAME_INPUT_IGNORE_WATCH_HELP": "ウォッチがホバーされているときは入力をブロックしない",
|
"CLEAR_SAVED_STATE": "保存された状態をクリア",
|
||||||
"USE_SKYBOX_HELP": "シーンアプリまたはパススルーがない場合にスカイボックスを表示します",
|
"CLEAR_PIPEWIRE_TOKENS": "PipeWire トークンをクリア",
|
||||||
"USE_PASSTHROUGH_HELP": "XRランタイムがサポートしていれば、パススルーを有効にします",
|
"DELETE_ALL_CONFIGS": "設定を消去",
|
||||||
"SCREEN_RENDER_DOWN_HELP": "高解像度スクリーンでのエイリアシングを軽減します",
|
"RESTART_SOFTWARE": "ソフトウェアを再起動",
|
||||||
"SETS_ON_WATCH": "ウォッチのセット",
|
"CLEAR_SAVED_STATE_HELP": "セットとオーバーレイの位置をリセット",
|
||||||
"TROUBLESHOOTING": "トラブルシューティング",
|
"CLEAR_PIPEWIRE_TOKENS_HELP": "次の起動時に画面選択のプロンプトを表示",
|
||||||
"CLEAR_SAVED_STATE": "保存された状態をクリア",
|
"DELETE_ALL_CONFIGS_HELP": "conf.d 内のすべての設定ファイルを削除",
|
||||||
"CLEAR_PIPEWIRE_TOKENS": "PipeWire トークンをクリア",
|
"RESTART_SOFTWARE_HELP": "再起動が必要な設定を適用",
|
||||||
"DELETE_ALL_CONFIGS": "設定を消去",
|
"CAPTURE_METHOD": "Waylandスクリーンキャプチャ",
|
||||||
"RESTART_SOFTWARE": "ソフトウェアを再起動",
|
"CAPTURE_METHOD_HELP": "画面が黒くなる、または乱れる場合は、\nこの設定を変更してみてください。",
|
||||||
"CLEAR_SAVED_STATE_HELP": "セットとオーバーレイの位置をリセット",
|
"KEYBOARD_MIDDLE_CLICK": "キーボードの中ボタンクリック",
|
||||||
"CLEAR_PIPEWIRE_TOKENS_HELP": "次の起動時に画面選択のプロンプトを表示",
|
"KEYBOARD_MIDDLE_CLICK_HELP": "紫色のレーザーで入力する際の修飾キー",
|
||||||
"DELETE_ALL_CONFIGS_HELP": "conf.d 内のすべての設定ファイルを削除",
|
"OPTION": {
|
||||||
"RESTART_SOFTWARE_HELP": "再起動が必要な設定を適用",
|
"AUTO": "自動",
|
||||||
"CAPTURE_METHOD": "Waylandスクリーンキャプチャ",
|
"AUTO_HELP": "サポートされている場合はScreenCopy GPU、\nそうでない場合はPipeWire GPU。",
|
||||||
"CAPTURE_METHOD_HELP": "画面が黒くなる、または乱れる場合は、\nこの設定を変更してみてください。",
|
"PIPEWIRE_HELP": "GPU高速キャプチャ。\nすべてのデスクトップで標準です。",
|
||||||
"KEYBOARD_MIDDLE_CLICK": "キーボードの中ボタンクリック",
|
"PW_FALLBACK_HELP": "CPU使用量が多い低速な方法です。\nPipeWire GPUが動作しない場合に試してください。",
|
||||||
"KEYBOARD_MIDDLE_CLICK_HELP": "紫色のレーザーで入力する際の修飾キー",
|
"SCREENCOPY_GPU_HELP": "高速で、スクリーン共有ポップアップはありません。\n動作する環境: Hyprland, Niri, River, Sway",
|
||||||
"OPTION": {
|
"SCREENCOPY_HELP": "遅延あり、画面共有ポップアップなし。\n動作する環境: Hyprland, Niri, River, Sway",
|
||||||
"AUTO": "自動",
|
"NONE": "なし",
|
||||||
"AUTO_HELP": "サポートされている場合はScreenCopy GPU、\nそうでない場合はPipeWire GPU。",
|
"HMD_PINCH": "HMD + ピンチ",
|
||||||
"PIPEWIRE_HELP": "GPU高速キャプチャ。\nすべてのデスクトップで標準です。",
|
"EYE_PINCH": "つまんで目を合わせる",
|
||||||
"PW_FALLBACK_HELP": "CPU使用量が多い低速な方法です。\nPipeWire GPUが動作しない場合に試してください。",
|
"EYE_ONLY": "視野のみ",
|
||||||
"SCREENCOPY_GPU_HELP": "高速で、スクリーン共有ポップアップはありません。\n動作する環境: Hyprland, Niri, River, Sway",
|
"HMD_ONLY": "HMDのみ"
|
||||||
"SCREENCOPY_HELP": "遅延あり、画面共有ポップアップなし。\n動作する環境: Hyprland, Niri, River, Sway"
|
},
|
||||||
},
|
"AUTOSTART_APPS": "起動時に実行するアプリ",
|
||||||
"AUTOSTART_APPS": "起動時に実行するアプリ"
|
"HANDSFREE_POINTER": "ハンズフリーモード",
|
||||||
},
|
"HANDSFREE_POINTER_HELP": "モーションコントローラーが利用できない場合の入力方法。\n左手のピンチは掴み、右手のピンチはクリックです。",
|
||||||
"HELLO": "こんにちは!",
|
"UI_GRADIENT_INTENSITY": "UIグラデーションの強さ",
|
||||||
"AUDIO": {
|
"RESET_PLAYSPACE": "プレイエリアをリセット",
|
||||||
"VOLUME": "音量",
|
"RESET_PLAYSPACE_HELP": "プレイエリアのオフセットをクリアします。",
|
||||||
"SETTINGS": "オーディオ設定",
|
"BLOCK_POSES_ON_KBD_INTERACTION": "キーボード操作時のポーズをブロック",
|
||||||
"AUTO_SWITCH_TO_VR_AUDIO": "VRオーディオに自動切り替え",
|
"BLOCK_POSES_ON_KBD_INTERACTION_HELP": "キーボードがホバーされ、「ゲーム入力をブロック」が有効になっている場合、ゲームがポーズを受信することをブロックします",
|
||||||
"SPEAKERS": "スピーカー",
|
"LANGUAGE": "言語",
|
||||||
"MICROPHONES": "マイク",
|
"REQUIRES_RESTART": "再起動が必要です",
|
||||||
"CARDS": "カード",
|
"GRID_OPACITY": "フロアグリッドの不透明度",
|
||||||
"SELECT_AUDIO_CARD_PROFILE": "オーディオカードプロファイルを選択",
|
"GRID_OPACITY_HELP": "スカイボックスが有効なときの床グリッドの不透明度"
|
||||||
"NO_VR_SPEAKERS_FOUND_SWITCH_MANUALLY": "VRスピーカーが見つかりませんでした。手動で切り替えてください。",
|
},
|
||||||
"NO_VR_MICROPHONE_SWITCH_MANUALLY": "VRマイクが見つかりませんでした。手動で切り替えてください。",
|
"HELLO": "こんにちは!",
|
||||||
"FAILED_TO_SWITCH_MICROPHONE": "マイクの切り替えに失敗しました",
|
"AUDIO": {
|
||||||
"MICROPHONE_SET_SUCCESSFULLY": "マイクの設定が完了しました",
|
"VOLUME": "音量",
|
||||||
"SPEAKERS_SET_SUCCESSFULLY": "スピーカーを設定しました"
|
"SETTINGS": "オーディオ設定",
|
||||||
},
|
"AUTO_SWITCH_TO_VR_AUDIO": "VRオーディオに自動切り替え",
|
||||||
"ACTIONS": {
|
"SPEAKERS": "スピーカー",
|
||||||
"RECENTER_PLAYSPACE": "プレイスペースを再中央"
|
"MICROPHONES": "マイク",
|
||||||
},
|
"CARDS": "カード",
|
||||||
"LIST_OF_PROCESSES": "プロセスのリスト",
|
"SELECT_AUDIO_CARD_PROFILE": "オーディオカードプロファイルを選択",
|
||||||
"POPUP_ADD_DISPLAY": {
|
"NO_VR_SPEAKERS_FOUND_SWITCH_MANUALLY": "VRスピーカーが見つかりませんでした。手動で切り替えてください。",
|
||||||
"RESOLUTION": "解像度"
|
"NO_VR_MICROPHONE_SWITCH_MANUALLY": "VRマイクが見つかりませんでした。手動で切り替えてください。",
|
||||||
},
|
"FAILED_TO_SWITCH_MICROPHONE": "マイクの切り替えに失敗しました",
|
||||||
"WIDTH": "幅",
|
"MICROPHONE_SET_SUCCESSFULLY": "マイクの設定が完了しました",
|
||||||
"HEIGHT": "高さ",
|
"SPEAKERS_SET_SUCCESSFULLY": "スピーカーを設定しました"
|
||||||
"HIDE": "隠す",
|
},
|
||||||
"REMOVE": "削除",
|
"ACTIONS": {
|
||||||
"SHOW": "表示",
|
"RECENTER_PLAYSPACE": "プレイスペースを再中央"
|
||||||
"PROCESS_LIST": {
|
},
|
||||||
"NO_PROCESSES_FOUND": "プロセスが見つかりませんでした",
|
"POPUP_ADD_DISPLAY": {
|
||||||
"LOCATED_ON": "に",
|
"RESOLUTION": "解像度"
|
||||||
"TERMINATE_PROCESS_NAMED_X": "プロセス \"{PROCESS_NAME}\" を終了します"
|
},
|
||||||
},
|
"WIDTH": "幅",
|
||||||
"FAILED_TO_LAUNCH_APPLICATION": "アプリケーションの起動に失敗しました:",
|
"HEIGHT": "高さ",
|
||||||
"NO_WINDOWS_FOUND": "ウィンドウが見つかりませんでした",
|
"HIDE": "隠す",
|
||||||
"WINDOW_OPTIONS": "ウィンドウオプション",
|
"REMOVE": "削除",
|
||||||
"APPLICATION_STARTED": "アプリケーションが起動しました",
|
"SHOW": "表示",
|
||||||
"LIST_OF_WINDOWS": "ウィンドウ一覧",
|
"FAILED_TO_LAUNCH_APPLICATION": "アプリケーションの起動に失敗しました:",
|
||||||
"CLOSE_WINDOW": "ウィンドウを閉じる",
|
"APPLICATION_STARTED": "アプリケーションが起動しました",
|
||||||
"GAME_LIST": {
|
"CLOSE_WINDOW": "ウィンドウを閉じる",
|
||||||
"NO_GAMES_FOUND": "ゲームが見つかりませんでした"
|
"GAME_LIST": {
|
||||||
},
|
"NO_GAMES_FOUND": "ゲームが見つかりませんでした",
|
||||||
"TERMINATE_PROCESS": "プロセスを終了する",
|
"RUNNING_GAMES_LIST": "実行中のゲーム一覧"
|
||||||
"GAME_LAUNCHED": "ゲームが起動しました",
|
},
|
||||||
"APP_LAUNCHER": {
|
"TERMINATE_PROCESS": "プロセスを終了する",
|
||||||
"MODE": {
|
"GAME_LAUNCHED": "ゲームが起動しました",
|
||||||
"NATIVE": "ネイティブモード",
|
"APP_LAUNCHER": {
|
||||||
"CAGE": "互換モード(Cage)"
|
"MODE": {
|
||||||
},
|
"NATIVE": "ネイティブモード",
|
||||||
"RES_TITLE": "解像度",
|
"CAGE": "互換モード(Cage)"
|
||||||
"ASPECT_TITLE": "アスペクト",
|
},
|
||||||
"ASPECT": {
|
"RES_TITLE": "解像度",
|
||||||
"WIDE": "ワイド",
|
"ASPECT_TITLE": "アスペクト",
|
||||||
"SEMI_WIDE": "半広角",
|
"ASPECT": {
|
||||||
"SQUARE": "正方形",
|
"WIDE": "ワイド",
|
||||||
"SEMI_TALL": "半縦長",
|
"SEMI_WIDE": "半広角",
|
||||||
"TALL": "縦長"
|
"SQUARE": "正方形",
|
||||||
},
|
"SEMI_TALL": "半縦長",
|
||||||
"POS_TITLE": "配置",
|
"TALL": "縦長"
|
||||||
"POS": {
|
},
|
||||||
"FLOATING": "フローティング",
|
"POS_TITLE": "配置",
|
||||||
"ANCHORED": "固定",
|
"POS": {
|
||||||
"STATIC": "固定",
|
"FLOATING": "フローティング",
|
||||||
"FLOATING_HELP": "独立して移動し、表示時に中央に再配置されます。",
|
"ANCHORED": "固定",
|
||||||
"ANCHORED_HELP": "中央マーカーに対して固定された位置に留まります。",
|
"STATIC": "固定",
|
||||||
"STATIC_HELP": "どのセットにも属していません。リセンターされません。"
|
"FLOATING_HELP": "独立して移動し、表示時に中央に再配置されます。",
|
||||||
},
|
"ANCHORED_HELP": "中央マーカーに対して固定された位置に留まります。",
|
||||||
"AUTOSTART": "起動時に自動実行",
|
"STATIC_HELP": "どのセットにも属していません。リセンターされません。"
|
||||||
"LAUNCH": "起動"
|
},
|
||||||
},
|
"AUTOSTART": "起動時に自動実行",
|
||||||
"DISPLAY_BRIGHTNESS": "ディスプレイの明るさ"
|
"LAUNCH": "起動"
|
||||||
}
|
},
|
||||||
|
"DISPLAY_BRIGHTNESS": "ディスプレイの明るさ",
|
||||||
|
"PROCESS_LIST": "プロセスリスト",
|
||||||
|
"REFRESH": "更新",
|
||||||
|
"PROCESS": {
|
||||||
|
"STOP": "停止",
|
||||||
|
"FORCE_KILL": "強制終了"
|
||||||
|
},
|
||||||
|
"DEBUG_INFO": "デバッグ情報"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,153 +1,163 @@
|
||||||
{
|
{
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"RECENTER_PLAYSPACE": "Wycentruj przestrzeń"
|
"RECENTER_PLAYSPACE": "Wycentruj przestrzeń"
|
||||||
},
|
},
|
||||||
"APP_SETTINGS": {
|
"APP_SETTINGS": {
|
||||||
"HIDE_USERNAME": "Ukryj nazwę użytkownika",
|
"HIDE_USERNAME": "Ukryj nazwę użytkownika",
|
||||||
"OPAQUE_BACKGROUND": "Nieprzezroczyste tło",
|
"OPAQUE_BACKGROUND": "Nieprzezroczyste tło",
|
||||||
"WLX": {},
|
"LOOK_AND_FEEL": "Wygląd i działanie",
|
||||||
"LOOK_AND_FEEL": "Wygląd i działanie",
|
"HIDE_GRAB_HELP": "Ukryj pomoc dotyczącą chwytania",
|
||||||
"HIDE_GRAB_HELP": "Ukryj pomoc dotyczącą chwytania",
|
"ANIMATION_SPEED": "Prędkość animacji UI",
|
||||||
"ANIMATION_SPEED": "Prędkość animacji UI",
|
"ROUND_MULTIPLIER": "Zaokrąglenie krawędzi UI",
|
||||||
"ROUND_MULTIPLIER": "Zaokrąglenie krawędzi UI",
|
"USE_SKYBOX": "Włącz niebo",
|
||||||
"USE_SKYBOX": "Włącz niebo",
|
"USE_PASSTHROUGH": "Włącz passthrough",
|
||||||
"USE_PASSTHROUGH": "Włącz passthrough",
|
"CLOCK_12H": "Zegar 12-godzinny",
|
||||||
"CLOCK_12H": "Zegar 12-godzinny",
|
"FEATURES": "Funkcje",
|
||||||
"FEATURES": "Funkcje",
|
"NOTIFICATIONS_ENABLED": "Włącz powiadomienia",
|
||||||
"NOTIFICATIONS_ENABLED": "Włącz powiadomienia",
|
"NOTIFICATIONS_SOUND_ENABLED": "Dźwięki powiadomień",
|
||||||
"NOTIFICATIONS_SOUND_ENABLED": "Dźwięki powiadomień",
|
"KEYBOARD_SOUND_ENABLED": "Dźwięki klawiatury",
|
||||||
"KEYBOARD_SOUND_ENABLED": "Dźwięki klawiatury",
|
"SPACE_DRAG_MULTIPLIER": "Mnożnik przesuwania przestrzeni",
|
||||||
"SPACE_DRAG_MULTIPLIER": "Mnożnik przesuwania przestrzeni",
|
"SPACE_DRAG_UNLOCKED": "Pozwól na przesuwanie przestrzeni na wszystkich osiach",
|
||||||
"SPACE_DRAG_UNLOCKED": "Pozwól na przesuwanie przestrzeni na wszystkich osiach",
|
"SPACE_ROTATE_UNLOCKED": "Pozwól na rotację przestrzeni na wszystkich osiach",
|
||||||
"SPACE_ROTATE_UNLOCKED": "Pozwól na rotację przestrzeni na wszystkich osiach",
|
"BLOCK_GAME_INPUT": "Blokuj input z gry",
|
||||||
"BLOCK_GAME_INPUT": "Blokuj input z gry",
|
"BLOCK_GAME_INPUT_IGNORE_WATCH": "Nie blokuj inputu gry, gdy zegarek jest używany",
|
||||||
"BLOCK_GAME_INPUT_IGNORE_WATCH": "Nie blokuj inputu gry, gdy zegarek jest używany",
|
"CONTROLS": "Sterowanie",
|
||||||
"CONTROLS": "Sterowanie",
|
"FOCUS_FOLLOWS_MOUSE_MODE": "Ruch myszą po dotknięciu spustu",
|
||||||
"FOCUS_FOLLOWS_MOUSE_MODE": "Ruch myszą po dotknięciu spustu",
|
"LEFT_HANDED_MOUSE": "Myszka dla leworęcznych",
|
||||||
"LEFT_HANDED_MOUSE": "Myszka dla leworęcznych",
|
"ALLOW_SLIDING": "Interakcja z drążkami podczas chwytania",
|
||||||
"ALLOW_SLIDING": "Interakcja z drążkami podczas chwytania",
|
"INVERT_SCROLL_DIRECTION_X": "Odwróć kierunek przewijania w poziomie",
|
||||||
"INVERT_SCROLL_DIRECTION_X": "Odwróć kierunek przewijania w poziomie",
|
"INVERT_SCROLL_DIRECTION_Y": "Odwróć kierunek przewijania w pionie",
|
||||||
"INVERT_SCROLL_DIRECTION_Y": "Odwróć kierunek przewijania w pionie",
|
"SCROLL_SPEED": "Prędkość przewijania",
|
||||||
"SCROLL_SPEED": "Prędkość przewijania",
|
"LONG_PRESS_DURATION": "Czas długiego przytrzymania",
|
||||||
"LONG_PRESS_DURATION": "Czas długiego przytrzymania",
|
"POINTER_LERP_FACTOR": "Wygładzanie wskaźnika",
|
||||||
"POINTER_LERP_FACTOR": "Wygładzanie wskaźnika",
|
"CLICK_FREEZE_TIME_MS": "Czas zamrożenia po kliknięciu (ms)",
|
||||||
"XR_CLICK_SENSITIVITY": "Czułość kliknięć XR",
|
"XWAYLAND_BY_DEFAULT": "Uruchamiaj aplikacje domyślnie w trybie kompatybilności",
|
||||||
"XR_CLICK_SENSITIVITY_RELEASE": "Czułość zwalniania XR",
|
"UPRIGHT_SCREEN_FIX": "Naprawa pozycji ekranu",
|
||||||
"CLICK_FREEZE_TIME_MS": "Czas zamrożenia po kliknięciu (ms)",
|
"DOUBLE_CURSOR_FIX": "Naprawa podwójnego kursora",
|
||||||
"MISC": "Różne",
|
"SCREEN_RENDER_DOWN": "Renderuj ekran w niższej rozdzielczości",
|
||||||
"XWAYLAND_BY_DEFAULT": "Uruchamiaj aplikacje domyślnie w trybie kompatybilności",
|
"UPRIGHT_SCREEN_FIX_HELP": "Naprawia pionowe ekrany na niektórych komputerach",
|
||||||
"UPRIGHT_SCREEN_FIX": "Naprawa pozycji ekranu",
|
"DOUBLE_CURSOR_FIX_HELP": "Włącz to, jeśli widzisz 2 kursory",
|
||||||
"DOUBLE_CURSOR_FIX": "Naprawa podwójnego kursora",
|
"CLICK_FREEZE_TIME_MS_HELP": "Pomaga w precyzji podwójnego kliknięcia",
|
||||||
"SCREEN_RENDER_DOWN": "Renderuj ekran w niższej rozdzielczości",
|
"LEFT_HANDED_MOUSE_HELP": "Użyj tego, jeśli przyciski myszy są zamienione",
|
||||||
"UPRIGHT_SCREEN_FIX_HELP": "Naprawia pionowe ekrany na niektórych komputerach",
|
"BLOCK_GAME_INPUT_HELP": "Blokuje wszystkie dane wejściowe, gdy kursor najedzie na nakładkę",
|
||||||
"DOUBLE_CURSOR_FIX_HELP": "Włącz to, jeśli widzisz 2 kursory",
|
"BLOCK_GAME_INPUT_IGNORE_WATCH_HELP": "Nie blokuj inputu, gdy wskaźnik jest najedzony",
|
||||||
"XR_CLICK_SENSITIVITY_HELP": "Czułość analogowego spustu",
|
"USE_SKYBOX_HELP": "Wyświetlaj niebo, jeśli nie ma aplikacji sceny lub passthrough",
|
||||||
"XR_CLICK_SENSITIVITY_RELEASE_HELP": "Musi być niższa niż kliknięcie",
|
"USE_PASSTHROUGH_HELP": "Pozwól na passthrough, jeśli runtime XR to obsługuje",
|
||||||
"CLICK_FREEZE_TIME_MS_HELP": "Pomaga w precyzji podwójnego kliknięcia",
|
"SCREEN_RENDER_DOWN_HELP": "Pomaga redukować aliasing na ekranach o wysokiej rozdzielczości",
|
||||||
"LEFT_HANDED_MOUSE_HELP": "Użyj tego, jeśli przyciski myszy są zamienione",
|
"ENABLE_WATCH": "Włącz zegarek",
|
||||||
"BLOCK_GAME_INPUT_HELP": "Blokuje wszystkie dane wejściowe, gdy kursor najedzie na nakładkę",
|
"SETS_ON_WATCH": "Lista zestawów na zegarku",
|
||||||
"BLOCK_GAME_INPUT_IGNORE_WATCH_HELP": "Nie blokuj inputu, gdy wskaźnik jest najedzony",
|
"TROUBLESHOOTING": "Rozwiązywanie problemów",
|
||||||
"USE_SKYBOX_HELP": "Wyświetlaj niebo, jeśli nie ma aplikacji sceny lub passthrough",
|
"CLEAR_SAVED_STATE": "Wyczyść zapisany stan",
|
||||||
"USE_PASSTHROUGH_HELP": "Pozwól na passthrough, jeśli runtime XR to obsługuje",
|
"CLEAR_PIPEWIRE_TOKENS": "Wyczyść tokeny PipeWire",
|
||||||
"SCREEN_RENDER_DOWN_HELP": "Pomaga redukować aliasing na ekranach o wysokiej rozdzielczości",
|
"DELETE_ALL_CONFIGS": "Wyczyść konfigurację",
|
||||||
"SETS_ON_WATCH": "Lista zestawów na zegarku",
|
"RESTART_SOFTWARE": "Restartuj WayVR",
|
||||||
"TROUBLESHOOTING": "Rozwiązywanie problemów",
|
"CLEAR_SAVED_STATE_HELP": "Zresetuj zestawy i pozycje nakładek",
|
||||||
"CLEAR_SAVED_STATE": "Wyczyść zapisany stan",
|
"CLEAR_PIPEWIRE_TOKENS_HELP": "Zapytaj o wybór ekranu przy następnym uruchomieniu",
|
||||||
"CLEAR_PIPEWIRE_TOKENS": "Wyczyść tokeny PipeWire",
|
"DELETE_ALL_CONFIGS_HELP": "Usuń wszystkie pliki konfiguracyjne z katalogu conf.d",
|
||||||
"DELETE_ALL_CONFIGS": "Wyczyść konfigurację",
|
"RESTART_SOFTWARE_HELP": "Zastosuj ustawienia wymagające ponownego uruchomienia",
|
||||||
"RESTART_SOFTWARE": "Uruchom ponownie oprogramowanie",
|
"CAPTURE_METHOD": "Przechwytywanie ekranu Wayland",
|
||||||
"CLEAR_SAVED_STATE_HELP": "Zresetuj zestawy i pozycje nakładek",
|
"CAPTURE_METHOD_HELP": "Spróbuj zmienić tę opcję, jeśli masz\nproblemy z czarnym lub migoczącym ekranem",
|
||||||
"CLEAR_PIPEWIRE_TOKENS_HELP": "Zapytaj o wybór ekranu przy następnym uruchomieniu",
|
"KEYBOARD_MIDDLE_CLICK": "Środkowy przycisk myszy na klawiaturze",
|
||||||
"DELETE_ALL_CONFIGS_HELP": "Usuń wszystkie pliki konfiguracyjne z katalogu conf.d",
|
"KEYBOARD_MIDDLE_CLICK_HELP": "Modyfikator, który ma zostać użyty podczas pisania\nfioletową wiązką lasera",
|
||||||
"RESTART_SOFTWARE_HELP": "Zastosuj ustawienia wymagające ponownego uruchomienia",
|
"OPTION": {
|
||||||
"CAPTURE_METHOD": "Przechwytywanie ekranu Wayland",
|
"AUTO": "Automatycznie",
|
||||||
"CAPTURE_METHOD_HELP": "Spróbuj zmienić tę opcję, jeśli masz\nproblemy z czarnym lub migoczącym ekranem",
|
"AUTO_HELP": "Skopiuj ekran za pomocą GPU, jeśli obsługiwane,\nw przeciwnym razie GPU PipeWire.",
|
||||||
"KEYBOARD_MIDDLE_CLICK": "Środkowy przycisk myszy na klawiaturze",
|
"PIPEWIRE_HELP": "Szybkie przechwytywanie GPU,\nstandard na wszystkich komputerach.",
|
||||||
"KEYBOARD_MIDDLE_CLICK_HELP": "Modyfikator, który ma zostać użyty podczas pisania\nfioletową wiązką lasera",
|
"PW_FALLBACK_HELP": "Powolna metoda z wysokim użyciem procesora.\nWypróbuj w przypadku, gdy PipeWire GPU nie działa",
|
||||||
"OPTION": {
|
"SCREENCOPY_GPU_HELP": "Szybkie działanie, brak wyskakujących okien z informacją o udostępnianiu ekranu.\nDziała na: Hyprland, Niri, River, Sway",
|
||||||
"AUTO": "Automatycznie",
|
"SCREENCOPY_HELP": "Wolne, bez wyskakujących okienek udostępniania ekranu.\nDziała na: Hyprland, Niri, River, Sway",
|
||||||
"AUTO_HELP": "Skopiuj ekran za pomocą GPU, jeśli obsługiwane,\nw przeciwnym razie GPU PipeWire.",
|
"NONE": "Brak",
|
||||||
"PIPEWIRE_HELP": "Szybkie przechwytywanie GPU,\nstandard na wszystkich komputerach.",
|
"HMD_PINCH": "HMD + ściśnięcie placami",
|
||||||
"PW_FALLBACK_HELP": "Powolna metoda z wysokim użyciem procesora.\nWypróbuj w przypadku, gdy PipeWire GPU nie działa",
|
"EYE_PINCH": "Ściśnięcie palcami + oko",
|
||||||
"SCREENCOPY_GPU_HELP": "Szybkie działanie, brak wyskakujących okien z informacją o udostępnianiu ekranu.\nDziała na: Hyprland, Niri, River, Sway",
|
"EYE_ONLY": "Tylko oko",
|
||||||
"SCREENCOPY_HELP": "Wolne, bez wyskakujących okienek udostępniania ekranu.\nDziała na: Hyprland, Niri, River, Sway"
|
"HMD_ONLY": "Tylko HMD"
|
||||||
},
|
},
|
||||||
"AUTOSTART_APPS": "Aplikacje do uruchomienia przy starcie"
|
"AUTOSTART_APPS": "Aplikacje auto-start",
|
||||||
},
|
"HANDSFREE_POINTER": "Tryb bez użycia rąk",
|
||||||
"APPLICATION_LAUNCHER": "Uruchamiacz aplikacji",
|
"HANDSFREE_POINTER_HELP": "Wejście do użycia, gdy kontrolery ruchu\nsą niedostępne. Lewy szczyptak to chwyt,\nprawy to kliknięcie.",
|
||||||
"APPLICATIONS": "Aplikacje",
|
"UI_GRADIENT_INTENSITY": "Intensywność gradientu UI",
|
||||||
"AUDIO": {
|
"RESET_PLAYSPACE": "Zresetuj przestrzeń gry",
|
||||||
"AUTO_SWITCH_TO_VR_AUDIO": "Automatyczne przełączanie na dźwięk VR",
|
"RESET_PLAYSPACE_HELP": "Wyczyść przesunięcie przestrzeni gry.",
|
||||||
"CARDS": "Karty",
|
"BLOCK_POSES_ON_KBD_INTERACTION": "Blokuj pozy podczas interakcji z klawiaturą",
|
||||||
"FAILED_TO_SWITCH_MICROPHONE": "Nie udało się przełączyć mikrofon",
|
"BLOCK_POSES_ON_KBD_INTERACTION_HELP": "Blokuje odbieranie póz przez grę, gdy kursor myszy znajduje się nad klawiaturą i włączona jest opcja 'Blokuj dane wejściowe z gry'",
|
||||||
"MICROPHONE_SET_SUCCESSFULLY": "Mikrofon ustawiono pomyślnie",
|
"LANGUAGE": "Język",
|
||||||
"MICROPHONES": "Mikrofony",
|
"REQUIRES_RESTART": "Wymaga restartu",
|
||||||
"NO_VR_MICROPHONE_SWITCH_MANUALLY": "Brak mikrofonu VR. Włącz go ręcznie.",
|
"MISC": "Różne",
|
||||||
"NO_VR_SPEAKERS_FOUND_SWITCH_MANUALLY": "Brak głośników VR. Włącz je ręcznie.",
|
"GRID_OPACITY": "Przezroczystość siatki podłogowej",
|
||||||
"SELECT_AUDIO_CARD_PROFILE": "Wybierz profil karty dźwiękowej",
|
"GRID_OPACITY_HELP": "Przezroczystość siatki podłogowej, gdy włączony jest skybox"
|
||||||
"SETTINGS": "Ustawienia dźwięku",
|
},
|
||||||
"SPEAKERS": "Głośniki",
|
"APPLICATION_LAUNCHER": "Uruchamiacz aplikacji",
|
||||||
"SPEAKERS_SET_SUCCESSFULLY": "Głośniki ustawiono pomyślnie",
|
"APPLICATIONS": "Aplikacje",
|
||||||
"VOLUME": "Głośność"
|
"AUDIO": {
|
||||||
},
|
"AUTO_SWITCH_TO_VR_AUDIO": "Automatyczne przełączanie na dźwięk VR",
|
||||||
"GAMES": "Gry",
|
"CARDS": "Karty",
|
||||||
"GENERAL_SETTINGS": "Ustawienia ogólne",
|
"FAILED_TO_SWITCH_MICROPHONE": "Nie udało się przełączyć mikrofon",
|
||||||
"HEIGHT": "Wysokość",
|
"MICROPHONE_SET_SUCCESSFULLY": "Mikrofon ustawiono pomyślnie",
|
||||||
"HELLO": "Witaj!",
|
"MICROPHONES": "Mikrofony",
|
||||||
"HELLO_USER": "Witaj, {USER}!",
|
"NO_VR_MICROPHONE_SWITCH_MANUALLY": "Brak mikrofonu VR. Włącz go ręcznie.",
|
||||||
"HIDE": "Ukryj",
|
"NO_VR_SPEAKERS_FOUND_SWITCH_MANUALLY": "Brak głośników VR. Włącz je ręcznie.",
|
||||||
"HOME_SCREEN": "Ekran główny",
|
"SELECT_AUDIO_CARD_PROFILE": "Wybierz profil karty dźwiękowej",
|
||||||
"LIST_OF_PROCESSES": "Lista procesów",
|
"SETTINGS": "Ustawienia dźwięku",
|
||||||
"MONADO_RUNTIME": "Środowisko Monado",
|
"SPEAKERS": "Głośniki",
|
||||||
"POPUP_ADD_DISPLAY": {
|
"SPEAKERS_SET_SUCCESSFULLY": "Głośniki ustawiono pomyślnie",
|
||||||
"RESOLUTION": "Rozdzielczość"
|
"VOLUME": "Głośność"
|
||||||
},
|
},
|
||||||
"REMOVE": "Usuń",
|
"GAMES": "Gry",
|
||||||
"SETTINGS": "Ustawienia",
|
"GENERAL_SETTINGS": "Ustawienia ogólne",
|
||||||
"SHOW": "Pokaż",
|
"HEIGHT": "Wysokość",
|
||||||
"WIDTH": "Szerokość",
|
"HELLO": "Witaj!",
|
||||||
"PROCESSES": "Procesy",
|
"HELLO_USER": "Witaj, {USER}!",
|
||||||
"PROCESS_LIST": {
|
"HIDE": "Ukryj",
|
||||||
"NO_PROCESSES_FOUND": "Nie znaleziono procesów",
|
"HOME_SCREEN": "Ekran główny",
|
||||||
"LOCATED_ON": "na",
|
"MONADO_RUNTIME": "Środowisko Monado",
|
||||||
"TERMINATE_PROCESS_NAMED_X": "Zakończ proces \"{PROCESS_NAME}\""
|
"POPUP_ADD_DISPLAY": {
|
||||||
},
|
"RESOLUTION": "Rozdzielczość"
|
||||||
"FAILED_TO_LAUNCH_APPLICATION": "Nie udało się uruchomić aplikacji:",
|
},
|
||||||
"NO_WINDOWS_FOUND": "Nie znaleziono okien",
|
"REMOVE": "Usuń",
|
||||||
"WINDOW_OPTIONS": "Opcje okna",
|
"SETTINGS": "Ustawienia",
|
||||||
"APPLICATION_STARTED": "Aplikacja uruchomiona",
|
"SHOW": "Pokaż",
|
||||||
"LIST_OF_WINDOWS": "Lista okien",
|
"WIDTH": "Szerokość",
|
||||||
"CLOSE_WINDOW": "Zamknij okno",
|
"FAILED_TO_LAUNCH_APPLICATION": "Nie udało się uruchomić aplikacji:",
|
||||||
"GAME_LIST": {
|
"APPLICATION_STARTED": "Aplikacja uruchomiona",
|
||||||
"NO_GAMES_FOUND": "Nie znaleziono gier"
|
"CLOSE_WINDOW": "Zamknij okno",
|
||||||
},
|
"GAME_LIST": {
|
||||||
"TERMINATE_PROCESS": "Zakończ proces",
|
"NO_GAMES_FOUND": "Nie znaleziono gier",
|
||||||
"GAME_LAUNCHED": "Gra uruchomiona",
|
"RUNNING_GAMES_LIST": "Lista uruchomionych gier"
|
||||||
"APP_LAUNCHER": {
|
},
|
||||||
"MODE": {
|
"TERMINATE_PROCESS": "Zakończ proces",
|
||||||
"NATIVE": "Tryb natywny",
|
"GAME_LAUNCHED": "Gra uruchomiona",
|
||||||
"CAGE": "Tryb kompatybilności (Cage)"
|
"APP_LAUNCHER": {
|
||||||
},
|
"MODE": {
|
||||||
"RES_TITLE": "Rozdzielczość",
|
"NATIVE": "Tryb natywny",
|
||||||
"ASPECT_TITLE": "Proporcje",
|
"CAGE": "Tryb kompatybilności (Cage)"
|
||||||
"ASPECT": {
|
},
|
||||||
"WIDE": "Szeroki",
|
"RES_TITLE": "Rozdzielczość",
|
||||||
"SEMI_WIDE": "Półszeroki",
|
"ASPECT_TITLE": "Proporcje",
|
||||||
"SQUARE": "Kwadrat",
|
"ASPECT": {
|
||||||
"SEMI_TALL": "Pół-wysoki",
|
"WIDE": "Szeroki",
|
||||||
"TALL": "Wysoki"
|
"SEMI_WIDE": "Półszeroki",
|
||||||
},
|
"SQUARE": "Kwadrat",
|
||||||
"POS_TITLE": "Pozycjonowanie",
|
"SEMI_TALL": "Pół-wysoki",
|
||||||
"POS": {
|
"TALL": "Wysoki"
|
||||||
"FLOATING": "Pływający",
|
},
|
||||||
"ANCHORED": "Przymocowane",
|
"POS_TITLE": "Pozycjonowanie",
|
||||||
"STATIC": "Statyczny",
|
"POS": {
|
||||||
"FLOATING_HELP": "Porusza się niezależnie, wycentrowuje się po otwarciu.",
|
"FLOATING": "Pływający",
|
||||||
"ANCHORED_HELP": "Pozostaje nieruchoma względem centralnego znacznika.",
|
"ANCHORED": "Przymocowane",
|
||||||
"STATIC_HELP": "Nie należy do żadnego zestawu. Nie wyśrodkowuje."
|
"STATIC": "Statyczny",
|
||||||
},
|
"FLOATING_HELP": "Porusza się niezależnie, wycentrowuje się po otwarciu.",
|
||||||
"AUTOSTART": "Uruchom automatycznie przy starcie",
|
"ANCHORED_HELP": "Pozostaje nieruchoma względem centralnego znacznika.",
|
||||||
"LAUNCH": "Uruchom"
|
"STATIC_HELP": "Nie należy do żadnego zestawu. Nie wyśrodkowuje."
|
||||||
},
|
},
|
||||||
"DISPLAY_BRIGHTNESS": "Jasność wyświetlacza"
|
"AUTOSTART": "Uruchom automatycznie przy starcie",
|
||||||
}
|
"LAUNCH": "Uruchom"
|
||||||
|
},
|
||||||
|
"DISPLAY_BRIGHTNESS": "Jasność wyświetlacza",
|
||||||
|
"PROCESS_LIST": "Lista procesów",
|
||||||
|
"REFRESH": "Odśwież",
|
||||||
|
"PROCESS": {
|
||||||
|
"STOP": "Zatrzymaj",
|
||||||
|
"FORCE_KILL": "Wymuś zakończenie"
|
||||||
|
},
|
||||||
|
"DEBUG_INFO": "Informacje debugowania"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,162 @@
|
||||||
|
{
|
||||||
|
"ACTIONS": {
|
||||||
|
"RECENTER_PLAYSPACE": "重置游玩区中心"
|
||||||
|
},
|
||||||
|
"APP_LAUNCHER": {
|
||||||
|
"ASPECT": {
|
||||||
|
"SEMI_TALL": "略高",
|
||||||
|
"SEMI_WIDE": "略宽",
|
||||||
|
"SQUARE": "正方形",
|
||||||
|
"TALL": "高",
|
||||||
|
"WIDE": "宽"
|
||||||
|
},
|
||||||
|
"ASPECT_TITLE": "比例",
|
||||||
|
"AUTOSTART": "启动时自动运行",
|
||||||
|
"LAUNCH": "启动",
|
||||||
|
"MODE": {
|
||||||
|
"CAGE": "兼容模式 (Cage)",
|
||||||
|
"NATIVE": "原生模式"
|
||||||
|
},
|
||||||
|
"POS": {
|
||||||
|
"ANCHORED": "锚定",
|
||||||
|
"ANCHORED_HELP": "相对于中心标记保持固定。",
|
||||||
|
"FLOATING": "悬浮",
|
||||||
|
"FLOATING_HELP": "独立移动,显示时自动重置中心。",
|
||||||
|
"STATIC": "静态",
|
||||||
|
"STATIC_HELP": "不属于任何集合。不会重置中心。"
|
||||||
|
},
|
||||||
|
"POS_TITLE": "定位",
|
||||||
|
"RES_TITLE": "分辨率"
|
||||||
|
},
|
||||||
|
"APP_SETTINGS": {
|
||||||
|
"ALLOW_SLIDING": "抓取时允许摇杆交互",
|
||||||
|
"ANIMATION_SPEED": "UI 动画速度",
|
||||||
|
"BLOCK_GAME_INPUT": "屏蔽游戏输入",
|
||||||
|
"BLOCK_GAME_INPUT_HELP": "悬停在覆盖层上时屏蔽所有输入",
|
||||||
|
"BLOCK_GAME_INPUT_IGNORE_WATCH": "屏蔽输入时忽略手表",
|
||||||
|
"BLOCK_GAME_INPUT_IGNORE_WATCH_HELP": "悬停在手表上时不屏蔽输入",
|
||||||
|
"CAPTURE_METHOD": "Wayland 屏幕采集",
|
||||||
|
"CAPTURE_METHOD_HELP": "如果您遇到黑屏或花屏,请尝试更改此项",
|
||||||
|
"CLEAR_PIPEWIRE_TOKENS": "清除 PipeWire 令牌",
|
||||||
|
"CLEAR_PIPEWIRE_TOKENS_HELP": "下次启动时提示选择屏幕",
|
||||||
|
"CLEAR_SAVED_STATE": "清除保存的状态",
|
||||||
|
"CLEAR_SAVED_STATE_HELP": "重置集合与覆盖层位置",
|
||||||
|
"CLICK_FREEZE_TIME_MS": "点击冻结时间 (毫秒)",
|
||||||
|
"CLICK_FREEZE_TIME_MS_HELP": "有助于提高双击精度",
|
||||||
|
"CLOCK_12H": "12 小时制时钟",
|
||||||
|
"CONTROLS": "控制",
|
||||||
|
"DELETE_ALL_CONFIGS": "擦除配置",
|
||||||
|
"DELETE_ALL_CONFIGS_HELP": "从 conf.d 中删除所有配置文件",
|
||||||
|
"DOUBLE_CURSOR_FIX": "双光标修复",
|
||||||
|
"DOUBLE_CURSOR_FIX_HELP": "如果您看到两个光标,请启用此项",
|
||||||
|
"FEATURES": "功能",
|
||||||
|
"FOCUS_FOLLOWS_MOUSE_MODE": "触摸扳机时移动鼠标",
|
||||||
|
"HIDE_GRAB_HELP": "隐藏抓取帮助",
|
||||||
|
"HIDE_USERNAME": "隐藏用户名",
|
||||||
|
"INVERT_SCROLL_DIRECTION_X": "反转水平滚动方向",
|
||||||
|
"INVERT_SCROLL_DIRECTION_Y": "反转垂直滚动方向",
|
||||||
|
"KEYBOARD_MIDDLE_CLICK": "键盘中键点击",
|
||||||
|
"KEYBOARD_MIDDLE_CLICK_HELP": "使用紫色激光打字时的修饰键",
|
||||||
|
"KEYBOARD_SOUND_ENABLED": "键盘音效",
|
||||||
|
"LEFT_HANDED_MOUSE": "左手鼠标",
|
||||||
|
"LEFT_HANDED_MOUSE_HELP": "如果鼠标按钮反置,请使用此项",
|
||||||
|
"LONG_PRESS_DURATION": "长按持续时间",
|
||||||
|
"LOOK_AND_FEEL": "外观与体验",
|
||||||
|
"MISC": "杂项",
|
||||||
|
"NOTIFICATIONS_ENABLED": "启用通知",
|
||||||
|
"NOTIFICATIONS_SOUND_ENABLED": "通知音效",
|
||||||
|
"OPAQUE_BACKGROUND": "不透明背景",
|
||||||
|
"OPTION": {
|
||||||
|
"AUTO": "自动",
|
||||||
|
"AUTO_HELP": "如果支持,则使用 ScreenCopy GPU,\n否则使用 PipeWire GPU。",
|
||||||
|
"PIPEWIRE_HELP": "快速 GPU 采集,\n所有桌面环境的标准方式。",
|
||||||
|
"PW_FALLBACK_HELP": "高 CPU 占用的慢速方法。\n在 PipeWire GPU 不起作用时尝试。",
|
||||||
|
"SCREENCOPY_GPU_HELP": "快速,无屏幕共享弹窗。\n支持:Hyprland, Niri, River, Sway",
|
||||||
|
"SCREENCOPY_HELP": "慢速,无屏幕共享弹窗。\n支持:Hyprland, Niri, River, Sway",
|
||||||
|
"NONE": "无",
|
||||||
|
"HMD_PINCH": "HMD + 捏合",
|
||||||
|
"EYE_PINCH": "眼睛 + 捏合",
|
||||||
|
"EYE_ONLY": "仅眼球",
|
||||||
|
"HMD_ONLY": "仅限头显"
|
||||||
|
},
|
||||||
|
"POINTER_LERP_FACTOR": "指针平滑",
|
||||||
|
"RESTART_SOFTWARE": "重启软件",
|
||||||
|
"RESTART_SOFTWARE_HELP": "应用需要重启的设置",
|
||||||
|
"ROUND_MULTIPLIER": "UI 边缘圆角",
|
||||||
|
"SCREEN_RENDER_DOWN": "以较低分辨率渲染屏幕",
|
||||||
|
"SCREEN_RENDER_DOWN_HELP": "有助于解决高分辨率屏幕的锯齿问题",
|
||||||
|
"SCROLL_SPEED": "滚动速度",
|
||||||
|
"SETS_ON_WATCH": "在手表上显示集合",
|
||||||
|
"SPACE_DRAG_MULTIPLIER": "空间拖拽倍率",
|
||||||
|
"SPACE_DRAG_UNLOCKED": "允许在所有轴上进行空间拖拽",
|
||||||
|
"SPACE_ROTATE_UNLOCKED": "允许在所有轴上进行空间旋转",
|
||||||
|
"TROUBLESHOOTING": "故障排除",
|
||||||
|
"UPRIGHT_SCREEN_FIX": "垂直屏幕修复",
|
||||||
|
"UPRIGHT_SCREEN_FIX_HELP": "修复某些桌面上的垂直屏幕问题",
|
||||||
|
"USE_PASSTHROUGH": "启用穿透",
|
||||||
|
"USE_PASSTHROUGH_HELP": "如果 XR 运行时支持,则允许穿透",
|
||||||
|
"USE_SKYBOX": "启用天空盒",
|
||||||
|
"USE_SKYBOX_HELP": "如果没有场景应用或穿透,则显示天空盒",
|
||||||
|
"XWAYLAND_BY_DEFAULT": "默认以兼容模式运行应用",
|
||||||
|
"AUTOSTART_APPS": "开机启动应用",
|
||||||
|
"HANDSFREE_POINTER": "免提模式",
|
||||||
|
"HANDSFREE_POINTER_HELP": "当运动控制器不可用时使用的输入。\n左手捏合为抓取,右手为点击。",
|
||||||
|
"UI_GRADIENT_INTENSITY": "UI 渐变强度",
|
||||||
|
"RESET_PLAYSPACE": "重置游戏空间",
|
||||||
|
"RESET_PLAYSPACE_HELP": "清除舞台空间偏移。",
|
||||||
|
"BLOCK_POSES_ON_KBD_INTERACTION": "与键盘交互时阻止姿势",
|
||||||
|
"BLOCK_POSES_ON_KBD_INTERACTION_HELP": "当键盘悬停且启用“阻止游戏输入”时,阻止游戏接收姿势",
|
||||||
|
"LANGUAGE": "语言",
|
||||||
|
"REQUIRES_RESTART": "需要重启",
|
||||||
|
"GRID_OPACITY": "地面网格不透明度",
|
||||||
|
"GRID_OPACITY_HELP": "启用天空盒时地板网格的不透明度"
|
||||||
|
},
|
||||||
|
"APPLICATION_LAUNCHER": "应用启动器",
|
||||||
|
"APPLICATION_STARTED": "应用已启动",
|
||||||
|
"APPLICATIONS": "应用",
|
||||||
|
"AUDIO": {
|
||||||
|
"AUTO_SWITCH_TO_VR_AUDIO": "自动切换到 VR 音频",
|
||||||
|
"CARDS": "声卡",
|
||||||
|
"FAILED_TO_SWITCH_MICROPHONE": "切换麦克风失败",
|
||||||
|
"MICROPHONE_SET_SUCCESSFULLY": "麦克风设置成功",
|
||||||
|
"MICROPHONES": "麦克风",
|
||||||
|
"NO_VR_MICROPHONE_SWITCH_MANUALLY": "未找到 VR 麦克风。请手动切换。",
|
||||||
|
"NO_VR_SPEAKERS_FOUND_SWITCH_MANUALLY": "未找到 VR 扬声器。请手动切换。",
|
||||||
|
"SELECT_AUDIO_CARD_PROFILE": "选择声卡配置",
|
||||||
|
"SETTINGS": "音频设置",
|
||||||
|
"SPEAKERS": "扬声器",
|
||||||
|
"SPEAKERS_SET_SUCCESSFULLY": "扬声器设置成功",
|
||||||
|
"VOLUME": "音量"
|
||||||
|
},
|
||||||
|
"CLOSE_WINDOW": "关闭窗口",
|
||||||
|
"DISPLAY_BRIGHTNESS": "显示亮度",
|
||||||
|
"FAILED_TO_LAUNCH_APPLICATION": "启动应用失败:",
|
||||||
|
"GAME_LAUNCHED": "游戏已启动",
|
||||||
|
"GAME_LIST": {
|
||||||
|
"NO_GAMES_FOUND": "未找到游戏",
|
||||||
|
"RUNNING_GAMES_LIST": "正在运行的游戏列表"
|
||||||
|
},
|
||||||
|
"GAMES": "游戏",
|
||||||
|
"GENERAL_SETTINGS": "通用设置",
|
||||||
|
"HEIGHT": "高度",
|
||||||
|
"HELLO": "你好!",
|
||||||
|
"HELLO_USER": "你好,{USER}!",
|
||||||
|
"HIDE": "隐藏",
|
||||||
|
"HOME_SCREEN": "主页",
|
||||||
|
"MONADO_RUNTIME": "Monado 运行时",
|
||||||
|
"POPUP_ADD_DISPLAY": {
|
||||||
|
"RESOLUTION": "分辨率"
|
||||||
|
},
|
||||||
|
"REMOVE": "移除",
|
||||||
|
"SETTINGS": "设置",
|
||||||
|
"SHOW": "显示",
|
||||||
|
"TERMINATE_PROCESS": "终止进程",
|
||||||
|
"WIDTH": "宽度",
|
||||||
|
"PROCESS_LIST": "进程列表",
|
||||||
|
"REFRESH": "刷新",
|
||||||
|
"PROCESS": {
|
||||||
|
"STOP": "停止",
|
||||||
|
"FORCE_KILL": "强制关闭"
|
||||||
|
},
|
||||||
|
"DEBUG_INFO": "调试信息"
|
||||||
|
}
|
||||||
|
|
@ -10,36 +10,42 @@ use wgui::{
|
||||||
i18n::Translation,
|
i18n::Translation,
|
||||||
layout::{Layout, LayoutParams, LayoutUpdateParams, LayoutUpdateResult, WidgetID},
|
layout::{Layout, LayoutParams, LayoutUpdateParams, LayoutUpdateResult, WidgetID},
|
||||||
parser::{Fetchable, ParseDocumentParams, ParserState},
|
parser::{Fetchable, ParseDocumentParams, ParserState},
|
||||||
|
renderer_vk::text::custom_glyph::CustomGlyphData,
|
||||||
task::Tasks,
|
task::Tasks,
|
||||||
widget::{label::WidgetLabel, rectangle::WidgetRectangle},
|
theme::WguiTheme,
|
||||||
|
widget::{label::WidgetLabel, rectangle::WidgetRectangle, sprite::WidgetSprite},
|
||||||
windowing::window::{WguiWindow, WguiWindowParams, WguiWindowParamsExtra, WguiWindowPlacement},
|
windowing::window::{WguiWindow, WguiWindowParams, WguiWindowParamsExtra, WguiWindowPlacement},
|
||||||
};
|
};
|
||||||
use wlx_common::{audio, dash_interface::BoxDashInterface, timestep::Timestep};
|
use wlx_common::{
|
||||||
|
async_executor::AsyncExecutor,
|
||||||
|
audio,
|
||||||
|
dash_interface::{BoxDashInterface, RecenterMode},
|
||||||
|
locale::WayVRLangProvider,
|
||||||
|
timestep::{self, Timestep},
|
||||||
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
assets,
|
assets,
|
||||||
tab::{
|
tab::{Tab, TabType, apps::TabApps, games::TabGames, home::TabHome, monado::TabMonado, settings::TabSettings},
|
||||||
apps::TabApps, games::TabGames, home::TabHome, monado::TabMonado, processes::TabProcesses, settings::TabSettings,
|
|
||||||
Tab, TabType,
|
|
||||||
},
|
|
||||||
util::{
|
util::{
|
||||||
popup_manager::{MountPopupParams, PopupManager, PopupManagerParams},
|
popup_manager::{MountPopupOnceParams, PopupManager, PopupManagerParams},
|
||||||
toast_manager::ToastManager,
|
toast_manager::ToastManager,
|
||||||
various::AsyncExecutor,
|
|
||||||
},
|
},
|
||||||
views,
|
views,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct FrontendWidgets {
|
pub struct FrontendWidgets {
|
||||||
pub id_label_time: WidgetID,
|
id_label_time: WidgetID,
|
||||||
pub id_rect_content: WidgetID,
|
id_rect_content: WidgetID,
|
||||||
|
id_sprite_titlebar_icon: WidgetID,
|
||||||
|
id_label_titlebar_title: WidgetID,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type FrontendTasks = Tasks<FrontendTask>;
|
pub type FrontendTasks = Tasks<FrontendTask>;
|
||||||
|
|
||||||
pub struct Frontend<T> {
|
pub struct Frontend<T> {
|
||||||
pub layout: Layout,
|
pub layout: Layout,
|
||||||
globals: WguiGlobals,
|
pub globals: WguiGlobals,
|
||||||
|
|
||||||
pub interface: BoxDashInterface<T>,
|
pub interface: BoxDashInterface<T>,
|
||||||
|
|
||||||
|
|
@ -77,9 +83,11 @@ pub struct FrontendUpdateResult {
|
||||||
pub sounds_to_play: Vec<SoundType>,
|
pub sounds_to_play: Vec<SoundType>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct InitParams<T> {
|
pub struct InitParams<'a, T> {
|
||||||
pub interface: BoxDashInterface<T>,
|
pub interface: BoxDashInterface<T>,
|
||||||
|
pub lang_provider: &'a WayVRLangProvider,
|
||||||
pub has_monado: bool,
|
pub has_monado: bool,
|
||||||
|
pub theme: Rc<WguiTheme>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|
@ -93,7 +101,7 @@ pub enum FrontendTask {
|
||||||
SetTab(TabType),
|
SetTab(TabType),
|
||||||
RefreshClock,
|
RefreshClock,
|
||||||
RefreshBackground,
|
RefreshBackground,
|
||||||
MountPopup(MountPopupParams),
|
MountPopupOnce(MountPopupOnceParams),
|
||||||
RefreshPopupManager,
|
RefreshPopupManager,
|
||||||
ShowAudioSettings,
|
ShowAudioSettings,
|
||||||
UpdateAudioSettingsView,
|
UpdateAudioSettingsView,
|
||||||
|
|
@ -104,7 +112,7 @@ pub enum FrontendTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: 'static> Frontend<T> {
|
impl<T: 'static> Frontend<T> {
|
||||||
pub fn new(params: InitParams<T>, data: &mut T) -> anyhow::Result<Frontend<T>> {
|
pub fn new(params: InitParams<T>) -> anyhow::Result<Frontend<T>> {
|
||||||
let mut assets = Box::new(assets::Asset {});
|
let mut assets = Box::new(assets::Asset {});
|
||||||
|
|
||||||
let font_binary_bold = assets.load_from_path_gzip("Quicksand-Bold.ttf.gz")?;
|
let font_binary_bold = assets.load_from_path_gzip("Quicksand-Bold.ttf.gz")?;
|
||||||
|
|
@ -113,7 +121,7 @@ impl<T: 'static> Frontend<T> {
|
||||||
|
|
||||||
let globals = WguiGlobals::new(
|
let globals = WguiGlobals::new(
|
||||||
assets,
|
assets,
|
||||||
wgui::globals::Defaults::default(),
|
params.lang_provider,
|
||||||
&WguiFontConfig {
|
&WguiFontConfig {
|
||||||
binaries: vec![&font_binary_regular, &font_binary_bold, &font_binary_light],
|
binaries: vec![&font_binary_regular, &font_binary_bold, &font_binary_light],
|
||||||
family_name_sans_serif: "Quicksand",
|
family_name_sans_serif: "Quicksand",
|
||||||
|
|
@ -129,7 +137,10 @@ impl<T: 'static> Frontend<T> {
|
||||||
path: AssetPath::BuiltIn("gui/dashboard.xml"),
|
path: AssetPath::BuiltIn("gui/dashboard.xml"),
|
||||||
extra: Default::default(),
|
extra: Default::default(),
|
||||||
},
|
},
|
||||||
&LayoutParams { resize_to_parent: true },
|
LayoutParams {
|
||||||
|
resize_to_parent: true,
|
||||||
|
theme: params.theme,
|
||||||
|
},
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let id_popup_manager = state.get_widget_id("popup_manager")?;
|
let id_popup_manager = state.get_widget_id("popup_manager")?;
|
||||||
|
|
@ -144,6 +155,8 @@ impl<T: 'static> Frontend<T> {
|
||||||
|
|
||||||
let id_label_time = state.get_widget_id("label_time")?;
|
let id_label_time = state.get_widget_id("label_time")?;
|
||||||
let id_rect_content = state.get_widget_id("rect_content")?;
|
let id_rect_content = state.get_widget_id("rect_content")?;
|
||||||
|
let id_sprite_titlebar_icon = state.get_widget_id("sprite_titlebar_icon")?;
|
||||||
|
let id_label_titlebar_title = state.get_widget_id("label_titlebar_title")?;
|
||||||
|
|
||||||
let timestep = Timestep::new(60.0);
|
let timestep = Timestep::new(60.0);
|
||||||
|
|
||||||
|
|
@ -157,6 +170,8 @@ impl<T: 'static> Frontend<T> {
|
||||||
widgets: FrontendWidgets {
|
widgets: FrontendWidgets {
|
||||||
id_label_time,
|
id_label_time,
|
||||||
id_rect_content,
|
id_rect_content,
|
||||||
|
id_sprite_titlebar_icon,
|
||||||
|
id_label_titlebar_title,
|
||||||
},
|
},
|
||||||
timestep,
|
timestep,
|
||||||
interface: params.interface,
|
interface: params.interface,
|
||||||
|
|
@ -169,8 +184,8 @@ impl<T: 'static> Frontend<T> {
|
||||||
};
|
};
|
||||||
|
|
||||||
// init some things first
|
// init some things first
|
||||||
frontend.update_background(data)?;
|
frontend.tasks.push(FrontendTask::RefreshBackground);
|
||||||
frontend.update_time(data)?;
|
frontend.tasks.push(FrontendTask::RefreshClock);
|
||||||
|
|
||||||
Frontend::register_widgets(&mut frontend)?;
|
Frontend::register_widgets(&mut frontend)?;
|
||||||
|
|
||||||
|
|
@ -183,10 +198,19 @@ impl<T: 'static> Frontend<T> {
|
||||||
|
|
||||||
fn play_sound(&mut self, audio_system: &mut audio::AudioSystem, sound_type: SoundType) -> anyhow::Result<()> {
|
fn play_sound(&mut self, audio_system: &mut audio::AudioSystem, sound_type: SoundType) -> anyhow::Result<()> {
|
||||||
let mut assets = self.globals.assets_builtin();
|
let mut assets = self.globals.assets_builtin();
|
||||||
let sample = audio::AudioSample::from_mp3(&assets.load_from_path(match sound_type {
|
|
||||||
|
let path = match sound_type {
|
||||||
SoundType::Startup => "sound/startup.mp3",
|
SoundType::Startup => "sound/startup.mp3",
|
||||||
SoundType::Launch => "sound/app_start.mp3",
|
SoundType::Launch => "sound/app_start.mp3",
|
||||||
})?)?;
|
};
|
||||||
|
|
||||||
|
// try loading a custom sound; if one doesn't exist (or it failed to load), use the built-in asset
|
||||||
|
let sound_bytes = match audio::AudioSample::try_bytes_from_config(path) {
|
||||||
|
Ok(bytes) => bytes,
|
||||||
|
Err(_) => assets.load_from_path(path)?.into(),
|
||||||
|
};
|
||||||
|
|
||||||
|
let sample = audio::AudioSample::from_mp3(&sound_bytes)?;
|
||||||
audio_system.play_sample(&sample);
|
audio_system.play_sample(&sample);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
@ -198,8 +222,10 @@ impl<T: 'static> Frontend<T> {
|
||||||
self.process_task(&mut params, task)?;
|
self.process_task(&mut params, task)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let time_ms = timestep::get_micros() / 1000;
|
||||||
|
|
||||||
if let Some(mut tab) = self.current_tab.take() {
|
if let Some(mut tab) = self.current_tab.take() {
|
||||||
tab.update(self, params.data)?;
|
tab.update(self, time_ms as u32, params.data)?;
|
||||||
|
|
||||||
self.current_tab = Some(tab);
|
self.current_tab = Some(tab);
|
||||||
}
|
}
|
||||||
|
|
@ -237,7 +263,7 @@ impl<T: 'static> Frontend<T> {
|
||||||
{
|
{
|
||||||
// always 30 times per second
|
// always 30 times per second
|
||||||
while self.timestep.on_tick() {
|
while self.timestep.on_tick() {
|
||||||
self.toast_manager.tick(&self.globals, &mut self.layout)?;
|
self.toast_manager.tick(&mut self.layout)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -253,13 +279,12 @@ impl<T: 'static> Frontend<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_time(&mut self, data: &mut T) -> anyhow::Result<()> {
|
fn update_time(&mut self, data: &mut T) -> anyhow::Result<()> {
|
||||||
let mut c = self.layout.start_common();
|
|
||||||
let mut common = c.common();
|
|
||||||
|
|
||||||
{
|
{
|
||||||
let Some(mut label) = common.state.widgets.get_as::<WidgetLabel>(self.widgets.id_label_time) else {
|
let mut common = self.layout.common();
|
||||||
anyhow::bail!("");
|
let mut label = common
|
||||||
};
|
.state
|
||||||
|
.widgets
|
||||||
|
.cast_as::<WidgetLabel>(self.widgets.id_label_time)?;
|
||||||
|
|
||||||
let now = chrono::Local::now();
|
let now = chrono::Local::now();
|
||||||
let hours = now.hour();
|
let hours = now.hour();
|
||||||
|
|
@ -276,31 +301,26 @@ impl<T: 'static> Frontend<T> {
|
||||||
label.set_text(&mut common, Translation::from_raw_text(&text));
|
label.set_text(&mut common, Translation::from_raw_text(&text));
|
||||||
}
|
}
|
||||||
|
|
||||||
c.finish()?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mount_popup(&mut self, params: MountPopupParams, data: &mut T) -> anyhow::Result<()> {
|
fn mount_popup_once(&mut self, params: MountPopupOnceParams, data: &mut T) -> anyhow::Result<()> {
|
||||||
let config = self.interface.general_config(data);
|
let config = self.interface.general_config(data);
|
||||||
|
|
||||||
self.popup_manager.mount_popup(
|
self
|
||||||
self.globals.clone(),
|
.popup_manager
|
||||||
&mut self.layout,
|
.mount_popup_once(&self.globals, &mut self.layout, &self.tasks, params, config)?;
|
||||||
self.tasks.clone(),
|
|
||||||
params,
|
|
||||||
config,
|
|
||||||
)?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn refresh_popup_manager(&mut self) -> anyhow::Result<()> {
|
fn refresh_popup_manager(&mut self) -> anyhow::Result<()> {
|
||||||
let mut c = self.layout.start_common();
|
self.popup_manager.refresh(&mut self.layout.alterables);
|
||||||
self.popup_manager.refresh(c.common().alterables);
|
|
||||||
c.finish()?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_background(&mut self, data: &mut T) -> anyhow::Result<()> {
|
fn update_background(&mut self, data: &mut T) -> anyhow::Result<()> {
|
||||||
|
self.layout.mark_redraw();
|
||||||
|
|
||||||
let Some(mut rect) = self
|
let Some(mut rect) = self
|
||||||
.layout
|
.layout
|
||||||
.state
|
.state
|
||||||
|
|
@ -327,7 +347,7 @@ impl<T: 'static> Frontend<T> {
|
||||||
FrontendTask::SetTab(tab_type) => self.set_tab(params.data, tab_type)?,
|
FrontendTask::SetTab(tab_type) => self.set_tab(params.data, tab_type)?,
|
||||||
FrontendTask::RefreshClock => self.update_time(params.data)?,
|
FrontendTask::RefreshClock => self.update_time(params.data)?,
|
||||||
FrontendTask::RefreshBackground => self.update_background(params.data)?,
|
FrontendTask::RefreshBackground => self.update_background(params.data)?,
|
||||||
FrontendTask::MountPopup(popup_params) => self.mount_popup(popup_params, params.data)?,
|
FrontendTask::MountPopupOnce(popup_params) => self.mount_popup_once(popup_params, params.data)?,
|
||||||
FrontendTask::RefreshPopupManager => self.refresh_popup_manager()?,
|
FrontendTask::RefreshPopupManager => self.refresh_popup_manager()?,
|
||||||
FrontendTask::ShowAudioSettings => self.action_show_audio_settings()?,
|
FrontendTask::ShowAudioSettings => self.action_show_audio_settings()?,
|
||||||
FrontendTask::UpdateAudioSettingsView => self.action_update_audio_settings()?,
|
FrontendTask::UpdateAudioSettingsView => self.action_update_audio_settings()?,
|
||||||
|
|
@ -339,17 +359,51 @@ impl<T: 'static> Frontend<T> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_tab_title(&mut self, translation: &str, icon: &str) -> anyhow::Result<()> {
|
||||||
|
let mut common = self.layout.common();
|
||||||
|
|
||||||
|
{
|
||||||
|
let mut label = common
|
||||||
|
.state
|
||||||
|
.widgets
|
||||||
|
.cast_as::<WidgetLabel>(self.widgets.id_label_titlebar_title)?;
|
||||||
|
label.set_text(&mut common, Translation::from_translation_key(translation));
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
let mut sprite = common
|
||||||
|
.state
|
||||||
|
.widgets
|
||||||
|
.cast_as::<WidgetSprite>(self.widgets.id_sprite_titlebar_icon)?;
|
||||||
|
sprite.set_content(
|
||||||
|
common.alterables,
|
||||||
|
Some(CustomGlyphData::from_assets(&self.globals, AssetPath::BuiltIn(icon))?),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn set_tab(&mut self, data: &mut T, tab_type: TabType) -> anyhow::Result<()> {
|
fn set_tab(&mut self, data: &mut T, tab_type: TabType) -> anyhow::Result<()> {
|
||||||
log::info!("Setting tab to {tab_type:?}");
|
log::info!("Setting tab to {tab_type:?}");
|
||||||
let widget_content = self.state.fetch_widget(&self.layout.state, "content")?;
|
let widget_content = self.state.fetch_widget(&self.layout.state, "content")?;
|
||||||
self.layout.remove_children(widget_content.id);
|
self.layout.remove_children(widget_content.id);
|
||||||
|
|
||||||
|
let (tab_translation, icon_path) = match tab_type {
|
||||||
|
TabType::Home => ("HOME_SCREEN", "dashboard/home.svg"),
|
||||||
|
TabType::Apps => ("APPLICATIONS", "dashboard/apps.svg"),
|
||||||
|
TabType::Games => ("GAMES", "dashboard/games.svg"),
|
||||||
|
TabType::Monado => ("MONADO_RUNTIME", "dashboard/monado.svg"),
|
||||||
|
TabType::Settings => ("SETTINGS", "dashboard/settings.svg"),
|
||||||
|
};
|
||||||
|
|
||||||
|
self.set_tab_title(tab_translation, icon_path)?;
|
||||||
|
|
||||||
let tab: Box<dyn Tab<T>> = match tab_type {
|
let tab: Box<dyn Tab<T>> = match tab_type {
|
||||||
TabType::Home => Box::new(TabHome::new(self, widget_content.id, data)?),
|
TabType::Home => Box::new(TabHome::new(self, widget_content.id, data)?),
|
||||||
TabType::Apps => Box::new(TabApps::new(self, widget_content.id, data)?),
|
TabType::Apps => Box::new(TabApps::new(self, widget_content.id, data)?),
|
||||||
TabType::Games => Box::new(TabGames::new(self, widget_content.id)?),
|
TabType::Games => Box::new(TabGames::new(self, widget_content.id)?),
|
||||||
TabType::Monado => Box::new(TabMonado::new(self, widget_content.id)?),
|
TabType::Monado => Box::new(TabMonado::new(self, widget_content.id)?),
|
||||||
TabType::Processes => Box::new(TabProcesses::new(self, widget_content.id)?),
|
|
||||||
TabType::Settings => Box::new(TabSettings::new(self, widget_content.id, data)?),
|
TabType::Settings => Box::new(TabSettings::new(self, widget_content.id, data)?),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -393,12 +447,6 @@ impl<T: 'static> Frontend<T> {
|
||||||
FrontendTask::SetTab(TabType::Monado),
|
FrontendTask::SetTab(TabType::Monado),
|
||||||
);
|
);
|
||||||
|
|
||||||
// "Processes" side button
|
|
||||||
// self.tasks.handle_button(
|
|
||||||
// &self.state.fetch_component_as::<ComponentButton>("btn_side_processes")?,
|
|
||||||
// FrontendTask::SetTab(TabType::Processes),
|
|
||||||
// );
|
|
||||||
|
|
||||||
// "Settings" side button
|
// "Settings" side button
|
||||||
self.tasks.handle_button(
|
self.tasks.handle_button(
|
||||||
&self.state.fetch_component_as::<ComponentButton>("btn_side_settings")?,
|
&self.state.fetch_component_as::<ComponentButton>("btn_side_settings")?,
|
||||||
|
|
@ -426,7 +474,6 @@ impl<T: 'static> Frontend<T> {
|
||||||
|
|
||||||
fn action_show_audio_settings(&mut self) -> anyhow::Result<()> {
|
fn action_show_audio_settings(&mut self) -> anyhow::Result<()> {
|
||||||
self.window_audio_settings.open(&mut WguiWindowParams {
|
self.window_audio_settings.open(&mut WguiWindowParams {
|
||||||
globals: &self.globals,
|
|
||||||
position: Vec2::new(64.0, 64.0),
|
position: Vec2::new(64.0, 64.0),
|
||||||
layout: &mut self.layout,
|
layout: &mut self.layout,
|
||||||
extra: WguiWindowParamsExtra {
|
extra: WguiWindowParamsExtra {
|
||||||
|
|
@ -466,7 +513,7 @@ impl<T: 'static> Frontend<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn action_recenter_playspace(&mut self, data: &mut T) -> anyhow::Result<()> {
|
fn action_recenter_playspace(&mut self, data: &mut T) -> anyhow::Result<()> {
|
||||||
self.interface.recenter_playspace(data)?;
|
self.interface.recenter_playspace(data, RecenterMode::Recenter)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,26 +9,20 @@ use wgui::{
|
||||||
assets::AssetPath,
|
assets::AssetPath,
|
||||||
components::button::{ButtonClickCallback, ComponentButton},
|
components::button::{ButtonClickCallback, ComponentButton},
|
||||||
globals::WguiGlobals,
|
globals::WguiGlobals,
|
||||||
i18n::Translation,
|
|
||||||
layout::{WidgetID, WidgetPair},
|
layout::{WidgetID, WidgetPair},
|
||||||
parser::{Fetchable, ParseDocumentParams, ParserState},
|
parser::{Fetchable, ParseDocumentParams, ParserState},
|
||||||
task::Tasks,
|
|
||||||
};
|
};
|
||||||
use wlx_common::desktop_finder::DesktopEntry;
|
use wlx_common::desktop_finder::DesktopEntry;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
frontend::{Frontend, FrontendTask, FrontendTasks},
|
frontend::{Frontend, FrontendTasks},
|
||||||
tab::{Tab, TabType},
|
tab::{Tab, TabType},
|
||||||
util::popup_manager::{MountPopupParams, PopupHandle},
|
util::popup_manager::PopupHolder,
|
||||||
views::{self, app_launcher},
|
views::{self},
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Task {
|
|
||||||
CloseLauncher,
|
|
||||||
}
|
|
||||||
|
|
||||||
struct State {
|
struct State {
|
||||||
view_launcher: Option<(PopupHandle, views::app_launcher::View)>,
|
view_launcher: PopupHolder<views::app_launcher::View>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TabApps<T> {
|
pub struct TabApps<T> {
|
||||||
|
|
@ -37,7 +31,6 @@ pub struct TabApps<T> {
|
||||||
|
|
||||||
state: Rc<RefCell<State>>,
|
state: Rc<RefCell<State>>,
|
||||||
app_list: AppList,
|
app_list: AppList,
|
||||||
tasks: Tasks<Task>,
|
|
||||||
marker: PhantomData<T>,
|
marker: PhantomData<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -46,22 +39,14 @@ impl<T> Tab<T> for TabApps<T> {
|
||||||
TabType::Apps
|
TabType::Apps
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update(&mut self, frontend: &mut Frontend<T>, data: &mut T) -> anyhow::Result<()> {
|
fn update(&mut self, frontend: &mut Frontend<T>, _time_ms: u32, data: &mut T) -> anyhow::Result<()> {
|
||||||
let mut state = self.state.borrow_mut();
|
let state = self.state.borrow_mut();
|
||||||
|
|
||||||
for task in self.tasks.drain() {
|
self.app_list.tick(frontend, &self.state, &mut self.parser_state)?;
|
||||||
match task {
|
|
||||||
Task::CloseLauncher => state.view_launcher = None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self
|
state
|
||||||
.app_list
|
.view_launcher
|
||||||
.tick(frontend, &self.state, &self.tasks, &mut self.parser_state)?;
|
.with_view_res(|view| view.update(&mut frontend.interface, data))?;
|
||||||
|
|
||||||
if let Some((_, launcher)) = &mut state.view_launcher {
|
|
||||||
launcher.update(&mut frontend.interface, data)?;
|
|
||||||
}
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -79,40 +64,14 @@ fn on_app_click(
|
||||||
globals: WguiGlobals,
|
globals: WguiGlobals,
|
||||||
entry: DesktopEntry,
|
entry: DesktopEntry,
|
||||||
state: Rc<RefCell<State>>,
|
state: Rc<RefCell<State>>,
|
||||||
tasks: Tasks<Task>,
|
|
||||||
) -> ButtonClickCallback {
|
) -> ButtonClickCallback {
|
||||||
Box::new(move |_common, _evt| {
|
Rc::new(move |_common, _evt| {
|
||||||
frontend_tasks.push(FrontendTask::MountPopup(MountPopupParams {
|
views::app_launcher::mount_popup(
|
||||||
title: Translation::from_raw_text(&entry.app_name),
|
frontend_tasks.clone(),
|
||||||
on_content: {
|
globals.clone(),
|
||||||
// this is awful
|
entry.clone(),
|
||||||
let state = state.clone();
|
state.borrow_mut().view_launcher.clone(),
|
||||||
let entry = entry.clone();
|
);
|
||||||
let globals = globals.clone();
|
|
||||||
let frontend_tasks = frontend_tasks.clone();
|
|
||||||
let tasks = tasks.clone();
|
|
||||||
|
|
||||||
Rc::new(move |data| {
|
|
||||||
let on_launched = {
|
|
||||||
let tasks = tasks.clone();
|
|
||||||
Box::new(move || tasks.push(Task::CloseLauncher))
|
|
||||||
};
|
|
||||||
|
|
||||||
let view = app_launcher::View::new(app_launcher::Params {
|
|
||||||
entry: entry.clone(),
|
|
||||||
globals: &globals,
|
|
||||||
layout: data.layout,
|
|
||||||
parent_id: data.id_content,
|
|
||||||
frontend_tasks: &frontend_tasks,
|
|
||||||
config: data.config,
|
|
||||||
on_launched,
|
|
||||||
})?;
|
|
||||||
|
|
||||||
state.borrow_mut().view_launcher = Some((data.handle, view));
|
|
||||||
Ok(())
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -128,8 +87,9 @@ fn doc_params(globals: WguiGlobals) -> ParseDocumentParams<'static> {
|
||||||
impl<T> TabApps<T> {
|
impl<T> TabApps<T> {
|
||||||
pub fn new(frontend: &mut Frontend<T>, parent_id: WidgetID, data: &mut T) -> anyhow::Result<Self> {
|
pub fn new(frontend: &mut Frontend<T>, parent_id: WidgetID, data: &mut T) -> anyhow::Result<Self> {
|
||||||
let globals = frontend.layout.state.globals.clone();
|
let globals = frontend.layout.state.globals.clone();
|
||||||
let tasks = Tasks::new();
|
let state = Rc::new(RefCell::new(State {
|
||||||
let state = Rc::new(RefCell::new(State { view_launcher: None }));
|
view_launcher: Default::default(),
|
||||||
|
}));
|
||||||
|
|
||||||
let parser_state = wgui::parser::parse_from_assets(&doc_params(globals.clone()), &mut frontend.layout, parent_id)?;
|
let parser_state = wgui::parser::parse_from_assets(&doc_params(globals.clone()), &mut frontend.layout, parent_id)?;
|
||||||
let app_list_parent = parser_state.fetch_widget(&frontend.layout.state, "app_list_parent")?;
|
let app_list_parent = parser_state.fetch_widget(&frontend.layout.state, "app_list_parent")?;
|
||||||
|
|
@ -157,7 +117,6 @@ impl<T> TabApps<T> {
|
||||||
app_list,
|
app_list,
|
||||||
parser_state,
|
parser_state,
|
||||||
state,
|
state,
|
||||||
tasks,
|
|
||||||
marker: PhantomData,
|
marker: PhantomData,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -286,7 +245,7 @@ impl AppList {
|
||||||
let mut params = HashMap::<Rc<str>, Rc<str>>::new();
|
let mut params = HashMap::<Rc<str>, Rc<str>>::new();
|
||||||
params.insert("text".into(), category_name.into());
|
params.insert("text".into(), category_name.into());
|
||||||
|
|
||||||
parser_state.parse_template(
|
parser_state.realize_template(
|
||||||
doc_params,
|
doc_params,
|
||||||
"CategoryText",
|
"CategoryText",
|
||||||
&mut frontend.layout,
|
&mut frontend.layout,
|
||||||
|
|
@ -318,7 +277,7 @@ impl AppList {
|
||||||
);
|
);
|
||||||
params.insert("name".into(), entry.app_name.clone());
|
params.insert("name".into(), entry.app_name.clone());
|
||||||
|
|
||||||
let data = parser_state.parse_template(
|
let data = parser_state.realize_template(
|
||||||
doc_params,
|
doc_params,
|
||||||
"AppEntry",
|
"AppEntry",
|
||||||
&mut frontend.layout,
|
&mut frontend.layout,
|
||||||
|
|
@ -334,11 +293,10 @@ impl AppList {
|
||||||
&mut self,
|
&mut self,
|
||||||
frontend: &mut Frontend<T>,
|
frontend: &mut Frontend<T>,
|
||||||
state: &Rc<RefCell<State>>,
|
state: &Rc<RefCell<State>>,
|
||||||
tasks: &Tasks<Task>,
|
|
||||||
parser_state: &mut ParserState,
|
parser_state: &mut ParserState,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
// load 4 entries for a single frame at most
|
// load 30 entries for a single frame at most
|
||||||
for _ in 0..4 {
|
for _ in 0..30 {
|
||||||
if let Some(entry) = self.entries_to_mount.pop_front() {
|
if let Some(entry) = self.entries_to_mount.pop_front() {
|
||||||
let globals = frontend.layout.state.globals.clone();
|
let globals = frontend.layout.state.globals.clone();
|
||||||
let button = self.mount_entry(frontend, parser_state, &doc_params(globals.clone()), &entry)?;
|
let button = self.mount_entry(frontend, parser_state, &doc_params(globals.clone()), &entry)?;
|
||||||
|
|
@ -348,7 +306,6 @@ impl AppList {
|
||||||
globals.clone(),
|
globals.clone(),
|
||||||
entry.clone(),
|
entry.clone(),
|
||||||
state.clone(),
|
state.clone(),
|
||||||
tasks.clone(),
|
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@ use wgui::{
|
||||||
use crate::{
|
use crate::{
|
||||||
frontend::Frontend,
|
frontend::Frontend,
|
||||||
tab::{Tab, TabType},
|
tab::{Tab, TabType},
|
||||||
views::game_list,
|
util::steam_utils::SteamUtils,
|
||||||
|
views::{ViewTrait, ViewUpdateParams, game_list, running_games_list},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct TabGames<T> {
|
pub struct TabGames<T> {
|
||||||
|
|
@ -17,6 +18,7 @@ pub struct TabGames<T> {
|
||||||
pub state: ParserState,
|
pub state: ParserState,
|
||||||
|
|
||||||
view_game_list: game_list::View,
|
view_game_list: game_list::View,
|
||||||
|
view_running_games_list: running_games_list::View,
|
||||||
marker: PhantomData<T>,
|
marker: PhantomData<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -25,17 +27,32 @@ impl<T> Tab<T> for TabGames<T> {
|
||||||
TabType::Games
|
TabType::Games
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update(&mut self, frontend: &mut Frontend<T>, _data: &mut T) -> anyhow::Result<()> {
|
fn update(&mut self, frontend: &mut Frontend<T>, time_ms: u32, data: &mut T) -> anyhow::Result<()> {
|
||||||
self.view_game_list.update(&mut frontend.layout, &frontend.executor)?;
|
let mut config_change_kind = None;
|
||||||
|
|
||||||
|
self.view_game_list.update(&mut ViewUpdateParams {
|
||||||
|
layout: &mut frontend.layout,
|
||||||
|
executor: &frontend.executor,
|
||||||
|
general_config: frontend.interface.general_config(data),
|
||||||
|
config_change_kind: &mut config_change_kind,
|
||||||
|
})?;
|
||||||
|
|
||||||
|
if let Some(kind) = config_change_kind {
|
||||||
|
frontend.interface.config_changed(data, kind);
|
||||||
|
}
|
||||||
|
|
||||||
|
self.view_running_games_list.update(&mut frontend.layout, time_ms)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> TabGames<T> {
|
impl<T> TabGames<T> {
|
||||||
pub fn new(frontend: &mut Frontend<T>, parent_id: WidgetID) -> anyhow::Result<Self> {
|
pub fn new(frontend: &mut Frontend<T>, parent_id: WidgetID) -> anyhow::Result<Self> {
|
||||||
|
let globals = frontend.layout.state.globals.clone();
|
||||||
|
|
||||||
let state = wgui::parser::parse_from_assets(
|
let state = wgui::parser::parse_from_assets(
|
||||||
&ParseDocumentParams {
|
&ParseDocumentParams {
|
||||||
globals: frontend.layout.state.globals.clone(),
|
globals: globals.clone(),
|
||||||
path: AssetPath::BuiltIn("gui/tab/games.xml"),
|
path: AssetPath::BuiltIn("gui/tab/games.xml"),
|
||||||
extra: Default::default(),
|
extra: Default::default(),
|
||||||
},
|
},
|
||||||
|
|
@ -44,18 +61,31 @@ impl<T> TabGames<T> {
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let game_list_parent = state.get_widget_id("game_list_parent")?;
|
let game_list_parent = state.get_widget_id("game_list_parent")?;
|
||||||
|
let id_running_games_list_parent = state.get_widget_id("running_games_list_parent")?;
|
||||||
|
|
||||||
|
let mut steam_utils = SteamUtils::new()?;
|
||||||
|
|
||||||
let view_game_list = game_list::View::new(game_list::Params {
|
let view_game_list = game_list::View::new(game_list::Params {
|
||||||
executor: frontend.executor.clone(),
|
executor: frontend.executor.clone(),
|
||||||
frontend_tasks: frontend.tasks.clone(),
|
frontend_tasks: frontend.tasks.clone(),
|
||||||
globals: frontend.layout.state.globals.clone(),
|
globals: globals.clone(),
|
||||||
layout: &mut frontend.layout,
|
layout: &mut frontend.layout,
|
||||||
parent_id: game_list_parent,
|
parent_id: game_list_parent,
|
||||||
|
steam_utils: &steam_utils,
|
||||||
|
})?;
|
||||||
|
|
||||||
|
let view_running_games_list = running_games_list::View::new(running_games_list::Params {
|
||||||
|
globals: globals.clone(),
|
||||||
|
layout: &mut frontend.layout,
|
||||||
|
parent_id: id_running_games_list_parent,
|
||||||
|
steam_utils: &mut steam_utils,
|
||||||
|
frontend_tasks: frontend.tasks.clone(),
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
state,
|
state,
|
||||||
view_game_list,
|
view_game_list,
|
||||||
|
view_running_games_list,
|
||||||
marker: PhantomData,
|
marker: PhantomData,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,12 @@ impl<T> TabHome<T> {
|
||||||
parent_id,
|
parent_id,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let mut c = frontend.layout.start_common();
|
let widget_label = state.fetch_widget(&frontend.layout.state, "label_hello")?.widget;
|
||||||
let widget_label = state.fetch_widget(&c.layout.state, "label_hello")?.widget;
|
configure_label_hello(
|
||||||
configure_label_hello(&mut c.common(), widget_label, frontend.interface.general_config(data));
|
&mut frontend.layout.common(),
|
||||||
|
widget_label,
|
||||||
|
frontend.interface.general_config(data),
|
||||||
|
);
|
||||||
|
|
||||||
let btn_apps = state.fetch_component_as::<ComponentButton>("btn_apps")?;
|
let btn_apps = state.fetch_component_as::<ComponentButton>("btn_apps")?;
|
||||||
let btn_games = state.fetch_component_as::<ComponentButton>("btn_games")?;
|
let btn_games = state.fetch_component_as::<ComponentButton>("btn_games")?;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ pub mod apps;
|
||||||
pub mod games;
|
pub mod games;
|
||||||
pub mod home;
|
pub mod home;
|
||||||
pub mod monado;
|
pub mod monado;
|
||||||
pub mod processes;
|
|
||||||
pub mod settings;
|
pub mod settings;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
|
|
@ -13,7 +12,6 @@ pub enum TabType {
|
||||||
Apps,
|
Apps,
|
||||||
Games,
|
Games,
|
||||||
Monado,
|
Monado,
|
||||||
Processes,
|
|
||||||
Settings,
|
Settings,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -21,7 +19,7 @@ pub trait Tab<T> {
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
fn get_type(&self) -> TabType;
|
fn get_type(&self) -> TabType;
|
||||||
|
|
||||||
fn update(&mut self, _: &mut Frontend<T>, _: &mut T) -> anyhow::Result<()> {
|
fn update(&mut self, _frontend: &mut Frontend<T>, _time_ms: u32, _user_data: &mut T) -> anyhow::Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,24 +2,133 @@ use std::{collections::HashMap, marker::PhantomData, rc::Rc};
|
||||||
|
|
||||||
use wgui::{
|
use wgui::{
|
||||||
assets::AssetPath,
|
assets::AssetPath,
|
||||||
components::{checkbox::ComponentCheckbox, slider::ComponentSlider},
|
components::{
|
||||||
|
bar_graph::{ComponentBarGraph, ValueCell},
|
||||||
|
button::ComponentButton,
|
||||||
|
checkbox::ComponentCheckbox,
|
||||||
|
color_selector::{ColorSelectorChangedCallback, ComponentColorSelector},
|
||||||
|
slider::{ComponentSlider, SliderValueChangedCallback},
|
||||||
|
tabs::ComponentTabs,
|
||||||
|
},
|
||||||
|
drawing::Color,
|
||||||
globals::WguiGlobals,
|
globals::WguiGlobals,
|
||||||
layout::WidgetID,
|
layout::{Layout, WidgetID},
|
||||||
parser::{self, Fetchable, ParseDocumentParams, ParserState},
|
parser::{self, Fetchable, ParseDocumentParams, ParserState},
|
||||||
task::Tasks,
|
task::Tasks,
|
||||||
};
|
};
|
||||||
use wlx_common::dash_interface;
|
use wlx_common::{
|
||||||
|
config::GeneralConfig,
|
||||||
|
dash_interface::{self, ConfigChangeKind, MonadoDumpSessionFrame},
|
||||||
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
frontend::Frontend,
|
frontend::Frontend,
|
||||||
tab::{Tab, TabType},
|
tab::{Tab, TabType},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Clone)]
|
||||||
|
enum TabNameEnum {
|
||||||
|
GeneralSettings,
|
||||||
|
ProcessList,
|
||||||
|
DebugTimings,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TabNameEnum {
|
||||||
|
fn from_string(s: &str) -> Option<Self> {
|
||||||
|
match s {
|
||||||
|
"general_settings" => Some(TabNameEnum::GeneralSettings),
|
||||||
|
"process_list" => Some(TabNameEnum::ProcessList),
|
||||||
|
"debug_timings" => Some(TabNameEnum::DebugTimings),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
enum Task {
|
enum Task {
|
||||||
Refresh,
|
|
||||||
FocusClient(String),
|
|
||||||
SetBrightness(f32),
|
SetBrightness(f32),
|
||||||
|
SetTab(TabNameEnum),
|
||||||
|
|
||||||
|
// `ProcessList` tab
|
||||||
|
ProcessListRefresh,
|
||||||
|
ProcessListFocusClient(String),
|
||||||
|
|
||||||
|
// `DebugTimings` tab
|
||||||
|
DebugTimingsRefreshSessionList,
|
||||||
|
DebugTimingsSetSessionId(i64),
|
||||||
|
|
||||||
|
GeneralSettingsChromaUpdate,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SubtabProcessList {
|
||||||
|
id_list_parent: WidgetID,
|
||||||
|
state: ParserState,
|
||||||
|
cells: Vec<parser::ParserData>,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SubtabGeneralSettings {
|
||||||
|
#[allow(dead_code)]
|
||||||
|
state: ParserState,
|
||||||
|
|
||||||
|
slider_keying_curve: Rc<ComponentSlider>,
|
||||||
|
slider_keying_despill: Rc<ComponentSlider>,
|
||||||
|
slider_keying_hue_range: Rc<ComponentSlider>,
|
||||||
|
slider_keying_saturation_range: Rc<ComponentSlider>,
|
||||||
|
slider_keying_value_range: Rc<ComponentSlider>,
|
||||||
|
cs_keying: Rc<ComponentColorSelector>,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct DebugGraph {
|
||||||
|
graph: Rc<ComponentBarGraph>,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct DebugSessionList {
|
||||||
|
#[allow(dead_code)]
|
||||||
|
buttons: Vec<Rc<ComponentButton>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct TimingsSession {
|
||||||
|
resolved_name: Option<String>,
|
||||||
|
last_frame: MonadoDumpSessionFrame,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Graphs {
|
||||||
|
predicted_display_time: DebugGraph,
|
||||||
|
predicted_frame_time: DebugGraph,
|
||||||
|
predicted_wake_up_time: DebugGraph,
|
||||||
|
predicted_gpu_done_time: DebugGraph,
|
||||||
|
predicted_display_period: DebugGraph,
|
||||||
|
display_time: DebugGraph,
|
||||||
|
when_predicted: DebugGraph,
|
||||||
|
when_wait_woke: DebugGraph,
|
||||||
|
when_begin: DebugGraph,
|
||||||
|
when_delivered: DebugGraph,
|
||||||
|
when_gpu_done: DebugGraph,
|
||||||
|
}
|
||||||
|
|
||||||
|
type SessionsMap = HashMap<i64 /* session id */, TimingsSession>;
|
||||||
|
|
||||||
|
struct SubtabDebugTimings {
|
||||||
|
#[allow(dead_code)]
|
||||||
|
state: ParserState,
|
||||||
|
|
||||||
|
graphs: Option<Graphs>,
|
||||||
|
session_list: DebugSessionList,
|
||||||
|
selected_session_id: Option<i64>,
|
||||||
|
|
||||||
|
id_sessions_list_parent: WidgetID,
|
||||||
|
id_timings_parent: WidgetID,
|
||||||
|
|
||||||
|
sessions: SessionsMap,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
#[allow(clippy::large_enum_variant)]
|
||||||
|
enum Subtab {
|
||||||
|
Empty,
|
||||||
|
GeneralSettings(SubtabGeneralSettings),
|
||||||
|
ProcessList(SubtabProcessList),
|
||||||
|
DebugTimings(SubtabDebugTimings),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TabMonado<T> {
|
pub struct TabMonado<T> {
|
||||||
|
|
@ -29,10 +138,8 @@ pub struct TabMonado<T> {
|
||||||
|
|
||||||
marker: PhantomData<T>,
|
marker: PhantomData<T>,
|
||||||
|
|
||||||
globals: WguiGlobals,
|
id_content: WidgetID,
|
||||||
id_list_parent: WidgetID,
|
subtab: Subtab,
|
||||||
|
|
||||||
cells: Vec<parser::ParserData>,
|
|
||||||
|
|
||||||
ticks: u32,
|
ticks: u32,
|
||||||
}
|
}
|
||||||
|
|
@ -42,18 +149,75 @@ impl<T> Tab<T> for TabMonado<T> {
|
||||||
TabType::Games
|
TabType::Games
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update(&mut self, frontend: &mut Frontend<T>, data: &mut T) -> anyhow::Result<()> {
|
fn update(&mut self, frontend: &mut Frontend<T>, _time_ms: u32, data: &mut T) -> anyhow::Result<()> {
|
||||||
for task in self.tasks.drain() {
|
for task in self.tasks.drain() {
|
||||||
match task {
|
match task {
|
||||||
Task::Refresh => self.refresh(frontend, data)?,
|
Task::ProcessListRefresh => {
|
||||||
Task::FocusClient(name) => self.focus_client(frontend, data, name)?,
|
if let Subtab::ProcessList(process_list) = &mut self.subtab {
|
||||||
|
process_list.refresh(frontend, data, &self.tasks)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Task::ProcessListFocusClient(client_name) => {
|
||||||
|
if let Subtab::ProcessList(process_list) = &mut self.subtab {
|
||||||
|
process_list.focus_client(frontend, data, client_name, &self.tasks)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Task::DebugTimingsRefreshSessionList => {
|
||||||
|
if let Subtab::DebugTimings(tab) = &mut self.subtab {
|
||||||
|
tab.refresh_session_list(&mut frontend.layout, &self.tasks)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Task::DebugTimingsSetSessionId(session_id) => {
|
||||||
|
if let Subtab::DebugTimings(tab) = &mut self.subtab {
|
||||||
|
tab.set_session_id(&mut frontend.layout, session_id)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Task::GeneralSettingsChromaUpdate => {
|
||||||
|
if let Subtab::GeneralSettings(tab) = &mut self.subtab {
|
||||||
|
tab.chroma_update(frontend.interface.general_config(data));
|
||||||
|
frontend
|
||||||
|
.interface
|
||||||
|
.config_changed(data, ConfigChangeKind::EnvironmentBlend);
|
||||||
|
}
|
||||||
|
}
|
||||||
Task::SetBrightness(brightness) => self.set_brightness(frontend, data, brightness),
|
Task::SetBrightness(brightness) => self.set_brightness(frontend, data, brightness),
|
||||||
|
Task::SetTab(tab) => {
|
||||||
|
frontend.layout.remove_children(self.id_content);
|
||||||
|
match tab {
|
||||||
|
TabNameEnum::GeneralSettings => {
|
||||||
|
self.subtab = Subtab::GeneralSettings(SubtabGeneralSettings::new(
|
||||||
|
self.id_content,
|
||||||
|
frontend,
|
||||||
|
data,
|
||||||
|
&self.tasks,
|
||||||
|
)?)
|
||||||
|
}
|
||||||
|
TabNameEnum::ProcessList => {
|
||||||
|
self.tasks.push(Task::ProcessListRefresh);
|
||||||
|
self.subtab = Subtab::ProcessList(SubtabProcessList::new(self.id_content, frontend)?)
|
||||||
|
}
|
||||||
|
TabNameEnum::DebugTimings => {
|
||||||
|
self.subtab = Subtab::DebugTimings(SubtabDebugTimings::new(self.id_content, frontend, &self.tasks)?)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// every few seconds
|
match &mut self.subtab {
|
||||||
if self.ticks.is_multiple_of(500) {
|
Subtab::Empty => {}
|
||||||
self.tasks.push(Task::Refresh);
|
Subtab::GeneralSettings(_) => {}
|
||||||
|
Subtab::ProcessList(_) => {
|
||||||
|
// every few seconds
|
||||||
|
if let Subtab::ProcessList(_) = &self.subtab
|
||||||
|
&& self.ticks.is_multiple_of(500)
|
||||||
|
{
|
||||||
|
self.tasks.push(Task::ProcessListRefresh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Subtab::DebugTimings(timings) => {
|
||||||
|
timings.update(&self.tasks, data, frontend)?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.ticks += 1;
|
self.ticks += 1;
|
||||||
|
|
@ -62,7 +226,7 @@ impl<T> Tab<T> for TabMonado<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn doc_params(globals: &'_ WguiGlobals) -> ParseDocumentParams<'_> {
|
fn doc_params_monado(globals: &'_ WguiGlobals) -> ParseDocumentParams<'_> {
|
||||||
ParseDocumentParams {
|
ParseDocumentParams {
|
||||||
globals: globals.clone(),
|
globals: globals.clone(),
|
||||||
path: AssetPath::BuiltIn("gui/tab/monado.xml"),
|
path: AssetPath::BuiltIn("gui/tab/monado.xml"),
|
||||||
|
|
@ -70,6 +234,30 @@ fn doc_params(globals: &'_ WguiGlobals) -> ParseDocumentParams<'_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn doc_params_tab_process_list(globals: &'_ WguiGlobals) -> ParseDocumentParams<'_> {
|
||||||
|
ParseDocumentParams {
|
||||||
|
globals: globals.clone(),
|
||||||
|
path: AssetPath::BuiltIn("gui/tab/monado_tab_process_list.xml"),
|
||||||
|
extra: Default::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn doc_params_tab_general_settings(globals: &'_ WguiGlobals) -> ParseDocumentParams<'_> {
|
||||||
|
ParseDocumentParams {
|
||||||
|
globals: globals.clone(),
|
||||||
|
path: AssetPath::BuiltIn("gui/tab/monado_tab_general_settings.xml"),
|
||||||
|
extra: Default::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn doc_params_tab_debug_timings(globals: &'_ WguiGlobals) -> ParseDocumentParams<'_> {
|
||||||
|
ParseDocumentParams {
|
||||||
|
globals: globals.clone(),
|
||||||
|
path: AssetPath::BuiltIn("gui/tab/monado_tab_debug_timings.xml"),
|
||||||
|
extra: Default::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn yesno(n: bool) -> &'static str {
|
fn yesno(n: bool) -> &'static str {
|
||||||
match n {
|
match n {
|
||||||
true => "yes",
|
true => "yes",
|
||||||
|
|
@ -77,29 +265,393 @@ fn yesno(n: bool) -> &'static str {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> TabMonado<T> {
|
const SLIDER_MULTIPLIER: f32 = 100.0;
|
||||||
pub fn new(frontend: &mut Frontend<T>, parent_id: WidgetID) -> anyhow::Result<Self> {
|
|
||||||
let globals = frontend.layout.state.globals.clone();
|
|
||||||
let state = wgui::parser::parse_from_assets(&doc_params(&globals), &mut frontend.layout, parent_id)?;
|
|
||||||
|
|
||||||
let id_list_parent = state.get_widget_id("list_parent")?;
|
impl SubtabGeneralSettings {
|
||||||
|
fn new<T>(
|
||||||
|
parent_id: WidgetID,
|
||||||
|
frontend: &mut Frontend<T>,
|
||||||
|
data: &mut T,
|
||||||
|
tasks: &Tasks<Task>,
|
||||||
|
) -> anyhow::Result<Self> {
|
||||||
|
let state = wgui::parser::parse_from_assets(
|
||||||
|
&doc_params_tab_general_settings(&frontend.globals),
|
||||||
|
&mut frontend.layout,
|
||||||
|
parent_id,
|
||||||
|
)?;
|
||||||
|
|
||||||
let tasks = Tasks::<Task>::new();
|
// get brightness
|
||||||
|
let slider_brightness = state.fetch_component_as::<ComponentSlider>("slider_brightness")?;
|
||||||
|
if let Some(brightness) = frontend.interface.monado_brightness_get(data) {
|
||||||
|
slider_brightness.set_value_primary(&mut frontend.layout.common(), brightness * 100.0);
|
||||||
|
|
||||||
tasks.push(Task::Refresh);
|
slider_brightness.on_value_changed({
|
||||||
|
let tasks = tasks.clone();
|
||||||
|
Box::new(move |_common, e| {
|
||||||
|
tasks.push(Task::SetBrightness(e.value / 100.0));
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let config = frontend.interface.general_config(data);
|
||||||
|
|
||||||
|
let cs_keying = state.fetch_component_as::<ComponentColorSelector>("cs_keying")?;
|
||||||
|
let slider_keying_despill = state.fetch_component_as::<ComponentSlider>("slider_keying_despill")?;
|
||||||
|
let slider_keying_curve = state.fetch_component_as::<ComponentSlider>("slider_keying_curve")?;
|
||||||
|
let slider_keying_hue_range = state.fetch_component_as::<ComponentSlider>("slider_keying_hue_range")?;
|
||||||
|
let slider_keying_saturation_range =
|
||||||
|
state.fetch_component_as::<ComponentSlider>("slider_keying_saturation_range")?;
|
||||||
|
let slider_keying_value_range = state.fetch_component_as::<ComponentSlider>("slider_keying_value_range")?;
|
||||||
|
|
||||||
|
{
|
||||||
|
let mut common = frontend.layout.common();
|
||||||
|
|
||||||
|
// set initial values
|
||||||
|
let (rgb, range_h, range_s, range_v) = config.chroma_key_params.get_rgb_and_hsv_ranges();
|
||||||
|
slider_keying_curve.set_value_primary(&mut common, config.chroma_key_params.curve * SLIDER_MULTIPLIER);
|
||||||
|
slider_keying_despill.set_value_primary(&mut common, config.chroma_key_params.despill * SLIDER_MULTIPLIER);
|
||||||
|
slider_keying_hue_range.set_value_primary(&mut common, range_h * SLIDER_MULTIPLIER);
|
||||||
|
slider_keying_saturation_range.set_value_primary(&mut common, range_s * SLIDER_MULTIPLIER);
|
||||||
|
slider_keying_value_range.set_value_primary(&mut common, range_v * SLIDER_MULTIPLIER);
|
||||||
|
cs_keying.set_color(&mut common, rgb);
|
||||||
|
|
||||||
|
// prepare callbacks
|
||||||
|
fn get_slider_callback(tasks: &Tasks<Task>) -> SliderValueChangedCallback {
|
||||||
|
Box::new({
|
||||||
|
let tasks = tasks.clone();
|
||||||
|
move |_, _| {
|
||||||
|
tasks.push(Task::GeneralSettingsChromaUpdate);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_color_selector_callback(tasks: &Tasks<Task>) -> ColorSelectorChangedCallback {
|
||||||
|
Box::new({
|
||||||
|
let tasks = tasks.clone();
|
||||||
|
move |_, _| {
|
||||||
|
tasks.push(Task::GeneralSettingsChromaUpdate);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
slider_keying_curve.on_value_changed(get_slider_callback(tasks));
|
||||||
|
slider_keying_despill.on_value_changed(get_slider_callback(tasks));
|
||||||
|
slider_keying_hue_range.on_value_changed(get_slider_callback(tasks));
|
||||||
|
slider_keying_saturation_range.on_value_changed(get_slider_callback(tasks));
|
||||||
|
slider_keying_value_range.on_value_changed(get_slider_callback(tasks));
|
||||||
|
cs_keying.on_changed(get_color_selector_callback(tasks));
|
||||||
|
}
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
state,
|
state,
|
||||||
marker: PhantomData,
|
slider_keying_curve,
|
||||||
|
slider_keying_despill,
|
||||||
|
slider_keying_hue_range,
|
||||||
|
slider_keying_saturation_range,
|
||||||
|
slider_keying_value_range,
|
||||||
|
cs_keying,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fn chroma_update(&mut self, config: &mut GeneralConfig) {
|
||||||
|
let val_curve = self.slider_keying_curve.get_value_primary();
|
||||||
|
let val_despill = self.slider_keying_despill.get_value_primary();
|
||||||
|
let val_range_h = self.slider_keying_hue_range.get_value_primary();
|
||||||
|
let val_range_s = self.slider_keying_saturation_range.get_value_primary();
|
||||||
|
let val_range_v = self.slider_keying_value_range.get_value_primary();
|
||||||
|
let val_rgb = self.cs_keying.get_color();
|
||||||
|
|
||||||
|
config.chroma_key_params.despill = val_despill / SLIDER_MULTIPLIER;
|
||||||
|
config.chroma_key_params.curve = val_curve / SLIDER_MULTIPLIER;
|
||||||
|
config.chroma_key_params.update_hsv_range_from_rgb(
|
||||||
|
val_rgb,
|
||||||
|
val_range_h / SLIDER_MULTIPLIER,
|
||||||
|
val_range_s / SLIDER_MULTIPLIER,
|
||||||
|
val_range_v / SLIDER_MULTIPLIER,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn mount_sessions_list(
|
||||||
|
state: &mut ParserState,
|
||||||
|
layout: &mut Layout,
|
||||||
|
tasks: &Tasks<Task>,
|
||||||
|
id_parent: WidgetID,
|
||||||
|
sessions: &SessionsMap,
|
||||||
|
) -> anyhow::Result<DebugSessionList> {
|
||||||
|
let mut buttons = Vec::new();
|
||||||
|
let globals = layout.state.globals.clone();
|
||||||
|
layout.remove_children(id_parent);
|
||||||
|
|
||||||
|
for (session_id, session) in sessions {
|
||||||
|
let mut params = HashMap::new();
|
||||||
|
|
||||||
|
params.insert(
|
||||||
|
Rc::from("text"),
|
||||||
|
Rc::from(format!(
|
||||||
|
"{} (ID {})",
|
||||||
|
session.resolved_name.as_ref().map_or("Unknown", |s| s.as_str()),
|
||||||
|
session_id,
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
|
||||||
|
let data = state.realize_template(
|
||||||
|
&doc_params_tab_debug_timings(&globals),
|
||||||
|
"SessionButton",
|
||||||
|
layout,
|
||||||
|
id_parent,
|
||||||
|
params,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let button = data.fetch_component_as::<ComponentButton>("button")?;
|
||||||
|
|
||||||
|
button.on_click({
|
||||||
|
let tasks = tasks.clone();
|
||||||
|
let session_id = *session_id;
|
||||||
|
Rc::new(move |_, _| {
|
||||||
|
tasks.push(Task::DebugTimingsSetSessionId(session_id));
|
||||||
|
Ok(())
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
buttons.push(button);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(DebugSessionList { buttons })
|
||||||
|
}
|
||||||
|
|
||||||
|
fn mount_graph(
|
||||||
|
state: &mut ParserState,
|
||||||
|
layout: &mut Layout,
|
||||||
|
id_parent: WidgetID,
|
||||||
|
name: &'static str,
|
||||||
|
limits: (f32, f32),
|
||||||
|
) -> anyhow::Result<DebugGraph> {
|
||||||
|
let globals = layout.state.globals.clone();
|
||||||
|
let mut params = HashMap::new();
|
||||||
|
params.insert(Rc::from("name"), Rc::from(name));
|
||||||
|
params.insert(Rc::from("limit_min"), Rc::from(limits.0.to_string()));
|
||||||
|
params.insert(Rc::from("limit_max"), Rc::from(limits.1.to_string()));
|
||||||
|
|
||||||
|
let data = state.realize_template(
|
||||||
|
&doc_params_tab_debug_timings(&globals),
|
||||||
|
"DebugGraph",
|
||||||
|
layout,
|
||||||
|
id_parent,
|
||||||
|
params,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let graph = data.fetch_component_as::<ComponentBarGraph>("graph")?;
|
||||||
|
Ok(DebugGraph { graph })
|
||||||
|
}
|
||||||
|
|
||||||
|
fn ns_to_ms(ns: i64) -> f32 {
|
||||||
|
(ns / 1000) as f32 / 1000.0
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SubtabDebugTimings {
|
||||||
|
fn new<T>(parent_id: WidgetID, frontend: &mut Frontend<T>, tasks: &Tasks<Task>) -> anyhow::Result<Self> {
|
||||||
|
let mut state = wgui::parser::parse_from_assets(
|
||||||
|
&doc_params_tab_debug_timings(&frontend.globals),
|
||||||
|
&mut frontend.layout,
|
||||||
|
parent_id,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let id_timings_parent = state.get_widget_id("timings_parent")?;
|
||||||
|
let id_sessions_list_parent = state.get_widget_id("session_list_parent")?;
|
||||||
|
|
||||||
|
let sessions = Default::default();
|
||||||
|
|
||||||
|
let session_list = mount_sessions_list(
|
||||||
|
&mut state,
|
||||||
|
&mut frontend.layout,
|
||||||
tasks,
|
tasks,
|
||||||
globals,
|
id_sessions_list_parent,
|
||||||
|
&sessions,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
Ok(Self {
|
||||||
|
state,
|
||||||
|
graphs: None,
|
||||||
|
session_list,
|
||||||
|
id_sessions_list_parent,
|
||||||
|
id_timings_parent,
|
||||||
|
sessions,
|
||||||
|
selected_session_id: None,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fn set_session_id(&mut self, layout: &mut Layout, session_id: i64) -> anyhow::Result<()> {
|
||||||
|
layout.remove_children(self.id_timings_parent);
|
||||||
|
|
||||||
|
let mut graph = |name: &'static str, limits: (f32, f32)| -> anyhow::Result<DebugGraph> {
|
||||||
|
mount_graph(&mut self.state, layout, self.id_timings_parent, name, limits)
|
||||||
|
};
|
||||||
|
|
||||||
|
// populate graphs
|
||||||
|
self.graphs = Some(Graphs {
|
||||||
|
predicted_display_time: graph("Predicted display time", (0.0, 30.0))?,
|
||||||
|
predicted_frame_time: graph("Predicted frame time", (0.0, 30.0))?,
|
||||||
|
predicted_wake_up_time: graph("Predicted wake-up time", (0.0, 30.0))?,
|
||||||
|
predicted_gpu_done_time: graph("Predicted GPU done time", (0.0, 30.0))?,
|
||||||
|
predicted_display_period: graph("Predicted display period", (0.0, 30.0))?,
|
||||||
|
display_time: graph("Display time", (0.0, 30.0))?,
|
||||||
|
when_predicted: graph("When predicted", (0.0, 30.0))?,
|
||||||
|
when_wait_woke: graph("When wait woke", (0.0, 30.0))?,
|
||||||
|
when_begin: graph("When begin", (0.0, 30.0))?,
|
||||||
|
when_delivered: graph("When delivered", (0.0, 30.0))?,
|
||||||
|
when_gpu_done: graph("When GPU done", (0.0, 30.0))?,
|
||||||
|
});
|
||||||
|
|
||||||
|
self.selected_session_id = Some(session_id);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn refresh_session_list(&mut self, layout: &mut Layout, tasks: &Tasks<Task>) -> anyhow::Result<()> {
|
||||||
|
self.session_list = mount_sessions_list(
|
||||||
|
&mut self.state,
|
||||||
|
layout,
|
||||||
|
tasks,
|
||||||
|
self.id_sessions_list_parent,
|
||||||
|
&self.sessions,
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn update<T>(&mut self, tasks: &Tasks<Task>, data: &mut T, frontend: &mut Frontend<T>) -> anyhow::Result<()> {
|
||||||
|
if !frontend.interface.monado_metrics_set_enabled(data, true) {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
let frames = frontend.interface.monado_metrics_dump_session_frames(data);
|
||||||
|
if frames.is_empty() {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
let col_green = Color::new(0.0, 1.0, 0.0, 1.0);
|
||||||
|
|
||||||
|
for frame in frames {
|
||||||
|
//log::info!("{:?}", frame);
|
||||||
|
|
||||||
|
match self.sessions.get_mut(&frame.session_id) {
|
||||||
|
Some(session) => {
|
||||||
|
if let Some(graphs) = &mut self.graphs
|
||||||
|
&& let Some(selected_session_id) = self.selected_session_id
|
||||||
|
&& selected_session_id == frame.session_id
|
||||||
|
{
|
||||||
|
let predicted_display_time = ns_to_ms(session.last_frame.predicted_display_time_ns as i64);
|
||||||
|
let predicted_frame_time = ns_to_ms(frame.predicted_frame_time_ns as i64);
|
||||||
|
let predicted_wake_up_time =
|
||||||
|
ns_to_ms(frame.predicted_wake_up_time_ns as i64 - session.last_frame.predicted_wake_up_time_ns as i64);
|
||||||
|
let predicted_gpu_done_time =
|
||||||
|
ns_to_ms(frame.predicted_gpu_done_time_ns as i64 - session.last_frame.predicted_gpu_done_time_ns as i64);
|
||||||
|
let predicted_display_period = ns_to_ms(session.last_frame.predicted_display_period_ns as i64); // 6.944 ms for 144Hz
|
||||||
|
let display_time = ns_to_ms(frame.display_time_ns as i64 - session.last_frame.display_time_ns as i64);
|
||||||
|
let when_predicted = ns_to_ms(frame.when_predicted_ns as i64 - session.last_frame.when_predicted_ns as i64);
|
||||||
|
let when_wait_woke = ns_to_ms(frame.when_wait_woke_ns as i64 - session.last_frame.when_wait_woke_ns as i64);
|
||||||
|
let when_begin = ns_to_ms(frame.when_begin_ns as i64 - session.last_frame.when_begin_ns as i64);
|
||||||
|
let when_delivered = ns_to_ms(frame.when_delivered_ns as i64 - session.last_frame.when_delivered_ns as i64);
|
||||||
|
let when_gpu_done = ns_to_ms(frame.when_gpu_done_ns as i64 - session.last_frame.when_gpu_done_ns as i64);
|
||||||
|
|
||||||
|
graphs.predicted_display_time.graph.push_value(ValueCell {
|
||||||
|
value: predicted_display_time,
|
||||||
|
color: col_green,
|
||||||
|
});
|
||||||
|
|
||||||
|
graphs.predicted_frame_time.graph.push_value(ValueCell {
|
||||||
|
value: predicted_frame_time,
|
||||||
|
color: col_green,
|
||||||
|
});
|
||||||
|
|
||||||
|
graphs.predicted_wake_up_time.graph.push_value(ValueCell {
|
||||||
|
value: predicted_wake_up_time,
|
||||||
|
color: col_green,
|
||||||
|
});
|
||||||
|
|
||||||
|
graphs.predicted_gpu_done_time.graph.push_value(ValueCell {
|
||||||
|
value: predicted_gpu_done_time,
|
||||||
|
color: col_green,
|
||||||
|
});
|
||||||
|
|
||||||
|
graphs.predicted_display_period.graph.push_value(ValueCell {
|
||||||
|
value: predicted_display_period,
|
||||||
|
color: col_green,
|
||||||
|
});
|
||||||
|
|
||||||
|
graphs.display_time.graph.push_value(ValueCell {
|
||||||
|
value: display_time,
|
||||||
|
color: col_green,
|
||||||
|
});
|
||||||
|
|
||||||
|
graphs.when_predicted.graph.push_value(ValueCell {
|
||||||
|
value: when_predicted,
|
||||||
|
color: col_green,
|
||||||
|
});
|
||||||
|
|
||||||
|
graphs.when_wait_woke.graph.push_value(ValueCell {
|
||||||
|
value: when_wait_woke,
|
||||||
|
color: col_green,
|
||||||
|
});
|
||||||
|
|
||||||
|
graphs.when_begin.graph.push_value(ValueCell {
|
||||||
|
value: when_begin,
|
||||||
|
color: col_green,
|
||||||
|
});
|
||||||
|
|
||||||
|
graphs.when_delivered.graph.push_value(ValueCell {
|
||||||
|
value: when_delivered,
|
||||||
|
color: col_green,
|
||||||
|
});
|
||||||
|
|
||||||
|
graphs.when_gpu_done.graph.push_value(ValueCell {
|
||||||
|
value: when_gpu_done,
|
||||||
|
color: col_green,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
session.last_frame = frame;
|
||||||
|
}
|
||||||
|
None => {
|
||||||
|
self.sessions.insert(
|
||||||
|
frame.session_id,
|
||||||
|
TimingsSession {
|
||||||
|
last_frame: frame,
|
||||||
|
resolved_name: None, /* TODO! find client ID from session ID */
|
||||||
|
},
|
||||||
|
);
|
||||||
|
tasks.push(Task::DebugTimingsRefreshSessionList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
frontend.layout.mark_redraw();
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SubtabProcessList {
|
||||||
|
fn new<T>(parent_id: WidgetID, frontend: &mut Frontend<T>) -> anyhow::Result<Self> {
|
||||||
|
let state = wgui::parser::parse_from_assets(
|
||||||
|
&doc_params_tab_process_list(&frontend.globals),
|
||||||
|
&mut frontend.layout,
|
||||||
|
parent_id,
|
||||||
|
)?;
|
||||||
|
let id_list_parent = state.get_widget_id("list_parent")?;
|
||||||
|
|
||||||
|
Ok(Self {
|
||||||
|
state,
|
||||||
id_list_parent,
|
id_list_parent,
|
||||||
ticks: 0,
|
|
||||||
cells: Vec::new(),
|
cells: Vec::new(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mount_client(&mut self, frontend: &mut Frontend<T>, client: &dash_interface::MonadoClient) -> anyhow::Result<()> {
|
fn mount_client(
|
||||||
|
&mut self,
|
||||||
|
layout: &mut Layout,
|
||||||
|
client: &dash_interface::MonadoClient,
|
||||||
|
tasks: &Tasks<Task>,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
let mut par = HashMap::<Rc<str>, Rc<str>>::new();
|
let mut par = HashMap::<Rc<str>, Rc<str>>::new();
|
||||||
par.insert(
|
par.insert(
|
||||||
"checked".into(),
|
"checked".into(),
|
||||||
|
|
@ -109,7 +661,10 @@ impl<T> TabMonado<T> {
|
||||||
Rc::from("0")
|
Rc::from("0")
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
par.insert("name".into(), client.name.clone().into());
|
par.insert(
|
||||||
|
"name".into(),
|
||||||
|
format!("{} (Client ID: {})", client.name, client.id).into(),
|
||||||
|
);
|
||||||
par.insert("flag_active".into(), yesno(client.is_active).into());
|
par.insert("flag_active".into(), yesno(client.is_active).into());
|
||||||
par.insert("flag_focused".into(), yesno(client.is_focused).into());
|
par.insert("flag_focused".into(), yesno(client.is_focused).into());
|
||||||
par.insert("flag_io_active".into(), yesno(client.is_io_active).into());
|
par.insert("flag_io_active".into(), yesno(client.is_io_active).into());
|
||||||
|
|
@ -117,21 +672,23 @@ impl<T> TabMonado<T> {
|
||||||
par.insert("flag_primary".into(), yesno(client.is_primary).into());
|
par.insert("flag_primary".into(), yesno(client.is_primary).into());
|
||||||
par.insert("flag_visible".into(), yesno(client.is_visible).into());
|
par.insert("flag_visible".into(), yesno(client.is_visible).into());
|
||||||
|
|
||||||
let state_cell = self.state.parse_template(
|
let globals = layout.state.globals.clone();
|
||||||
&doc_params(&self.globals),
|
|
||||||
|
let state_cell = self.state.realize_template(
|
||||||
|
&doc_params_tab_process_list(&globals),
|
||||||
"Cell",
|
"Cell",
|
||||||
&mut frontend.layout,
|
layout,
|
||||||
self.id_list_parent,
|
self.id_list_parent,
|
||||||
par,
|
par,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let checkbox = state_cell.fetch_component_as::<ComponentCheckbox>("checkbox")?;
|
let checkbox = state_cell.fetch_component_as::<ComponentCheckbox>("checkbox")?;
|
||||||
checkbox.on_toggle({
|
checkbox.on_toggle({
|
||||||
let tasks = self.tasks.clone();
|
let tasks = tasks.clone();
|
||||||
let client_name = client.name.clone();
|
let client_name = client.name.clone();
|
||||||
Box::new(move |_common, e| {
|
Box::new(move |_common, e| {
|
||||||
if e.checked {
|
if e.checked {
|
||||||
tasks.push(Task::FocusClient(client_name.clone()));
|
tasks.push(Task::ProcessListFocusClient(client_name.clone()));
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
|
|
@ -142,41 +699,63 @@ impl<T> TabMonado<T> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn refresh(&mut self, frontend: &mut Frontend<T>, data: &mut T) -> anyhow::Result<()> {
|
fn focus_client<T>(
|
||||||
|
&mut self,
|
||||||
|
frontend: &mut Frontend<T>,
|
||||||
|
data: &mut T,
|
||||||
|
name: String,
|
||||||
|
tasks: &Tasks<Task>,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
|
frontend.interface.monado_client_focus(data, &name)?;
|
||||||
|
tasks.push(Task::ProcessListRefresh);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn refresh<T>(&mut self, frontend: &mut Frontend<T>, data: &mut T, tasks: &Tasks<Task>) -> anyhow::Result<()> {
|
||||||
log::debug!("refreshing monado client list");
|
log::debug!("refreshing monado client list");
|
||||||
|
|
||||||
let clients = frontend.interface.monado_client_list(data)?;
|
let clients = frontend.interface.monado_client_list(data, true)?;
|
||||||
|
|
||||||
frontend.layout.remove_children(self.id_list_parent);
|
frontend.layout.remove_children(self.id_list_parent);
|
||||||
self.cells.clear();
|
self.cells.clear();
|
||||||
|
|
||||||
for client in clients {
|
for client in clients {
|
||||||
self.mount_client(frontend, &client)?;
|
self.mount_client(&mut frontend.layout, &client, tasks)?;
|
||||||
}
|
|
||||||
|
|
||||||
// get brightness
|
|
||||||
let slider_brightness = self.state.fetch_component_as::<ComponentSlider>("slider_brightness")?;
|
|
||||||
if let Some(brightness) = frontend.interface.monado_brightness_get(data) {
|
|
||||||
let mut c = frontend.layout.start_common();
|
|
||||||
slider_brightness.set_value(&mut c.common(), brightness * 100.0);
|
|
||||||
c.finish()?;
|
|
||||||
|
|
||||||
slider_brightness.on_value_changed({
|
|
||||||
let tasks = self.tasks.clone();
|
|
||||||
Box::new(move |_common, e| {
|
|
||||||
tasks.push(Task::SetBrightness(e.value / 100.0));
|
|
||||||
Ok(())
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn focus_client(&mut self, frontend: &mut Frontend<T>, data: &mut T, name: String) -> anyhow::Result<()> {
|
impl<T> TabMonado<T> {
|
||||||
frontend.interface.monado_client_focus(data, &name)?;
|
pub fn new(frontend: &mut Frontend<T>, parent_id: WidgetID) -> anyhow::Result<Self> {
|
||||||
self.tasks.push(Task::Refresh);
|
let globals = frontend.layout.state.globals.clone();
|
||||||
Ok(())
|
let state = wgui::parser::parse_from_assets(&doc_params_monado(&globals), &mut frontend.layout, parent_id)?;
|
||||||
|
let id_content = state.get_widget_id("content")?;
|
||||||
|
let tabs = state.fetch_component_as::<ComponentTabs>("tabs")?;
|
||||||
|
|
||||||
|
let tasks = Tasks::<Task>::new();
|
||||||
|
|
||||||
|
tabs.on_select({
|
||||||
|
let tasks = tasks.clone();
|
||||||
|
Rc::new(move |_common, evt| {
|
||||||
|
if let Some(tab) = TabNameEnum::from_string(&evt.name) {
|
||||||
|
tasks.push(Task::SetTab(tab));
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
tasks.push(Task::SetTab(TabNameEnum::ProcessList));
|
||||||
|
|
||||||
|
Ok(Self {
|
||||||
|
state,
|
||||||
|
marker: PhantomData,
|
||||||
|
tasks,
|
||||||
|
id_content,
|
||||||
|
ticks: 0,
|
||||||
|
subtab: Subtab::Empty,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_brightness(&mut self, frontend: &mut Frontend<T>, data: &mut T, brightness: f32) {
|
fn set_brightness(&mut self, frontend: &mut Frontend<T>, data: &mut T, brightness: f32) {
|
||||||
|
|
|
||||||
|
|
@ -1,70 +0,0 @@
|
||||||
use std::marker::PhantomData;
|
|
||||||
|
|
||||||
use wgui::{
|
|
||||||
assets::AssetPath,
|
|
||||||
layout::WidgetID,
|
|
||||||
parser::{Fetchable, ParseDocumentParams, ParserState},
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
frontend::Frontend,
|
|
||||||
tab::{Tab, TabType},
|
|
||||||
views::{process_list, window_list},
|
|
||||||
};
|
|
||||||
|
|
||||||
pub struct TabProcesses<T> {
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub state: ParserState,
|
|
||||||
|
|
||||||
view_window_list: window_list::View,
|
|
||||||
view_process_list: process_list::View,
|
|
||||||
marker: PhantomData<T>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T> Tab<T> for TabProcesses<T> {
|
|
||||||
fn get_type(&self) -> TabType {
|
|
||||||
TabType::Games
|
|
||||||
}
|
|
||||||
|
|
||||||
fn update(&mut self, frontend: &mut Frontend<T>, data: &mut T) -> anyhow::Result<()> {
|
|
||||||
self
|
|
||||||
.view_window_list
|
|
||||||
.update(&mut frontend.layout, &mut frontend.interface, data)?;
|
|
||||||
self
|
|
||||||
.view_process_list
|
|
||||||
.update(&mut frontend.layout, &mut frontend.interface, data)?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T> TabProcesses<T> {
|
|
||||||
pub fn new(frontend: &mut Frontend<T>, parent_id: WidgetID) -> anyhow::Result<Self> {
|
|
||||||
let globals = frontend.layout.state.globals.clone();
|
|
||||||
let state = wgui::parser::parse_from_assets(
|
|
||||||
&ParseDocumentParams {
|
|
||||||
globals: globals.clone(),
|
|
||||||
path: AssetPath::BuiltIn("gui/tab/processes.xml"),
|
|
||||||
extra: Default::default(),
|
|
||||||
},
|
|
||||||
&mut frontend.layout,
|
|
||||||
parent_id,
|
|
||||||
)?;
|
|
||||||
|
|
||||||
Ok(Self {
|
|
||||||
view_window_list: window_list::View::new(window_list::Params {
|
|
||||||
layout: &mut frontend.layout,
|
|
||||||
parent_id: state.get_widget_id("window_list_parent")?,
|
|
||||||
globals: globals.clone(),
|
|
||||||
frontend_tasks: frontend.tasks.clone(),
|
|
||||||
on_click: None,
|
|
||||||
})?,
|
|
||||||
view_process_list: process_list::View::new(process_list::Params {
|
|
||||||
layout: &mut frontend.layout,
|
|
||||||
parent_id: state.get_widget_id("process_list_parent")?,
|
|
||||||
globals,
|
|
||||||
})?,
|
|
||||||
state,
|
|
||||||
marker: PhantomData,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,736 +0,0 @@
|
||||||
use std::{collections::HashMap, marker::PhantomData, rc::Rc, str::FromStr};
|
|
||||||
|
|
||||||
use glam::Vec2;
|
|
||||||
use strum::{AsRefStr, EnumProperty, EnumString, VariantArray};
|
|
||||||
use wgui::{
|
|
||||||
assets::AssetPath,
|
|
||||||
components::{button::ComponentButton, checkbox::ComponentCheckbox, slider::ComponentSlider},
|
|
||||||
event::{CallbackDataCommon, EventAlterables},
|
|
||||||
i18n::Translation,
|
|
||||||
layout::{Layout, WidgetID},
|
|
||||||
log::LogErr,
|
|
||||||
parser::{Fetchable, ParseDocumentParams, ParserState},
|
|
||||||
task::Tasks,
|
|
||||||
widget::label::WidgetLabel,
|
|
||||||
windowing::context_menu::{self, Blueprint, ContextMenu, TickResult},
|
|
||||||
};
|
|
||||||
use wlx_common::{config::GeneralConfig, config_io::ConfigRoot};
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
frontend::{Frontend, FrontendTask},
|
|
||||||
tab::{Tab, TabType},
|
|
||||||
};
|
|
||||||
|
|
||||||
enum Task {
|
|
||||||
UpdateBool(SettingType, bool),
|
|
||||||
UpdateFloat(SettingType, f32),
|
|
||||||
UpdateInt(SettingType, i32),
|
|
||||||
OpenContextMenu(Vec2, Vec<context_menu::Cell>),
|
|
||||||
ClearPipewireTokens,
|
|
||||||
ClearSavedState,
|
|
||||||
DeleteAllConfigs,
|
|
||||||
RestartSoftware,
|
|
||||||
RemoveAutostartApp(Rc<str>),
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct TabSettings<T> {
|
|
||||||
pub state: ParserState,
|
|
||||||
|
|
||||||
app_button_ids: Vec<Rc<str>>,
|
|
||||||
context_menu: ContextMenu,
|
|
||||||
|
|
||||||
tasks: Tasks<Task>,
|
|
||||||
marker: PhantomData<T>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T> Tab<T> for TabSettings<T> {
|
|
||||||
fn get_type(&self) -> TabType {
|
|
||||||
TabType::Settings
|
|
||||||
}
|
|
||||||
|
|
||||||
fn update(&mut self, frontend: &mut Frontend<T>, data: &mut T) -> anyhow::Result<()> {
|
|
||||||
let config = frontend.interface.general_config(data);
|
|
||||||
let mut changed = false;
|
|
||||||
for task in self.tasks.drain() {
|
|
||||||
match task {
|
|
||||||
Task::UpdateBool(setting, n) => {
|
|
||||||
setting.get_frontend_task().map(|task| frontend.tasks.push(task));
|
|
||||||
*setting.mut_bool(config) = n;
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
Task::UpdateFloat(setting, n) => {
|
|
||||||
setting.get_frontend_task().map(|task| frontend.tasks.push(task));
|
|
||||||
*setting.mut_f32(config) = n;
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
Task::UpdateInt(setting, n) => {
|
|
||||||
setting.get_frontend_task().map(|task| frontend.tasks.push(task));
|
|
||||||
*setting.mut_i32(config) = n;
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
Task::ClearPipewireTokens => {
|
|
||||||
let _ = std::fs::remove_file(ConfigRoot::Generic.get_conf_d_path().join("pw_tokens.yaml"))
|
|
||||||
.log_err("Could not remove pw_tokens.yaml");
|
|
||||||
}
|
|
||||||
Task::ClearSavedState => {
|
|
||||||
let _ = std::fs::remove_file(ConfigRoot::Generic.get_conf_d_path().join("zz-saved-state.json5"))
|
|
||||||
.log_err("Could not remove zz-saved-state.json5");
|
|
||||||
}
|
|
||||||
Task::DeleteAllConfigs => {
|
|
||||||
let path = ConfigRoot::Generic.get_conf_d_path();
|
|
||||||
std::fs::remove_dir_all(&path)?;
|
|
||||||
std::fs::create_dir(&path)?;
|
|
||||||
}
|
|
||||||
Task::RestartSoftware => {
|
|
||||||
frontend.interface.restart(data);
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
Task::OpenContextMenu(position, cells) => {
|
|
||||||
self.context_menu.open(context_menu::OpenParams {
|
|
||||||
on_custom_attribs: None,
|
|
||||||
position,
|
|
||||||
blueprint: Blueprint::Cells(cells),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Task::RemoveAutostartApp(button_id) => {
|
|
||||||
if let (Some(idx), Ok(widget)) = (
|
|
||||||
self.app_button_ids.iter().position(|x| button_id.eq(x)),
|
|
||||||
self.state.get_widget_id(&format!("{button_id}_root")),
|
|
||||||
) {
|
|
||||||
self.app_button_ids.remove(idx);
|
|
||||||
config.autostart_apps.remove(idx);
|
|
||||||
frontend.layout.remove_widget(widget);
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dropdown handling
|
|
||||||
if let TickResult::Action(name) = self.context_menu.tick(&mut frontend.layout, &mut self.state)? {
|
|
||||||
if let (Some(setting), Some(id), Some(value), Some(text), Some(translated)) = {
|
|
||||||
let mut s = name.splitn(5, ';');
|
|
||||||
(s.next(), s.next(), s.next(), s.next(), s.next())
|
|
||||||
} {
|
|
||||||
let mut label = self
|
|
||||||
.state
|
|
||||||
.fetch_widget_as::<WidgetLabel>(&frontend.layout.state, &format!("{id}_value"))?;
|
|
||||||
|
|
||||||
let mut alterables = EventAlterables::default();
|
|
||||||
let mut common = CallbackDataCommon {
|
|
||||||
alterables: &mut alterables,
|
|
||||||
state: &frontend.layout.state,
|
|
||||||
};
|
|
||||||
|
|
||||||
let translation = Translation {
|
|
||||||
text: text.into(),
|
|
||||||
translated: translated == "1",
|
|
||||||
};
|
|
||||||
|
|
||||||
label.set_text(&mut common, translation);
|
|
||||||
|
|
||||||
let setting = SettingType::from_str(setting).expect("Invalid Enum string");
|
|
||||||
setting.set_enum(config, value);
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Notify overlays of the change
|
|
||||||
if changed {
|
|
||||||
frontend.interface.config_changed(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(clippy::enum_variant_names)]
|
|
||||||
#[derive(Clone, Copy, AsRefStr, EnumString)]
|
|
||||||
enum SettingType {
|
|
||||||
AnimationSpeed,
|
|
||||||
RoundMultiplier,
|
|
||||||
InvertScrollDirectionX,
|
|
||||||
InvertScrollDirectionY,
|
|
||||||
ScrollSpeed,
|
|
||||||
LongPressDuration,
|
|
||||||
NotificationsEnabled,
|
|
||||||
NotificationsSoundEnabled,
|
|
||||||
KeyboardSoundEnabled,
|
|
||||||
UprightScreenFix,
|
|
||||||
DoubleCursorFix,
|
|
||||||
SetsOnWatch,
|
|
||||||
HideGrabHelp,
|
|
||||||
XrClickSensitivity,
|
|
||||||
XrClickSensitivityRelease,
|
|
||||||
AllowSliding,
|
|
||||||
ClickFreezeTimeMs,
|
|
||||||
FocusFollowsMouseMode,
|
|
||||||
LeftHandedMouse,
|
|
||||||
BlockGameInput,
|
|
||||||
BlockGameInputIgnoreWatch,
|
|
||||||
SpaceDragMultiplier,
|
|
||||||
UseSkybox,
|
|
||||||
UsePassthrough,
|
|
||||||
ScreenRenderDown,
|
|
||||||
PointerLerpFactor,
|
|
||||||
SpaceDragUnlocked,
|
|
||||||
SpaceRotateUnlocked,
|
|
||||||
Clock12h,
|
|
||||||
HideUsername,
|
|
||||||
OpaqueBackground,
|
|
||||||
XwaylandByDefault,
|
|
||||||
CaptureMethod,
|
|
||||||
KeyboardMiddleClick,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl SettingType {
|
|
||||||
pub fn mut_bool<'a>(self, config: &'a mut GeneralConfig) -> &'a mut bool {
|
|
||||||
match self {
|
|
||||||
Self::InvertScrollDirectionX => &mut config.invert_scroll_direction_x,
|
|
||||||
Self::InvertScrollDirectionY => &mut config.invert_scroll_direction_y,
|
|
||||||
Self::NotificationsEnabled => &mut config.notifications_enabled,
|
|
||||||
Self::NotificationsSoundEnabled => &mut config.notifications_sound_enabled,
|
|
||||||
Self::KeyboardSoundEnabled => &mut config.keyboard_sound_enabled,
|
|
||||||
Self::UprightScreenFix => &mut config.upright_screen_fix,
|
|
||||||
Self::DoubleCursorFix => &mut config.double_cursor_fix,
|
|
||||||
Self::SetsOnWatch => &mut config.sets_on_watch,
|
|
||||||
Self::HideGrabHelp => &mut config.hide_grab_help,
|
|
||||||
Self::AllowSliding => &mut config.allow_sliding,
|
|
||||||
Self::FocusFollowsMouseMode => &mut config.focus_follows_mouse_mode,
|
|
||||||
Self::LeftHandedMouse => &mut config.left_handed_mouse,
|
|
||||||
Self::BlockGameInput => &mut config.block_game_input,
|
|
||||||
Self::BlockGameInputIgnoreWatch => &mut config.block_game_input_ignore_watch,
|
|
||||||
Self::UseSkybox => &mut config.use_skybox,
|
|
||||||
Self::UsePassthrough => &mut config.use_passthrough,
|
|
||||||
Self::ScreenRenderDown => &mut config.screen_render_down,
|
|
||||||
Self::SpaceDragUnlocked => &mut config.space_drag_unlocked,
|
|
||||||
Self::SpaceRotateUnlocked => &mut config.space_rotate_unlocked,
|
|
||||||
Self::Clock12h => &mut config.clock_12h,
|
|
||||||
Self::HideUsername => &mut config.hide_username,
|
|
||||||
Self::OpaqueBackground => &mut config.opaque_background,
|
|
||||||
Self::XwaylandByDefault => &mut config.xwayland_by_default,
|
|
||||||
_ => panic!("Requested bool for non-bool SettingType"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn mut_f32<'a>(self, config: &'a mut GeneralConfig) -> &'a mut f32 {
|
|
||||||
match self {
|
|
||||||
Self::AnimationSpeed => &mut config.animation_speed,
|
|
||||||
Self::RoundMultiplier => &mut config.round_multiplier,
|
|
||||||
Self::ScrollSpeed => &mut config.scroll_speed,
|
|
||||||
Self::LongPressDuration => &mut config.long_press_duration,
|
|
||||||
Self::XrClickSensitivity => &mut config.xr_click_sensitivity,
|
|
||||||
Self::XrClickSensitivityRelease => &mut config.xr_click_sensitivity_release,
|
|
||||||
Self::SpaceDragMultiplier => &mut config.space_drag_multiplier,
|
|
||||||
Self::PointerLerpFactor => &mut config.pointer_lerp_factor,
|
|
||||||
_ => panic!("Requested f32 for non-f32 SettingType"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn mut_i32<'a>(self, config: &'a mut GeneralConfig) -> &'a mut i32 {
|
|
||||||
match self {
|
|
||||||
Self::ClickFreezeTimeMs => &mut config.click_freeze_time_ms,
|
|
||||||
_ => panic!("Requested i32 for non-i32 SettingType"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn set_enum<'a>(self, config: &'a mut GeneralConfig, value: &str) {
|
|
||||||
match self {
|
|
||||||
Self::CaptureMethod => {
|
|
||||||
config.capture_method = wlx_common::config::CaptureMethod::from_str(value).expect("Invalid enum value!")
|
|
||||||
}
|
|
||||||
Self::KeyboardMiddleClick => {
|
|
||||||
config.keyboard_middle_click_mode =
|
|
||||||
wlx_common::config::AltModifier::from_str(value).expect("Invalid enum value!")
|
|
||||||
}
|
|
||||||
_ => panic!("Requested enum for non-enum SettingType"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_enum_title<'a>(self, config: &'a mut GeneralConfig) -> Translation {
|
|
||||||
match self {
|
|
||||||
Self::CaptureMethod => Self::get_enum_title_inner(config.capture_method),
|
|
||||||
Self::KeyboardMiddleClick => Self::get_enum_title_inner(config.keyboard_middle_click_mode),
|
|
||||||
_ => panic!("Requested enum for non-enum SettingType"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_enum_title_inner<E>(value: E) -> Translation
|
|
||||||
where
|
|
||||||
E: EnumProperty + AsRef<str>,
|
|
||||||
{
|
|
||||||
value
|
|
||||||
.get_str("Translation")
|
|
||||||
.map(|x| Translation::from_translation_key(x))
|
|
||||||
.or_else(|| value.get_str("Text").map(|x| Translation::from_raw_text(x)))
|
|
||||||
.unwrap_or_else(|| Translation::from_raw_text(value.as_ref()))
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_enum_tooltip_inner<E>(value: E) -> Option<Translation>
|
|
||||||
where
|
|
||||||
E: EnumProperty + AsRef<str>,
|
|
||||||
{
|
|
||||||
value.get_str("Tooltip").map(|x| Translation::from_translation_key(x))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Ok is translation, Err is raw text
|
|
||||||
fn get_translation(self) -> Result<&'static str, &'static str> {
|
|
||||||
match self {
|
|
||||||
Self::AnimationSpeed => Ok("APP_SETTINGS.ANIMATION_SPEED"),
|
|
||||||
Self::RoundMultiplier => Ok("APP_SETTINGS.ROUND_MULTIPLIER"),
|
|
||||||
Self::InvertScrollDirectionX => Ok("APP_SETTINGS.INVERT_SCROLL_DIRECTION_X"),
|
|
||||||
Self::InvertScrollDirectionY => Ok("APP_SETTINGS.INVERT_SCROLL_DIRECTION_Y"),
|
|
||||||
Self::ScrollSpeed => Ok("APP_SETTINGS.SCROLL_SPEED"),
|
|
||||||
Self::LongPressDuration => Ok("APP_SETTINGS.LONG_PRESS_DURATION"),
|
|
||||||
Self::NotificationsEnabled => Ok("APP_SETTINGS.NOTIFICATIONS_ENABLED"),
|
|
||||||
Self::NotificationsSoundEnabled => Ok("APP_SETTINGS.NOTIFICATIONS_SOUND_ENABLED"),
|
|
||||||
Self::KeyboardSoundEnabled => Ok("APP_SETTINGS.KEYBOARD_SOUND_ENABLED"),
|
|
||||||
Self::UprightScreenFix => Ok("APP_SETTINGS.UPRIGHT_SCREEN_FIX"),
|
|
||||||
Self::DoubleCursorFix => Ok("APP_SETTINGS.DOUBLE_CURSOR_FIX"),
|
|
||||||
Self::SetsOnWatch => Ok("APP_SETTINGS.SETS_ON_WATCH"),
|
|
||||||
Self::HideGrabHelp => Ok("APP_SETTINGS.HIDE_GRAB_HELP"),
|
|
||||||
Self::XrClickSensitivity => Ok("APP_SETTINGS.XR_CLICK_SENSITIVITY"),
|
|
||||||
Self::XrClickSensitivityRelease => Ok("APP_SETTINGS.XR_CLICK_SENSITIVITY_RELEASE"),
|
|
||||||
Self::AllowSliding => Ok("APP_SETTINGS.ALLOW_SLIDING"),
|
|
||||||
Self::ClickFreezeTimeMs => Ok("APP_SETTINGS.CLICK_FREEZE_TIME_MS"),
|
|
||||||
Self::FocusFollowsMouseMode => Ok("APP_SETTINGS.FOCUS_FOLLOWS_MOUSE_MODE"),
|
|
||||||
Self::LeftHandedMouse => Ok("APP_SETTINGS.LEFT_HANDED_MOUSE"),
|
|
||||||
Self::BlockGameInput => Ok("APP_SETTINGS.BLOCK_GAME_INPUT"),
|
|
||||||
Self::BlockGameInputIgnoreWatch => Ok("APP_SETTINGS.BLOCK_GAME_INPUT_IGNORE_WATCH"),
|
|
||||||
Self::SpaceDragMultiplier => Ok("APP_SETTINGS.SPACE_DRAG_MULTIPLIER"),
|
|
||||||
Self::UseSkybox => Ok("APP_SETTINGS.USE_SKYBOX"),
|
|
||||||
Self::UsePassthrough => Ok("APP_SETTINGS.USE_PASSTHROUGH"),
|
|
||||||
Self::ScreenRenderDown => Ok("APP_SETTINGS.SCREEN_RENDER_DOWN"),
|
|
||||||
Self::PointerLerpFactor => Ok("APP_SETTINGS.POINTER_LERP_FACTOR"),
|
|
||||||
Self::SpaceDragUnlocked => Ok("APP_SETTINGS.SPACE_DRAG_UNLOCKED"),
|
|
||||||
Self::SpaceRotateUnlocked => Ok("APP_SETTINGS.SPACE_ROTATE_UNLOCKED"),
|
|
||||||
Self::Clock12h => Ok("APP_SETTINGS.CLOCK_12H"),
|
|
||||||
Self::HideUsername => Ok("APP_SETTINGS.HIDE_USERNAME"),
|
|
||||||
Self::OpaqueBackground => Ok("APP_SETTINGS.OPAQUE_BACKGROUND"),
|
|
||||||
Self::XwaylandByDefault => Ok("APP_SETTINGS.XWAYLAND_BY_DEFAULT"),
|
|
||||||
Self::CaptureMethod => Ok("APP_SETTINGS.CAPTURE_METHOD"),
|
|
||||||
Self::KeyboardMiddleClick => Ok("APP_SETTINGS.KEYBOARD_MIDDLE_CLICK"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_tooltip(self) -> Option<&'static str> {
|
|
||||||
match self {
|
|
||||||
Self::UprightScreenFix => Some("APP_SETTINGS.UPRIGHT_SCREEN_FIX_HELP"),
|
|
||||||
Self::DoubleCursorFix => Some("APP_SETTINGS.DOUBLE_CURSOR_FIX_HELP"),
|
|
||||||
Self::XrClickSensitivity => Some("APP_SETTINGS.XR_CLICK_SENSITIVITY_HELP"),
|
|
||||||
Self::XrClickSensitivityRelease => Some("APP_SETTINGS.XR_CLICK_SENSITIVITY_RELEASE_HELP"),
|
|
||||||
Self::FocusFollowsMouseMode => Some("APP_SETTINGS.FOCUS_FOLLOWS_MOUSE_MODE_HELP"),
|
|
||||||
Self::LeftHandedMouse => Some("APP_SETTINGS.LEFT_HANDED_MOUSE_HELP"),
|
|
||||||
Self::BlockGameInput => Some("APP_SETTINGS.BLOCK_GAME_INPUT_HELP"),
|
|
||||||
Self::BlockGameInputIgnoreWatch => Some("APP_SETTINGS.BLOCK_GAME_INPUT_IGNORE_WATCH_HELP"),
|
|
||||||
Self::UseSkybox => Some("APP_SETTINGS.USE_SKYBOX_HELP"),
|
|
||||||
Self::UsePassthrough => Some("APP_SETTINGS.USE_PASSTHROUGH_HELP"),
|
|
||||||
Self::ScreenRenderDown => Some("APP_SETTINGS.SCREEN_RENDER_DOWN_HELP"),
|
|
||||||
Self::CaptureMethod => Some("APP_SETTINGS.CAPTURE_METHOD_HELP"),
|
|
||||||
Self::KeyboardMiddleClick => Some("APP_SETTINGS.KEYBOARD_MIDDLE_CLICK_HELP"),
|
|
||||||
_ => None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: incorporate this
|
|
||||||
fn requires_restart(self) -> bool {
|
|
||||||
match self {
|
|
||||||
Self::AnimationSpeed
|
|
||||||
| Self::RoundMultiplier
|
|
||||||
| Self::UprightScreenFix
|
|
||||||
| Self::DoubleCursorFix
|
|
||||||
| Self::SetsOnWatch
|
|
||||||
| Self::UseSkybox
|
|
||||||
| Self::UsePassthrough
|
|
||||||
| Self::ScreenRenderDown => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_frontend_task(self) -> Option<FrontendTask> {
|
|
||||||
match self {
|
|
||||||
Self::Clock12h => Some(FrontendTask::RefreshClock),
|
|
||||||
Self::OpaqueBackground => Some(FrontendTask::RefreshBackground),
|
|
||||||
_ => None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! category {
|
|
||||||
($pe:expr, $root:expr, $translation:expr, $icon:expr) => {{
|
|
||||||
let id = $pe.idx.to_string();
|
|
||||||
$pe.idx += 1;
|
|
||||||
|
|
||||||
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
|
||||||
params.insert(Rc::from("translation"), Rc::from($translation));
|
|
||||||
params.insert(Rc::from("icon"), Rc::from($icon));
|
|
||||||
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
|
||||||
|
|
||||||
$pe
|
|
||||||
.parser_state
|
|
||||||
.instantiate_template($pe.doc_params, "SettingsGroupBox", $pe.layout, $root, params)?;
|
|
||||||
|
|
||||||
$pe.parser_state.get_widget_id(&id)
|
|
||||||
}};
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! checkbox {
|
|
||||||
($mp:expr, $root:expr, $setting:expr) => {
|
|
||||||
let id = $mp.idx.to_string();
|
|
||||||
$mp.idx += 1;
|
|
||||||
|
|
||||||
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
|
||||||
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
|
||||||
|
|
||||||
match $setting.get_translation() {
|
|
||||||
Ok(translation) => params.insert(Rc::from("translation"), translation.into()),
|
|
||||||
Err(raw_text) => params.insert(Rc::from("text"), raw_text.into()),
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Some(tooltip) = $setting.get_tooltip() {
|
|
||||||
params.insert(Rc::from("tooltip"), Rc::from(tooltip));
|
|
||||||
}
|
|
||||||
|
|
||||||
let checked = if *$setting.mut_bool($mp.config) { "1" } else { "0" };
|
|
||||||
params.insert(Rc::from("checked"), Rc::from(checked));
|
|
||||||
|
|
||||||
$mp
|
|
||||||
.parser_state
|
|
||||||
.instantiate_template($mp.doc_params, "CheckBoxSetting", $mp.layout, $root, params)?;
|
|
||||||
|
|
||||||
let checkbox = $mp.parser_state.fetch_component_as::<ComponentCheckbox>(&id)?;
|
|
||||||
checkbox.on_toggle(Box::new({
|
|
||||||
let tasks = $mp.tasks.clone();
|
|
||||||
move |_common, e| {
|
|
||||||
tasks.push(Task::UpdateBool($setting, e.checked));
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! slider_f32 {
|
|
||||||
($mp:expr, $root:expr, $setting:expr, $min:expr, $max:expr, $step:expr) => {
|
|
||||||
let id = $mp.idx.to_string();
|
|
||||||
$mp.idx += 1;
|
|
||||||
|
|
||||||
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
|
||||||
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
|
||||||
|
|
||||||
match $setting.get_translation() {
|
|
||||||
Ok(translation) => params.insert(Rc::from("translation"), translation.into()),
|
|
||||||
Err(raw_text) => params.insert(Rc::from("text"), raw_text.into()),
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Some(tooltip) = $setting.get_tooltip() {
|
|
||||||
params.insert(Rc::from("tooltip"), Rc::from(tooltip));
|
|
||||||
}
|
|
||||||
|
|
||||||
let value = $setting.mut_f32($mp.config).to_string();
|
|
||||||
params.insert(Rc::from("value"), Rc::from(value));
|
|
||||||
params.insert(Rc::from("min"), Rc::from($min.to_string()));
|
|
||||||
params.insert(Rc::from("max"), Rc::from($max.to_string()));
|
|
||||||
params.insert(Rc::from("step"), Rc::from($step.to_string()));
|
|
||||||
|
|
||||||
$mp
|
|
||||||
.parser_state
|
|
||||||
.instantiate_template($mp.doc_params, "SliderSetting", $mp.layout, $root, params)?;
|
|
||||||
|
|
||||||
let slider = $mp.parser_state.fetch_component_as::<ComponentSlider>(&id)?;
|
|
||||||
slider.on_value_changed(Box::new({
|
|
||||||
let tasks = $mp.tasks.clone();
|
|
||||||
move |_common, e| {
|
|
||||||
tasks.push(Task::UpdateFloat($setting, e.value));
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! slider_i32 {
|
|
||||||
($mp:expr, $root:expr, $setting:expr, $min:expr, $max:expr, $step:expr) => {
|
|
||||||
let id = $mp.idx.to_string();
|
|
||||||
$mp.idx += 1;
|
|
||||||
|
|
||||||
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
|
||||||
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
|
||||||
|
|
||||||
match $setting.get_translation() {
|
|
||||||
Ok(translation) => params.insert(Rc::from("translation"), translation.into()),
|
|
||||||
Err(raw_text) => params.insert(Rc::from("text"), raw_text.into()),
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Some(tooltip) = $setting.get_tooltip() {
|
|
||||||
params.insert(Rc::from("tooltip"), Rc::from(tooltip));
|
|
||||||
}
|
|
||||||
|
|
||||||
let value = $setting.mut_i32($mp.config).to_string();
|
|
||||||
params.insert(Rc::from("value"), Rc::from(value));
|
|
||||||
params.insert(Rc::from("min"), Rc::from($min.to_string()));
|
|
||||||
params.insert(Rc::from("max"), Rc::from($max.to_string()));
|
|
||||||
params.insert(Rc::from("step"), Rc::from($step.to_string()));
|
|
||||||
|
|
||||||
$mp
|
|
||||||
.parser_state
|
|
||||||
.instantiate_template($mp.doc_params, "SliderSetting", $mp.layout, $root, params)?;
|
|
||||||
|
|
||||||
let slider = $mp.parser_state.fetch_component_as::<ComponentSlider>(&id)?;
|
|
||||||
slider.on_value_changed(Box::new({
|
|
||||||
let tasks = $mp.tasks.clone();
|
|
||||||
move |_common, e| {
|
|
||||||
tasks.push(Task::UpdateInt($setting, e.value as i32));
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! dropdown {
|
|
||||||
($mp:expr, $root:expr, $setting:expr, $options:expr) => {
|
|
||||||
let id = $mp.idx.to_string();
|
|
||||||
$mp.idx += 1;
|
|
||||||
|
|
||||||
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
|
||||||
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
|
||||||
|
|
||||||
match $setting.get_translation() {
|
|
||||||
Ok(translation) => params.insert(Rc::from("translation"), translation.into()),
|
|
||||||
Err(raw_text) => params.insert(Rc::from("text"), raw_text.into()),
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Some(tooltip) = $setting.get_tooltip() {
|
|
||||||
params.insert(Rc::from("tooltip"), Rc::from(tooltip));
|
|
||||||
}
|
|
||||||
|
|
||||||
$mp
|
|
||||||
.parser_state
|
|
||||||
.instantiate_template($mp.doc_params, "DropdownButton", $mp.layout, $root, params)?;
|
|
||||||
|
|
||||||
let setting_str = $setting.as_ref();
|
|
||||||
let title = $setting.get_enum_title($mp.config);
|
|
||||||
|
|
||||||
{
|
|
||||||
let mut label = $mp
|
|
||||||
.parser_state
|
|
||||||
.fetch_widget_as::<WidgetLabel>(&$mp.layout.state, &format!("{id}_value"))?;
|
|
||||||
label.set_text_simple(&mut $mp.layout.state.globals.get(), title);
|
|
||||||
}
|
|
||||||
|
|
||||||
let btn = $mp.parser_state.fetch_component_as::<ComponentButton>(&id)?;
|
|
||||||
btn.on_click(Box::new({
|
|
||||||
let tasks = $mp.tasks.clone();
|
|
||||||
move |_common, e| {
|
|
||||||
tasks.push(Task::OpenContextMenu(
|
|
||||||
e.mouse_pos_absolute.unwrap_or_default(),
|
|
||||||
$options
|
|
||||||
.iter()
|
|
||||||
.filter_map(|item| {
|
|
||||||
if item.get_bool("Hidden").unwrap_or(false) {
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
|
|
||||||
let value = item.as_ref();
|
|
||||||
let title = SettingType::get_enum_title_inner(*item);
|
|
||||||
let tooltip = SettingType::get_enum_tooltip_inner(*item);
|
|
||||||
|
|
||||||
let text = &title.text;
|
|
||||||
let translated = if title.translated { "1" } else { "0" };
|
|
||||||
|
|
||||||
Some(context_menu::Cell {
|
|
||||||
action_name: Some(format!("{setting_str};{id};{value};{text};{translated}").into()),
|
|
||||||
title,
|
|
||||||
tooltip,
|
|
||||||
attribs: vec![],
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.collect(),
|
|
||||||
));
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! danger_button {
|
|
||||||
($mp:expr, $root:expr, $translation:expr, $icon:expr, $task:expr) => {
|
|
||||||
let id = $mp.idx.to_string();
|
|
||||||
$mp.idx += 1;
|
|
||||||
|
|
||||||
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
|
||||||
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
|
||||||
params.insert(Rc::from("translation"), Rc::from($translation));
|
|
||||||
params.insert(Rc::from("icon"), Rc::from($icon));
|
|
||||||
|
|
||||||
$mp
|
|
||||||
.parser_state
|
|
||||||
.instantiate_template($mp.doc_params, "DangerButton", $mp.layout, $root, params)?;
|
|
||||||
|
|
||||||
let btn = $mp.parser_state.fetch_component_as::<ComponentButton>(&id)?;
|
|
||||||
btn.on_click(Box::new({
|
|
||||||
let tasks = $mp.tasks.clone();
|
|
||||||
move |_common, _e| {
|
|
||||||
tasks.push($task);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! autostart_app {
|
|
||||||
($mp:expr, $root:expr, $text:expr, $ids:expr) => {
|
|
||||||
let id = $mp.idx.to_string();
|
|
||||||
$mp.idx += 1;
|
|
||||||
|
|
||||||
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
|
||||||
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
|
||||||
params.insert(Rc::from("text"), Rc::from($text.as_str()));
|
|
||||||
|
|
||||||
$mp
|
|
||||||
.parser_state
|
|
||||||
.instantiate_template($mp.doc_params, "AutostartApp", $mp.layout, $root, params)?;
|
|
||||||
|
|
||||||
let btn = $mp.parser_state.fetch_component_as::<ComponentButton>(&id)?;
|
|
||||||
let id: Rc<str> = Rc::from(id);
|
|
||||||
|
|
||||||
$ids.push(id.clone());
|
|
||||||
|
|
||||||
btn.on_click(Box::new({
|
|
||||||
let tasks = $mp.tasks.clone();
|
|
||||||
move |_common, _e| {
|
|
||||||
tasks.push(Task::RemoveAutostartApp(id.clone()));
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
struct MacroParams<'a> {
|
|
||||||
layout: &'a mut Layout,
|
|
||||||
parser_state: &'a mut ParserState,
|
|
||||||
doc_params: &'a ParseDocumentParams<'a>,
|
|
||||||
config: &'a mut GeneralConfig,
|
|
||||||
tasks: Tasks<Task>,
|
|
||||||
idx: usize,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T> TabSettings<T> {
|
|
||||||
pub fn new(frontend: &mut Frontend<T>, parent_id: WidgetID, data: &mut T) -> anyhow::Result<Self> {
|
|
||||||
let doc_params = ParseDocumentParams {
|
|
||||||
globals: frontend.layout.state.globals.clone(),
|
|
||||||
path: AssetPath::BuiltIn("gui/tab/settings.xml"),
|
|
||||||
extra: Default::default(),
|
|
||||||
};
|
|
||||||
let mut parser_state = wgui::parser::parse_from_assets(&doc_params, &mut frontend.layout, parent_id)?;
|
|
||||||
|
|
||||||
let root = parser_state.get_widget_id("settings_root")?;
|
|
||||||
|
|
||||||
let mut mp = MacroParams {
|
|
||||||
layout: &mut frontend.layout,
|
|
||||||
parser_state: &mut parser_state,
|
|
||||||
doc_params: &doc_params,
|
|
||||||
config: frontend.interface.general_config(data),
|
|
||||||
tasks: Tasks::default(),
|
|
||||||
idx: 9001,
|
|
||||||
};
|
|
||||||
|
|
||||||
let c = category!(mp, root, "APP_SETTINGS.LOOK_AND_FEEL", "dashboard/palette.svg")?;
|
|
||||||
checkbox!(mp, c, SettingType::OpaqueBackground);
|
|
||||||
checkbox!(mp, c, SettingType::HideUsername);
|
|
||||||
checkbox!(mp, c, SettingType::HideGrabHelp);
|
|
||||||
slider_f32!(mp, c, SettingType::AnimationSpeed, 0.5, 5.0, 0.1); // min, max, step
|
|
||||||
slider_f32!(mp, c, SettingType::RoundMultiplier, 0.5, 5.0, 0.1);
|
|
||||||
checkbox!(mp, c, SettingType::SetsOnWatch);
|
|
||||||
checkbox!(mp, c, SettingType::UseSkybox);
|
|
||||||
checkbox!(mp, c, SettingType::UsePassthrough);
|
|
||||||
checkbox!(mp, c, SettingType::Clock12h);
|
|
||||||
|
|
||||||
let c = category!(mp, root, "APP_SETTINGS.FEATURES", "dashboard/options.svg")?;
|
|
||||||
checkbox!(mp, c, SettingType::NotificationsEnabled);
|
|
||||||
checkbox!(mp, c, SettingType::NotificationsSoundEnabled);
|
|
||||||
checkbox!(mp, c, SettingType::KeyboardSoundEnabled);
|
|
||||||
checkbox!(mp, c, SettingType::SpaceDragUnlocked);
|
|
||||||
checkbox!(mp, c, SettingType::SpaceRotateUnlocked);
|
|
||||||
slider_f32!(mp, c, SettingType::SpaceDragMultiplier, -10.0, 10.0, 0.5);
|
|
||||||
checkbox!(mp, c, SettingType::BlockGameInput);
|
|
||||||
checkbox!(mp, c, SettingType::BlockGameInputIgnoreWatch);
|
|
||||||
|
|
||||||
let c = category!(mp, root, "APP_SETTINGS.CONTROLS", "dashboard/controller.svg")?;
|
|
||||||
dropdown!(
|
|
||||||
mp,
|
|
||||||
c,
|
|
||||||
SettingType::KeyboardMiddleClick,
|
|
||||||
wlx_common::config::AltModifier::VARIANTS
|
|
||||||
);
|
|
||||||
checkbox!(mp, c, SettingType::FocusFollowsMouseMode);
|
|
||||||
checkbox!(mp, c, SettingType::LeftHandedMouse);
|
|
||||||
checkbox!(mp, c, SettingType::AllowSliding);
|
|
||||||
checkbox!(mp, c, SettingType::InvertScrollDirectionX);
|
|
||||||
checkbox!(mp, c, SettingType::InvertScrollDirectionY);
|
|
||||||
slider_f32!(mp, c, SettingType::ScrollSpeed, 0.1, 5.0, 0.1);
|
|
||||||
slider_f32!(mp, c, SettingType::LongPressDuration, 0.1, 2.0, 0.1);
|
|
||||||
slider_f32!(mp, c, SettingType::PointerLerpFactor, 0.1, 1.0, 0.1);
|
|
||||||
slider_f32!(mp, c, SettingType::XrClickSensitivity, 0.1, 1.0, 0.1);
|
|
||||||
slider_f32!(mp, c, SettingType::XrClickSensitivityRelease, 0.1, 1.0, 0.1);
|
|
||||||
slider_i32!(mp, c, SettingType::ClickFreezeTimeMs, 0, 500, 50);
|
|
||||||
|
|
||||||
let c = category!(mp, root, "APP_SETTINGS.MISC", "dashboard/blocks.svg")?;
|
|
||||||
dropdown!(
|
|
||||||
mp,
|
|
||||||
c,
|
|
||||||
SettingType::CaptureMethod,
|
|
||||||
wlx_common::config::CaptureMethod::VARIANTS
|
|
||||||
);
|
|
||||||
checkbox!(mp, c, SettingType::XwaylandByDefault);
|
|
||||||
checkbox!(mp, c, SettingType::UprightScreenFix);
|
|
||||||
checkbox!(mp, c, SettingType::DoubleCursorFix);
|
|
||||||
checkbox!(mp, c, SettingType::ScreenRenderDown);
|
|
||||||
|
|
||||||
let mut app_button_ids = vec![];
|
|
||||||
|
|
||||||
if !mp.config.autostart_apps.is_empty() {
|
|
||||||
let c = category!(mp, root, "APP_SETTINGS.AUTOSTART_APPS", "dashboard/apps.svg")?;
|
|
||||||
|
|
||||||
for app in &mp.config.autostart_apps {
|
|
||||||
autostart_app!(mp, c, app.name, app_button_ids);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let c = category!(mp, root, "APP_SETTINGS.TROUBLESHOOTING", "dashboard/cpu.svg")?;
|
|
||||||
danger_button!(
|
|
||||||
mp,
|
|
||||||
c,
|
|
||||||
"APP_SETTINGS.CLEAR_PIPEWIRE_TOKENS",
|
|
||||||
"dashboard/display.svg",
|
|
||||||
Task::ClearPipewireTokens
|
|
||||||
);
|
|
||||||
danger_button!(
|
|
||||||
mp,
|
|
||||||
c,
|
|
||||||
"APP_SETTINGS.CLEAR_SAVED_STATE",
|
|
||||||
"dashboard/binary.svg",
|
|
||||||
Task::ClearSavedState
|
|
||||||
);
|
|
||||||
danger_button!(
|
|
||||||
mp,
|
|
||||||
c,
|
|
||||||
"APP_SETTINGS.DELETE_ALL_CONFIGS",
|
|
||||||
"dashboard/circle.svg",
|
|
||||||
Task::DeleteAllConfigs
|
|
||||||
);
|
|
||||||
danger_button!(
|
|
||||||
mp,
|
|
||||||
c,
|
|
||||||
"APP_SETTINGS.RESTART_SOFTWARE",
|
|
||||||
"dashboard/refresh.svg",
|
|
||||||
Task::RestartSoftware
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(Self {
|
|
||||||
app_button_ids,
|
|
||||||
tasks: mp.tasks,
|
|
||||||
state: parser_state,
|
|
||||||
marker: PhantomData,
|
|
||||||
context_menu: ContextMenu::default(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,377 @@
|
||||||
|
use std::{collections::HashMap, rc::Rc};
|
||||||
|
|
||||||
|
use crate::tab::settings::{self, SettingType, Task, horiz_cell, mount_requires_restart};
|
||||||
|
use wgui::{
|
||||||
|
components::{
|
||||||
|
button::{ButtonClickEvent, ComponentButton},
|
||||||
|
checkbox::ComponentCheckbox,
|
||||||
|
slider::ComponentSlider,
|
||||||
|
},
|
||||||
|
layout::{Layout, WidgetID},
|
||||||
|
parser::{Fetchable, ParseDocumentParams, ParserState},
|
||||||
|
task::Tasks,
|
||||||
|
widget::label::WidgetLabel,
|
||||||
|
windowing::context_menu,
|
||||||
|
};
|
||||||
|
use wlx_common::config::GeneralConfig;
|
||||||
|
|
||||||
|
pub fn options_category(
|
||||||
|
mp: &mut MacroParams,
|
||||||
|
parent: WidgetID,
|
||||||
|
translation: &str,
|
||||||
|
icon: &str,
|
||||||
|
) -> anyhow::Result<WidgetID> {
|
||||||
|
let id = mp.idx.to_string();
|
||||||
|
mp.idx += 1;
|
||||||
|
|
||||||
|
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
||||||
|
params.insert(Rc::from("translation"), Rc::from(translation));
|
||||||
|
params.insert(Rc::from("icon"), Rc::from(icon));
|
||||||
|
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
||||||
|
|
||||||
|
mp.parser_state
|
||||||
|
.instantiate_template(mp.doc_params, "SettingsGroupBox", mp.layout, parent, params)?;
|
||||||
|
|
||||||
|
mp.parser_state.get_widget_id(&id)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn options_checkbox(mp: &mut MacroParams, parent: WidgetID, setting: SettingType) -> anyhow::Result<()> {
|
||||||
|
let id = mp.idx.to_string();
|
||||||
|
mp.idx += 1;
|
||||||
|
|
||||||
|
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
||||||
|
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
||||||
|
|
||||||
|
match setting.get_translation() {
|
||||||
|
Ok(translation) => params.insert(Rc::from("translation"), translation.into()),
|
||||||
|
Err(raw_text) => params.insert(Rc::from("text"), raw_text.into()),
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Some(tooltip) = setting.get_tooltip() {
|
||||||
|
params.insert(Rc::from("tooltip"), Rc::from(tooltip));
|
||||||
|
}
|
||||||
|
|
||||||
|
let checked = if *setting.mut_bool(mp.config) { "1" } else { "0" };
|
||||||
|
params.insert(Rc::from("checked"), Rc::from(checked));
|
||||||
|
|
||||||
|
let id_cell = horiz_cell(mp.layout, parent)?;
|
||||||
|
|
||||||
|
mp.parser_state
|
||||||
|
.instantiate_template(mp.doc_params, "CheckBoxSetting", mp.layout, id_cell, params)?;
|
||||||
|
|
||||||
|
if setting.requires_restart() {
|
||||||
|
mount_requires_restart(mp.layout, id_cell)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
let checkbox = mp.parser_state.fetch_component_as::<ComponentCheckbox>(&id)?;
|
||||||
|
checkbox.on_toggle(Box::new({
|
||||||
|
let tasks = mp.tasks.clone();
|
||||||
|
move |_common, e| {
|
||||||
|
tasks.push(Task::UpdateBool(setting, e.checked));
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn options_slider_f32(
|
||||||
|
mp: &mut MacroParams,
|
||||||
|
parent: WidgetID,
|
||||||
|
setting: SettingType,
|
||||||
|
min: f32,
|
||||||
|
max: f32,
|
||||||
|
step: f32,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
|
let id = mp.idx.to_string();
|
||||||
|
mp.idx += 1;
|
||||||
|
|
||||||
|
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
||||||
|
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
||||||
|
|
||||||
|
match setting.get_translation() {
|
||||||
|
Ok(translation) => params.insert(Rc::from("translation"), translation.into()),
|
||||||
|
Err(raw_text) => params.insert(Rc::from("text"), raw_text.into()),
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Some(tooltip) = setting.get_tooltip() {
|
||||||
|
params.insert(Rc::from("tooltip"), Rc::from(tooltip));
|
||||||
|
}
|
||||||
|
|
||||||
|
let value = setting.mut_f32(mp.config).to_string();
|
||||||
|
params.insert(Rc::from("value"), Rc::from(value));
|
||||||
|
params.insert(Rc::from("min"), Rc::from(min.to_string()));
|
||||||
|
params.insert(Rc::from("max"), Rc::from(max.to_string()));
|
||||||
|
params.insert(Rc::from("step"), Rc::from(step.to_string()));
|
||||||
|
|
||||||
|
let id_cell = horiz_cell(mp.layout, parent)?;
|
||||||
|
|
||||||
|
mp.parser_state
|
||||||
|
.instantiate_template(mp.doc_params, "SliderSetting", mp.layout, id_cell, params)?;
|
||||||
|
|
||||||
|
if setting.requires_restart() {
|
||||||
|
mount_requires_restart(mp.layout, id_cell)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
let slider = mp.parser_state.fetch_component_as::<ComponentSlider>(&id)?;
|
||||||
|
slider.on_value_changed(Box::new({
|
||||||
|
let tasks = mp.tasks.clone();
|
||||||
|
move |_common, e| {
|
||||||
|
tasks.push(Task::UpdateFloat(setting, e.value));
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn options_range_f32(
|
||||||
|
mp: &mut MacroParams,
|
||||||
|
parent: WidgetID,
|
||||||
|
setting: SettingType,
|
||||||
|
setting2: SettingType,
|
||||||
|
min: f32,
|
||||||
|
max: f32,
|
||||||
|
step: f32,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
|
let id = mp.idx.to_string();
|
||||||
|
mp.idx += 1;
|
||||||
|
|
||||||
|
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
||||||
|
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
||||||
|
|
||||||
|
match setting.get_translation() {
|
||||||
|
Ok(translation) => params.insert(Rc::from("translation"), translation.into()),
|
||||||
|
Err(raw_text) => params.insert(Rc::from("text"), raw_text.into()),
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Some(tooltip) = setting.get_tooltip() {
|
||||||
|
params.insert(Rc::from("tooltip"), Rc::from(tooltip));
|
||||||
|
}
|
||||||
|
|
||||||
|
let value = setting.mut_f32(mp.config).to_string();
|
||||||
|
let value2 = setting2.mut_f32(mp.config).to_string();
|
||||||
|
params.insert(Rc::from("value"), Rc::from(value));
|
||||||
|
params.insert(Rc::from("value2"), Rc::from(value2));
|
||||||
|
params.insert(Rc::from("min"), Rc::from(min.to_string()));
|
||||||
|
params.insert(Rc::from("max"), Rc::from(max.to_string()));
|
||||||
|
params.insert(Rc::from("step"), Rc::from(step.to_string()));
|
||||||
|
|
||||||
|
let id_cell = horiz_cell(mp.layout, parent)?;
|
||||||
|
|
||||||
|
mp.parser_state
|
||||||
|
.instantiate_template(mp.doc_params, "RangeSetting", mp.layout, id_cell, params)?;
|
||||||
|
|
||||||
|
if setting.requires_restart() {
|
||||||
|
mount_requires_restart(mp.layout, id_cell)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
let slider = mp.parser_state.fetch_component_as::<ComponentSlider>(&id)?;
|
||||||
|
slider.on_value_changed(Box::new({
|
||||||
|
let tasks = mp.tasks.clone();
|
||||||
|
move |_common, e| {
|
||||||
|
if matches!(e.index, wgui::components::slider::ValueIndex::Primary) {
|
||||||
|
tasks.push(Task::UpdateFloat(setting, e.value));
|
||||||
|
} else {
|
||||||
|
tasks.push(Task::UpdateFloat(setting2, e.value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn options_slider_i32(
|
||||||
|
mp: &mut MacroParams,
|
||||||
|
parent: WidgetID,
|
||||||
|
setting: SettingType,
|
||||||
|
min: i32,
|
||||||
|
max: i32,
|
||||||
|
step: i32,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
|
let id = mp.idx.to_string();
|
||||||
|
mp.idx += 1;
|
||||||
|
|
||||||
|
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
||||||
|
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
||||||
|
|
||||||
|
match setting.get_translation() {
|
||||||
|
Ok(translation) => params.insert(Rc::from("translation"), translation.into()),
|
||||||
|
Err(raw_text) => params.insert(Rc::from("text"), raw_text.into()),
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Some(tooltip) = setting.get_tooltip() {
|
||||||
|
params.insert(Rc::from("tooltip"), Rc::from(tooltip));
|
||||||
|
}
|
||||||
|
|
||||||
|
let id_cell = horiz_cell(mp.layout, parent)?;
|
||||||
|
|
||||||
|
let value = setting.mut_i32(mp.config).to_string();
|
||||||
|
params.insert(Rc::from("value"), Rc::from(value));
|
||||||
|
params.insert(Rc::from("min"), Rc::from(min.to_string()));
|
||||||
|
params.insert(Rc::from("max"), Rc::from(max.to_string()));
|
||||||
|
params.insert(Rc::from("step"), Rc::from(step.to_string()));
|
||||||
|
|
||||||
|
mp.parser_state
|
||||||
|
.instantiate_template(mp.doc_params, "SliderSetting", mp.layout, id_cell, params)?;
|
||||||
|
|
||||||
|
if setting.requires_restart() {
|
||||||
|
mount_requires_restart(mp.layout, id_cell)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
let slider = mp.parser_state.fetch_component_as::<ComponentSlider>(&id)?;
|
||||||
|
slider.on_value_changed(Box::new({
|
||||||
|
let tasks = mp.tasks.clone();
|
||||||
|
move |_common, e| {
|
||||||
|
tasks.push(Task::UpdateInt(setting, e.value as i32));
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn options_dropdown<EnumType>(
|
||||||
|
mp: &mut MacroParams,
|
||||||
|
parent: WidgetID,
|
||||||
|
setting: &'static SettingType,
|
||||||
|
) -> anyhow::Result<()>
|
||||||
|
where
|
||||||
|
EnumType: strum::VariantArray + strum::EnumProperty + std::convert::AsRef<str> + Copy + 'static,
|
||||||
|
{
|
||||||
|
let id = mp.idx.to_string();
|
||||||
|
mp.idx += 1;
|
||||||
|
|
||||||
|
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
||||||
|
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
||||||
|
|
||||||
|
match setting.get_translation() {
|
||||||
|
Ok(translation) => params.insert(Rc::from("translation"), translation.into()),
|
||||||
|
Err(raw_text) => params.insert(Rc::from("text"), raw_text.into()),
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Some(tooltip) = setting.get_tooltip() {
|
||||||
|
params.insert(Rc::from("tooltip"), Rc::from(tooltip));
|
||||||
|
}
|
||||||
|
|
||||||
|
let id_cell = horiz_cell(mp.layout, parent)?;
|
||||||
|
|
||||||
|
mp.parser_state
|
||||||
|
.instantiate_template(mp.doc_params, "DropdownButton", mp.layout, id_cell, params)?;
|
||||||
|
|
||||||
|
if setting.requires_restart() {
|
||||||
|
mount_requires_restart(mp.layout, id_cell)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
let setting_str = setting.as_ref();
|
||||||
|
let title = setting.get_enum_title(mp.config);
|
||||||
|
|
||||||
|
{
|
||||||
|
let mut label = mp
|
||||||
|
.parser_state
|
||||||
|
.fetch_widget_as::<WidgetLabel>(&mp.layout.state, &format!("{id}_value"))?;
|
||||||
|
label.set_text_simple(&mut mp.layout.state.globals.get(), title);
|
||||||
|
}
|
||||||
|
|
||||||
|
let btn = mp.parser_state.fetch_component_as::<ComponentButton>(&id)?;
|
||||||
|
btn.on_click(Rc::new({
|
||||||
|
let tasks = mp.tasks.clone();
|
||||||
|
move |_common, e: ButtonClickEvent| {
|
||||||
|
tasks.push(Task::OpenContextMenu(
|
||||||
|
e.mouse_pos_absolute.unwrap_or_default(),
|
||||||
|
EnumType::VARIANTS
|
||||||
|
.iter()
|
||||||
|
.filter_map(|item| {
|
||||||
|
if item.get_bool("Hidden").unwrap_or(false) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
|
let value = item.as_ref();
|
||||||
|
let title = SettingType::get_enum_title_inner(*item);
|
||||||
|
let tooltip = SettingType::get_enum_tooltip_inner(*item);
|
||||||
|
|
||||||
|
let text = &title.text;
|
||||||
|
let translated = if title.translated { "1" } else { "0" };
|
||||||
|
|
||||||
|
Some(context_menu::Cell {
|
||||||
|
action_name: Some(format!("{setting_str};{id};{value};{text};{translated}").into()),
|
||||||
|
title,
|
||||||
|
tooltip,
|
||||||
|
attribs: vec![],
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.collect(),
|
||||||
|
));
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn options_danger_button(
|
||||||
|
mp: &mut MacroParams,
|
||||||
|
parent: WidgetID,
|
||||||
|
translation: &str,
|
||||||
|
icon: &str,
|
||||||
|
task: Task,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
|
let id = mp.idx.to_string();
|
||||||
|
mp.idx += 1;
|
||||||
|
|
||||||
|
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
||||||
|
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
||||||
|
params.insert(Rc::from("translation"), Rc::from(translation));
|
||||||
|
params.insert(Rc::from("icon"), Rc::from(icon));
|
||||||
|
|
||||||
|
mp.parser_state
|
||||||
|
.instantiate_template(mp.doc_params, "DangerButton", mp.layout, parent, params)?;
|
||||||
|
|
||||||
|
let btn = mp.parser_state.fetch_component_as::<ComponentButton>(&id)?;
|
||||||
|
btn.on_click(Rc::new({
|
||||||
|
let tasks = mp.tasks.clone();
|
||||||
|
move |_common, _e| {
|
||||||
|
tasks.push(task.clone());
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn options_autostart_app(
|
||||||
|
mp: &mut MacroParams,
|
||||||
|
parent: WidgetID,
|
||||||
|
text: &str,
|
||||||
|
ids: &mut Vec<Rc<str>>,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
|
let id = mp.idx.to_string();
|
||||||
|
mp.idx += 1;
|
||||||
|
|
||||||
|
let mut params: HashMap<Rc<str>, Rc<str>> = HashMap::new();
|
||||||
|
params.insert(Rc::from("id"), Rc::from(id.as_ref()));
|
||||||
|
params.insert(Rc::from("text"), Rc::from(text));
|
||||||
|
|
||||||
|
mp.parser_state
|
||||||
|
.instantiate_template(mp.doc_params, "AutostartApp", mp.layout, parent, params)?;
|
||||||
|
|
||||||
|
let btn = mp.parser_state.fetch_component_as::<ComponentButton>(&id)?;
|
||||||
|
let id: Rc<str> = Rc::from(id);
|
||||||
|
|
||||||
|
ids.push(id.clone());
|
||||||
|
|
||||||
|
btn.on_click(Rc::new({
|
||||||
|
let tasks = mp.tasks.clone();
|
||||||
|
move |_common, _e| {
|
||||||
|
tasks.push(Task::RemoveAutostartApp(id.clone()));
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct MacroParams<'a> {
|
||||||
|
pub layout: &'a mut Layout,
|
||||||
|
pub parser_state: &'a mut ParserState,
|
||||||
|
pub doc_params: &'a ParseDocumentParams<'a>,
|
||||||
|
pub config: &'a mut GeneralConfig,
|
||||||
|
pub tasks: Tasks<settings::Task>,
|
||||||
|
pub idx: usize,
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,694 @@
|
||||||
|
use glam::Vec2;
|
||||||
|
use std::{marker::PhantomData, rc::Rc, str::FromStr};
|
||||||
|
use strum::{AsRefStr, EnumProperty, EnumString};
|
||||||
|
use wgui::{
|
||||||
|
assets::AssetPath,
|
||||||
|
components::tabs::ComponentTabs,
|
||||||
|
drawing,
|
||||||
|
event::StyleSetRequest,
|
||||||
|
globals::WguiGlobals,
|
||||||
|
i18n::Translation,
|
||||||
|
layout::{Layout, WidgetID},
|
||||||
|
log::LogErr,
|
||||||
|
parser::{Fetchable, ParseDocumentParams, ParserState},
|
||||||
|
renderer_vk::text::{FontWeight, TextStyle},
|
||||||
|
taffy::{self, prelude::length},
|
||||||
|
task::Tasks,
|
||||||
|
widget::{
|
||||||
|
div::WidgetDiv,
|
||||||
|
label::{WidgetLabel, WidgetLabelParams},
|
||||||
|
},
|
||||||
|
windowing::context_menu::{self, Blueprint, ContextMenu, TickResult},
|
||||||
|
};
|
||||||
|
use wlx_common::{
|
||||||
|
config::GeneralConfig,
|
||||||
|
config_io::ConfigRoot,
|
||||||
|
dash_interface::{ConfigChangeKind, InterfaceFeats, RecenterMode},
|
||||||
|
};
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
frontend::{Frontend, FrontendTask, FrontendTasks},
|
||||||
|
tab::{Tab, TabType, settings::macros::MacroParams},
|
||||||
|
views::ViewUpdateParams,
|
||||||
|
};
|
||||||
|
|
||||||
|
mod macros;
|
||||||
|
mod tab_autostart_apps;
|
||||||
|
mod tab_controls;
|
||||||
|
mod tab_features;
|
||||||
|
mod tab_look_and_feel;
|
||||||
|
mod tab_misc;
|
||||||
|
mod tab_skybox;
|
||||||
|
mod tab_space_drag;
|
||||||
|
mod tab_troubleshooting;
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
|
enum TabNameEnum {
|
||||||
|
AutostartApps,
|
||||||
|
Controls,
|
||||||
|
Features,
|
||||||
|
LookAndFeel,
|
||||||
|
Misc,
|
||||||
|
Skybox,
|
||||||
|
SpaceDrag,
|
||||||
|
Troubleshooting,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TabNameEnum {
|
||||||
|
fn from_string(s: &str) -> Option<Self> {
|
||||||
|
match s {
|
||||||
|
"autostart_apps" => Some(TabNameEnum::AutostartApps),
|
||||||
|
"controls" => Some(TabNameEnum::Controls),
|
||||||
|
"features" => Some(TabNameEnum::Features),
|
||||||
|
"look_and_feel" => Some(TabNameEnum::LookAndFeel),
|
||||||
|
"misc" => Some(TabNameEnum::Misc),
|
||||||
|
"skybox" => Some(TabNameEnum::Skybox),
|
||||||
|
"space_drag" => Some(TabNameEnum::SpaceDrag),
|
||||||
|
"troubleshooting" => Some(TabNameEnum::Troubleshooting),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
|
enum Task {
|
||||||
|
ClearPipewireTokens,
|
||||||
|
ClearSavedState,
|
||||||
|
DeleteAllConfigs,
|
||||||
|
OpenContextMenu(Vec2, Vec<context_menu::Cell>),
|
||||||
|
RemoveAutostartApp(Rc<str>),
|
||||||
|
ResetPlayspace,
|
||||||
|
RestartSoftware,
|
||||||
|
SetTab(TabNameEnum),
|
||||||
|
SettingUpdated(SettingType),
|
||||||
|
UpdateBool(SettingType, bool),
|
||||||
|
UpdateFloat(SettingType, f32),
|
||||||
|
UpdateInt(SettingType, i32),
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SettingsMountParams<'a> {
|
||||||
|
mp: &'a mut MacroParams<'a>,
|
||||||
|
frontend_tasks: &'a FrontendTasks,
|
||||||
|
id_parent: WidgetID,
|
||||||
|
feats: InterfaceFeats,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct SettingUpdatedParams<'a> {
|
||||||
|
layout: &'a mut Layout,
|
||||||
|
config: &'a GeneralConfig,
|
||||||
|
setting_type: SettingType,
|
||||||
|
}
|
||||||
|
|
||||||
|
trait SettingsTab {
|
||||||
|
fn update(&mut self, _par: &mut ViewUpdateParams) -> anyhow::Result<()> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn setting_updated(&mut self, _sup: &mut SettingUpdatedParams) -> anyhow::Result<()> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct TabSettings<T> {
|
||||||
|
pub state: ParserState,
|
||||||
|
|
||||||
|
app_button_ids: Vec<Rc<str>>,
|
||||||
|
context_menu: ContextMenu,
|
||||||
|
|
||||||
|
current_tab: Option<Box<dyn SettingsTab>>,
|
||||||
|
|
||||||
|
tasks: Tasks<Task>,
|
||||||
|
marker: PhantomData<T>,
|
||||||
|
frontend_tasks: FrontendTasks,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T> Tab<T> for TabSettings<T> {
|
||||||
|
fn get_type(&self) -> TabType {
|
||||||
|
TabType::Settings
|
||||||
|
}
|
||||||
|
|
||||||
|
fn update(&mut self, frontend: &mut Frontend<T>, _time_ms: u32, data: &mut T) -> anyhow::Result<()> {
|
||||||
|
if let Some(tab) = &mut self.current_tab {
|
||||||
|
let mut config_change_kind = None;
|
||||||
|
|
||||||
|
tab.update(&mut ViewUpdateParams {
|
||||||
|
layout: &mut frontend.layout,
|
||||||
|
executor: &frontend.executor,
|
||||||
|
general_config: frontend.interface.general_config(data),
|
||||||
|
config_change_kind: &mut config_change_kind,
|
||||||
|
})?;
|
||||||
|
|
||||||
|
if let Some(kind) = config_change_kind {
|
||||||
|
frontend.interface.config_changed(data, kind);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut changed = None;
|
||||||
|
for task in self.tasks.drain() {
|
||||||
|
match task {
|
||||||
|
Task::SetTab(tab) => {
|
||||||
|
self.set_tab(frontend, data, tab)?;
|
||||||
|
}
|
||||||
|
Task::UpdateBool(setting, n) => {
|
||||||
|
self.tasks.push(Task::SettingUpdated(setting));
|
||||||
|
if let Some(task) = setting.get_frontend_task() {
|
||||||
|
frontend.tasks.push(task)
|
||||||
|
}
|
||||||
|
let config = frontend.interface.general_config(data);
|
||||||
|
*setting.mut_bool(config) = n;
|
||||||
|
changed = Some(setting.change_kind());
|
||||||
|
}
|
||||||
|
Task::UpdateFloat(setting, n) => {
|
||||||
|
self.tasks.push(Task::SettingUpdated(setting));
|
||||||
|
if let Some(task) = setting.get_frontend_task() {
|
||||||
|
frontend.tasks.push(task)
|
||||||
|
}
|
||||||
|
let config = frontend.interface.general_config(data);
|
||||||
|
*setting.mut_f32(config) = n;
|
||||||
|
changed = Some(setting.change_kind());
|
||||||
|
}
|
||||||
|
Task::UpdateInt(setting, n) => {
|
||||||
|
self.tasks.push(Task::SettingUpdated(setting));
|
||||||
|
if let Some(task) = setting.get_frontend_task() {
|
||||||
|
frontend.tasks.push(task)
|
||||||
|
}
|
||||||
|
let config = frontend.interface.general_config(data);
|
||||||
|
*setting.mut_i32(config) = n;
|
||||||
|
changed = Some(setting.change_kind());
|
||||||
|
}
|
||||||
|
Task::ClearPipewireTokens => {
|
||||||
|
let _ = std::fs::remove_file(ConfigRoot::Generic.get_conf_d_path().join("pw_tokens.yaml"))
|
||||||
|
.log_err("Could not remove pw_tokens.yaml");
|
||||||
|
}
|
||||||
|
Task::ClearSavedState => {
|
||||||
|
let _ = std::fs::remove_file(ConfigRoot::Generic.get_conf_d_path().join("zz-saved-state.json5"))
|
||||||
|
.log_err("Could not remove zz-saved-state.json5");
|
||||||
|
}
|
||||||
|
Task::DeleteAllConfigs => {
|
||||||
|
let path = ConfigRoot::Generic.get_conf_d_path();
|
||||||
|
std::fs::remove_dir_all(&path)?;
|
||||||
|
std::fs::create_dir(&path)?;
|
||||||
|
}
|
||||||
|
Task::ResetPlayspace => {
|
||||||
|
frontend.interface.recenter_playspace(data, RecenterMode::Reset)?;
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
Task::RestartSoftware => {
|
||||||
|
frontend.interface.restart(data);
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
Task::OpenContextMenu(position, cells) => {
|
||||||
|
self.context_menu.open(context_menu::OpenParams {
|
||||||
|
on_custom_attribs: None,
|
||||||
|
position,
|
||||||
|
blueprint: Blueprint::Cells(cells),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Task::RemoveAutostartApp(button_id) => {
|
||||||
|
if let (Some(idx), Ok(widget)) = (
|
||||||
|
self.app_button_ids.iter().position(|x| button_id.eq(x)),
|
||||||
|
self.state.get_widget_id(&format!("{button_id}_root")),
|
||||||
|
) {
|
||||||
|
self.app_button_ids.remove(idx);
|
||||||
|
let config = frontend.interface.general_config(data);
|
||||||
|
config.autostart_apps.remove(idx);
|
||||||
|
frontend.layout.remove_widget(widget);
|
||||||
|
changed = Some(ConfigChangeKind::OverlayConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Task::SettingUpdated(setting) => {
|
||||||
|
if let Some(tab) = &mut self.current_tab {
|
||||||
|
tab.setting_updated(&mut SettingUpdatedParams {
|
||||||
|
layout: &mut frontend.layout,
|
||||||
|
config: frontend.interface.general_config(data),
|
||||||
|
setting_type: setting,
|
||||||
|
})?;
|
||||||
|
}
|
||||||
|
match setting {
|
||||||
|
SettingType::UiAnimationSpeed | SettingType::UiGradientIntensity | SettingType::UiRoundMultiplier => {
|
||||||
|
// todo: currently, wayvr restart is required to apply these changes (WguiTheme is Rc)
|
||||||
|
}
|
||||||
|
_ => { /* do nothing */ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dropdown handling
|
||||||
|
if let TickResult::Action(name) = self.context_menu.tick(&mut frontend.layout, &mut self.state)?
|
||||||
|
&& let (Some(setting), Some(id), Some(value), Some(text), Some(translated)) = {
|
||||||
|
let mut s = name.splitn(5, ';');
|
||||||
|
(s.next(), s.next(), s.next(), s.next(), s.next())
|
||||||
|
} {
|
||||||
|
let mut common = frontend.layout.common();
|
||||||
|
let mut label = self
|
||||||
|
.state
|
||||||
|
.fetch_widget_as::<WidgetLabel>(common.state, &format!("{id}_value"))?;
|
||||||
|
|
||||||
|
let translation = Translation {
|
||||||
|
text: text.into(),
|
||||||
|
translated: translated == "1",
|
||||||
|
};
|
||||||
|
|
||||||
|
label.set_text(&mut common, translation);
|
||||||
|
|
||||||
|
let setting = SettingType::from_str(setting).expect("Invalid Enum string");
|
||||||
|
let config = frontend.interface.general_config(data);
|
||||||
|
setting.set_enum(config, value);
|
||||||
|
changed = Some(ConfigChangeKind::OverlayConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Notify overlays of the change
|
||||||
|
if let Some(changed) = changed {
|
||||||
|
frontend.interface.config_changed(data, changed);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sorted alphabetically
|
||||||
|
#[allow(clippy::enum_variant_names)]
|
||||||
|
#[derive(Clone, Copy, Eq, PartialEq, AsRefStr, EnumString)]
|
||||||
|
enum SettingType {
|
||||||
|
AllowSliding,
|
||||||
|
BlockGameInput,
|
||||||
|
BlockGameInputIgnoreWatch,
|
||||||
|
BlockPosesOnKbdInteraction,
|
||||||
|
CaptureMethod,
|
||||||
|
ClickFreezeTimeMs,
|
||||||
|
Clock12h,
|
||||||
|
DoubleCursorFix,
|
||||||
|
FocusFollowsMouseMode,
|
||||||
|
GridOpacity,
|
||||||
|
HandsfreePointer,
|
||||||
|
HideGrabHelp,
|
||||||
|
HideUsername,
|
||||||
|
InvertScrollDirectionX,
|
||||||
|
InvertScrollDirectionY,
|
||||||
|
KeyboardMiddleClick,
|
||||||
|
KeyboardSoundEnabled,
|
||||||
|
Language,
|
||||||
|
LeftHandedMouse,
|
||||||
|
LongPressDuration,
|
||||||
|
NotificationsEnabled,
|
||||||
|
NotificationsSoundEnabled,
|
||||||
|
OpaqueBackground,
|
||||||
|
PointerLerpFactor,
|
||||||
|
ScreenRenderDown,
|
||||||
|
ScrollSpeed,
|
||||||
|
EnableWatch,
|
||||||
|
SetsOnWatch,
|
||||||
|
SpaceDragMultiplier,
|
||||||
|
SpaceDragUnlocked,
|
||||||
|
SpaceGravityDamping,
|
||||||
|
SpaceGravityEnabled,
|
||||||
|
SpaceGravityFlingStrength,
|
||||||
|
SpaceGravityGravity,
|
||||||
|
SpaceGravityGroundFriction,
|
||||||
|
SpaceGravityFloorHeight,
|
||||||
|
SpaceRotateUnlocked,
|
||||||
|
UiAnimationSpeed,
|
||||||
|
UiGradientIntensity,
|
||||||
|
UiRoundMultiplier,
|
||||||
|
UprightScreenFix,
|
||||||
|
UsePassthrough,
|
||||||
|
UseSkybox,
|
||||||
|
WatchViewAngleMax,
|
||||||
|
WatchViewAngleMin,
|
||||||
|
XrClickSensitivity,
|
||||||
|
XrClickSensitivityRelease,
|
||||||
|
XwaylandByDefault,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SettingType {
|
||||||
|
pub fn change_kind(self) -> ConfigChangeKind {
|
||||||
|
match self {
|
||||||
|
Self::UseSkybox | Self::UsePassthrough => ConfigChangeKind::EnvironmentBlend,
|
||||||
|
_ => ConfigChangeKind::OverlayConfig,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn mut_bool(self, config: &mut GeneralConfig) -> &mut bool {
|
||||||
|
match self {
|
||||||
|
Self::AllowSliding => &mut config.allow_sliding,
|
||||||
|
Self::BlockGameInput => &mut config.block_game_input,
|
||||||
|
Self::BlockGameInputIgnoreWatch => &mut config.block_game_input_ignore_watch,
|
||||||
|
Self::BlockPosesOnKbdInteraction => &mut config.block_poses_on_kbd_interaction,
|
||||||
|
Self::Clock12h => &mut config.clock_12h,
|
||||||
|
Self::DoubleCursorFix => &mut config.double_cursor_fix,
|
||||||
|
Self::EnableWatch => &mut config.enable_watch,
|
||||||
|
Self::FocusFollowsMouseMode => &mut config.focus_follows_mouse_mode,
|
||||||
|
Self::HideGrabHelp => &mut config.hide_grab_help,
|
||||||
|
Self::HideUsername => &mut config.hide_username,
|
||||||
|
Self::InvertScrollDirectionX => &mut config.invert_scroll_direction_x,
|
||||||
|
Self::InvertScrollDirectionY => &mut config.invert_scroll_direction_y,
|
||||||
|
Self::KeyboardSoundEnabled => &mut config.keyboard_sound_enabled,
|
||||||
|
Self::LeftHandedMouse => &mut config.left_handed_mouse,
|
||||||
|
Self::NotificationsEnabled => &mut config.notifications_enabled,
|
||||||
|
Self::NotificationsSoundEnabled => &mut config.notifications_sound_enabled,
|
||||||
|
Self::OpaqueBackground => &mut config.opaque_background,
|
||||||
|
Self::ScreenRenderDown => &mut config.screen_render_down,
|
||||||
|
Self::SetsOnWatch => &mut config.sets_on_watch,
|
||||||
|
Self::SpaceDragUnlocked => &mut config.space_drag_unlocked,
|
||||||
|
Self::SpaceGravityEnabled => &mut config.space_gravity_enabled,
|
||||||
|
Self::SpaceRotateUnlocked => &mut config.space_rotate_unlocked,
|
||||||
|
Self::UprightScreenFix => &mut config.upright_screen_fix,
|
||||||
|
Self::UsePassthrough => &mut config.use_passthrough,
|
||||||
|
Self::UseSkybox => &mut config.use_skybox,
|
||||||
|
Self::XwaylandByDefault => &mut config.xwayland_by_default,
|
||||||
|
_ => panic!("Requested bool for non-bool SettingType"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn mut_f32(self, config: &mut GeneralConfig) -> &mut f32 {
|
||||||
|
match self {
|
||||||
|
Self::GridOpacity => &mut config.grid_opacity,
|
||||||
|
Self::LongPressDuration => &mut config.long_press_duration,
|
||||||
|
Self::PointerLerpFactor => &mut config.pointer_lerp_factor,
|
||||||
|
Self::ScrollSpeed => &mut config.scroll_speed,
|
||||||
|
Self::SpaceDragMultiplier => &mut config.space_drag_multiplier,
|
||||||
|
Self::SpaceGravityDamping => &mut config.space_gravity_damping,
|
||||||
|
Self::SpaceGravityFlingStrength => &mut config.space_gravity_fling_strength,
|
||||||
|
Self::SpaceGravityGravity => &mut config.space_gravity_gravity,
|
||||||
|
Self::SpaceGravityGroundFriction => &mut config.space_gravity_ground_friction,
|
||||||
|
Self::SpaceGravityFloorHeight => &mut config.space_gravity_floor_height,
|
||||||
|
Self::UiAnimationSpeed => &mut config.ui_animation_speed,
|
||||||
|
Self::UiGradientIntensity => &mut config.ui_gradient_intensity,
|
||||||
|
Self::UiRoundMultiplier => &mut config.ui_round_multiplier,
|
||||||
|
Self::WatchViewAngleMax => &mut config.watch_view_angle_max,
|
||||||
|
Self::WatchViewAngleMin => &mut config.watch_view_angle_min,
|
||||||
|
Self::XrClickSensitivity => &mut config.xr_click_sensitivity,
|
||||||
|
Self::XrClickSensitivityRelease => &mut config.xr_click_sensitivity_release,
|
||||||
|
_ => panic!("Requested f32 for non-f32 SettingType"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn mut_i32(self, config: &mut GeneralConfig) -> &mut i32 {
|
||||||
|
match self {
|
||||||
|
Self::ClickFreezeTimeMs => &mut config.click_freeze_time_ms,
|
||||||
|
_ => panic!("Requested i32 for non-i32 SettingType"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_enum(self, config: &mut GeneralConfig, value: &str) {
|
||||||
|
match self {
|
||||||
|
Self::CaptureMethod => {
|
||||||
|
config.capture_method = wlx_common::config::CaptureMethod::from_str(value).expect("Invalid enum value!")
|
||||||
|
}
|
||||||
|
Self::KeyboardMiddleClick => {
|
||||||
|
config.keyboard_middle_click_mode =
|
||||||
|
wlx_common::config::AltModifier::from_str(value).expect("Invalid enum value!")
|
||||||
|
}
|
||||||
|
Self::HandsfreePointer => {
|
||||||
|
config.handsfree_pointer = wlx_common::config::HandsfreePointer::from_str(value).expect("Invalid enum value!")
|
||||||
|
}
|
||||||
|
Self::Language => {
|
||||||
|
config.language = Some(wlx_common::locale::Language::from_str(value).expect("Invalid enum value!"))
|
||||||
|
}
|
||||||
|
_ => panic!("Requested enum for non-enum SettingType"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_enum_title(self, config: &mut GeneralConfig) -> Translation {
|
||||||
|
match self {
|
||||||
|
Self::CaptureMethod => Self::get_enum_title_inner(config.capture_method),
|
||||||
|
Self::KeyboardMiddleClick => Self::get_enum_title_inner(config.keyboard_middle_click_mode),
|
||||||
|
Self::HandsfreePointer => Self::get_enum_title_inner(config.handsfree_pointer),
|
||||||
|
Self::Language => match &config.language {
|
||||||
|
Some(lang) => Self::get_enum_title_inner(*lang),
|
||||||
|
None => Translation::from_translation_key("APP_SETTINGS.OPTION.AUTO"),
|
||||||
|
},
|
||||||
|
_ => panic!("Requested enum for non-enum SettingType"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_enum_title_inner<E>(value: E) -> Translation
|
||||||
|
where
|
||||||
|
E: EnumProperty + AsRef<str>,
|
||||||
|
{
|
||||||
|
value
|
||||||
|
.get_str("Translation")
|
||||||
|
.map(Translation::from_translation_key)
|
||||||
|
.or_else(|| value.get_str("Text").map(Translation::from_raw_text))
|
||||||
|
.unwrap_or_else(|| Translation::from_raw_text(value.as_ref()))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_enum_tooltip_inner<E>(value: E) -> Option<Translation>
|
||||||
|
where
|
||||||
|
E: EnumProperty + AsRef<str>,
|
||||||
|
{
|
||||||
|
value.get_str("Tooltip").map(Translation::from_translation_key)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Ok is translation, Err is raw text
|
||||||
|
/// `match` sorted alphabetically
|
||||||
|
fn get_translation(self) -> Result<&'static str, &'static str> {
|
||||||
|
match self {
|
||||||
|
Self::AllowSliding => Ok("APP_SETTINGS.ALLOW_SLIDING"),
|
||||||
|
Self::BlockGameInput => Ok("APP_SETTINGS.BLOCK_GAME_INPUT"),
|
||||||
|
Self::BlockGameInputIgnoreWatch => Ok("APP_SETTINGS.BLOCK_GAME_INPUT_IGNORE_WATCH"),
|
||||||
|
Self::BlockPosesOnKbdInteraction => Ok("APP_SETTINGS.BLOCK_POSES_ON_KBD_INTERACTION"),
|
||||||
|
Self::CaptureMethod => Ok("APP_SETTINGS.CAPTURE_METHOD"),
|
||||||
|
Self::ClickFreezeTimeMs => Ok("APP_SETTINGS.CLICK_FREEZE_TIME_MS"),
|
||||||
|
Self::Clock12h => Ok("APP_SETTINGS.CLOCK_12H"),
|
||||||
|
Self::DoubleCursorFix => Ok("APP_SETTINGS.DOUBLE_CURSOR_FIX"),
|
||||||
|
Self::FocusFollowsMouseMode => Ok("APP_SETTINGS.FOCUS_FOLLOWS_MOUSE_MODE"),
|
||||||
|
Self::GridOpacity => Ok("APP_SETTINGS.GRID_OPACITY"),
|
||||||
|
Self::HandsfreePointer => Ok("APP_SETTINGS.HANDSFREE_POINTER"),
|
||||||
|
Self::HideGrabHelp => Ok("APP_SETTINGS.HIDE_GRAB_HELP"),
|
||||||
|
Self::HideUsername => Ok("APP_SETTINGS.HIDE_USERNAME"),
|
||||||
|
Self::InvertScrollDirectionX => Ok("APP_SETTINGS.INVERT_SCROLL_DIRECTION_X"),
|
||||||
|
Self::InvertScrollDirectionY => Ok("APP_SETTINGS.INVERT_SCROLL_DIRECTION_Y"),
|
||||||
|
Self::KeyboardMiddleClick => Ok("APP_SETTINGS.KEYBOARD_MIDDLE_CLICK"),
|
||||||
|
Self::KeyboardSoundEnabled => Ok("APP_SETTINGS.KEYBOARD_SOUND_ENABLED"),
|
||||||
|
Self::Language => Ok("APP_SETTINGS.LANGUAGE"),
|
||||||
|
Self::LeftHandedMouse => Ok("APP_SETTINGS.LEFT_HANDED_MOUSE"),
|
||||||
|
Self::LongPressDuration => Ok("APP_SETTINGS.LONG_PRESS_DURATION"),
|
||||||
|
Self::NotificationsEnabled => Ok("APP_SETTINGS.NOTIFICATIONS_ENABLED"),
|
||||||
|
Self::NotificationsSoundEnabled => Ok("APP_SETTINGS.NOTIFICATIONS_SOUND_ENABLED"),
|
||||||
|
Self::OpaqueBackground => Ok("APP_SETTINGS.OPAQUE_BACKGROUND"),
|
||||||
|
Self::PointerLerpFactor => Ok("APP_SETTINGS.POINTER_LERP_FACTOR"),
|
||||||
|
Self::ScreenRenderDown => Ok("APP_SETTINGS.SCREEN_RENDER_DOWN"),
|
||||||
|
Self::ScrollSpeed => Ok("APP_SETTINGS.SCROLL_SPEED"),
|
||||||
|
Self::EnableWatch => Ok("APP_SETTINGS.ENABLE_WATCH"),
|
||||||
|
Self::SetsOnWatch => Ok("APP_SETTINGS.SETS_ON_WATCH"),
|
||||||
|
Self::SpaceDragMultiplier => Ok("APP_SETTINGS.SPACE_DRAG_MULTIPLIER"),
|
||||||
|
Self::SpaceDragUnlocked => Ok("APP_SETTINGS.SPACE_DRAG_UNLOCKED"),
|
||||||
|
Self::SpaceGravityDamping => Ok("APP_SETTINGS.SPACE_GRAVITY_DAMPING"),
|
||||||
|
Self::SpaceGravityEnabled => Ok("APP_SETTINGS.ENABLED"),
|
||||||
|
Self::SpaceGravityFlingStrength => Ok("APP_SETTINGS.SPACE_GRAVITY_FLING_STRENGTH"),
|
||||||
|
Self::SpaceGravityGravity => Ok("APP_SETTINGS.SPACE_GRAVITY_GRAVITY"),
|
||||||
|
Self::SpaceGravityGroundFriction => Ok("APP_SETTINGS.SPACE_GRAVITY_GROUND_FRICTION"),
|
||||||
|
Self::SpaceGravityFloorHeight => Ok("APP_SETTINGS.SPACE_GRAVITY_FLOOR_HEIGHT"),
|
||||||
|
Self::SpaceRotateUnlocked => Ok("APP_SETTINGS.SPACE_ROTATE_UNLOCKED"),
|
||||||
|
Self::UiAnimationSpeed => Ok("APP_SETTINGS.ANIMATION_SPEED"),
|
||||||
|
Self::UiGradientIntensity => Ok("APP_SETTINGS.UI_GRADIENT_INTENSITY"),
|
||||||
|
Self::UiRoundMultiplier => Ok("APP_SETTINGS.ROUND_MULTIPLIER"),
|
||||||
|
Self::UprightScreenFix => Ok("APP_SETTINGS.UPRIGHT_SCREEN_FIX"),
|
||||||
|
Self::UsePassthrough => Ok("APP_SETTINGS.USE_PASSTHROUGH"),
|
||||||
|
Self::UseSkybox => Ok("APP_SETTINGS.USE_SKYBOX"),
|
||||||
|
Self::WatchViewAngleMax => Ok("APP_SETTINGS.WATCH_VIEW_ANGLE"),
|
||||||
|
Self::WatchViewAngleMin => Ok("APP_SETTINGS.WATCH_VIEW_ANGLE"),
|
||||||
|
Self::XrClickSensitivity => Ok("APP_SETTINGS.XR_CLICK_SENSITIVITY"),
|
||||||
|
Self::XrClickSensitivityRelease => Ok("APP_SETTINGS.XR_CLICK_SENSITIVITY"),
|
||||||
|
Self::XwaylandByDefault => Ok("APP_SETTINGS.XWAYLAND_BY_DEFAULT"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `match` sorted alphabetically
|
||||||
|
fn get_tooltip(self) -> Option<&'static str> {
|
||||||
|
match self {
|
||||||
|
Self::BlockGameInput => Some("APP_SETTINGS.BLOCK_GAME_INPUT_HELP"),
|
||||||
|
Self::BlockGameInputIgnoreWatch => Some("APP_SETTINGS.BLOCK_GAME_INPUT_IGNORE_WATCH_HELP"),
|
||||||
|
Self::BlockPosesOnKbdInteraction => Some("APP_SETTINGS.BLOCK_POSES_ON_KBD_INTERACTION_HELP"),
|
||||||
|
Self::CaptureMethod => Some("APP_SETTINGS.CAPTURE_METHOD_HELP"),
|
||||||
|
Self::DoubleCursorFix => Some("APP_SETTINGS.DOUBLE_CURSOR_FIX_HELP"),
|
||||||
|
Self::GridOpacity => Some("APP_SETTINGS.GRID_OPACITY_HELP"),
|
||||||
|
Self::HandsfreePointer => Some("APP_SETTINGS.HANDSFREE_POINTER_HELP"),
|
||||||
|
Self::KeyboardMiddleClick => Some("APP_SETTINGS.KEYBOARD_MIDDLE_CLICK_HELP"),
|
||||||
|
Self::LeftHandedMouse => Some("APP_SETTINGS.LEFT_HANDED_MOUSE_HELP"),
|
||||||
|
Self::ScreenRenderDown => Some("APP_SETTINGS.SCREEN_RENDER_DOWN_HELP"),
|
||||||
|
Self::SpaceGravityDamping => Some("APP_SETTINGS.SPACE_GRAVITY_DAMPING_HELP"),
|
||||||
|
Self::SpaceGravityFlingStrength => Some("APP_SETTINGS.SPACE_GRAVITY_FLING_STRENGTH_HELP"),
|
||||||
|
Self::SpaceGravityFloorHeight => Some("APP_SETTINGS.SPACE_GRAVITY_FLOOR_HEIGHT_HELP"),
|
||||||
|
Self::SpaceGravityGravity => Some("APP_SETTINGS.SPACE_GRAVITY_GRAVITY_HELP"),
|
||||||
|
Self::SpaceGravityGroundFriction => Some("APP_SETTINGS.SPACE_GRAVITY_GROUND_FRICTION_HELP"),
|
||||||
|
Self::UprightScreenFix => Some("APP_SETTINGS.UPRIGHT_SCREEN_FIX_HELP"),
|
||||||
|
Self::UsePassthrough => Some("APP_SETTINGS.USE_PASSTHROUGH_HELP"),
|
||||||
|
Self::UseSkybox => Some("APP_SETTINGS.USE_SKYBOX_HELP"),
|
||||||
|
Self::WatchViewAngleMax => Some("APP_SETTINGS.WATCH_VIEW_ANGLE_HELP"),
|
||||||
|
Self::WatchViewAngleMin => Some("APP_SETTINGS.WATCH_VIEW_ANGLE_HELP"),
|
||||||
|
Self::XrClickSensitivity => Some("APP_SETTINGS.XR_CLICK_SENSITIVITY_HELP"),
|
||||||
|
Self::XrClickSensitivityRelease => Some("APP_SETTINGS.XR_CLICK_SENSITIVITY_HELP"),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn requires_restart(self) -> bool {
|
||||||
|
matches!(
|
||||||
|
self,
|
||||||
|
Self::UiAnimationSpeed
|
||||||
|
| Self::UiRoundMultiplier
|
||||||
|
| Self::UiGradientIntensity
|
||||||
|
| Self::UprightScreenFix
|
||||||
|
| Self::DoubleCursorFix
|
||||||
|
| Self::Language
|
||||||
|
| Self::CaptureMethod
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_frontend_task(self) -> Option<FrontendTask> {
|
||||||
|
match self {
|
||||||
|
Self::Clock12h => Some(FrontendTask::RefreshClock),
|
||||||
|
Self::OpaqueBackground => Some(FrontendTask::RefreshBackground),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// creates a simple div with horizontal, centered flow
|
||||||
|
fn horiz_cell(layout: &mut Layout, parent: WidgetID) -> anyhow::Result<WidgetID> {
|
||||||
|
let (pair, _) = layout.add_child(
|
||||||
|
parent,
|
||||||
|
WidgetDiv::create(),
|
||||||
|
taffy::Style {
|
||||||
|
flex_direction: taffy::FlexDirection::Row,
|
||||||
|
align_items: Some(taffy::AlignItems::Center),
|
||||||
|
gap: length(8.0),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
Ok(pair.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn mount_requires_restart(layout: &mut Layout, parent: WidgetID) -> anyhow::Result<()> {
|
||||||
|
let content = Translation::from_translation_key("APP_SETTINGS.REQUIRES_RESTART");
|
||||||
|
let label = WidgetLabel::create(
|
||||||
|
&mut layout.state,
|
||||||
|
WidgetLabelParams {
|
||||||
|
content,
|
||||||
|
style: TextStyle {
|
||||||
|
wrap: false,
|
||||||
|
color: Some(drawing::Color::new(1.0, 0.5, 0.5, 1.0)),
|
||||||
|
weight: Some(FontWeight::Bold),
|
||||||
|
size: Some(10.0),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
layout.add_child(parent, label, Default::default())?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn doc_params(globals: &'_ WguiGlobals) -> ParseDocumentParams<'_> {
|
||||||
|
ParseDocumentParams {
|
||||||
|
globals: globals.clone(),
|
||||||
|
path: AssetPath::BuiltIn("gui/tab/settings.xml"),
|
||||||
|
extra: Default::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T> TabSettings<T> {
|
||||||
|
fn set_tab(&mut self, frontend: &mut Frontend<T>, data: &mut T, name: TabNameEnum) -> anyhow::Result<()> {
|
||||||
|
let root = self.state.get_widget_id("settings_root")?;
|
||||||
|
frontend.layout.remove_children(root);
|
||||||
|
let globals = frontend.layout.state.globals.clone();
|
||||||
|
self.current_tab = None;
|
||||||
|
|
||||||
|
let feats = frontend.interface.get_feats(data);
|
||||||
|
|
||||||
|
let mut mp = MacroParams {
|
||||||
|
layout: &mut frontend.layout,
|
||||||
|
parser_state: &mut self.state,
|
||||||
|
doc_params: &doc_params(&globals),
|
||||||
|
config: frontend.interface.general_config(data),
|
||||||
|
tasks: self.tasks.clone(),
|
||||||
|
idx: 9001,
|
||||||
|
};
|
||||||
|
|
||||||
|
let settings_mount_params = SettingsMountParams {
|
||||||
|
mp: &mut mp,
|
||||||
|
id_parent: root,
|
||||||
|
frontend_tasks: &self.frontend_tasks,
|
||||||
|
feats,
|
||||||
|
};
|
||||||
|
|
||||||
|
match name {
|
||||||
|
TabNameEnum::LookAndFeel => {
|
||||||
|
self.current_tab = Some(Box::new(tab_look_and_feel::State::mount(settings_mount_params)?));
|
||||||
|
}
|
||||||
|
TabNameEnum::Features => {
|
||||||
|
self.current_tab = Some(Box::new(tab_features::State::mount(settings_mount_params)?));
|
||||||
|
}
|
||||||
|
TabNameEnum::SpaceDrag => {
|
||||||
|
self.current_tab = Some(Box::new(tab_space_drag::State::mount(settings_mount_params)?));
|
||||||
|
}
|
||||||
|
TabNameEnum::Controls => {
|
||||||
|
self.current_tab = Some(Box::new(tab_controls::State::mount(settings_mount_params)?));
|
||||||
|
}
|
||||||
|
TabNameEnum::Misc => {
|
||||||
|
self.current_tab = Some(Box::new(tab_misc::State::mount(settings_mount_params)?));
|
||||||
|
}
|
||||||
|
TabNameEnum::AutostartApps => {
|
||||||
|
self.current_tab = Some(Box::new(tab_autostart_apps::State::mount(
|
||||||
|
settings_mount_params,
|
||||||
|
&mut self.app_button_ids,
|
||||||
|
)?));
|
||||||
|
}
|
||||||
|
TabNameEnum::Troubleshooting => {
|
||||||
|
self.current_tab = Some(Box::new(tab_troubleshooting::State::mount(settings_mount_params)?));
|
||||||
|
}
|
||||||
|
TabNameEnum::Skybox => {
|
||||||
|
self.current_tab = Some(Box::new(tab_skybox::State::mount(settings_mount_params)?));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new(frontend: &mut Frontend<T>, parent_id: WidgetID, data: &mut T) -> anyhow::Result<Self> {
|
||||||
|
let doc_params = ParseDocumentParams {
|
||||||
|
globals: frontend.layout.state.globals.clone(),
|
||||||
|
path: AssetPath::BuiltIn("gui/tab/settings.xml"),
|
||||||
|
extra: Default::default(),
|
||||||
|
};
|
||||||
|
|
||||||
|
let parser_state = wgui::parser::parse_from_assets(&doc_params, &mut frontend.layout, parent_id)?;
|
||||||
|
let tasks = Tasks::default();
|
||||||
|
let tabs = parser_state.fetch_component_as::<ComponentTabs>("tabs")?;
|
||||||
|
|
||||||
|
if !frontend.interface.get_feats(data).openxr {
|
||||||
|
let skybox_btn = tabs.get_tab_button("skybox").unwrap();
|
||||||
|
frontend
|
||||||
|
.layout
|
||||||
|
.common()
|
||||||
|
.alterables
|
||||||
|
.set_style(skybox_btn.get_rect(), StyleSetRequest::Display(taffy::Display::None));
|
||||||
|
}
|
||||||
|
|
||||||
|
tabs.on_select({
|
||||||
|
let tasks = tasks.clone();
|
||||||
|
Rc::new(move |_common, evt| {
|
||||||
|
if let Some(tab) = TabNameEnum::from_string(&evt.name) {
|
||||||
|
tasks.push(Task::SetTab(tab));
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
tasks.push(Task::SetTab(TabNameEnum::LookAndFeel));
|
||||||
|
|
||||||
|
Ok(Self {
|
||||||
|
app_button_ids: Vec::new(),
|
||||||
|
tasks,
|
||||||
|
state: parser_state,
|
||||||
|
marker: PhantomData,
|
||||||
|
context_menu: ContextMenu::default(),
|
||||||
|
current_tab: None,
|
||||||
|
frontend_tasks: frontend.tasks.clone(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
use std::rc::Rc;
|
||||||
|
|
||||||
|
use crate::tab::settings::{
|
||||||
|
SettingsMountParams, SettingsTab,
|
||||||
|
macros::{options_autostart_app, options_category},
|
||||||
|
};
|
||||||
|
|
||||||
|
pub struct State {}
|
||||||
|
|
||||||
|
impl SettingsTab for State {}
|
||||||
|
|
||||||
|
impl State {
|
||||||
|
pub fn mount(par: SettingsMountParams, app_button_ids: &mut Vec<Rc<str>>) -> anyhow::Result<State> {
|
||||||
|
*app_button_ids = Vec::new();
|
||||||
|
|
||||||
|
if !par.mp.config.autostart_apps.is_empty() {
|
||||||
|
let c = options_category(
|
||||||
|
par.mp,
|
||||||
|
par.id_parent,
|
||||||
|
"APP_SETTINGS.AUTOSTART_APPS",
|
||||||
|
"dashboard/apps.svg",
|
||||||
|
)?;
|
||||||
|
|
||||||
|
// todo: prevent clone
|
||||||
|
let autostart_apps = par.mp.config.autostart_apps.clone();
|
||||||
|
for app in autostart_apps {
|
||||||
|
options_autostart_app(par.mp, c, &app.name, app_button_ids)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(State {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
use crate::tab::settings::{
|
||||||
|
SettingType, SettingsMountParams, SettingsTab,
|
||||||
|
macros::{
|
||||||
|
options_category, options_checkbox, options_dropdown, options_range_f32, options_slider_f32, options_slider_i32,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
pub struct State {}
|
||||||
|
|
||||||
|
impl SettingsTab for State {}
|
||||||
|
|
||||||
|
impl State {
|
||||||
|
pub fn mount(par: SettingsMountParams) -> anyhow::Result<State> {
|
||||||
|
let c = options_category(
|
||||||
|
par.mp,
|
||||||
|
par.id_parent,
|
||||||
|
"APP_SETTINGS.CONTROLS",
|
||||||
|
"dashboard/controller.svg",
|
||||||
|
)?;
|
||||||
|
options_dropdown::<wlx_common::config::AltModifier>(par.mp, c, &SettingType::KeyboardMiddleClick)?;
|
||||||
|
options_dropdown::<wlx_common::config::HandsfreePointer>(par.mp, c, &SettingType::HandsfreePointer)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::FocusFollowsMouseMode)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::LeftHandedMouse)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::AllowSliding)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::InvertScrollDirectionX)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::InvertScrollDirectionY)?;
|
||||||
|
options_slider_f32(par.mp, c, SettingType::ScrollSpeed, 0.1, 5.0, 0.1)?;
|
||||||
|
options_slider_f32(par.mp, c, SettingType::LongPressDuration, 0.1, 2.0, 0.1)?;
|
||||||
|
|
||||||
|
if par.feats.openxr {
|
||||||
|
options_slider_f32(par.mp, c, SettingType::PointerLerpFactor, 0.1, 1.0, 0.1)?;
|
||||||
|
options_range_f32(
|
||||||
|
par.mp,
|
||||||
|
c,
|
||||||
|
SettingType::XrClickSensitivityRelease,
|
||||||
|
SettingType::XrClickSensitivity,
|
||||||
|
0.1,
|
||||||
|
0.9,
|
||||||
|
0.1,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
options_slider_i32(par.mp, c, SettingType::ClickFreezeTimeMs, 0, 500, 50)?;
|
||||||
|
Ok(State {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
use crate::tab::settings::{
|
||||||
|
SettingType, SettingsMountParams, SettingsTab,
|
||||||
|
macros::{options_category, options_checkbox, options_range_f32, options_slider_f32},
|
||||||
|
};
|
||||||
|
|
||||||
|
pub struct State {}
|
||||||
|
|
||||||
|
impl SettingsTab for State {}
|
||||||
|
|
||||||
|
impl State {
|
||||||
|
pub fn mount(par: SettingsMountParams) -> anyhow::Result<State> {
|
||||||
|
let c = options_category(par.mp, par.id_parent, "APP_SETTINGS.FEATURES", "dashboard/options.svg")?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::NotificationsEnabled)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::NotificationsSoundEnabled)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::KeyboardSoundEnabled)?;
|
||||||
|
if !par.feats.openxr || par.feats.monado {
|
||||||
|
// monado or openvr
|
||||||
|
options_checkbox(par.mp, c, SettingType::BlockGameInput)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::BlockGameInputIgnoreWatch)?;
|
||||||
|
}
|
||||||
|
if par.feats.monado {
|
||||||
|
// monado-only
|
||||||
|
options_checkbox(par.mp, c, SettingType::BlockPosesOnKbdInteraction)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
options_range_f32(
|
||||||
|
par.mp,
|
||||||
|
c,
|
||||||
|
SettingType::WatchViewAngleMin,
|
||||||
|
SettingType::WatchViewAngleMax,
|
||||||
|
0.1,
|
||||||
|
1.0,
|
||||||
|
0.1,
|
||||||
|
)?;
|
||||||
|
Ok(State {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
use crate::tab::settings::{
|
||||||
|
SettingType, SettingsMountParams, SettingsTab,
|
||||||
|
macros::{options_category, options_checkbox, options_dropdown, options_slider_f32},
|
||||||
|
};
|
||||||
|
|
||||||
|
pub struct State {}
|
||||||
|
|
||||||
|
impl SettingsTab for State {}
|
||||||
|
|
||||||
|
impl State {
|
||||||
|
pub fn mount(par: SettingsMountParams) -> anyhow::Result<State> {
|
||||||
|
let c = options_category(
|
||||||
|
par.mp,
|
||||||
|
par.id_parent,
|
||||||
|
"APP_SETTINGS.LOOK_AND_FEEL",
|
||||||
|
"dashboard/palette.svg",
|
||||||
|
)?;
|
||||||
|
options_dropdown::<wlx_common::locale::Language>(par.mp, c, &SettingType::Language)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::OpaqueBackground)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::HideUsername)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::HideGrabHelp)?;
|
||||||
|
options_slider_f32(par.mp, c, SettingType::UiAnimationSpeed, 0.5, 5.0, 0.1)?; // min, max, step
|
||||||
|
options_slider_f32(par.mp, c, SettingType::UiGradientIntensity, 0.0, 1.0, 0.05)?; // min, max, step
|
||||||
|
options_slider_f32(par.mp, c, SettingType::UiRoundMultiplier, 0.1, 5.0, 0.1)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::EnableWatch)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::SetsOnWatch)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::Clock12h)?;
|
||||||
|
Ok(State {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
use crate::tab::settings::{
|
||||||
|
SettingType, SettingsMountParams, SettingsTab,
|
||||||
|
macros::{options_category, options_checkbox, options_dropdown},
|
||||||
|
};
|
||||||
|
|
||||||
|
pub struct State {}
|
||||||
|
|
||||||
|
impl SettingsTab for State {}
|
||||||
|
|
||||||
|
impl State {
|
||||||
|
pub fn mount(par: SettingsMountParams) -> anyhow::Result<State> {
|
||||||
|
let c = options_category(par.mp, par.id_parent, "APP_SETTINGS.MISC", "dashboard/blocks.svg")?;
|
||||||
|
options_dropdown::<wlx_common::config::CaptureMethod>(par.mp, c, &SettingType::CaptureMethod)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::XwaylandByDefault)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::UprightScreenFix)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::DoubleCursorFix)?;
|
||||||
|
options_checkbox(par.mp, c, SettingType::ScreenRenderDown)?;
|
||||||
|
Ok(State {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
use wgui::{assets::AssetPath, i18n::Translation, layout::Layout, task::Tasks};
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
frontend::FrontendTasks,
|
||||||
|
tab::settings::{
|
||||||
|
SettingType, SettingsMountParams, SettingsTab,
|
||||||
|
macros::{options_category, options_checkbox, options_slider_f32},
|
||||||
|
},
|
||||||
|
util::{popup_manager::PopupHolder, wgui_simple},
|
||||||
|
views::{self, ViewUpdateParams, skymap_list},
|
||||||
|
};
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
|
enum Task {
|
||||||
|
ShowSkymapList,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct State {
|
||||||
|
popup_skymap_list: PopupHolder<skymap_list::View>,
|
||||||
|
tasks: Tasks<Task>,
|
||||||
|
frontend_tasks: FrontendTasks,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SettingsTab for State {
|
||||||
|
fn update(&mut self, par: &mut ViewUpdateParams) -> anyhow::Result<()> {
|
||||||
|
self.popup_skymap_list.update(par)?;
|
||||||
|
|
||||||
|
for task in self.tasks.drain() {
|
||||||
|
match task {
|
||||||
|
Task::ShowSkymapList => self.show_skymap_list(par.layout),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl State {
|
||||||
|
pub fn mount(par: SettingsMountParams) -> anyhow::Result<Self> {
|
||||||
|
let id_category = options_category(par.mp, par.id_parent, "APP_SETTINGS.SKYBOX", "dashboard/globe.svg")?;
|
||||||
|
options_checkbox(par.mp, id_category, SettingType::UseSkybox)?;
|
||||||
|
options_checkbox(par.mp, id_category, SettingType::UsePassthrough)?;
|
||||||
|
options_slider_f32(par.mp, id_category, SettingType::GridOpacity, 0.0, 1.0, 0.05)?;
|
||||||
|
|
||||||
|
let tasks = Tasks::<Task>::new();
|
||||||
|
|
||||||
|
// "Browse skymaps" button
|
||||||
|
wgui_simple::create_button(wgui_simple::CreateButtonParams {
|
||||||
|
id_parent: id_category,
|
||||||
|
layout: par.mp.layout,
|
||||||
|
content: Translation::from_translation_key("APP_SETTINGS.BROWSE_SKYMAPS"),
|
||||||
|
icon_builtin: AssetPath::BuiltIn("dashboard/globe.svg"),
|
||||||
|
on_click: tasks.get_button_click_callback(Task::ShowSkymapList),
|
||||||
|
})?;
|
||||||
|
|
||||||
|
Ok(Self {
|
||||||
|
popup_skymap_list: Default::default(),
|
||||||
|
frontend_tasks: par.frontend_tasks.clone(),
|
||||||
|
tasks,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fn show_skymap_list(&mut self, layout: &mut Layout) {
|
||||||
|
views::skymap_list::mount_popup(
|
||||||
|
self.frontend_tasks.clone(),
|
||||||
|
layout.state.globals.clone(),
|
||||||
|
self.popup_skymap_list.clone(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,138 @@
|
||||||
|
use wgui::{
|
||||||
|
assets::AssetPath,
|
||||||
|
i18n::Translation,
|
||||||
|
layout::{Layout, LayoutTask, WidgetID},
|
||||||
|
parser::{Fetchable, ParseDocumentParams},
|
||||||
|
};
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
tab::settings::{
|
||||||
|
SettingType, SettingsMountParams, SettingsTab,
|
||||||
|
macros::{options_category, options_checkbox, options_slider_f32},
|
||||||
|
},
|
||||||
|
util::wgui_simple,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub struct State {
|
||||||
|
id_space_gravity_parent: WidgetID,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn set_visible(parent: WidgetID, layout: &mut Layout, n: bool) {
|
||||||
|
layout.tasks.push(LayoutTask::SetWidgetVisible(parent, n));
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SettingsTab for State {
|
||||||
|
fn setting_updated(&mut self, sup: &mut super::SettingUpdatedParams) -> anyhow::Result<()> {
|
||||||
|
if sup.setting_type == SettingType::SpaceGravityEnabled {
|
||||||
|
set_visible(
|
||||||
|
self.id_space_gravity_parent,
|
||||||
|
sup.layout,
|
||||||
|
sup.config.space_gravity_enabled,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl State {
|
||||||
|
pub fn mount(par: SettingsMountParams) -> anyhow::Result<State> {
|
||||||
|
let c = options_category(par.mp, par.id_parent, "APP_SETTINGS.SPACE_DRAG", "dashboard/drag.svg")?;
|
||||||
|
|
||||||
|
let globals = par.mp.layout.state.globals.clone();
|
||||||
|
|
||||||
|
let tab_state = wgui::parser::parse_from_assets(
|
||||||
|
&ParseDocumentParams {
|
||||||
|
globals,
|
||||||
|
path: AssetPath::BuiltIn("gui/tab/settings_tab_space_drag.xml"),
|
||||||
|
extra: Default::default(),
|
||||||
|
},
|
||||||
|
par.mp.layout,
|
||||||
|
c,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let id_common_options_parent = tab_state.get_widget_id("common_options_parent")?;
|
||||||
|
let id_gravity_enabled_parent = tab_state.get_widget_id("gravity_enabled_parent")?;
|
||||||
|
let id_space_gravity_parent = tab_state.get_widget_id("space_gravity_parent")?;
|
||||||
|
|
||||||
|
if !par.feats.openxr || par.feats.monado {
|
||||||
|
// monado or openvr
|
||||||
|
options_checkbox(par.mp, id_common_options_parent, SettingType::SpaceDragUnlocked)?;
|
||||||
|
|
||||||
|
options_slider_f32(
|
||||||
|
par.mp,
|
||||||
|
id_common_options_parent,
|
||||||
|
SettingType::SpaceDragMultiplier,
|
||||||
|
-10.0,
|
||||||
|
10.0,
|
||||||
|
0.5,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
if par.feats.monado {
|
||||||
|
// openvr can only ever rotate yaw
|
||||||
|
options_checkbox(par.mp, id_common_options_parent, SettingType::SpaceRotateUnlocked)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
if par.feats.monado {
|
||||||
|
/* space gravity section */
|
||||||
|
options_checkbox(par.mp, id_gravity_enabled_parent, SettingType::SpaceGravityEnabled)?;
|
||||||
|
|
||||||
|
options_slider_f32(
|
||||||
|
par.mp,
|
||||||
|
id_space_gravity_parent,
|
||||||
|
SettingType::SpaceGravityGravity,
|
||||||
|
0.0,
|
||||||
|
10.0,
|
||||||
|
0.5,
|
||||||
|
)?;
|
||||||
|
options_slider_f32(
|
||||||
|
par.mp,
|
||||||
|
id_space_gravity_parent,
|
||||||
|
SettingType::SpaceGravityDamping,
|
||||||
|
0.1,
|
||||||
|
1.0,
|
||||||
|
0.01,
|
||||||
|
)?;
|
||||||
|
options_slider_f32(
|
||||||
|
par.mp,
|
||||||
|
id_space_gravity_parent,
|
||||||
|
SettingType::SpaceGravityFlingStrength,
|
||||||
|
0.0,
|
||||||
|
3.0,
|
||||||
|
0.1,
|
||||||
|
)?;
|
||||||
|
options_slider_f32(
|
||||||
|
par.mp,
|
||||||
|
id_space_gravity_parent,
|
||||||
|
SettingType::SpaceGravityGroundFriction,
|
||||||
|
0.0,
|
||||||
|
1.0,
|
||||||
|
0.01,
|
||||||
|
)?;
|
||||||
|
options_slider_f32(
|
||||||
|
par.mp,
|
||||||
|
id_space_gravity_parent,
|
||||||
|
SettingType::SpaceGravityFloorHeight,
|
||||||
|
-5.0,
|
||||||
|
5.0,
|
||||||
|
0.1,
|
||||||
|
)?;
|
||||||
|
} else {
|
||||||
|
wgui_simple::create_label(
|
||||||
|
par.mp.layout,
|
||||||
|
id_gravity_enabled_parent,
|
||||||
|
Translation::from_translation_key("APP_SETTINGS.NOT_SUPPORTED"),
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
set_visible(
|
||||||
|
id_space_gravity_parent,
|
||||||
|
par.mp.layout,
|
||||||
|
par.mp.config.space_gravity_enabled,
|
||||||
|
);
|
||||||
|
|
||||||
|
Ok(State {
|
||||||
|
id_space_gravity_parent,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
use crate::tab::settings::{
|
||||||
|
SettingsMountParams, SettingsTab, Task,
|
||||||
|
macros::{options_category, options_danger_button},
|
||||||
|
};
|
||||||
|
|
||||||
|
pub struct State {}
|
||||||
|
|
||||||
|
impl SettingsTab for State {}
|
||||||
|
|
||||||
|
impl State {
|
||||||
|
pub fn mount(par: SettingsMountParams) -> anyhow::Result<Self> {
|
||||||
|
let c = options_category(
|
||||||
|
par.mp,
|
||||||
|
par.id_parent,
|
||||||
|
"APP_SETTINGS.TROUBLESHOOTING",
|
||||||
|
"dashboard/cpu.svg",
|
||||||
|
)?;
|
||||||
|
options_danger_button(
|
||||||
|
par.mp,
|
||||||
|
c,
|
||||||
|
"APP_SETTINGS.RESET_PLAYSPACE",
|
||||||
|
"dashboard/recenter.svg",
|
||||||
|
Task::ResetPlayspace,
|
||||||
|
)?;
|
||||||
|
options_danger_button(
|
||||||
|
par.mp,
|
||||||
|
c,
|
||||||
|
"APP_SETTINGS.CLEAR_PIPEWIRE_TOKENS",
|
||||||
|
"dashboard/display.svg",
|
||||||
|
Task::ClearPipewireTokens,
|
||||||
|
)?;
|
||||||
|
options_danger_button(
|
||||||
|
par.mp,
|
||||||
|
c,
|
||||||
|
"APP_SETTINGS.CLEAR_SAVED_STATE",
|
||||||
|
"dashboard/binary.svg",
|
||||||
|
Task::ClearSavedState,
|
||||||
|
)?;
|
||||||
|
options_danger_button(
|
||||||
|
par.mp,
|
||||||
|
c,
|
||||||
|
"APP_SETTINGS.DELETE_ALL_CONFIGS",
|
||||||
|
"dashboard/circle.svg",
|
||||||
|
Task::DeleteAllConfigs,
|
||||||
|
)?;
|
||||||
|
options_danger_button(
|
||||||
|
par.mp,
|
||||||
|
c,
|
||||||
|
"APP_SETTINGS.RESTART_SOFTWARE",
|
||||||
|
"dashboard/refresh.svg",
|
||||||
|
Task::RestartSoftware,
|
||||||
|
)?;
|
||||||
|
Ok(State {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
|
use crate::util::{networking::http_client, steam_utils::AppID};
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use wlx_common::cache_dir;
|
use wlx_common::{async_executor::AsyncExecutor, cache_dir};
|
||||||
|
|
||||||
use crate::util::{http_client, steam_utils::AppID, various::AsyncExecutor};
|
|
||||||
|
|
||||||
pub struct CoverArt {
|
pub struct CoverArt {
|
||||||
// can be empty in case if data couldn't be fetched (use a fallback image then)
|
// can be empty in case if data couldn't be fetched (use a fallback image then)
|
||||||
|
|
@ -24,7 +23,7 @@ pub async fn request_image(executor: AsyncExecutor, app_id: AppID) -> anyhow::Re
|
||||||
app_id
|
app_id
|
||||||
);
|
);
|
||||||
|
|
||||||
match http_client::get(&executor, &url).await {
|
match http_client::get_simple(&executor, &url).await {
|
||||||
Ok(response) => {
|
Ok(response) => {
|
||||||
log::info!("Success");
|
log::info!("Success");
|
||||||
cache_dir::set_data(&cache_file_path, &response.data).await?;
|
cache_dir::set_data(&cache_file_path, &response.data).await?;
|
||||||
|
|
@ -69,7 +68,7 @@ async fn get_app_details_json_internal(
|
||||||
// Fetch from Steam API
|
// Fetch from Steam API
|
||||||
log::info!("Fetching app detail ID {}", app_id);
|
log::info!("Fetching app detail ID {}", app_id);
|
||||||
let url = format!("https://store.steampowered.com/api/appdetails?appids={}", app_id);
|
let url = format!("https://store.steampowered.com/api/appdetails?appids={}", app_id);
|
||||||
let response = http_client::get(&executor, &url).await?;
|
let response = http_client::get_simple(&executor, &url).await?;
|
||||||
let res_utf8 = String::from_utf8(response.data)?;
|
let res_utf8 = String::from_utf8(response.data)?;
|
||||||
let root = serde_json::from_str::<serde_json::Value>(&res_utf8)?;
|
let root = serde_json::from_str::<serde_json::Value>(&res_utf8)?;
|
||||||
let body = root.get(&app_id).context("invalid body")?;
|
let body = root.get(&app_id).context("invalid body")?;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
pub mod cached_fetcher;
|
pub mod cached_fetcher;
|
||||||
pub mod http_client;
|
pub mod networking;
|
||||||
pub mod pactl_wrapper;
|
pub mod pactl_wrapper;
|
||||||
pub mod popup_manager;
|
pub mod popup_manager;
|
||||||
pub mod steam_utils;
|
pub mod steam_utils;
|
||||||
pub mod toast_manager;
|
pub mod toast_manager;
|
||||||
pub mod various;
|
pub mod wgui_simple;
|
||||||
|
|
|
||||||
|
|
@ -13,16 +13,38 @@ use smol::{net::TcpStream, prelude::*};
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::task::{Context, Poll};
|
use std::task::{Context, Poll};
|
||||||
|
use wlx_common::async_executor::AsyncExecutor;
|
||||||
use crate::util::various::AsyncExecutor;
|
|
||||||
pub struct HttpClientResponse {
|
pub struct HttpClientResponse {
|
||||||
pub data: Vec<u8>,
|
pub data: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get(executor: &AsyncExecutor, url: &str) -> anyhow::Result<HttpClientResponse> {
|
impl HttpClientResponse {
|
||||||
log::info!("fetching URL \"{}\"", url);
|
pub fn into_json<T>(self) -> anyhow::Result<T>
|
||||||
|
where
|
||||||
|
T: for<'a> serde::Deserialize<'a>,
|
||||||
|
{
|
||||||
|
let utf8 = str::from_utf8(&self.data)?;
|
||||||
|
Ok(serde_json::from_str::<T>(utf8)?)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let url: hyper::Uri = url.try_into()?;
|
pub struct ProgressFuncData {
|
||||||
|
pub bytes_downloaded: u64,
|
||||||
|
pub file_size: u64,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub type ProgressFunc = Box<dyn Fn(ProgressFuncData)>;
|
||||||
|
|
||||||
|
pub struct GetParams<'a> {
|
||||||
|
pub executor: &'a AsyncExecutor,
|
||||||
|
pub url: &'a str,
|
||||||
|
pub on_progress: Option<ProgressFunc>,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn get(params: GetParams<'_>) -> anyhow::Result<HttpClientResponse> {
|
||||||
|
log::info!("fetching URL \"{}\"", params.url);
|
||||||
|
|
||||||
|
let url: hyper::Uri = params.url.try_into()?;
|
||||||
let req = Request::builder()
|
let req = Request::builder()
|
||||||
.header(
|
.header(
|
||||||
hyper::header::HOST,
|
hyper::header::HOST,
|
||||||
|
|
@ -31,23 +53,55 @@ pub async fn get(executor: &AsyncExecutor, url: &str) -> anyhow::Result<HttpClie
|
||||||
.uri(url)
|
.uri(url)
|
||||||
.body(Empty::new())?;
|
.body(Empty::new())?;
|
||||||
|
|
||||||
let resp = fetch(executor, req).await?;
|
let resp = fetch(params.executor, req).await?;
|
||||||
|
|
||||||
if !resp.status().is_success() {
|
if !resp.status().is_success() {
|
||||||
// non-200 HTTP response
|
// non-200 HTTP response
|
||||||
anyhow::bail!("non-200 HTTP response: {}", resp.status().as_str());
|
anyhow::bail!("non-200 HTTP response: {}", resp.status().as_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
let body = BodyStream::new(resp.into_body())
|
let mut bytes_downloaded: u64 = 0;
|
||||||
|
let mut file_size: u64 = 1;
|
||||||
|
|
||||||
|
let (parts, body) = resp.into_parts();
|
||||||
|
|
||||||
|
// that's a pretty interesting way to get file size :]
|
||||||
|
if let Some(val) = parts.headers.get("Content-Length")
|
||||||
|
&& let Ok(str) = val.to_str()
|
||||||
|
&& let Ok(s) = str.parse()
|
||||||
|
{
|
||||||
|
file_size = s;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut on_progress = params.on_progress;
|
||||||
|
|
||||||
|
let data = BodyStream::new(body)
|
||||||
.try_fold(Vec::new(), |mut body, chunk| {
|
.try_fold(Vec::new(), |mut body, chunk| {
|
||||||
if let Some(chunk) = chunk.data_ref() {
|
if let Some(chunk) = chunk.data_ref() {
|
||||||
|
bytes_downloaded += chunk.len() as u64;
|
||||||
body.extend_from_slice(chunk);
|
body.extend_from_slice(chunk);
|
||||||
|
|
||||||
|
if let Some(on_progress) = &mut on_progress {
|
||||||
|
on_progress(ProgressFuncData {
|
||||||
|
bytes_downloaded,
|
||||||
|
file_size,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Ok(body)
|
Ok(body)
|
||||||
})
|
})
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
Ok(HttpClientResponse { data: body })
|
Ok(HttpClientResponse { data })
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn get_simple(executor: &AsyncExecutor, url: &str) -> anyhow::Result<HttpClientResponse> {
|
||||||
|
get(GetParams {
|
||||||
|
executor,
|
||||||
|
url,
|
||||||
|
on_progress: None,
|
||||||
|
})
|
||||||
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn fetch(
|
async fn fetch(
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
use std::rc::Rc;
|
||||||
|
|
||||||
|
use wgui::{globals::WguiGlobals, renderer_vk::text::custom_glyph::CustomGlyphData};
|
||||||
|
use wlx_common::async_executor::AsyncExecutor;
|
||||||
|
|
||||||
|
use crate::util::networking::http_client;
|
||||||
|
|
||||||
|
pub async fn fetch_to_glyph_data(
|
||||||
|
globals: &WguiGlobals,
|
||||||
|
executor: &AsyncExecutor,
|
||||||
|
url: &str,
|
||||||
|
) -> anyhow::Result<(CustomGlyphData, Rc<Vec<u8>>)> {
|
||||||
|
let res = http_client::get_simple(executor, url).await?;
|
||||||
|
let glyph_data = CustomGlyphData::from_bytes_raster(globals, url, &res.data)?;
|
||||||
|
Ok((glyph_data, Rc::new(res.data)))
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
pub mod http_client;
|
||||||
|
pub mod image_fetch;
|
||||||
|
pub mod skymap_catalog;
|
||||||
|
|
||||||
|
// pub const WAYVR_ROOT_URL: &str = "https://wayvr.org";
|
||||||
|
pub const WAYVR_SKYMAPS_ROOT: &str = "https://wayvr.org/skymaps";
|
||||||
|
|
@ -0,0 +1,189 @@
|
||||||
|
use crate::util::networking::{self, WAYVR_SKYMAPS_ROOT, http_client};
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
use std::path::PathBuf;
|
||||||
|
use wlx_common::{async_executor::AsyncExecutor, config_io};
|
||||||
|
pub type SkymapUuid = uuid::Uuid;
|
||||||
|
|
||||||
|
#[derive(Copy, Clone, Serialize, Deserialize, Debug)]
|
||||||
|
pub enum SkymapResolution {
|
||||||
|
Res2k,
|
||||||
|
Res4k,
|
||||||
|
Res8k,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SkymapResolution {
|
||||||
|
pub const fn get_display_str(&self) -> &'static str {
|
||||||
|
match self {
|
||||||
|
SkymapResolution::Res2k => "2K (2 MiB VRAM)",
|
||||||
|
SkymapResolution::Res4k => "4K (8 MiB VRAM)",
|
||||||
|
SkymapResolution::Res8k => "8K (33 MiB VRAM)",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const fn get_display_str_simple(&self) -> &'static str {
|
||||||
|
match self {
|
||||||
|
SkymapResolution::Res2k => "2K",
|
||||||
|
SkymapResolution::Res4k => "4K",
|
||||||
|
SkymapResolution::Res8k => "8K",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn from_display_str_simple(text: &str) -> Option<SkymapResolution> {
|
||||||
|
match text {
|
||||||
|
"2K" => Some(SkymapResolution::Res2k),
|
||||||
|
"4K" => Some(SkymapResolution::Res4k),
|
||||||
|
"8K" => Some(SkymapResolution::Res8k),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct SkymapCatalogEntryFiles {
|
||||||
|
pub size_8k: Option<String>, // "my_skymap_8k.dds"
|
||||||
|
pub size_4k: Option<String>, // "my_skymap_4k.dds"
|
||||||
|
pub size_2k: String, // we should have *at least* this
|
||||||
|
pub preview: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SkymapCatalogEntryFiles {
|
||||||
|
pub fn get_url_preview(&self) -> String {
|
||||||
|
format!("{}/files/{}", WAYVR_SKYMAPS_ROOT, self.preview)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_filename_from_res(&self, res: SkymapResolution) -> Option<String> {
|
||||||
|
match res {
|
||||||
|
SkymapResolution::Res2k => Some(&self.size_2k),
|
||||||
|
SkymapResolution::Res4k => self.size_4k.as_ref(),
|
||||||
|
SkymapResolution::Res8k => self.size_8k.as_ref(),
|
||||||
|
}
|
||||||
|
.map(|raw_filename| {
|
||||||
|
// sanitize filename, do not allow "../" just in case
|
||||||
|
PathBuf::from(raw_filename)
|
||||||
|
.file_name()
|
||||||
|
.map(|s| String::from(s.to_string_lossy()))
|
||||||
|
})?
|
||||||
|
}
|
||||||
|
|
||||||
|
// example result: "https://wayvr.org/skymaps/files/my_skymap_8k.dds"
|
||||||
|
pub fn get_url_from_res(&self, res: SkymapResolution) -> Option<String> {
|
||||||
|
let filename = self.get_filename_from_res(res)?;
|
||||||
|
Some(format!("{}/files/{}", WAYVR_SKYMAPS_ROOT, filename))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_preview_path(&self) -> PathBuf {
|
||||||
|
config_io::get_skymaps_root().join(&self.preview)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn save_preview_to_file(&self, data: &[u8]) -> anyhow::Result<()> {
|
||||||
|
std::fs::write(self.get_preview_path(), data)?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn remove_preview_file(&self) {
|
||||||
|
let _dont_care = std::fs::remove_file(self.get_preview_path());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
pub struct SkymapCatalogEntry {
|
||||||
|
pub uuid: SkymapUuid,
|
||||||
|
pub created_at: String,
|
||||||
|
pub modified_at: String,
|
||||||
|
pub version: u32,
|
||||||
|
pub name: String,
|
||||||
|
pub description: String,
|
||||||
|
pub author: String,
|
||||||
|
pub files: SkymapCatalogEntryFiles,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SkymapCatalogEntry {
|
||||||
|
pub fn get_destination_path(&self, resolution: SkymapResolution) -> Option<PathBuf> {
|
||||||
|
let filename = self.files.get_filename_from_res(resolution)?;
|
||||||
|
Some(config_io::get_skymaps_root().join(filename))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_destination_metadata_path(&self) -> PathBuf {
|
||||||
|
config_io::get_skymaps_root().join(format!("{}.json", self.uuid))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn is_downloaded(&self, resolution: SkymapResolution) -> anyhow::Result<bool> {
|
||||||
|
let Some(full_path) = self.get_destination_path(resolution) else {
|
||||||
|
return Ok(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
Ok(std::fs::exists(full_path)?)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn has_any_downloaded(&self) -> bool {
|
||||||
|
self.is_downloaded(SkymapResolution::Res2k).unwrap_or(false)
|
||||||
|
|| self.is_downloaded(SkymapResolution::Res4k).unwrap_or(false)
|
||||||
|
|| self.is_downloaded(SkymapResolution::Res8k).unwrap_or(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn remove_file(&self, resolution: SkymapResolution) {
|
||||||
|
let Some(full_path) = self.get_destination_path(resolution) else {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
let _dont_care = std::fs::remove_file(full_path);
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn save_metadata(&self) -> anyhow::Result<()> {
|
||||||
|
let json = serde_json::to_string_pretty(self)?;
|
||||||
|
std::fs::write(self.get_destination_metadata_path(), json)?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn remove_metadata(&self) {
|
||||||
|
let _dont_care = std::fs::remove_file(self.get_destination_metadata_path());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Deserialize)]
|
||||||
|
pub struct SkymapCatalog {
|
||||||
|
pub version: u32,
|
||||||
|
pub r#type: String,
|
||||||
|
pub entries: Vec<SkymapCatalogEntry>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SkymapCatalog {
|
||||||
|
fn validate(&self) -> anyhow::Result<()> {
|
||||||
|
if self.version != 1 {
|
||||||
|
anyhow::bail!("Unsupported version");
|
||||||
|
}
|
||||||
|
|
||||||
|
if self.r#type != "wayvr_skymaps" {
|
||||||
|
anyhow::bail!("Unsupported type");
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn request_catalog(executor: &AsyncExecutor) -> anyhow::Result<SkymapCatalog> {
|
||||||
|
log::info!("Fetching skymap list");
|
||||||
|
|
||||||
|
let res = http_client::get_simple(executor, &format!("{}/catalog.json", networking::WAYVR_SKYMAPS_ROOT)).await?;
|
||||||
|
let catalog = res.into_json::<SkymapCatalog>()?;
|
||||||
|
catalog.validate()?;
|
||||||
|
|
||||||
|
Ok(catalog)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_entries_from_disk() -> anyhow::Result<Vec<SkymapCatalogEntry>> {
|
||||||
|
let mut entries = Vec::<SkymapCatalogEntry>::new();
|
||||||
|
|
||||||
|
let skymaps_root = config_io::get_skymaps_root();
|
||||||
|
|
||||||
|
for uuid in config_io::get_skymaps_uuids().unwrap_or_default() {
|
||||||
|
let metadata_path = skymaps_root.join(format!("{}.json", uuid));
|
||||||
|
let Ok(data) = std::fs::read_to_string(metadata_path) else {
|
||||||
|
continue;
|
||||||
|
};
|
||||||
|
|
||||||
|
let entry = serde_json::from_str::<SkymapCatalogEntry>(&data)?;
|
||||||
|
entries.push(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(entries)
|
||||||
|
}
|
||||||
|
|
@ -6,17 +6,19 @@ use std::{
|
||||||
use wgui::{
|
use wgui::{
|
||||||
assets::AssetPath,
|
assets::AssetPath,
|
||||||
components::button::ComponentButton,
|
components::button::ComponentButton,
|
||||||
event::{EventAlterables, StyleSetRequest},
|
event::EventAlterables,
|
||||||
globals::WguiGlobals,
|
globals::WguiGlobals,
|
||||||
i18n::Translation,
|
i18n::Translation,
|
||||||
layout::{Layout, LayoutTask, LayoutTasks, WidgetID},
|
layout::{Layout, LayoutTask, LayoutTasks, WidgetID},
|
||||||
parser::{Fetchable, ParseDocumentParams, ParserState},
|
parser::{Fetchable, ParseDocumentParams, ParserState},
|
||||||
taffy::Display,
|
|
||||||
widget::label::WidgetLabel,
|
widget::label::WidgetLabel,
|
||||||
};
|
};
|
||||||
use wlx_common::config::GeneralConfig;
|
use wlx_common::config::GeneralConfig;
|
||||||
|
|
||||||
use crate::frontend::{FrontendTask, FrontendTasks};
|
use crate::{
|
||||||
|
frontend::{FrontendTask, FrontendTasks},
|
||||||
|
views::{ViewTrait, ViewUpdateParams},
|
||||||
|
};
|
||||||
|
|
||||||
pub struct PopupManagerParams {
|
pub struct PopupManagerParams {
|
||||||
pub parent_id: WidgetID,
|
pub parent_id: WidgetID,
|
||||||
|
|
@ -34,15 +36,136 @@ pub struct MountedPopup {
|
||||||
frontend_tasks: FrontendTasks,
|
frontend_tasks: FrontendTasks,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
struct MountedPopupState {
|
struct MountedPopupState {
|
||||||
mounted_popup: Option<MountedPopup>,
|
mounted_popup: Option<MountedPopup>,
|
||||||
|
closed_callback: Option<PopupClosedCallback>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Default, Clone)]
|
||||||
pub struct PopupHandle {
|
pub struct PopupHandle {
|
||||||
state: Rc<RefCell<MountedPopupState>>,
|
state: Rc<RefCell<MountedPopupState>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct PopupHolderState<ViewType: ViewTrait> {
|
||||||
|
popup_handle: PopupHandle,
|
||||||
|
view: Option<ViewType>,
|
||||||
|
on_view_close: Option<Box<dyn FnOnce()>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
// we can't use #[derive(Default)] due to the fact that ViewType can't be Default.
|
||||||
|
impl<ViewType: ViewTrait> Default for PopupHolderState<ViewType> {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
popup_handle: Default::default(),
|
||||||
|
view: None,
|
||||||
|
on_view_close: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PopupHolder<ViewType: ViewTrait> {
|
||||||
|
state: Rc<RefCell<PopupHolderState<ViewType>>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<ViewType: ViewTrait> Default for PopupHolder<ViewType> {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
state: Rc::new(RefCell::new(PopupHolderState::default())),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<ViewType: ViewTrait> PopupHolderState<ViewType> {
|
||||||
|
fn close(&mut self) {
|
||||||
|
if self.view.is_some() {
|
||||||
|
self.view = None;
|
||||||
|
if let Some(on_close) = self.on_view_close.take() {
|
||||||
|
on_close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.popup_handle.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<ViewType: ViewTrait> Drop for PopupHolderState<ViewType> {
|
||||||
|
fn drop(&mut self) {
|
||||||
|
self.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// we can't derive(Clone) due to the fact that ViewType is non-cloneable
|
||||||
|
impl<ViewType: ViewTrait> Clone for PopupHolder<ViewType> {
|
||||||
|
fn clone(&self) -> Self {
|
||||||
|
Self {
|
||||||
|
state: self.state.clone(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<ViewType: ViewTrait> PopupHolder<ViewType> {
|
||||||
|
pub fn update(&self, par: &mut ViewUpdateParams) -> anyhow::Result<()> {
|
||||||
|
let mut state = self.state.borrow_mut();
|
||||||
|
let Some(view) = &mut state.view else {
|
||||||
|
return Ok(());
|
||||||
|
};
|
||||||
|
|
||||||
|
view.update(par)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_view(&self, handle: PopupHandle, view: ViewType, on_view_close: Option<Box<dyn FnOnce()>>) {
|
||||||
|
let mut state = self.state.borrow_mut();
|
||||||
|
state.view = Some(view);
|
||||||
|
state.popup_handle = handle;
|
||||||
|
state.on_view_close = on_view_close;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get underlying ViewType object in a closure and return its value
|
||||||
|
// example usage:
|
||||||
|
//
|
||||||
|
// ```rs
|
||||||
|
// holder.with_view(|view| {
|
||||||
|
// view.foo();
|
||||||
|
// })
|
||||||
|
// ```
|
||||||
|
//
|
||||||
|
pub fn with_view<F, R>(&self, f: F) -> Option<R>
|
||||||
|
where
|
||||||
|
F: FnOnce(&mut ViewType) -> R,
|
||||||
|
{
|
||||||
|
let mut state = self.state.borrow_mut();
|
||||||
|
state.view.as_mut().map(f)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Same as with_view, but the closure expects a simple anyhow::Result<()> type
|
||||||
|
pub fn with_view_res<F>(&self, f: F) -> anyhow::Result<()>
|
||||||
|
where
|
||||||
|
F: FnOnce(&mut ViewType) -> anyhow::Result<()>,
|
||||||
|
{
|
||||||
|
if let Some(res) = self.with_view(f) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_close_callback(&self, layout: &Layout) -> Box<dyn FnOnce()>
|
||||||
|
where
|
||||||
|
ViewType: 'static,
|
||||||
|
{
|
||||||
|
let layout_tasks = layout.tasks.clone();
|
||||||
|
let weak_state = Rc::downgrade(&self.state);
|
||||||
|
Box::new(move || {
|
||||||
|
// we can't borrow State here yet, dispatch it.
|
||||||
|
layout_tasks.push(LayoutTask::Dispatch(Box::new(move |_common| {
|
||||||
|
if let Some(state) = weak_state.upgrade() {
|
||||||
|
state.borrow_mut().close();
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
})));
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl PopupHandle {
|
impl PopupHandle {
|
||||||
pub fn close(&self) {
|
pub fn close(&self) {
|
||||||
self.state.borrow_mut().mounted_popup = None; // Drop will be called
|
self.state.borrow_mut().mounted_popup = None; // Drop will be called
|
||||||
|
|
@ -61,10 +184,24 @@ pub struct PopupContentFuncData<'a> {
|
||||||
pub id_content: WidgetID,
|
pub id_content: WidgetID,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PopupClosedCallback = Box<dyn FnOnce()>;
|
||||||
|
type OnContentCallback = Box<dyn FnOnce(PopupContentFuncData) -> anyhow::Result<PopupClosedCallback>>;
|
||||||
|
|
||||||
|
// we need to implement Clone here, but the underlying function can be called only once.
|
||||||
|
// on_content will be cleared after the first call
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct MountPopupParams {
|
pub struct MountPopupOnceParams {
|
||||||
pub title: Translation,
|
title: Translation,
|
||||||
pub on_content: Rc<dyn Fn(PopupContentFuncData) -> anyhow::Result<()>>,
|
on_content: Rc<RefCell<Option<OnContentCallback>>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl MountPopupOnceParams {
|
||||||
|
pub fn new(title: Translation, on_content: OnContentCallback) -> Self {
|
||||||
|
Self {
|
||||||
|
title,
|
||||||
|
on_content: Rc::new(RefCell::new(Some(on_content))),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for MountedPopup {
|
impl Drop for MountedPopup {
|
||||||
|
|
@ -78,25 +215,23 @@ impl State {
|
||||||
fn refresh_stack(&mut self, alterables: &mut EventAlterables) {
|
fn refresh_stack(&mut self, alterables: &mut EventAlterables) {
|
||||||
// show only the topmost popup
|
// show only the topmost popup
|
||||||
self.popup_stack.retain(|weak| {
|
self.popup_stack.retain(|weak| {
|
||||||
let Some(popup) = weak.upgrade() else {
|
let retain = {
|
||||||
return false;
|
let Some(popup) = weak.upgrade() else {
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
popup.borrow_mut().mounted_popup.is_some()
|
||||||
};
|
};
|
||||||
popup.borrow_mut().mounted_popup.is_some()
|
if !retain {
|
||||||
|
log::debug!("removing popup from popup_stack");
|
||||||
|
}
|
||||||
|
retain
|
||||||
});
|
});
|
||||||
|
|
||||||
for (idx, popup) in self.popup_stack.iter().enumerate() {
|
for (idx, popup) in self.popup_stack.iter().enumerate() {
|
||||||
let popup = popup.upgrade().unwrap(); // safe
|
let popup = popup.upgrade().unwrap(); // safe
|
||||||
let popup = popup.borrow_mut();
|
let popup = popup.borrow_mut();
|
||||||
let mounted_popup = popup.mounted_popup.as_ref().unwrap(); // safe;
|
let mounted_popup = popup.mounted_popup.as_ref().unwrap(); // safe;
|
||||||
|
alterables.set_widget_visible(mounted_popup.id_root, idx == self.popup_stack.len() - 1);
|
||||||
alterables.set_style(
|
|
||||||
mounted_popup.id_root,
|
|
||||||
StyleSetRequest::Display(if idx == self.popup_stack.len() - 1 {
|
|
||||||
Display::Flex
|
|
||||||
} else {
|
|
||||||
Display::None
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -116,16 +251,13 @@ impl PopupManager {
|
||||||
state.refresh_stack(alterables);
|
state.refresh_stack(alterables);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Mount a new popup on top of the existing popup stack.
|
fn mount_popup_prepare(
|
||||||
/// Only the topmost popup is visible.
|
&self,
|
||||||
pub fn mount_popup(
|
globals: &WguiGlobals,
|
||||||
&mut self,
|
|
||||||
globals: WguiGlobals,
|
|
||||||
layout: &mut Layout,
|
layout: &mut Layout,
|
||||||
frontend_tasks: FrontendTasks,
|
frontend_tasks: &FrontendTasks,
|
||||||
params: MountPopupParams,
|
popup_title: &Translation,
|
||||||
config: &GeneralConfig,
|
) -> anyhow::Result<(PopupHandle, WidgetID /* content widget ID */)> {
|
||||||
) -> anyhow::Result<()> {
|
|
||||||
let doc_params = &ParseDocumentParams {
|
let doc_params = &ParseDocumentParams {
|
||||||
globals: globals.clone(),
|
globals: globals.clone(),
|
||||||
path: AssetPath::BuiltIn("gui/view/popup_window.xml"),
|
path: AssetPath::BuiltIn("gui/view/popup_window.xml"),
|
||||||
|
|
@ -138,7 +270,7 @@ impl PopupManager {
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut label_title = state.fetch_widget_as::<WidgetLabel>(&layout.state, "popup_title")?;
|
let mut label_title = state.fetch_widget_as::<WidgetLabel>(&layout.state, "popup_title")?;
|
||||||
label_title.set_text_simple(&mut globals.get(), params.title);
|
label_title.set_text_simple(&mut globals.get(), popup_title.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
let but_back = state.fetch_component_as::<ComponentButton>("but_back")?;
|
let but_back = state.fetch_component_as::<ComponentButton>("but_back")?;
|
||||||
|
|
@ -152,6 +284,7 @@ impl PopupManager {
|
||||||
|
|
||||||
let mounted_popup_state = MountedPopupState {
|
let mounted_popup_state = MountedPopupState {
|
||||||
mounted_popup: Some(mounted_popup),
|
mounted_popup: Some(mounted_popup),
|
||||||
|
closed_callback: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
let popup_handle = PopupHandle {
|
let popup_handle = PopupHandle {
|
||||||
|
|
@ -159,28 +292,56 @@ impl PopupManager {
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut state = self.state.borrow_mut();
|
let mut state = self.state.borrow_mut();
|
||||||
|
log::debug!("pushing popup to popup_stack");
|
||||||
state.popup_stack.push(Rc::downgrade(&popup_handle.state));
|
state.popup_stack.push(Rc::downgrade(&popup_handle.state));
|
||||||
|
|
||||||
but_back.on_click({
|
but_back.on_click({
|
||||||
let popup_handle = Rc::downgrade(&popup_handle.state);
|
let popup_handle = Rc::downgrade(&popup_handle.state);
|
||||||
Box::new(move |_common, _evt| {
|
Rc::new(move |_common, _evt| {
|
||||||
if let Some(popup_handle) = popup_handle.upgrade() {
|
if let Some(popup_handle) = popup_handle.upgrade()
|
||||||
popup_handle.borrow_mut().mounted_popup = None; // will call Drop
|
&& let Some(closed_callback) = {
|
||||||
|
let mut state = popup_handle.borrow_mut();
|
||||||
|
state.mounted_popup = None; // will call Drop
|
||||||
|
state.closed_callback.take()
|
||||||
|
} {
|
||||||
|
log::debug!("closed_callback called");
|
||||||
|
closed_callback();
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
frontend_tasks.push(FrontendTask::RefreshPopupManager);
|
frontend_tasks.push(FrontendTask::RefreshPopupManager);
|
||||||
|
Ok((popup_handle, id_content))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Mount a new popup on top of the existing popup stack.
|
||||||
|
/// Only the topmost popup is visible.
|
||||||
|
pub fn mount_popup_once(
|
||||||
|
&mut self,
|
||||||
|
globals: &WguiGlobals,
|
||||||
|
layout: &mut Layout,
|
||||||
|
frontend_tasks: &FrontendTasks,
|
||||||
|
params: MountPopupOnceParams,
|
||||||
|
config: &GeneralConfig,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
|
let mut func = params.on_content.borrow_mut();
|
||||||
|
let Some(on_content_func) = func.take() else {
|
||||||
|
anyhow::bail!("mount_popup_once called more than once");
|
||||||
|
};
|
||||||
|
|
||||||
|
let (popup_handle, id_content) = self.mount_popup_prepare(globals, layout, frontend_tasks, ¶ms.title)?;
|
||||||
|
|
||||||
// mount user-set popup content
|
// mount user-set popup content
|
||||||
(*params.on_content)(PopupContentFuncData {
|
let closed_callback = on_content_func(PopupContentFuncData {
|
||||||
layout,
|
layout,
|
||||||
handle: popup_handle.clone(),
|
handle: popup_handle.clone(),
|
||||||
id_content,
|
id_content,
|
||||||
config,
|
config,
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
popup_handle.state.borrow_mut().closed_callback = Some(closed_callback);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ use keyvalues_parser::{Obj, Vdf};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
pub struct SteamUtils {
|
pub struct SteamUtils {
|
||||||
steam_root: PathBuf,
|
steam_root: PathBuf,
|
||||||
}
|
}
|
||||||
|
|
@ -32,7 +33,10 @@ pub struct AppManifest {
|
||||||
pub last_played: Option<u64>, // unix timestamp
|
pub last_played: Option<u64>, // unix timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO @oo8dev: game sort methods
|
||||||
|
#[allow(dead_code)]
|
||||||
pub enum GameSortMethod {
|
pub enum GameSortMethod {
|
||||||
|
None,
|
||||||
NameAsc,
|
NameAsc,
|
||||||
NameDesc,
|
NameDesc,
|
||||||
PlayDateDesc,
|
PlayDateDesc,
|
||||||
|
|
@ -119,6 +123,12 @@ struct AppEntry {
|
||||||
pub app_id: AppID,
|
pub app_id: AppID,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn launch(app_id: &AppID) -> anyhow::Result<()> {
|
||||||
|
log::info!("Launching Steam game with AppID {}", app_id);
|
||||||
|
call_steam(&format!("steam://rungameid/{}", app_id))?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
pub fn stop(app_id: AppID, force_kill: bool) -> anyhow::Result<()> {
|
pub fn stop(app_id: AppID, force_kill: bool) -> anyhow::Result<()> {
|
||||||
log::info!("Stopping Steam game with AppID {}", app_id);
|
log::info!("Stopping Steam game with AppID {}", app_id);
|
||||||
|
|
||||||
|
|
@ -137,12 +147,6 @@ pub fn stop(app_id: AppID, force_kill: bool) -> anyhow::Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn launch(app_id: &AppID) -> anyhow::Result<()> {
|
|
||||||
log::info!("Launching Steam game with AppID {}", app_id);
|
|
||||||
call_steam(&format!("steam://rungameid/{}", app_id))?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
pub struct RunningGame {
|
pub struct RunningGame {
|
||||||
pub app_id: AppID,
|
pub app_id: AppID,
|
||||||
|
|
@ -281,6 +285,7 @@ impl SteamUtils {
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
match sort_method {
|
match sort_method {
|
||||||
|
GameSortMethod::None => {}
|
||||||
GameSortMethod::NameAsc => {
|
GameSortMethod::NameAsc => {
|
||||||
games.sort_by(|a, b| a.name.cmp(&b.name));
|
games.sort_by(|a, b| a.name.cmp(&b.name));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ use wgui::{
|
||||||
animation::{Animation, AnimationEasing},
|
animation::{Animation, AnimationEasing},
|
||||||
components::tooltip::{TOOLTIP_BORDER_COLOR, TOOLTIP_COLOR},
|
components::tooltip::{TOOLTIP_BORDER_COLOR, TOOLTIP_COLOR},
|
||||||
drawing::Color,
|
drawing::Color,
|
||||||
globals::WguiGlobals,
|
|
||||||
i18n::Translation,
|
i18n::Translation,
|
||||||
layout::{Layout, LayoutTask, LayoutTasks, WidgetID},
|
layout::{Layout, LayoutTask, LayoutTasks, WidgetID},
|
||||||
renderer_vk::{
|
renderer_vk::{
|
||||||
|
|
@ -61,15 +60,7 @@ impl ToastManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mount_toast(
|
fn mount_toast(&self, layout: &mut Layout, state: &mut State, content: Translation) -> anyhow::Result<()> {
|
||||||
&self,
|
|
||||||
globals: &WguiGlobals,
|
|
||||||
layout: &mut Layout,
|
|
||||||
state: &mut State,
|
|
||||||
content: Translation,
|
|
||||||
) -> anyhow::Result<()> {
|
|
||||||
let mut globals = globals.get();
|
|
||||||
|
|
||||||
let (root, _) = layout.add_topmost_child(
|
let (root, _) = layout.add_topmost_child(
|
||||||
WidgetDiv::create(),
|
WidgetDiv::create(),
|
||||||
taffy::Style {
|
taffy::Style {
|
||||||
|
|
@ -110,27 +101,24 @@ impl ToastManager {
|
||||||
},
|
},
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let (label, _) = layout.add_child(
|
let label = WidgetLabel::create(
|
||||||
rect.id,
|
&mut layout.state,
|
||||||
WidgetLabel::create(
|
WidgetLabelParams {
|
||||||
&mut globals,
|
content,
|
||||||
WidgetLabelParams {
|
style: TextStyle {
|
||||||
content,
|
weight: Some(FontWeight::Bold),
|
||||||
style: TextStyle {
|
align: Some(HorizontalAlign::Center),
|
||||||
weight: Some(FontWeight::Bold),
|
wrap: true,
|
||||||
align: Some(HorizontalAlign::Center),
|
..Default::default()
|
||||||
wrap: true,
|
|
||||||
..Default::default()
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
),
|
},
|
||||||
taffy::Style { ..Default::default() },
|
);
|
||||||
)?;
|
let (label, _) = layout.add_child(rect.id, label, taffy::Style { ..Default::default() })?;
|
||||||
|
|
||||||
// show-up animation
|
// show-up animation
|
||||||
layout.animations.add(Animation::new(
|
layout.animations.add(Animation::new(
|
||||||
rect.id,
|
rect.id,
|
||||||
(TOAST_DURATION_TICKS as f32 * globals.defaults.animation_mult) as u32,
|
(TOAST_DURATION_TICKS as f32 * layout.state.theme.animation_mult) as u32,
|
||||||
AnimationEasing::Linear,
|
AnimationEasing::Linear,
|
||||||
Box::new(move |common, data| {
|
Box::new(move |common, data| {
|
||||||
let pos_showup = AnimationEasing::OutQuint.interpolate((data.pos * 4.0).min(1.0));
|
let pos_showup = AnimationEasing::OutQuint.interpolate((data.pos * 4.0).min(1.0));
|
||||||
|
|
@ -161,7 +149,7 @@ impl ToastManager {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn tick(&mut self, globals: &WguiGlobals, layout: &mut Layout) -> anyhow::Result<()> {
|
pub fn tick(&mut self, layout: &mut Layout) -> anyhow::Result<()> {
|
||||||
let mut state = self.state.borrow_mut();
|
let mut state = self.state.borrow_mut();
|
||||||
if state.timeout > 0 {
|
if state.timeout > 0 {
|
||||||
state.timeout -= 1;
|
state.timeout -= 1;
|
||||||
|
|
@ -176,7 +164,7 @@ impl ToastManager {
|
||||||
state.timeout = TOAST_DURATION_TICKS;
|
state.timeout = TOAST_DURATION_TICKS;
|
||||||
// mount next
|
// mount next
|
||||||
if let Some(content) = state.queue.pop_front() {
|
if let Some(content) = state.queue.pop_front() {
|
||||||
self.mount_toast(globals, layout, &mut state, content)?;
|
self.mount_toast(layout, &mut state, content)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
use std::{path::PathBuf, rc::Rc, str::FromStr};
|
|
||||||
use wgui::{
|
|
||||||
assets::{AssetPath, AssetPathOwned},
|
|
||||||
globals::WguiGlobals,
|
|
||||||
i18n::Translation,
|
|
||||||
layout::{Layout, WidgetID},
|
|
||||||
renderer_vk::text::custom_glyph::CustomGlyphData,
|
|
||||||
taffy::{self, prelude::length},
|
|
||||||
widget::{
|
|
||||||
label::{WidgetLabel, WidgetLabelParams},
|
|
||||||
sprite::{WidgetSprite, WidgetSpriteParams},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
use wlx_common::desktop_finder;
|
|
||||||
|
|
||||||
pub type AsyncExecutor = Rc<smol::LocalExecutor<'static>>;
|
|
||||||
|
|
||||||
// the compiler wants to scream
|
|
||||||
#[allow(irrefutable_let_patterns)]
|
|
||||||
pub fn get_desktop_file_icon_path(desktop_file: &desktop_finder::DesktopEntry) -> AssetPathOwned {
|
|
||||||
/*
|
|
||||||
FIXME: why is the compiler complaining about trailing irrefutable patterns there?!?!
|
|
||||||
looking at the PathBuf::from_str implementation, it always returns Ok() and it's inline, maybe that's why.
|
|
||||||
*/
|
|
||||||
if let Some(icon) = &desktop_file.icon_path
|
|
||||||
&& let Ok(path) = PathBuf::from_str(icon)
|
|
||||||
{
|
|
||||||
return AssetPathOwned::File(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
AssetPathOwned::BuiltIn(PathBuf::from_str("dashboard/terminal.svg").unwrap())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn mount_simple_label(
|
|
||||||
globals: &WguiGlobals,
|
|
||||||
layout: &mut Layout,
|
|
||||||
parent_id: WidgetID,
|
|
||||||
translation: Translation,
|
|
||||||
) -> anyhow::Result<()> {
|
|
||||||
layout.add_child(
|
|
||||||
parent_id,
|
|
||||||
WidgetLabel::create(
|
|
||||||
&mut globals.get(),
|
|
||||||
WidgetLabelParams {
|
|
||||||
content: translation,
|
|
||||||
..Default::default()
|
|
||||||
},
|
|
||||||
),
|
|
||||||
taffy::Style::default(),
|
|
||||||
)?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn mount_simple_sprite_square(
|
|
||||||
globals: &WguiGlobals,
|
|
||||||
layout: &mut Layout,
|
|
||||||
parent_id: WidgetID,
|
|
||||||
size_px: f32,
|
|
||||||
path: AssetPath,
|
|
||||||
) -> anyhow::Result<()> {
|
|
||||||
layout.add_child(
|
|
||||||
parent_id,
|
|
||||||
WidgetSprite::create(WidgetSpriteParams {
|
|
||||||
glyph_data: Some(CustomGlyphData::from_assets(globals, path)?),
|
|
||||||
..Default::default()
|
|
||||||
}),
|
|
||||||
taffy::Style {
|
|
||||||
size: taffy::Size {
|
|
||||||
width: length(size_px),
|
|
||||||
height: length(size_px),
|
|
||||||
},
|
|
||||||
..Default::default()
|
|
||||||
},
|
|
||||||
)?;
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,159 @@
|
||||||
|
use glam::{Mat4, Vec2};
|
||||||
|
use wgui::{
|
||||||
|
animation::{Animation, AnimationEasing},
|
||||||
|
assets::AssetPath,
|
||||||
|
components::{self, button::ButtonClickCallback},
|
||||||
|
drawing,
|
||||||
|
i18n::Translation,
|
||||||
|
layout::{Layout, LayoutTask, WidgetID},
|
||||||
|
parser::{Fetchable, ParseDocumentParams},
|
||||||
|
renderer_vk::{
|
||||||
|
text::{FontWeight, TextStyle, custom_glyph::CustomGlyphData},
|
||||||
|
util::centered_matrix,
|
||||||
|
},
|
||||||
|
taffy::{self, prelude::length},
|
||||||
|
widget::{
|
||||||
|
ConstructEssentials,
|
||||||
|
label::{WidgetLabel, WidgetLabelParams},
|
||||||
|
sprite::{WidgetSprite, WidgetSpriteParams},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
pub struct CreateButtonParams<'a> {
|
||||||
|
pub id_parent: WidgetID,
|
||||||
|
pub layout: &'a mut Layout,
|
||||||
|
pub content: Translation,
|
||||||
|
pub icon_builtin: AssetPath<'a>,
|
||||||
|
pub on_click: ButtonClickCallback,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn create_button(par: CreateButtonParams) -> anyhow::Result<()> {
|
||||||
|
let (_, button) = components::button::construct(
|
||||||
|
&mut ConstructEssentials {
|
||||||
|
layout: par.layout,
|
||||||
|
parent: par.id_parent,
|
||||||
|
},
|
||||||
|
components::button::Params {
|
||||||
|
text: Some(par.content),
|
||||||
|
sprite_src: Some(par.icon_builtin),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
button.on_click(par.on_click);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub fn create_label(layout: &mut Layout, id_parent: WidgetID, content: Translation) -> anyhow::Result<()> {
|
||||||
|
let label = WidgetLabel::create(
|
||||||
|
&mut layout.state,
|
||||||
|
WidgetLabelParams {
|
||||||
|
content,
|
||||||
|
style: TextStyle {
|
||||||
|
wrap: true,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
layout.add_child(id_parent, label, Default::default())?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn create_label_error(layout: &mut Layout, parent: WidgetID, content: String) -> anyhow::Result<()> {
|
||||||
|
let label = WidgetLabel::create(
|
||||||
|
&mut layout.state,
|
||||||
|
WidgetLabelParams {
|
||||||
|
content: Translation::from_raw_text_string(content),
|
||||||
|
style: TextStyle {
|
||||||
|
wrap: true,
|
||||||
|
color: Some(drawing::Color::new(1.0, 0.5, 0.0, 1.0)),
|
||||||
|
weight: Some(FontWeight::Bold),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
layout.add_child(parent, label, Default::default())?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn create_icon(layout: &mut Layout, id_parent: WidgetID, size: Vec2, path: AssetPath) -> anyhow::Result<WidgetID> {
|
||||||
|
let widget_sprite = WidgetSprite::create(WidgetSpriteParams {
|
||||||
|
color: None,
|
||||||
|
glyph_data: Some(CustomGlyphData::from_assets(&layout.state.globals, path)?),
|
||||||
|
});
|
||||||
|
|
||||||
|
let size = taffy::Size {
|
||||||
|
width: length(size.x),
|
||||||
|
height: length(size.y),
|
||||||
|
};
|
||||||
|
|
||||||
|
let (widget, _) = layout.add_child(
|
||||||
|
id_parent,
|
||||||
|
widget_sprite,
|
||||||
|
taffy::Style {
|
||||||
|
min_size: size,
|
||||||
|
max_size: size,
|
||||||
|
size,
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
|
||||||
|
Ok(widget.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CreateLoadingParams<'a> {
|
||||||
|
pub layout: &'a mut Layout,
|
||||||
|
pub parent_id: WidgetID,
|
||||||
|
pub with_text: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn create_loading(par: CreateLoadingParams) -> anyhow::Result<WidgetID> {
|
||||||
|
let doc_params = ParseDocumentParams {
|
||||||
|
globals: par.layout.state.globals.clone(),
|
||||||
|
path: AssetPath::BuiltIn("gui/t_loading.xml"),
|
||||||
|
extra: Default::default(),
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut parser_state = wgui::parser::parse_from_assets(&doc_params, par.layout, par.parent_id)?;
|
||||||
|
|
||||||
|
let data = parser_state.realize_template(
|
||||||
|
&doc_params,
|
||||||
|
if par.with_text {
|
||||||
|
"LoadingWithText"
|
||||||
|
} else {
|
||||||
|
"LoadingWithoutText"
|
||||||
|
},
|
||||||
|
par.layout,
|
||||||
|
par.parent_id,
|
||||||
|
Default::default(),
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let id_root = data.get_widget_id("root")?;
|
||||||
|
let id_sprite_loading = data.get_widget_id("sprite_loading")?;
|
||||||
|
|
||||||
|
par.layout.animations.add(Animation::new(
|
||||||
|
id_sprite_loading,
|
||||||
|
60 * 30, /* spin it for 30 seconds at most */
|
||||||
|
AnimationEasing::Linear,
|
||||||
|
Box::new(move |common, data| {
|
||||||
|
// spin it
|
||||||
|
data.data.transform = centered_matrix(data.widget_boundary.size, &Mat4::from_rotation_z(data.pos * 400.0));
|
||||||
|
if data.pos == 1.0 {
|
||||||
|
// remove the spinner, do not waste energy
|
||||||
|
common
|
||||||
|
.alterables
|
||||||
|
.tasks
|
||||||
|
.push(LayoutTask::RemoveWidget(id_sprite_loading));
|
||||||
|
}
|
||||||
|
common.alterables.mark_redraw();
|
||||||
|
}),
|
||||||
|
));
|
||||||
|
|
||||||
|
Ok(id_root)
|
||||||
|
}
|
||||||
|
|
@ -14,7 +14,11 @@ use wgui::{
|
||||||
};
|
};
|
||||||
use wlx_common::{config::GeneralConfig, dash_interface::BoxDashInterface, desktop_finder::DesktopEntry};
|
use wlx_common::{config::GeneralConfig, dash_interface::BoxDashInterface, desktop_finder::DesktopEntry};
|
||||||
|
|
||||||
use crate::frontend::{FrontendTask, FrontendTasks, SoundType};
|
use crate::{
|
||||||
|
frontend::{FrontendTask, FrontendTasks, SoundType},
|
||||||
|
util::popup_manager::{MountPopupOnceParams, PopupHolder},
|
||||||
|
views::{ViewTrait, ViewUpdateParams},
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Clone, Copy, Eq, PartialEq, EnumString, VariantNames, AsRefStr)]
|
#[derive(Clone, Copy, Eq, PartialEq, EnumString, VariantNames, AsRefStr)]
|
||||||
enum PosMode {
|
enum PosMode {
|
||||||
|
|
@ -50,7 +54,6 @@ enum CompositorMode {
|
||||||
enum Task {
|
enum Task {
|
||||||
SetCompositor(CompositorMode),
|
SetCompositor(CompositorMode),
|
||||||
SetRes(ResMode),
|
SetRes(ResMode),
|
||||||
SetPos(PosMode),
|
|
||||||
SetOrientation(OrientationMode),
|
SetOrientation(OrientationMode),
|
||||||
SetAutoStart(bool),
|
SetAutoStart(bool),
|
||||||
Launch,
|
Launch,
|
||||||
|
|
@ -67,7 +70,7 @@ struct LaunchParams<'a, T> {
|
||||||
interface: &'a mut BoxDashInterface<T>,
|
interface: &'a mut BoxDashInterface<T>,
|
||||||
auto_start: bool,
|
auto_start: bool,
|
||||||
data: &'a mut T,
|
data: &'a mut T,
|
||||||
on_launched: &'a dyn Fn(),
|
on_launched: Option<Box<dyn FnOnce()>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct View {
|
pub struct View {
|
||||||
|
|
@ -92,7 +95,7 @@ pub struct View {
|
||||||
|
|
||||||
auto_start: bool,
|
auto_start: bool,
|
||||||
|
|
||||||
on_launched: Box<dyn Fn()>,
|
on_launched: Option<Box<dyn FnOnce()>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Params<'a> {
|
pub struct Params<'a> {
|
||||||
|
|
@ -102,7 +105,13 @@ pub struct Params<'a> {
|
||||||
pub parent_id: WidgetID,
|
pub parent_id: WidgetID,
|
||||||
pub config: &'a GeneralConfig,
|
pub config: &'a GeneralConfig,
|
||||||
pub frontend_tasks: &'a FrontendTasks,
|
pub frontend_tasks: &'a FrontendTasks,
|
||||||
pub on_launched: Box<dyn Fn()>,
|
pub on_launched: Box<dyn FnOnce()>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ViewTrait for View {
|
||||||
|
fn update(&mut self, _par: &mut ViewUpdateParams) -> anyhow::Result<()> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl View {
|
impl View {
|
||||||
|
|
@ -156,7 +165,7 @@ impl View {
|
||||||
} else {
|
} else {
|
||||||
CompositorMode::Native
|
CompositorMode::Native
|
||||||
};
|
};
|
||||||
radio_compositor.set_value(compositor_mode.as_ref())?;
|
radio_compositor.set_value_simple(compositor_mode.as_ref())?;
|
||||||
tasks.push(Task::SetCompositor(compositor_mode));
|
tasks.push(Task::SetCompositor(compositor_mode));
|
||||||
|
|
||||||
let res_mode = ResMode::Res1080;
|
let res_mode = ResMode::Res1080;
|
||||||
|
|
@ -180,7 +189,7 @@ impl View {
|
||||||
let tasks = tasks.clone();
|
let tasks = tasks.clone();
|
||||||
Box::new(move |_, ev| {
|
Box::new(move |_, ev| {
|
||||||
if let Some(mode) = ev.value.and_then(|v| {
|
if let Some(mode) = ev.value.and_then(|v| {
|
||||||
CompositorMode::from_str(&*v)
|
CompositorMode::from_str(&v)
|
||||||
.inspect_err(|_| {
|
.inspect_err(|_| {
|
||||||
log::error!(
|
log::error!(
|
||||||
"Invalid value for compositor: '{v}'. Valid values are: {:?}",
|
"Invalid value for compositor: '{v}'. Valid values are: {:?}",
|
||||||
|
|
@ -199,7 +208,7 @@ impl View {
|
||||||
let tasks = tasks.clone();
|
let tasks = tasks.clone();
|
||||||
Box::new(move |_, ev| {
|
Box::new(move |_, ev| {
|
||||||
if let Some(mode) = ev.value.and_then(|v| {
|
if let Some(mode) = ev.value.and_then(|v| {
|
||||||
ResMode::from_str(&*v)
|
ResMode::from_str(&v)
|
||||||
.inspect_err(|_| {
|
.inspect_err(|_| {
|
||||||
log::error!(
|
log::error!(
|
||||||
"Invalid value for resolution: '{v}'. Valid values are: {:?}",
|
"Invalid value for resolution: '{v}'. Valid values are: {:?}",
|
||||||
|
|
@ -237,7 +246,7 @@ impl View {
|
||||||
let tasks = tasks.clone();
|
let tasks = tasks.clone();
|
||||||
Box::new(move |_, ev| {
|
Box::new(move |_, ev| {
|
||||||
if let Some(mode) = ev.value.and_then(|v| {
|
if let Some(mode) = ev.value.and_then(|v| {
|
||||||
OrientationMode::from_str(&*v)
|
OrientationMode::from_str(&v)
|
||||||
.inspect_err(|_| {
|
.inspect_err(|_| {
|
||||||
log::error!(
|
log::error!(
|
||||||
"Invalid value for orientation: '{v}'. Valid values are: {:?}",
|
"Invalid value for orientation: '{v}'. Valid values are: {:?}",
|
||||||
|
|
@ -281,7 +290,7 @@ impl View {
|
||||||
entry: params.entry,
|
entry: params.entry,
|
||||||
frontend_tasks: params.frontend_tasks.clone(),
|
frontend_tasks: params.frontend_tasks.clone(),
|
||||||
globals: params.globals.clone(),
|
globals: params.globals.clone(),
|
||||||
on_launched: params.on_launched,
|
on_launched: Some(params.on_launched),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -295,7 +304,6 @@ impl View {
|
||||||
match task {
|
match task {
|
||||||
Task::SetCompositor(mode) => self.compositor_mode = mode,
|
Task::SetCompositor(mode) => self.compositor_mode = mode,
|
||||||
Task::SetRes(mode) => self.res_mode = mode,
|
Task::SetRes(mode) => self.res_mode = mode,
|
||||||
Task::SetPos(mode) => self.pos_mode = mode,
|
|
||||||
Task::SetOrientation(mode) => self.orientation_mode = mode,
|
Task::SetOrientation(mode) => self.orientation_mode = mode,
|
||||||
Task::SetAutoStart(auto_start) => self.auto_start = auto_start,
|
Task::SetAutoStart(auto_start) => self.auto_start = auto_start,
|
||||||
Task::Launch => self.action_launch(interface, data),
|
Task::Launch => self.action_launch(interface, data),
|
||||||
|
|
@ -318,7 +326,7 @@ impl View {
|
||||||
auto_start: self.auto_start,
|
auto_start: self.auto_start,
|
||||||
interface,
|
interface,
|
||||||
data,
|
data,
|
||||||
on_launched: &self.on_launched,
|
on_launched: self.on_launched.take(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -336,7 +344,7 @@ impl View {
|
||||||
))));
|
))));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn launch<T>(params: LaunchParams<T>) -> anyhow::Result<()> {
|
fn launch<T>(mut params: LaunchParams<T>) -> anyhow::Result<()> {
|
||||||
let mut env = Vec::<String>::new();
|
let mut env = Vec::<String>::new();
|
||||||
|
|
||||||
if params.compositor_mode == CompositorMode::Native {
|
if params.compositor_mode == CompositorMode::Native {
|
||||||
|
|
@ -392,7 +400,9 @@ impl View {
|
||||||
|
|
||||||
params.frontend_tasks.push(FrontendTask::PlaySound(SoundType::Launch));
|
params.frontend_tasks.push(FrontendTask::PlaySound(SoundType::Launch));
|
||||||
|
|
||||||
(*params.on_launched)();
|
if let Some(on_launched) = params.on_launched.take() {
|
||||||
|
on_launched();
|
||||||
|
}
|
||||||
|
|
||||||
// we're done!
|
// we're done!
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
@ -422,3 +432,26 @@ impl View {
|
||||||
[width as u32, height as u32]
|
[width as u32, height as u32]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn mount_popup(frontend_tasks: FrontendTasks, globals: WguiGlobals, entry: DesktopEntry, popup: PopupHolder<View>) {
|
||||||
|
frontend_tasks
|
||||||
|
.clone()
|
||||||
|
.push(FrontendTask::MountPopupOnce(MountPopupOnceParams::new(
|
||||||
|
Translation::from_raw_text(&entry.app_name),
|
||||||
|
Box::new(move |data| {
|
||||||
|
let on_launched = popup.get_close_callback(data.layout);
|
||||||
|
let view = View::new(Params {
|
||||||
|
entry: entry.clone(),
|
||||||
|
globals: &globals,
|
||||||
|
layout: data.layout,
|
||||||
|
parent_id: data.id_content,
|
||||||
|
frontend_tasks: &frontend_tasks,
|
||||||
|
config: data.config,
|
||||||
|
on_launched,
|
||||||
|
})?;
|
||||||
|
|
||||||
|
popup.set_view(data.handle, view, None);
|
||||||
|
Ok(popup.get_close_callback(data.layout))
|
||||||
|
}),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,8 +110,7 @@ struct MultiSelectorParams<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mount_multi_selector(params: MultiSelectorParams) -> anyhow::Result<()> {
|
fn mount_multi_selector(params: MultiSelectorParams) -> anyhow::Result<()> {
|
||||||
let globals = params.ess.layout.state.globals.clone();
|
let accent_color = params.ess.layout.state.theme.accent_color;
|
||||||
let accent_color = globals.get().defaults.accent_color;
|
|
||||||
|
|
||||||
for cell in params.cells {
|
for cell in params.cells {
|
||||||
let highlighted = cell.key == params.def_cell;
|
let highlighted = cell.key == params.def_cell;
|
||||||
|
|
@ -131,7 +130,7 @@ fn mount_multi_selector(params: MultiSelectorParams) -> anyhow::Result<()> {
|
||||||
button.on_click({
|
button.on_click({
|
||||||
let on_click = params.on_click.clone();
|
let on_click = params.on_click.clone();
|
||||||
let key = cell.key.clone();
|
let key = cell.key.clone();
|
||||||
Box::new(move |_, _| {
|
Rc::new(move |_, _| {
|
||||||
(*on_click)(key.as_str());
|
(*on_click)(key.as_str());
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
|
|
@ -610,7 +609,7 @@ impl View {
|
||||||
fn handle_func_button_click(&self, task: ViewTask) -> ButtonClickCallback {
|
fn handle_func_button_click(&self, task: ViewTask) -> ButtonClickCallback {
|
||||||
let tasks = self.tasks.clone();
|
let tasks = self.tasks.clone();
|
||||||
let on_update = self.on_update.clone();
|
let on_update = self.on_update.clone();
|
||||||
Box::new(move |_common, _evt| {
|
Rc::new(move |_common, _evt| {
|
||||||
tasks.push(task.clone());
|
tasks.push(task.clone());
|
||||||
(*on_update)();
|
(*on_update)();
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
@ -654,11 +653,6 @@ impl View {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_button_highlights(&self, layout: &mut Layout) -> anyhow::Result<()> {
|
fn update_button_highlights(&self, layout: &mut Layout) -> anyhow::Result<()> {
|
||||||
let defaults = self.globals.defaults();
|
|
||||||
|
|
||||||
let mut c = layout.start_common();
|
|
||||||
let mut common = c.common();
|
|
||||||
|
|
||||||
let num: u8 = match &self.mode {
|
let num: u8 = match &self.mode {
|
||||||
CurrentMode::Sinks => 0,
|
CurrentMode::Sinks => 0,
|
||||||
CurrentMode::Sources => 1,
|
CurrentMode::Sources => 1,
|
||||||
|
|
@ -666,22 +660,21 @@ impl View {
|
||||||
CurrentMode::CardProfileSelector(_) => 255,
|
CurrentMode::CardProfileSelector(_) => 255,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let mut com = layout.common();
|
||||||
|
|
||||||
let mut perform = |btn_num: u8, btn: &Rc<ComponentButton>| {
|
let mut perform = |btn_num: u8, btn: &Rc<ComponentButton>| {
|
||||||
btn.set_color(
|
let color = if num == btn_num {
|
||||||
&mut common,
|
com.state.theme.accent_color
|
||||||
if num == btn_num {
|
} else {
|
||||||
defaults.accent_color
|
com.state.theme.button_color
|
||||||
} else {
|
};
|
||||||
defaults.button_color
|
btn.set_color(&mut com, color);
|
||||||
},
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
perform(0, &self.btn_sinks);
|
perform(0, &self.btn_sinks);
|
||||||
perform(1, &self.btn_sources);
|
perform(1, &self.btn_sources);
|
||||||
perform(2, &self.btn_cards);
|
perform(2, &self.btn_cards);
|
||||||
|
|
||||||
c.finish()?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -755,21 +748,20 @@ impl View {
|
||||||
|
|
||||||
let data = self
|
let data = self
|
||||||
.state
|
.state
|
||||||
.parse_template(&doc_params(&self.globals), "Card", params.layout, self.id_devices, par)?;
|
.realize_template(&doc_params(&self.globals), "Card", params.layout, self.id_devices, par)?;
|
||||||
|
|
||||||
let btn_card = data.fetch_component_as::<ComponentButton>("btn_card")?;
|
let btn_card = data.fetch_component_as::<ComponentButton>("btn_card")?;
|
||||||
btn_card.on_click({
|
btn_card.on_click({
|
||||||
let tasks = self.tasks.clone();
|
let tasks = self.tasks.clone();
|
||||||
let card = params.card.clone();
|
let card = params.card.clone();
|
||||||
let on_update = self.on_update.clone();
|
let on_update = self.on_update.clone();
|
||||||
Box::new(move |_common, _evt| {
|
Rc::new(move |_common, _evt| {
|
||||||
tasks.push(ViewTask::SetMode(CurrentMode::CardProfileSelector(card.clone())));
|
tasks.push(ViewTask::SetMode(CurrentMode::CardProfileSelector(card.clone())));
|
||||||
(*on_update)();
|
(*on_update)();
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
log::info!("mount card TODO: {}", params.card.name);
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -799,7 +791,7 @@ impl View {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
let data = self.state.parse_template(
|
let data = self.state.realize_template(
|
||||||
&doc_params(&self.globals),
|
&doc_params(&self.globals),
|
||||||
"DeviceSlider",
|
"DeviceSlider",
|
||||||
params.layout,
|
params.layout,
|
||||||
|
|
@ -807,14 +799,12 @@ impl View {
|
||||||
par,
|
par,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let mut c = params.layout.start_common();
|
let mut common = params.layout.common();
|
||||||
let mut common = c.common();
|
|
||||||
|
|
||||||
let checkbox = data.fetch_component_as::<ComponentCheckbox>("checkbox")?;
|
let checkbox = data.fetch_component_as::<ComponentCheckbox>("checkbox")?;
|
||||||
let btn_mute = data.fetch_component_as::<ComponentButton>("btn_mute")?;
|
let btn_mute = data.fetch_component_as::<ComponentButton>("btn_mute")?;
|
||||||
let slider = data.fetch_component_as::<ComponentSlider>("slider")?;
|
let slider = data.fetch_component_as::<ComponentSlider>("slider")?;
|
||||||
|
|
||||||
slider.set_value(&mut common, params.control.on_volume_request()? / VOLUME_MULT);
|
slider.set_value_primary(&mut common, params.control.on_volume_request()? / VOLUME_MULT);
|
||||||
|
|
||||||
checkbox.set_checked(&mut common, params.checked);
|
checkbox.set_checked(&mut common, params.checked);
|
||||||
|
|
||||||
|
|
@ -829,21 +819,21 @@ impl View {
|
||||||
slider.on_value_changed({
|
slider.on_value_changed({
|
||||||
let control = params.control.clone();
|
let control = params.control.clone();
|
||||||
Box::new(move |_common, event| {
|
Box::new(move |_common, event| {
|
||||||
control.on_volume_change(event.value * VOLUME_MULT)?;
|
if let Err(e) = control.on_volume_change(event.value * VOLUME_MULT) {
|
||||||
Ok(())
|
log::error!("{:?}", e);
|
||||||
|
debug_assert!(false);
|
||||||
|
};
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
btn_mute.on_click({
|
btn_mute.on_click({
|
||||||
let control = params.control.clone();
|
let control = params.control.clone();
|
||||||
Box::new(move |_common, _event| {
|
Rc::new(move |_common, _event| {
|
||||||
control.on_mute_toggle()?;
|
control.on_mute_toggle()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
c.finish()?;
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -946,7 +936,7 @@ impl View {
|
||||||
layout.remove_children(self.id_devices);
|
layout.remove_children(self.id_devices);
|
||||||
|
|
||||||
{
|
{
|
||||||
let data = self.state.parse_template(
|
let data = self.state.realize_template(
|
||||||
&doc_params(&self.globals),
|
&doc_params(&self.globals),
|
||||||
"SelectAudioProfileText",
|
"SelectAudioProfileText",
|
||||||
layout,
|
layout,
|
||||||
|
|
@ -957,7 +947,7 @@ impl View {
|
||||||
btn_back.on_click({
|
btn_back.on_click({
|
||||||
let tasks = self.tasks.clone();
|
let tasks = self.tasks.clone();
|
||||||
let on_update = self.on_update.clone();
|
let on_update = self.on_update.clone();
|
||||||
Box::new(move |_, _| {
|
Rc::new(move |_, _| {
|
||||||
tasks.push(ViewTask::SetMode(CurrentMode::Cards));
|
tasks.push(ViewTask::SetMode(CurrentMode::Cards));
|
||||||
(*on_update)();
|
(*on_update)();
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,127 @@
|
||||||
|
use std::{collections::HashMap, rc::Rc};
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
frontend::{FrontendTask, FrontendTasks},
|
||||||
|
util::popup_manager::{MountPopupOnceParams, PopupHolder},
|
||||||
|
views::{ViewTrait, ViewUpdateParams},
|
||||||
|
};
|
||||||
|
use wgui::{
|
||||||
|
assets::AssetPath,
|
||||||
|
components::button::ComponentButton,
|
||||||
|
globals::WguiGlobals,
|
||||||
|
i18n::Translation,
|
||||||
|
layout::{Layout, WidgetID},
|
||||||
|
parser::{Fetchable, ParseDocumentParams, ParserState},
|
||||||
|
task::Tasks,
|
||||||
|
widget::label::WidgetLabel,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub struct ButtonEntry {
|
||||||
|
pub content: Translation, // button text
|
||||||
|
pub icon: &'static str, // sprite_src_builtin
|
||||||
|
pub action: &'static str, // action name (will be passed into on_action_click)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Params {
|
||||||
|
pub globals: WguiGlobals,
|
||||||
|
pub entries: Vec<ButtonEntry>,
|
||||||
|
pub message: Translation,
|
||||||
|
pub on_action_click: Box<dyn FnOnce(&'static str)>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
|
enum Task {
|
||||||
|
ActionClicked(&'static str),
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct View {
|
||||||
|
tasks: Tasks<Task>,
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
parser_state: ParserState,
|
||||||
|
|
||||||
|
on_action_click: Option<Box<dyn FnOnce(&'static str)>>,
|
||||||
|
on_close_request: Option<Box<dyn FnOnce()>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn doc_params(globals: &WguiGlobals) -> ParseDocumentParams<'_> {
|
||||||
|
ParseDocumentParams {
|
||||||
|
globals: globals.clone(),
|
||||||
|
path: AssetPath::BuiltIn("gui/view/dialog_box.xml"),
|
||||||
|
extra: Default::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ViewTrait for View {
|
||||||
|
fn update(&mut self, _par: &mut ViewUpdateParams) -> anyhow::Result<()> {
|
||||||
|
for task in self.tasks.drain() {
|
||||||
|
match task {
|
||||||
|
Task::ActionClicked(action) => {
|
||||||
|
if let Some(func) = self.on_action_click.take() {
|
||||||
|
func(action);
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Some(on_close) = self.on_close_request.take() {
|
||||||
|
on_close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl View {
|
||||||
|
pub fn new(
|
||||||
|
layout: &mut Layout,
|
||||||
|
id_parent: WidgetID,
|
||||||
|
on_close_request: Box<dyn FnOnce()>,
|
||||||
|
par: Params,
|
||||||
|
) -> anyhow::Result<Self> {
|
||||||
|
let tasks = Tasks::<Task>::new();
|
||||||
|
|
||||||
|
let mut parser_state = wgui::parser::parse_from_assets(&doc_params(&par.globals), layout, id_parent)?;
|
||||||
|
let id_buttons = parser_state.get_widget_id("buttons")?;
|
||||||
|
|
||||||
|
{
|
||||||
|
let label_message = parser_state.fetch_widget(&layout.state, "label_message")?.widget;
|
||||||
|
label_message
|
||||||
|
.cast::<WidgetLabel>()?
|
||||||
|
.set_text(&mut layout.common(), par.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
for entry in par.entries {
|
||||||
|
let mut t_par = HashMap::<Rc<str>, Rc<str>>::new();
|
||||||
|
t_par.insert(Rc::from("icon"), Rc::from(entry.icon));
|
||||||
|
|
||||||
|
let data =
|
||||||
|
parser_state.realize_template(&doc_params(&par.globals), "DialogBoxButton", layout, id_buttons, t_par)?;
|
||||||
|
|
||||||
|
let button = data.fetch_component_as::<ComponentButton>("btn")?;
|
||||||
|
button.set_text(&mut layout.common(), entry.content.clone());
|
||||||
|
button.on_click(tasks.get_button_click_callback(Task::ActionClicked(entry.action)));
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(Self {
|
||||||
|
tasks,
|
||||||
|
parser_state,
|
||||||
|
on_action_click: Some(par.on_action_click),
|
||||||
|
on_close_request: Some(on_close_request),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn mount_popup(popup: PopupHolder<View>, frontend_tasks: FrontendTasks, params: Params) {
|
||||||
|
frontend_tasks
|
||||||
|
.clone()
|
||||||
|
.push(FrontendTask::MountPopupOnce(MountPopupOnceParams::new(
|
||||||
|
Translation::from_raw_text("Info"),
|
||||||
|
Box::new(move |data| {
|
||||||
|
let on_close_request = popup.get_close_callback(data.layout);
|
||||||
|
let view = View::new(data.layout, data.id_content, on_close_request, params)?;
|
||||||
|
|
||||||
|
popup.set_view(data.handle, view, None);
|
||||||
|
Ok(popup.get_close_callback(data.layout))
|
||||||
|
}),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,265 @@
|
||||||
|
use crate::{
|
||||||
|
frontend::{FrontendTask, FrontendTasks},
|
||||||
|
util::{
|
||||||
|
networking::http_client::{self, ProgressFuncData},
|
||||||
|
popup_manager::{MountPopupOnceParams, PopupHolder},
|
||||||
|
wgui_simple,
|
||||||
|
},
|
||||||
|
views::{ViewTrait, ViewUpdateParams},
|
||||||
|
};
|
||||||
|
use glam::Vec2;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
use wgui::{
|
||||||
|
assets::AssetPath,
|
||||||
|
components::button::ComponentButton,
|
||||||
|
globals::WguiGlobals,
|
||||||
|
i18n::Translation,
|
||||||
|
layout::{Layout, WidgetID},
|
||||||
|
parser::{Fetchable, ParseDocumentParams, ParserState},
|
||||||
|
task::Tasks,
|
||||||
|
widget::label::WidgetLabel,
|
||||||
|
};
|
||||||
|
use wlx_common::async_executor::AsyncExecutor;
|
||||||
|
|
||||||
|
pub struct Params {
|
||||||
|
pub globals: WguiGlobals,
|
||||||
|
pub executor: AsyncExecutor,
|
||||||
|
pub target_path: PathBuf,
|
||||||
|
pub url: String,
|
||||||
|
pub on_downloaded: Box<dyn FnOnce()>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone)]
|
||||||
|
enum Task {
|
||||||
|
StartDownload(/*url*/ String, /*target path*/ PathBuf),
|
||||||
|
SetStatusText(String),
|
||||||
|
ShowIconSuccess,
|
||||||
|
ShowIconError,
|
||||||
|
Close,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct View {
|
||||||
|
globals: WguiGlobals,
|
||||||
|
tasks: Tasks<Task>,
|
||||||
|
executor: AsyncExecutor,
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
parser_state: ParserState,
|
||||||
|
|
||||||
|
id_label_status: WidgetID,
|
||||||
|
id_loading_parent: WidgetID,
|
||||||
|
id_content: WidgetID,
|
||||||
|
on_close_request: Option<Box<dyn FnOnce()>>,
|
||||||
|
on_downloaded: Option<Box<dyn FnOnce()>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn doc_params(globals: &WguiGlobals) -> ParseDocumentParams<'_> {
|
||||||
|
ParseDocumentParams {
|
||||||
|
globals: globals.clone(),
|
||||||
|
path: AssetPath::BuiltIn("gui/view/download_file.xml"),
|
||||||
|
extra: Default::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ViewTrait for View {
|
||||||
|
fn update(&mut self, par: &mut ViewUpdateParams) -> anyhow::Result<()> {
|
||||||
|
for task in self.tasks.drain() {
|
||||||
|
match task {
|
||||||
|
Task::StartDownload(url, path) => {
|
||||||
|
if let Some(on_downloaded) = self.on_downloaded.take() {
|
||||||
|
self
|
||||||
|
.executor
|
||||||
|
.spawn(View::download(
|
||||||
|
self.tasks.clone(),
|
||||||
|
self.executor.clone(),
|
||||||
|
url,
|
||||||
|
path,
|
||||||
|
on_downloaded,
|
||||||
|
))
|
||||||
|
.detach();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Task::SetStatusText(text) => {
|
||||||
|
let widgets = &mut par.layout.state.widgets;
|
||||||
|
widgets
|
||||||
|
.fetch(self.id_label_status)?
|
||||||
|
.cast::<WidgetLabel>()?
|
||||||
|
.set_text(&mut par.layout.common(), Translation::from_raw_text_string(text));
|
||||||
|
}
|
||||||
|
Task::ShowIconSuccess => {
|
||||||
|
par.layout.remove_children(self.id_loading_parent);
|
||||||
|
wgui_simple::create_icon(
|
||||||
|
par.layout,
|
||||||
|
self.id_loading_parent,
|
||||||
|
Vec2::splat(32.0),
|
||||||
|
AssetPath::BuiltIn("dashboard/check.svg"),
|
||||||
|
)?;
|
||||||
|
|
||||||
|
// "Close window" button
|
||||||
|
self
|
||||||
|
.parser_state
|
||||||
|
.realize_template(
|
||||||
|
&doc_params(&self.globals),
|
||||||
|
"btn_close",
|
||||||
|
par.layout,
|
||||||
|
self.id_content,
|
||||||
|
Default::default(),
|
||||||
|
)?
|
||||||
|
.fetch_component_as::<ComponentButton>("btn")?
|
||||||
|
.on_click(self.tasks.get_button_click_callback(Task::Close));
|
||||||
|
}
|
||||||
|
Task::ShowIconError => {
|
||||||
|
par.layout.remove_children(self.id_loading_parent);
|
||||||
|
wgui_simple::create_icon(
|
||||||
|
par.layout,
|
||||||
|
self.id_loading_parent,
|
||||||
|
Vec2::splat(32.0),
|
||||||
|
AssetPath::BuiltIn("dashboard/error.svg"),
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
Task::Close => {
|
||||||
|
if let Some(on_close) = self.on_close_request.take() {
|
||||||
|
on_close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn handle_async_result<T, E>(error_reason: &'static str, tasks: &Tasks<Task>, result: anyhow::Result<T, E>) -> Option<T>
|
||||||
|
where
|
||||||
|
E: std::fmt::Debug,
|
||||||
|
{
|
||||||
|
match result {
|
||||||
|
Ok(res) => Some(res),
|
||||||
|
Err(e) => {
|
||||||
|
tasks.push(Task::ShowIconError);
|
||||||
|
tasks.push(Task::SetStatusText(format!("{}: {:?}", error_reason, e)));
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl View {
|
||||||
|
pub fn new(
|
||||||
|
layout: &mut Layout,
|
||||||
|
id_parent: WidgetID,
|
||||||
|
on_close_request: Box<dyn FnOnce()>,
|
||||||
|
par: Params,
|
||||||
|
) -> anyhow::Result<Self> {
|
||||||
|
let tasks = Tasks::<Task>::new();
|
||||||
|
|
||||||
|
let parser_state = wgui::parser::parse_from_assets(&doc_params(&par.globals), layout, id_parent)?;
|
||||||
|
let id_label_status = parser_state.get_widget_id("label_status")?;
|
||||||
|
let id_content = parser_state.get_widget_id("content")?;
|
||||||
|
let id_loading_parent = parser_state.get_widget_id("loading_parent")?;
|
||||||
|
|
||||||
|
wgui_simple::create_loading(wgui_simple::CreateLoadingParams {
|
||||||
|
parent_id: id_loading_parent,
|
||||||
|
layout,
|
||||||
|
with_text: false,
|
||||||
|
})?;
|
||||||
|
|
||||||
|
let str_target_path = par.globals.i18n().translate("TARGET_PATH");
|
||||||
|
|
||||||
|
{
|
||||||
|
let label_target_path = parser_state.fetch_widget(&layout.state, "label_target_path")?.widget;
|
||||||
|
label_target_path.cast::<WidgetLabel>()?.set_text(
|
||||||
|
&mut layout.common(),
|
||||||
|
Translation::from_raw_text_string(format!("{}: {}", str_target_path, par.target_path.display())),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.push(Task::StartDownload(par.url, par.target_path));
|
||||||
|
|
||||||
|
Ok(Self {
|
||||||
|
tasks,
|
||||||
|
globals: par.globals.clone(),
|
||||||
|
executor: par.executor.clone(),
|
||||||
|
parser_state,
|
||||||
|
id_label_status,
|
||||||
|
id_loading_parent,
|
||||||
|
id_content,
|
||||||
|
on_close_request: Some(on_close_request),
|
||||||
|
on_downloaded: Some(par.on_downloaded),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn download(
|
||||||
|
tasks: Tasks<Task>,
|
||||||
|
executor: AsyncExecutor,
|
||||||
|
url: String,
|
||||||
|
target_path: PathBuf,
|
||||||
|
on_downloaded: Box<dyn FnOnce()>,
|
||||||
|
) -> Option<()> {
|
||||||
|
tasks.push(Task::SetStatusText(String::from("Connecting to the server...")));
|
||||||
|
|
||||||
|
// start downloading from the server with progress reporting
|
||||||
|
let res = handle_async_result(
|
||||||
|
"Download failed",
|
||||||
|
&tasks,
|
||||||
|
http_client::get(http_client::GetParams {
|
||||||
|
executor: &executor,
|
||||||
|
url: &url,
|
||||||
|
on_progress: Some(Box::new({
|
||||||
|
let tasks = tasks.clone();
|
||||||
|
move |data: ProgressFuncData| {
|
||||||
|
tasks.push(Task::SetStatusText(format!(
|
||||||
|
"{}/{} KiB ({}%)",
|
||||||
|
data.bytes_downloaded / 1024,
|
||||||
|
data.file_size / 1024,
|
||||||
|
(data.bytes_downloaded as f32 / data.file_size as f32 * 100.0).round()
|
||||||
|
)))
|
||||||
|
}
|
||||||
|
})),
|
||||||
|
})
|
||||||
|
.await,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
tasks.push(Task::SetStatusText(String::from("Writing to file...")));
|
||||||
|
|
||||||
|
// create skymaps directory if it doesn't exist yet
|
||||||
|
if let Some(parent) = target_path.parent() {
|
||||||
|
handle_async_result(
|
||||||
|
"Directory creation failed",
|
||||||
|
&tasks,
|
||||||
|
smol::fs::create_dir_all(parent).await,
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_async_result(
|
||||||
|
"File write failed",
|
||||||
|
&tasks,
|
||||||
|
smol::fs::write(target_path, res.data).await,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
tasks.push(Task::SetStatusText(String::from("Download finished")));
|
||||||
|
tasks.push(Task::ShowIconSuccess);
|
||||||
|
|
||||||
|
on_downloaded();
|
||||||
|
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn mount_popup(
|
||||||
|
popup: PopupHolder<View>,
|
||||||
|
frontend_tasks: FrontendTasks,
|
||||||
|
on_view_close: Box<dyn FnOnce()>,
|
||||||
|
params: Params,
|
||||||
|
) {
|
||||||
|
frontend_tasks
|
||||||
|
.clone()
|
||||||
|
.push(FrontendTask::MountPopupOnce(MountPopupOnceParams::new(
|
||||||
|
Translation::from_translation_key("DOWNLOADER"),
|
||||||
|
Box::new(move |data| {
|
||||||
|
let on_close_request = popup.get_close_callback(data.layout);
|
||||||
|
let view = View::new(data.layout, data.id_content, on_close_request, params)?;
|
||||||
|
|
||||||
|
popup.set_view(data.handle, view, Some(on_view_close));
|
||||||
|
Ok(popup.get_close_callback(data.layout))
|
||||||
|
}),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
@ -10,7 +10,7 @@ use wgui::{
|
||||||
drawing::{self, GradientMode},
|
drawing::{self, GradientMode},
|
||||||
globals::WguiGlobals,
|
globals::WguiGlobals,
|
||||||
i18n::Translation,
|
i18n::Translation,
|
||||||
layout::{Layout, WidgetID, WidgetPair},
|
layout::{Layout, WidgetID},
|
||||||
renderer_vk::text::{FontWeight, HorizontalAlign, TextShadow, TextStyle, custom_glyph::CustomGlyphData},
|
renderer_vk::text::{FontWeight, HorizontalAlign, TextShadow, TextStyle, custom_glyph::CustomGlyphData},
|
||||||
taffy::{
|
taffy::{
|
||||||
self, AlignItems, AlignSelf, JustifyContent, JustifySelf,
|
self, AlignItems, AlignSelf, JustifyContent, JustifySelf,
|
||||||
|
|
@ -25,11 +25,12 @@ use wgui::{
|
||||||
util::WLength,
|
util::WLength,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
use wlx_common::async_executor::AsyncExecutor;
|
||||||
|
|
||||||
use crate::util::{
|
use crate::util::{
|
||||||
cached_fetcher::{self, CoverArt},
|
cached_fetcher::{self, CoverArt},
|
||||||
steam_utils::{self, AppID},
|
steam_utils::{self, AppID},
|
||||||
various::AsyncExecutor,
|
wgui_simple,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct ViewCommon {
|
pub struct ViewCommon {
|
||||||
|
|
@ -47,8 +48,8 @@ pub struct Params<'a, 'b> {
|
||||||
|
|
||||||
pub struct View {
|
pub struct View {
|
||||||
pub button: Rc<ComponentButton>,
|
pub button: Rc<ComponentButton>,
|
||||||
pair: WidgetPair,
|
|
||||||
id_image_parent: WidgetID,
|
id_image_parent: WidgetID,
|
||||||
|
id_loading: WidgetID,
|
||||||
app_name: String,
|
app_name: String,
|
||||||
app_id: AppID,
|
app_id: AppID,
|
||||||
}
|
}
|
||||||
|
|
@ -99,15 +100,9 @@ impl View {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mount_placeholder_text(
|
fn mount_placeholder_text(&self, layout: &mut Layout, parent: WidgetID, text: &str) -> anyhow::Result<()> {
|
||||||
&self,
|
|
||||||
globals: &WguiGlobals,
|
|
||||||
layout: &mut Layout,
|
|
||||||
parent: WidgetID,
|
|
||||||
text: &str,
|
|
||||||
) -> anyhow::Result<()> {
|
|
||||||
let label = WidgetLabel::create(
|
let label = WidgetLabel::create(
|
||||||
&mut globals.get(),
|
&mut layout.state,
|
||||||
WidgetLabelParams {
|
WidgetLabelParams {
|
||||||
content: Translation::from_raw_text(text),
|
content: Translation::from_raw_text(text),
|
||||||
style: TextStyle {
|
style: TextStyle {
|
||||||
|
|
@ -150,11 +145,13 @@ impl View {
|
||||||
layout: &mut Layout,
|
layout: &mut Layout,
|
||||||
cover_art: &CoverArt,
|
cover_art: &CoverArt,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
|
layout.remove_widget(self.id_loading);
|
||||||
|
|
||||||
if cover_art.compressed_image_data.is_empty() {
|
if cover_art.compressed_image_data.is_empty() {
|
||||||
// mount placeholder
|
// mount placeholder
|
||||||
let img = view_common.get_placeholder_image()?.clone();
|
let img = view_common.get_placeholder_image()?.clone();
|
||||||
self.mount_image(layout, &img)?;
|
self.mount_image(layout, &img)?;
|
||||||
self.mount_placeholder_text(&view_common.globals, layout, self.id_image_parent, &self.app_name)?;
|
self.mount_placeholder_text(layout, self.id_image_parent, &self.app_name)?;
|
||||||
} else {
|
} else {
|
||||||
// mount image
|
// mount image
|
||||||
let path = format!("app:{:?}", self.app_id);
|
let path = format!("app:{:?}", self.app_id);
|
||||||
|
|
@ -278,6 +275,12 @@ impl View {
|
||||||
rect_gradient_style(taffy::AlignSelf::End, 0.05),
|
rect_gradient_style(taffy::AlignSelf::End, 0.05),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
let id_loading = wgui_simple::create_loading(wgui_simple::CreateLoadingParams {
|
||||||
|
layout: params.ess.layout,
|
||||||
|
parent_id: image_parent.id,
|
||||||
|
with_text: false,
|
||||||
|
})?;
|
||||||
|
|
||||||
// request cover image data from the internet or disk cache
|
// request cover image data from the internet or disk cache
|
||||||
params
|
params
|
||||||
.executor
|
.executor
|
||||||
|
|
@ -289,11 +292,11 @@ impl View {
|
||||||
.detach();
|
.detach();
|
||||||
|
|
||||||
Ok(View {
|
Ok(View {
|
||||||
pair: widget_button,
|
|
||||||
button,
|
button,
|
||||||
id_image_parent: image_parent.id,
|
id_image_parent: image_parent.id,
|
||||||
app_name: params.manifest.name.clone(),
|
app_name: params.manifest.name.clone(),
|
||||||
app_id: params.manifest.app_id.clone(),
|
app_id: params.manifest.app_id.clone(),
|
||||||
|
id_loading,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ use crate::{
|
||||||
frontend::{FrontendTask, FrontendTasks, SoundType},
|
frontend::{FrontendTask, FrontendTasks, SoundType},
|
||||||
util::{
|
util::{
|
||||||
cached_fetcher::{self, CoverArt},
|
cached_fetcher::{self, CoverArt},
|
||||||
|
popup_manager::{MountPopupOnceParams, PopupHolder},
|
||||||
steam_utils::{self, AppID, AppManifest},
|
steam_utils::{self, AppID, AppManifest},
|
||||||
various::AsyncExecutor,
|
|
||||||
},
|
},
|
||||||
views::game_cover,
|
views::{ViewTrait, ViewUpdateParams, game_cover},
|
||||||
};
|
};
|
||||||
use wgui::{
|
use wgui::{
|
||||||
assets::AssetPath,
|
assets::AssetPath,
|
||||||
|
|
@ -19,6 +19,7 @@ use wgui::{
|
||||||
task::Tasks,
|
task::Tasks,
|
||||||
widget::{ConstructEssentials, label::WidgetLabel},
|
widget::{ConstructEssentials, label::WidgetLabel},
|
||||||
};
|
};
|
||||||
|
use wlx_common::async_executor::AsyncExecutor;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
enum Task {
|
enum Task {
|
||||||
|
|
@ -34,13 +35,14 @@ pub struct Params<'a> {
|
||||||
pub layout: &'a mut Layout,
|
pub layout: &'a mut Layout,
|
||||||
pub parent_id: WidgetID,
|
pub parent_id: WidgetID,
|
||||||
pub frontend_tasks: &'a FrontendTasks,
|
pub frontend_tasks: &'a FrontendTasks,
|
||||||
pub on_launched: Box<dyn Fn()>,
|
pub on_launched: Box<dyn FnOnce()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct View {
|
pub struct View {
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
state: ParserState,
|
state: ParserState,
|
||||||
tasks: Tasks<Task>,
|
tasks: Tasks<Task>,
|
||||||
on_launched: Box<dyn Fn()>,
|
on_launched: Option<Box<dyn FnOnce()>>,
|
||||||
frontend_tasks: FrontendTasks,
|
frontend_tasks: FrontendTasks,
|
||||||
|
|
||||||
game_cover_view_common: game_cover::ViewCommon,
|
game_cover_view_common: game_cover::ViewCommon,
|
||||||
|
|
@ -48,6 +50,30 @@ pub struct View {
|
||||||
app_id: AppID,
|
app_id: AppID,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ViewTrait for View {
|
||||||
|
fn update(&mut self, par: &mut ViewUpdateParams) -> anyhow::Result<()> {
|
||||||
|
loop {
|
||||||
|
let tasks = self.tasks.drain();
|
||||||
|
if tasks.is_empty() {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
for task in tasks {
|
||||||
|
match task {
|
||||||
|
Task::FillAppDetails(details) => self.action_fill_app_details(par.layout, details)?,
|
||||||
|
Task::Launch => self.action_launch(),
|
||||||
|
Task::SetCoverArt(cover_art) => {
|
||||||
|
let _ = self
|
||||||
|
.view_cover
|
||||||
|
.set_cover_art(&mut self.game_cover_view_common, par.layout, &cover_art);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl View {
|
impl View {
|
||||||
async fn fetch_details(executor: AsyncExecutor, tasks: Tasks<Task>, app_id: AppID) {
|
async fn fetch_details(executor: AsyncExecutor, tasks: Tasks<Task>, app_id: AppID) {
|
||||||
let Some(details) = cached_fetcher::get_app_details_json(executor, app_id).await else {
|
let Some(details) = cached_fetcher::get_app_details_json(executor, app_id).await else {
|
||||||
|
|
@ -104,7 +130,7 @@ impl View {
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
state,
|
state,
|
||||||
tasks,
|
tasks,
|
||||||
on_launched: params.on_launched,
|
on_launched: Some(params.on_launched),
|
||||||
frontend_tasks: params.frontend_tasks.clone(),
|
frontend_tasks: params.frontend_tasks.clone(),
|
||||||
game_cover_view_common: game_cover::ViewCommon::new(params.globals.clone()),
|
game_cover_view_common: game_cover::ViewCommon::new(params.globals.clone()),
|
||||||
view_cover,
|
view_cover,
|
||||||
|
|
@ -112,43 +138,20 @@ impl View {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self, layout: &mut Layout) -> anyhow::Result<()> {
|
|
||||||
loop {
|
|
||||||
let tasks = self.tasks.drain();
|
|
||||||
if tasks.is_empty() {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
for task in tasks {
|
|
||||||
match task {
|
|
||||||
Task::FillAppDetails(details) => self.action_fill_app_details(layout, details)?,
|
|
||||||
Task::Launch => self.action_launch(),
|
|
||||||
Task::SetCoverArt(cover_art) => {
|
|
||||||
let _ = self
|
|
||||||
.view_cover
|
|
||||||
.set_cover_art(&mut self.game_cover_view_common, layout, &cover_art);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn action_fill_app_details(
|
fn action_fill_app_details(
|
||||||
&mut self,
|
&mut self,
|
||||||
layout: &mut Layout,
|
layout: &mut Layout,
|
||||||
mut details: cached_fetcher::AppDetailsJSONData,
|
mut details: cached_fetcher::AppDetailsJSONData,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
let mut c = layout.start_common();
|
|
||||||
|
|
||||||
{
|
{
|
||||||
let label_author = self.state.fetch_widget(&c.layout.state, "label_author")?.widget;
|
let mut c = layout.common();
|
||||||
let label_description = self.state.fetch_widget(&c.layout.state, "label_description")?.widget;
|
let label_author = self.state.fetch_widget(c.state, "label_author")?.widget;
|
||||||
|
let label_description = self.state.fetch_widget(c.state, "label_description")?.widget;
|
||||||
|
|
||||||
if let Some(developer) = details.developers.pop() {
|
if let Some(developer) = details.developers.pop() {
|
||||||
label_author
|
label_author
|
||||||
.cast::<WidgetLabel>()?
|
.cast::<WidgetLabel>()?
|
||||||
.set_text(&mut c.common(), Translation::from_raw_text_string(developer));
|
.set_text(&mut c, Translation::from_raw_text_string(developer));
|
||||||
}
|
}
|
||||||
|
|
||||||
let desc = if let Some(desc) = &details.short_description {
|
let desc = if let Some(desc) = &details.short_description {
|
||||||
|
|
@ -162,11 +165,10 @@ impl View {
|
||||||
if let Some(desc) = desc {
|
if let Some(desc) = desc {
|
||||||
label_description
|
label_description
|
||||||
.cast::<WidgetLabel>()?
|
.cast::<WidgetLabel>()?
|
||||||
.set_text(&mut c.common(), Translation::from_raw_text(desc));
|
.set_text(&mut c, Translation::from_raw_text(desc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
c.finish()?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -190,6 +192,37 @@ impl View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(*self.on_launched)();
|
if let Some(on_launched) = self.on_launched.take() {
|
||||||
|
on_launched();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn mount_popup(
|
||||||
|
frontend_tasks: FrontendTasks,
|
||||||
|
executor: AsyncExecutor,
|
||||||
|
globals: WguiGlobals,
|
||||||
|
manifest: AppManifest,
|
||||||
|
popup: PopupHolder<View>,
|
||||||
|
) {
|
||||||
|
frontend_tasks
|
||||||
|
.clone()
|
||||||
|
.push(FrontendTask::MountPopupOnce(MountPopupOnceParams::new(
|
||||||
|
Translation::from_raw_text(&manifest.name),
|
||||||
|
Box::new(move |data| {
|
||||||
|
let on_launched = popup.get_close_callback(data.layout);
|
||||||
|
let view = View::new(Params {
|
||||||
|
manifest: manifest.clone(),
|
||||||
|
executor: executor.clone(),
|
||||||
|
globals: &globals,
|
||||||
|
layout: data.layout,
|
||||||
|
parent_id: data.id_content,
|
||||||
|
frontend_tasks: &frontend_tasks,
|
||||||
|
on_launched,
|
||||||
|
})?;
|
||||||
|
|
||||||
|
popup.set_view(data.handle, view, None);
|
||||||
|
Ok(popup.get_close_callback(data.layout))
|
||||||
|
}),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
use std::{cell::RefCell, collections::HashMap, rc::Rc};
|
use std::{collections::HashMap, rc::Rc};
|
||||||
|
|
||||||
use wgui::{
|
use wgui::{
|
||||||
assets::AssetPath,
|
assets::AssetPath,
|
||||||
|
components::button::ComponentButton,
|
||||||
globals::WguiGlobals,
|
globals::WguiGlobals,
|
||||||
i18n::Translation,
|
i18n::Translation,
|
||||||
layout::{Layout, WidgetID},
|
layout::{Layout, WidgetID},
|
||||||
|
|
@ -12,24 +13,26 @@ use wgui::{
|
||||||
label::{WidgetLabel, WidgetLabelParams},
|
label::{WidgetLabel, WidgetLabelParams},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
use wlx_common::async_executor::AsyncExecutor;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
frontend::{FrontendTask, FrontendTasks},
|
frontend::FrontendTasks,
|
||||||
util::{
|
util::{
|
||||||
cached_fetcher::CoverArt,
|
cached_fetcher::CoverArt,
|
||||||
popup_manager::{MountPopupParams, PopupHandle},
|
popup_manager::PopupHolder,
|
||||||
steam_utils::{self, AppID, AppManifest, SteamUtils},
|
steam_utils::{self, AppID, SteamUtils},
|
||||||
various::AsyncExecutor,
|
|
||||||
},
|
},
|
||||||
views::{self, game_cover, game_launcher},
|
views::{self, ViewTrait, ViewUpdateParams, game_cover},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
enum Task {
|
enum Task {
|
||||||
AppManifestClicked(steam_utils::AppManifest),
|
AppManifestClicked(steam_utils::AppManifest),
|
||||||
SetCoverArt(AppID, Rc<CoverArt>),
|
SetCoverArt(AppID, Rc<CoverArt>),
|
||||||
CloseLauncher,
|
LoadManifests,
|
||||||
Refresh,
|
FillPage(u32),
|
||||||
|
PrevPage,
|
||||||
|
NextPage,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Params<'a> {
|
pub struct Params<'a> {
|
||||||
|
|
@ -38,15 +41,13 @@ pub struct Params<'a> {
|
||||||
pub frontend_tasks: FrontendTasks,
|
pub frontend_tasks: FrontendTasks,
|
||||||
pub layout: &'a mut Layout,
|
pub layout: &'a mut Layout,
|
||||||
pub parent_id: WidgetID,
|
pub parent_id: WidgetID,
|
||||||
|
pub steam_utils: &'a SteamUtils,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Cell {
|
const MAX_GAMES_PER_PAGE: u32 = 30;
|
||||||
|
|
||||||
|
pub struct GameCoverCell {
|
||||||
view_cover: game_cover::View,
|
view_cover: game_cover::View,
|
||||||
manifest: AppManifest,
|
|
||||||
}
|
|
||||||
|
|
||||||
struct State {
|
|
||||||
view_launcher: Option<(PopupHandle, views::game_launcher::View)>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct View {
|
pub struct View {
|
||||||
|
|
@ -56,11 +57,39 @@ pub struct View {
|
||||||
frontend_tasks: FrontendTasks,
|
frontend_tasks: FrontendTasks,
|
||||||
globals: WguiGlobals,
|
globals: WguiGlobals,
|
||||||
id_list_parent: WidgetID,
|
id_list_parent: WidgetID,
|
||||||
steam_utils: steam_utils::SteamUtils,
|
|
||||||
cells: HashMap<AppID, Cell>,
|
|
||||||
game_cover_view_common: game_cover::ViewCommon,
|
game_cover_view_common: game_cover::ViewCommon,
|
||||||
executor: AsyncExecutor,
|
executor: AsyncExecutor,
|
||||||
state: Rc<RefCell<State>>,
|
mounted_game_covers: HashMap<AppID, GameCoverCell>,
|
||||||
|
all_manifests: Vec<steam_utils::AppManifest>,
|
||||||
|
cur_page: u32,
|
||||||
|
page_count: u32,
|
||||||
|
id_label_page: WidgetID,
|
||||||
|
view_launcher: PopupHolder<views::game_launcher::View>,
|
||||||
|
steam_utils: SteamUtils,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ViewTrait for View {
|
||||||
|
fn update(&mut self, par: &mut ViewUpdateParams) -> anyhow::Result<()> {
|
||||||
|
loop {
|
||||||
|
let tasks = self.tasks.drain();
|
||||||
|
if tasks.is_empty() {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
for task in tasks {
|
||||||
|
match task {
|
||||||
|
Task::LoadManifests => self.load_manifests(),
|
||||||
|
Task::FillPage(page_idx) => self.fill_page(par.layout, par.executor, page_idx)?,
|
||||||
|
Task::AppManifestClicked(manifest) => self.action_app_manifest_clicked(manifest)?,
|
||||||
|
Task::SetCoverArt(app_id, cover_art) => self.set_cover_art(par.layout, app_id, cover_art),
|
||||||
|
Task::PrevPage => self.page_prev(),
|
||||||
|
Task::NextPage => self.page_next(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
self.view_launcher.update(par)?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl View {
|
impl View {
|
||||||
|
|
@ -73,12 +102,21 @@ impl View {
|
||||||
|
|
||||||
let parser_state = wgui::parser::parse_from_assets(doc_params, params.layout, params.parent_id)?;
|
let parser_state = wgui::parser::parse_from_assets(doc_params, params.layout, params.parent_id)?;
|
||||||
let list_parent = parser_state.fetch_widget(¶ms.layout.state, "list_parent")?;
|
let list_parent = parser_state.fetch_widget(¶ms.layout.state, "list_parent")?;
|
||||||
|
let id_label_page = parser_state.get_widget_id("label_page")?;
|
||||||
|
|
||||||
let tasks = Tasks::new();
|
let tasks = Tasks::new();
|
||||||
|
|
||||||
let steam_utils = SteamUtils::new()?;
|
tasks.handle_button(
|
||||||
|
&parser_state.fetch_component_as::<ComponentButton>("btn_prev")?,
|
||||||
|
Task::PrevPage,
|
||||||
|
);
|
||||||
|
|
||||||
tasks.push(Task::Refresh);
|
tasks.handle_button(
|
||||||
|
&parser_state.fetch_component_as::<ComponentButton>("btn_next")?,
|
||||||
|
Task::NextPage,
|
||||||
|
);
|
||||||
|
|
||||||
|
tasks.push(Task::LoadManifests);
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
parser_state,
|
parser_state,
|
||||||
|
|
@ -86,51 +124,27 @@ impl View {
|
||||||
frontend_tasks: params.frontend_tasks,
|
frontend_tasks: params.frontend_tasks,
|
||||||
globals: params.globals.clone(),
|
globals: params.globals.clone(),
|
||||||
id_list_parent: list_parent.id,
|
id_list_parent: list_parent.id,
|
||||||
steam_utils,
|
mounted_game_covers: HashMap::new(),
|
||||||
cells: HashMap::new(),
|
|
||||||
game_cover_view_common: game_cover::ViewCommon::new(params.globals.clone()),
|
game_cover_view_common: game_cover::ViewCommon::new(params.globals.clone()),
|
||||||
state: Rc::new(RefCell::new(State { view_launcher: None })),
|
|
||||||
executor: params.executor,
|
executor: params.executor,
|
||||||
|
all_manifests: Vec::new(),
|
||||||
|
cur_page: 0,
|
||||||
|
page_count: 0,
|
||||||
|
id_label_page,
|
||||||
|
view_launcher: Default::default(),
|
||||||
|
steam_utils: params.steam_utils.clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self, layout: &mut Layout, executor: &AsyncExecutor) -> anyhow::Result<()> {
|
|
||||||
loop {
|
|
||||||
let tasks = self.tasks.drain();
|
|
||||||
if tasks.is_empty() {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
for task in tasks {
|
|
||||||
match task {
|
|
||||||
Task::Refresh => self.refresh(layout, executor)?,
|
|
||||||
Task::AppManifestClicked(manifest) => self.action_app_manifest_clicked(manifest)?,
|
|
||||||
Task::SetCoverArt(app_id, cover_art) => self.set_cover_art(layout, app_id, cover_art),
|
|
||||||
Task::CloseLauncher => self.state.borrow_mut().view_launcher = None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut state = self.state.borrow_mut();
|
|
||||||
if let Some((_, view)) = &mut state.view_launcher {
|
|
||||||
view.update(layout)?;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct Games {
|
|
||||||
manifests: Vec<steam_utils::AppManifest>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fill_game_list(
|
fn fill_game_list(
|
||||||
ess: &mut ConstructEssentials,
|
ess: &mut ConstructEssentials,
|
||||||
executor: &AsyncExecutor,
|
executor: &AsyncExecutor,
|
||||||
cells: &mut HashMap<AppID, Cell>,
|
mounted_game_covers: &mut HashMap<AppID, GameCoverCell>,
|
||||||
games: &Games,
|
manifests: &[steam_utils::AppManifest],
|
||||||
tasks: &Tasks<Task>,
|
tasks: &Tasks<Task>,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
for manifest in &games.manifests {
|
for manifest in manifests {
|
||||||
let on_loaded = {
|
let on_loaded = {
|
||||||
let app_id = manifest.app_id.clone();
|
let app_id = manifest.app_id.clone();
|
||||||
let tasks = tasks.clone();
|
let tasks = tasks.clone();
|
||||||
|
|
@ -150,81 +164,108 @@ fn fill_game_list(
|
||||||
view_cover.button.on_click({
|
view_cover.button.on_click({
|
||||||
let tasks = tasks.clone();
|
let tasks = tasks.clone();
|
||||||
let manifest = manifest.clone();
|
let manifest = manifest.clone();
|
||||||
Box::new(move |_, _| {
|
Rc::new(move |_, _| {
|
||||||
tasks.push(Task::AppManifestClicked(manifest.clone()));
|
tasks.push(Task::AppManifestClicked(manifest.clone()));
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
cells.insert(
|
mounted_game_covers.insert(manifest.app_id.clone(), GameCoverCell { view_cover });
|
||||||
manifest.app_id.clone(),
|
|
||||||
Cell {
|
|
||||||
view_cover,
|
|
||||||
manifest: manifest.clone(),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
impl View {
|
impl View {
|
||||||
fn game_list(&self) -> anyhow::Result<Games> {
|
fn load_manifests(&mut self) {
|
||||||
let manifests = self
|
match self
|
||||||
.steam_utils
|
.steam_utils
|
||||||
.list_installed_games(steam_utils::GameSortMethod::PlayDateDesc)?;
|
.list_installed_games(steam_utils::GameSortMethod::PlayDateDesc)
|
||||||
|
{
|
||||||
Ok(Games { manifests })
|
Ok(manifests) => {
|
||||||
|
self.page_count = (manifests.len() as u32 + MAX_GAMES_PER_PAGE) / MAX_GAMES_PER_PAGE;
|
||||||
|
self.all_manifests = manifests;
|
||||||
|
self.tasks.push(Task::FillPage(0));
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
log::error!("Failed to list installed games: {e:?}");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn refresh(&mut self, layout: &mut Layout, executor: &AsyncExecutor) -> anyhow::Result<()> {
|
fn page_prev(&mut self) {
|
||||||
layout.remove_children(self.id_list_parent);
|
if self.cur_page == 0 {
|
||||||
self.cells.clear();
|
return;
|
||||||
|
|
||||||
let mut text: Option<Translation> = None;
|
|
||||||
match self.game_list() {
|
|
||||||
Ok(list) => {
|
|
||||||
if list.manifests.is_empty() {
|
|
||||||
text = Some(Translation::from_translation_key("GAME_LIST.NO_GAMES_FOUND"))
|
|
||||||
} else {
|
|
||||||
fill_game_list(
|
|
||||||
&mut ConstructEssentials {
|
|
||||||
layout,
|
|
||||||
parent: self.id_list_parent,
|
|
||||||
},
|
|
||||||
executor,
|
|
||||||
&mut self.cells,
|
|
||||||
&list,
|
|
||||||
&self.tasks,
|
|
||||||
)?
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(e) => text = Some(Translation::from_raw_text(&format!("Error: {:?}", e))),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.cur_page -= 1;
|
||||||
|
self.tasks.push(Task::FillPage(self.cur_page));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn page_next(&mut self) {
|
||||||
|
if self.cur_page >= self.page_count - 1 {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.cur_page += 1;
|
||||||
|
self.tasks.push(Task::FillPage(self.cur_page));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn fill_page(&mut self, layout: &mut Layout, executor: &AsyncExecutor, page_idx: u32) -> anyhow::Result<()> {
|
||||||
|
layout.remove_children(self.id_list_parent);
|
||||||
|
self.mounted_game_covers.clear();
|
||||||
|
|
||||||
|
let idx_from = (page_idx * MAX_GAMES_PER_PAGE).min(self.all_manifests.len() as u32);
|
||||||
|
let idx_to = ((page_idx + 1) * MAX_GAMES_PER_PAGE).min(self.all_manifests.len() as u32);
|
||||||
|
|
||||||
|
let page_manifests = &self.all_manifests[idx_from as usize..idx_to as usize];
|
||||||
|
|
||||||
|
let mut text: Option<Translation> = None;
|
||||||
|
|
||||||
|
if page_manifests.is_empty() {
|
||||||
|
text = Some(Translation::from_translation_key("GAME_LIST.NO_GAMES_FOUND"))
|
||||||
|
}
|
||||||
|
|
||||||
|
// set page text
|
||||||
|
{
|
||||||
|
let mut c = layout.common();
|
||||||
|
let mut widget = c.state.widgets.cast_as::<WidgetLabel>(self.id_label_page)?;
|
||||||
|
widget.set_text(
|
||||||
|
&mut c,
|
||||||
|
Translation::from_raw_text_string(format!("{}/{}", self.cur_page + 1, self.page_count)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
fill_game_list(
|
||||||
|
&mut ConstructEssentials {
|
||||||
|
layout,
|
||||||
|
parent: self.id_list_parent,
|
||||||
|
},
|
||||||
|
executor,
|
||||||
|
&mut self.mounted_game_covers,
|
||||||
|
page_manifests,
|
||||||
|
&self.tasks,
|
||||||
|
)?;
|
||||||
|
|
||||||
if let Some(text) = text.take() {
|
if let Some(text) = text.take() {
|
||||||
layout.add_child(
|
let label = WidgetLabel::create(
|
||||||
self.id_list_parent,
|
&mut layout.state,
|
||||||
WidgetLabel::create(
|
WidgetLabelParams {
|
||||||
&mut self.globals.get(),
|
content: text,
|
||||||
WidgetLabelParams {
|
..Default::default()
|
||||||
content: text,
|
},
|
||||||
..Default::default()
|
);
|
||||||
},
|
layout.add_child(self.id_list_parent, label, Default::default())?;
|
||||||
),
|
|
||||||
Default::default(),
|
|
||||||
)?;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_cover_art(&mut self, layout: &mut Layout, app_id: AppID, cover_art: Rc<CoverArt>) {
|
fn set_cover_art(&mut self, layout: &mut Layout, app_id: AppID, cover_art: Rc<CoverArt>) {
|
||||||
let Some(cell) = &mut self.cells.get_mut(&app_id) else {
|
let Some(cover) = &mut self.mounted_game_covers.get_mut(&app_id) else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Err(e) = cell
|
if let Err(e) = cover
|
||||||
.view_cover
|
.view_cover
|
||||||
.set_cover_art(&mut self.game_cover_view_common, layout, &cover_art)
|
.set_cover_art(&mut self.game_cover_view_common, layout, &cover_art)
|
||||||
{
|
{
|
||||||
|
|
@ -233,36 +274,13 @@ impl View {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn action_app_manifest_clicked(&mut self, manifest: steam_utils::AppManifest) -> anyhow::Result<()> {
|
fn action_app_manifest_clicked(&mut self, manifest: steam_utils::AppManifest) -> anyhow::Result<()> {
|
||||||
self.frontend_tasks.push(FrontendTask::MountPopup(MountPopupParams {
|
views::game_launcher::mount_popup(
|
||||||
title: Translation::from_raw_text(&manifest.name),
|
self.frontend_tasks.clone(),
|
||||||
on_content: {
|
self.executor.clone(),
|
||||||
let state = self.state.clone();
|
self.globals.clone(),
|
||||||
let tasks = self.tasks.clone();
|
manifest,
|
||||||
let executor = self.executor.clone();
|
self.view_launcher.clone(),
|
||||||
let globals = self.globals.clone();
|
);
|
||||||
let frontend_tasks = self.frontend_tasks.clone();
|
|
||||||
|
|
||||||
Rc::new(move |data| {
|
|
||||||
let on_launched = {
|
|
||||||
let tasks = tasks.clone();
|
|
||||||
Box::new(move || tasks.push(Task::CloseLauncher))
|
|
||||||
};
|
|
||||||
|
|
||||||
let view = game_launcher::View::new(game_launcher::Params {
|
|
||||||
manifest: manifest.clone(),
|
|
||||||
executor: executor.clone(),
|
|
||||||
globals: &globals,
|
|
||||||
layout: data.layout,
|
|
||||||
parent_id: data.id_content,
|
|
||||||
frontend_tasks: &frontend_tasks,
|
|
||||||
on_launched,
|
|
||||||
})?;
|
|
||||||
|
|
||||||
state.borrow_mut().view_launcher = Some((data.handle, view));
|
|
||||||
Ok(())
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,25 @@
|
||||||
|
use wlx_common::{async_executor::AsyncExecutor, config::GeneralConfig, dash_interface::ConfigChangeKind};
|
||||||
|
|
||||||
pub mod app_launcher;
|
pub mod app_launcher;
|
||||||
pub mod audio_settings;
|
pub mod audio_settings;
|
||||||
|
pub mod dialog_box;
|
||||||
|
pub mod download_file;
|
||||||
pub mod game_cover;
|
pub mod game_cover;
|
||||||
pub mod game_launcher;
|
pub mod game_launcher;
|
||||||
pub mod game_list;
|
pub mod game_list;
|
||||||
pub mod process_list;
|
pub mod remote_skymap_downloader;
|
||||||
pub mod window_list;
|
pub mod remote_skymap_list;
|
||||||
pub mod window_options;
|
pub mod running_games_list;
|
||||||
|
pub mod skymap_list;
|
||||||
|
pub mod skymap_list_cell;
|
||||||
|
|
||||||
|
pub struct ViewUpdateParams<'a> {
|
||||||
|
pub layout: &'a mut wgui::layout::Layout,
|
||||||
|
pub executor: &'a AsyncExecutor,
|
||||||
|
pub general_config: &'a mut GeneralConfig,
|
||||||
|
pub config_change_kind: &'a mut Option<ConfigChangeKind>,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait ViewTrait {
|
||||||
|
fn update(&mut self, par: &mut ViewUpdateParams) -> anyhow::Result<()>;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,255 +0,0 @@
|
||||||
use std::rc::Rc;
|
|
||||||
|
|
||||||
use wayvr_ipc::packet_server::{self};
|
|
||||||
use wgui::{
|
|
||||||
assets::AssetPath,
|
|
||||||
components::{
|
|
||||||
self,
|
|
||||||
button::ComponentButton,
|
|
||||||
tooltip::{TooltipInfo, TooltipSide},
|
|
||||||
},
|
|
||||||
globals::WguiGlobals,
|
|
||||||
i18n::Translation,
|
|
||||||
layout::{Layout, WidgetID},
|
|
||||||
parser::{Fetchable, ParseDocumentParams, ParserState},
|
|
||||||
taffy::{self, prelude::length},
|
|
||||||
task::Tasks,
|
|
||||||
widget::{
|
|
||||||
ConstructEssentials,
|
|
||||||
div::WidgetDiv,
|
|
||||||
label::{WidgetLabel, WidgetLabelParams},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
use wlx_common::{dash_interface::BoxDashInterface, desktop_finder::DesktopEntry};
|
|
||||||
|
|
||||||
use crate::util::{self, various::get_desktop_file_icon_path};
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
|
||||||
enum Task {
|
|
||||||
Refresh,
|
|
||||||
TerminateProcess(packet_server::WvrProcess),
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct Params<'a> {
|
|
||||||
pub globals: WguiGlobals,
|
|
||||||
pub layout: &'a mut Layout,
|
|
||||||
pub parent_id: WidgetID,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct View {
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub parser_state: ParserState,
|
|
||||||
tasks: Tasks<Task>,
|
|
||||||
globals: WguiGlobals,
|
|
||||||
id_list_parent: WidgetID,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl View {
|
|
||||||
pub fn new(params: Params) -> anyhow::Result<Self> {
|
|
||||||
let doc_params = &ParseDocumentParams {
|
|
||||||
globals: params.globals.clone(),
|
|
||||||
path: AssetPath::BuiltIn("gui/view/process_list.xml"),
|
|
||||||
extra: Default::default(),
|
|
||||||
};
|
|
||||||
|
|
||||||
let parser_state = wgui::parser::parse_from_assets(doc_params, params.layout, params.parent_id)?;
|
|
||||||
let list_parent = parser_state.fetch_widget(¶ms.layout.state, "list_parent")?;
|
|
||||||
|
|
||||||
let tasks = Tasks::new();
|
|
||||||
|
|
||||||
tasks.push(Task::Refresh);
|
|
||||||
|
|
||||||
Ok(Self {
|
|
||||||
parser_state,
|
|
||||||
tasks,
|
|
||||||
globals: params.globals,
|
|
||||||
id_list_parent: list_parent.id,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn update<T>(
|
|
||||||
&mut self,
|
|
||||||
layout: &mut Layout,
|
|
||||||
interface: &mut BoxDashInterface<T>,
|
|
||||||
data: &mut T,
|
|
||||||
) -> anyhow::Result<()> {
|
|
||||||
loop {
|
|
||||||
let tasks = self.tasks.drain();
|
|
||||||
if tasks.is_empty() {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
for task in tasks {
|
|
||||||
match task {
|
|
||||||
Task::Refresh => self.refresh(layout, interface, data)?,
|
|
||||||
Task::TerminateProcess(process) => self.action_terminate_process(interface, data, process)?,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_desktop_entry_from_process(process: &packet_server::WvrProcess) -> Option<DesktopEntry> {
|
|
||||||
// TODO: refactor this after we ditch old wayvr-dashboard completely
|
|
||||||
let Some(dfile_str) = process.userdata.get("desktop-entry") else {
|
|
||||||
return None;
|
|
||||||
};
|
|
||||||
|
|
||||||
let Ok(desktop_file) = serde_json::from_str::<DesktopEntry>(dfile_str) else {
|
|
||||||
debug_assert!(false); // invalid json???
|
|
||||||
return None;
|
|
||||||
};
|
|
||||||
|
|
||||||
Some(desktop_file)
|
|
||||||
}
|
|
||||||
|
|
||||||
struct ProcessEntryResult {
|
|
||||||
btn_terminate: Rc<ComponentButton>,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn construct_process_entry(
|
|
||||||
ess: &mut ConstructEssentials,
|
|
||||||
globals: &WguiGlobals,
|
|
||||||
process: &packet_server::WvrProcess,
|
|
||||||
) -> anyhow::Result<ProcessEntryResult> {
|
|
||||||
let (cell, _) = ess.layout.add_child(
|
|
||||||
ess.parent,
|
|
||||||
WidgetDiv::create(),
|
|
||||||
taffy::Style {
|
|
||||||
flex_direction: taffy::FlexDirection::Row,
|
|
||||||
align_items: Some(taffy::AlignItems::Center),
|
|
||||||
gap: length(8.0),
|
|
||||||
..Default::default()
|
|
||||||
},
|
|
||||||
)?;
|
|
||||||
|
|
||||||
let text_terminate_process = Translation::from_raw_text_string(globals.i18n().translate_and_replace(
|
|
||||||
"PROCESS_LIST.TERMINATE_PROCESS_NAMED_X",
|
|
||||||
("{PROCESS_NAME}", &process.name),
|
|
||||||
));
|
|
||||||
|
|
||||||
//"Terminate process" button
|
|
||||||
let (_, btn_terminate) = components::button::construct(
|
|
||||||
&mut ConstructEssentials {
|
|
||||||
layout: ess.layout,
|
|
||||||
parent: cell.id,
|
|
||||||
},
|
|
||||||
components::button::Params {
|
|
||||||
sprite_src: Some(AssetPath::BuiltIn("dashboard/remove_circle.svg")),
|
|
||||||
tooltip: Some(TooltipInfo {
|
|
||||||
text: text_terminate_process,
|
|
||||||
side: TooltipSide::Right,
|
|
||||||
}),
|
|
||||||
..Default::default()
|
|
||||||
},
|
|
||||||
)?;
|
|
||||||
|
|
||||||
if let Some(desktop_file) = get_desktop_entry_from_process(process) {
|
|
||||||
// desktop file icon and process name
|
|
||||||
util::various::mount_simple_sprite_square(
|
|
||||||
globals,
|
|
||||||
ess.layout,
|
|
||||||
cell.id,
|
|
||||||
24.0,
|
|
||||||
get_desktop_file_icon_path(&desktop_file).as_ref(),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
util::various::mount_simple_label(
|
|
||||||
globals,
|
|
||||||
ess.layout,
|
|
||||||
cell.id,
|
|
||||||
Translation::from_raw_text_rc(desktop_file.app_name.clone()),
|
|
||||||
)?;
|
|
||||||
} else {
|
|
||||||
// just show a process name
|
|
||||||
util::various::mount_simple_label(
|
|
||||||
globals,
|
|
||||||
ess.layout,
|
|
||||||
cell.id,
|
|
||||||
Translation::from_raw_text_string(process.name.clone()),
|
|
||||||
)?;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(ProcessEntryResult { btn_terminate })
|
|
||||||
}
|
|
||||||
|
|
||||||
fn fill_process_list(
|
|
||||||
globals: &WguiGlobals,
|
|
||||||
ess: &mut ConstructEssentials,
|
|
||||||
tasks: &Tasks<Task>,
|
|
||||||
list: &Vec<packet_server::WvrProcess>,
|
|
||||||
) -> anyhow::Result<()> {
|
|
||||||
for process_entry in list {
|
|
||||||
let entry_res = construct_process_entry(ess, globals, process_entry)?;
|
|
||||||
|
|
||||||
entry_res.btn_terminate.on_click({
|
|
||||||
let tasks = tasks.clone();
|
|
||||||
let entry = process_entry.clone();
|
|
||||||
Box::new(move |_, _| {
|
|
||||||
tasks.push(Task::TerminateProcess(entry.clone()));
|
|
||||||
Ok(())
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
impl View {
|
|
||||||
fn refresh<T>(
|
|
||||||
&mut self,
|
|
||||||
layout: &mut Layout,
|
|
||||||
interface: &mut BoxDashInterface<T>,
|
|
||||||
data: &mut T,
|
|
||||||
) -> anyhow::Result<()> {
|
|
||||||
layout.remove_children(self.id_list_parent);
|
|
||||||
|
|
||||||
let mut text: Option<Translation> = None;
|
|
||||||
match interface.process_list(data) {
|
|
||||||
Ok(list) => {
|
|
||||||
if list.is_empty() {
|
|
||||||
text = Some(Translation::from_translation_key("PROCESS_LIST.NO_PROCESSES_FOUND"))
|
|
||||||
} else {
|
|
||||||
fill_process_list(
|
|
||||||
&self.globals,
|
|
||||||
&mut ConstructEssentials {
|
|
||||||
layout,
|
|
||||||
parent: self.id_list_parent,
|
|
||||||
},
|
|
||||||
&self.tasks,
|
|
||||||
&list,
|
|
||||||
)?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(e) => text = Some(Translation::from_raw_text(&format!("Error: {:?}", e))),
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(text) = text.take() {
|
|
||||||
layout.add_child(
|
|
||||||
self.id_list_parent,
|
|
||||||
WidgetLabel::create(
|
|
||||||
&mut self.globals.get(),
|
|
||||||
WidgetLabelParams {
|
|
||||||
content: text,
|
|
||||||
..Default::default()
|
|
||||||
},
|
|
||||||
),
|
|
||||||
Default::default(),
|
|
||||||
)?;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn action_terminate_process<T>(
|
|
||||||
&mut self,
|
|
||||||
interface: &mut BoxDashInterface<T>,
|
|
||||||
data: &mut T,
|
|
||||||
process: packet_server::WvrProcess,
|
|
||||||
) -> anyhow::Result<()> {
|
|
||||||
interface.process_terminate(data, process.handle)?;
|
|
||||||
self.tasks.push(Task::Refresh);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||