reset playspace button in settings

This commit is contained in:
galister
2026-01-25 11:44:17 +09:00
parent 3ec1dd7f4e
commit 6960652379
6 changed files with 36 additions and 11 deletions

View File

@@ -16,6 +16,13 @@ pub struct MonadoClient {
pub is_io_active: bool,
}
#[derive(Clone, Copy)]
pub enum RecenterMode {
FixFloor,
Recenter,
Reset,
}
pub trait DashInterface<T> {
fn window_list(&mut self, data: &mut T) -> anyhow::Result<Vec<WvrWindow>>;
fn window_set_visible(&mut self, data: &mut T, handle: WvrWindowHandle, visible: bool) -> anyhow::Result<()>;
@@ -33,7 +40,7 @@ pub trait DashInterface<T> {
fn monado_client_focus(&mut self, data: &mut T, name: &str) -> anyhow::Result<()>;
fn monado_brightness_get(&mut self, data: &mut T) -> Option<f32>;
fn monado_brightness_set(&mut self, data: &mut T, brightness: f32) -> Option<()>;
fn recenter_playspace(&mut self, data: &mut T) -> anyhow::Result<()>;
fn recenter_playspace(&mut self, data: &mut T, mode: RecenterMode) -> anyhow::Result<()>;
fn desktop_finder<'a>(&'a mut self, data: &'a mut T) -> &'a mut DesktopFinder;
fn general_config<'a>(&'a mut self, data: &'a mut T) -> &'a mut GeneralConfig;
fn config_changed(&mut self, data: &mut T);

View File

@@ -5,7 +5,7 @@ use wayvr_ipc::{
use crate::{
config::GeneralConfig,
dash_interface::{self, DashInterface},
dash_interface::{self, DashInterface, RecenterMode},
desktop_finder::DesktopFinder,
gen_id,
};
@@ -210,7 +210,7 @@ impl DashInterface<()> for DashInterfaceEmulated {
}
}
fn recenter_playspace(&mut self, _: &mut ()) -> anyhow::Result<()> {
fn recenter_playspace(&mut self, _: &mut (), _: RecenterMode) -> anyhow::Result<()> {
// stub!
Ok(())
}