mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-05 07:39:00 +00:00
feat: show warning associated with simulated hmd
This commit is contained in:
parent
6fd579d6af
commit
5f28604c15
1 changed files with 11 additions and 2 deletions
|
@ -69,14 +69,23 @@ impl SimpleComponent for DevicesBox {
|
|||
adw::ActionRow {
|
||||
#[track = "model.changed(Self::devices())"]
|
||||
set_icon_name: Some(match model.get_dev(XRDevice::Head) {
|
||||
Some(_) => "emblem-ok-symbolic",
|
||||
Some(name) => match name.as_str() {
|
||||
"Simulated HMD" => "dialog-warning-symbolic",
|
||||
_ => "emblem-ok-symbolic",
|
||||
},
|
||||
None => "dialog-question-symbolic",
|
||||
}),
|
||||
#[track = "model.changed(Self::devices())"]
|
||||
set_class_active: ("error", model.get_dev(XRDevice::Head).is_none()),
|
||||
#[track = "model.changed(Self::devices())"]
|
||||
set_class_active: ("warning", model.get_dev(XRDevice::Head)
|
||||
.is_some_and(|name| name == "Simulated HMD")),
|
||||
set_title: "Head",
|
||||
#[track = "model.changed(Self::devices())"]
|
||||
set_subtitle: model.get_dev_or_none(XRDevice::Head).as_str(),
|
||||
set_subtitle: match model.get_dev_or_none(XRDevice::Head).as_str() {
|
||||
"Simulated HMD" => "No HMD detected (Simulated HMD)",
|
||||
s => s,
|
||||
},
|
||||
// TODO: status icon with popover
|
||||
},
|
||||
// Left
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue