hide unsupported settings depending on backend

This commit is contained in:
galister 2026-05-17 12:46:54 +09:00
parent e39085aa2b
commit 901c18520e
3 changed files with 30 additions and 17 deletions

View File

@ -23,7 +23,7 @@ use wgui::{
use wlx_common::{ use wlx_common::{
config::GeneralConfig, config::GeneralConfig,
config_io::ConfigRoot, config_io::ConfigRoot,
dash_interface::{ConfigChangeKind, RecenterMode}, dash_interface::{ConfigChangeKind, InterfaceFeats, RecenterMode},
}; };
use crate::{ use crate::{
@ -87,6 +87,7 @@ struct SettingsMountParams<'a> {
mp: &'a mut MacroParams<'a>, mp: &'a mut MacroParams<'a>,
frontend_tasks: &'a FrontendTasks, frontend_tasks: &'a FrontendTasks,
id_parent: WidgetID, id_parent: WidgetID,
feats: InterfaceFeats,
} }
trait SettingsTab { trait SettingsTab {
@ -549,6 +550,8 @@ impl<T> TabSettings<T> {
let globals = frontend.layout.state.globals.clone(); let globals = frontend.layout.state.globals.clone();
self.current_tab = None; self.current_tab = None;
let feats = frontend.interface.get_feats(data);
let mut mp = MacroParams { let mut mp = MacroParams {
layout: &mut frontend.layout, layout: &mut frontend.layout,
parser_state: &mut self.state, parser_state: &mut self.state,
@ -562,6 +565,7 @@ impl<T> TabSettings<T> {
mp: &mut mp, mp: &mut mp,
id_parent: root, id_parent: root,
frontend_tasks: &self.frontend_tasks, frontend_tasks: &self.frontend_tasks,
feats,
}; };
match name { match name {

View File

@ -26,16 +26,19 @@ impl State {
options_checkbox(par.mp, c, SettingType::InvertScrollDirectionY)?; 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::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::LongPressDuration, 0.1, 2.0, 0.1)?;
options_slider_f32(par.mp, c, SettingType::PointerLerpFactor, 0.1, 1.0, 0.1)?;
options_range_f32( if par.feats.openxr {
par.mp, options_slider_f32(par.mp, c, SettingType::PointerLerpFactor, 0.1, 1.0, 0.1)?;
c, options_range_f32(
SettingType::XrClickSensitivityRelease, par.mp,
SettingType::XrClickSensitivity, c,
0.1, SettingType::XrClickSensitivityRelease,
0.9, SettingType::XrClickSensitivity,
0.1, 0.1,
)?; 0.9,
0.1,
)?;
}
options_slider_i32(par.mp, c, SettingType::ClickFreezeTimeMs, 0, 500, 50)?; options_slider_i32(par.mp, c, SettingType::ClickFreezeTimeMs, 0, 500, 50)?;
Ok(State {}) Ok(State {})

View File

@ -13,12 +13,18 @@ impl State {
options_checkbox(par.mp, c, SettingType::NotificationsEnabled)?; options_checkbox(par.mp, c, SettingType::NotificationsEnabled)?;
options_checkbox(par.mp, c, SettingType::NotificationsSoundEnabled)?; options_checkbox(par.mp, c, SettingType::NotificationsSoundEnabled)?;
options_checkbox(par.mp, c, SettingType::KeyboardSoundEnabled)?; options_checkbox(par.mp, c, SettingType::KeyboardSoundEnabled)?;
options_checkbox(par.mp, c, SettingType::SpaceDragUnlocked)?; if !par.feats.openxr || par.feats.monado {
options_checkbox(par.mp, c, SettingType::SpaceRotateUnlocked)?; // monado or openvr
options_slider_f32(par.mp, c, SettingType::SpaceDragMultiplier, -10.0, 10.0, 0.5)?; options_checkbox(par.mp, c, SettingType::SpaceDragUnlocked)?;
options_checkbox(par.mp, c, SettingType::BlockGameInput)?; options_slider_f32(par.mp, c, SettingType::SpaceDragMultiplier, -10.0, 10.0, 0.5)?;
options_checkbox(par.mp, c, SettingType::BlockGameInputIgnoreWatch)?; }
options_checkbox(par.mp, c, SettingType::BlockPosesOnKbdInteraction)?; 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( options_range_f32(
par.mp, par.mp,
c, c,