From 901c18520ea99fb859acda963da93f5ad3562cd6 Mon Sep 17 00:00:00 2001 From: galister <22305755+galister@users.noreply.github.com> Date: Sun, 17 May 2026 12:46:54 +0900 Subject: [PATCH] hide unsupported settings depending on backend --- dash-frontend/src/tab/settings/mod.rs | 6 ++++- .../src/tab/settings/tab_controls.rs | 23 +++++++++++-------- .../src/tab/settings/tab_features.rs | 18 ++++++++++----- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/dash-frontend/src/tab/settings/mod.rs b/dash-frontend/src/tab/settings/mod.rs index 10da171c..ab32bdf1 100644 --- a/dash-frontend/src/tab/settings/mod.rs +++ b/dash-frontend/src/tab/settings/mod.rs @@ -23,7 +23,7 @@ use wgui::{ use wlx_common::{ config::GeneralConfig, config_io::ConfigRoot, - dash_interface::{ConfigChangeKind, RecenterMode}, + dash_interface::{ConfigChangeKind, InterfaceFeats, RecenterMode}, }; use crate::{ @@ -87,6 +87,7 @@ struct SettingsMountParams<'a> { mp: &'a mut MacroParams<'a>, frontend_tasks: &'a FrontendTasks, id_parent: WidgetID, + feats: InterfaceFeats, } trait SettingsTab { @@ -549,6 +550,8 @@ impl TabSettings { 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, @@ -562,6 +565,7 @@ impl TabSettings { mp: &mut mp, id_parent: root, frontend_tasks: &self.frontend_tasks, + feats, }; match name { diff --git a/dash-frontend/src/tab/settings/tab_controls.rs b/dash-frontend/src/tab/settings/tab_controls.rs index 2fb6978d..7f40963f 100644 --- a/dash-frontend/src/tab/settings/tab_controls.rs +++ b/dash-frontend/src/tab/settings/tab_controls.rs @@ -26,16 +26,19 @@ impl State { 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)?; - 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, - )?; + + 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 {}) diff --git a/dash-frontend/src/tab/settings/tab_features.rs b/dash-frontend/src/tab/settings/tab_features.rs index ae7b5d41..19d59c41 100644 --- a/dash-frontend/src/tab/settings/tab_features.rs +++ b/dash-frontend/src/tab/settings/tab_features.rs @@ -13,12 +13,18 @@ impl State { options_checkbox(par.mp, c, SettingType::NotificationsEnabled)?; options_checkbox(par.mp, c, SettingType::NotificationsSoundEnabled)?; options_checkbox(par.mp, c, SettingType::KeyboardSoundEnabled)?; - options_checkbox(par.mp, c, SettingType::SpaceDragUnlocked)?; - options_checkbox(par.mp, c, SettingType::SpaceRotateUnlocked)?; - options_slider_f32(par.mp, c, SettingType::SpaceDragMultiplier, -10.0, 10.0, 0.5)?; - options_checkbox(par.mp, c, SettingType::BlockGameInput)?; - options_checkbox(par.mp, c, SettingType::BlockGameInputIgnoreWatch)?; - options_checkbox(par.mp, c, SettingType::BlockPosesOnKbdInteraction)?; + if !par.feats.openxr || par.feats.monado { + // monado or openvr + options_checkbox(par.mp, c, SettingType::SpaceDragUnlocked)?; + options_slider_f32(par.mp, c, SettingType::SpaceDragMultiplier, -10.0, 10.0, 0.5)?; + } + if par.feats.monado { + options_checkbox(par.mp, c, SettingType::SpaceRotateUnlocked)?; + options_checkbox(par.mp, c, SettingType::BlockGameInput)?; + options_checkbox(par.mp, c, SettingType::BlockGameInputIgnoreWatch)?; + options_checkbox(par.mp, c, SettingType::BlockPosesOnKbdInteraction)?; + } + options_range_f32( par.mp, c,