watch: smarter battery display

This commit is contained in:
galister
2024-02-17 02:30:33 +01:00
parent ba9ba876dc
commit 68baa3a1ef
4 changed files with 65 additions and 16 deletions

View File

@@ -248,9 +248,10 @@ impl OpenVrInputSource {
}
}
app.input_state.devices.sort_by(|a, b| {
(a.role as u8)
.cmp(&(b.role as u8))
.then(a.index.0.cmp(&b.index.0))
(a.soc.is_none() as u8)
.cmp(&(b.soc.is_none() as u8))
.then((a.role as u8).cmp(&(b.role as u8)))
.then(a.soc.unwrap_or(999.).total_cmp(&b.soc.unwrap_or(999.)))
});
}
}