dash-frontend: "Skybox" tab

This commit is contained in:
Aleksander 2026-04-04 14:47:01 +02:00 committed by galister
parent 1238808d87
commit 1d8b22d992
8 changed files with 28 additions and 8 deletions

View File

@ -48,6 +48,7 @@
<div gap="4"> <div gap="4">
<Tabs id="tabs"> <Tabs id="tabs">
<Tab name="look_and_feel" translation="APP_SETTINGS.LOOK_AND_FEEL" sprite_src_builtin="dashboard/palette.svg" /> <Tab name="look_and_feel" translation="APP_SETTINGS.LOOK_AND_FEEL" sprite_src_builtin="dashboard/palette.svg" />
<Tab name="skybox" translation="APP_SETTINGS.SKYBOX" sprite_src_builtin="dashboard/globe.svg" />
<Tab name="features" translation="APP_SETTINGS.FEATURES" sprite_src_builtin="dashboard/options.svg" /> <Tab name="features" translation="APP_SETTINGS.FEATURES" sprite_src_builtin="dashboard/options.svg" />
<Tab name="controls" translation="APP_SETTINGS.CONTROLS" sprite_src_builtin="dashboard/controller.svg" /> <Tab name="controls" translation="APP_SETTINGS.CONTROLS" sprite_src_builtin="dashboard/controller.svg" />
<Tab name="misc" translation="APP_SETTINGS.MISC" sprite_src_builtin="dashboard/blocks.svg" /> <Tab name="misc" translation="APP_SETTINGS.MISC" sprite_src_builtin="dashboard/blocks.svg" />
@ -59,4 +60,4 @@
</div> </div>
</div> </div>
</elements> </elements>
</layout> </layout>

View File

@ -99,6 +99,7 @@
"SCREEN_RENDER_DOWN_HELP": "Helps with aliasing on high-res screens", "SCREEN_RENDER_DOWN_HELP": "Helps with aliasing on high-res screens",
"SCROLL_SPEED": "Scroll speed", "SCROLL_SPEED": "Scroll speed",
"SETS_ON_WATCH": "Sets on watch", "SETS_ON_WATCH": "Sets on watch",
"SKYBOX": "Skybox",
"SPACE_DRAG_MULTIPLIER": "Space drag multiplier", "SPACE_DRAG_MULTIPLIER": "Space drag multiplier",
"SPACE_DRAG_UNLOCKED": "Allow space drag on all axes", "SPACE_DRAG_UNLOCKED": "Allow space drag on all axes",
"SPACE_ROTATE_UNLOCKED": "Allow space rotate on all axes", "SPACE_ROTATE_UNLOCKED": "Allow space rotate on all axes",

View File

@ -33,6 +33,7 @@ mod tab_controls;
mod tab_features; mod tab_features;
mod tab_look_and_feel; mod tab_look_and_feel;
mod tab_misc; mod tab_misc;
mod tab_skybox;
mod tab_troubleshooting; mod tab_troubleshooting;
#[derive(Clone)] #[derive(Clone)]
@ -43,6 +44,7 @@ enum TabNameEnum {
Misc, Misc,
AutostartApps, AutostartApps,
Troubleshooting, Troubleshooting,
Skybox,
} }
impl TabNameEnum { impl TabNameEnum {
@ -54,6 +56,7 @@ impl TabNameEnum {
"misc" => Some(TabNameEnum::Misc), "misc" => Some(TabNameEnum::Misc),
"autostart_apps" => Some(TabNameEnum::AutostartApps), "autostart_apps" => Some(TabNameEnum::AutostartApps),
"troubleshooting" => Some(TabNameEnum::Troubleshooting), "troubleshooting" => Some(TabNameEnum::Troubleshooting),
"skybox" => Some(TabNameEnum::Skybox),
_ => None, _ => None,
} }
} }
@ -533,6 +536,9 @@ impl<T> TabSettings<T> {
TabNameEnum::Troubleshooting => { TabNameEnum::Troubleshooting => {
tab_troubleshooting::mount(&mut mp, root)?; tab_troubleshooting::mount(&mut mp, root)?;
} }
TabNameEnum::Skybox => {
tab_skybox::mount(&mut mp, root)?;
}
} }
Ok(()) Ok(())

View File

@ -7,14 +7,12 @@ use wgui::layout::WidgetID;
pub fn mount(mp: &mut MacroParams, parent: WidgetID) -> anyhow::Result<()> { pub fn mount(mp: &mut MacroParams, parent: WidgetID) -> anyhow::Result<()> {
let c = options_category(mp, parent, "APP_SETTINGS.LOOK_AND_FEEL", "dashboard/palette.svg")?; let c = options_category(mp, parent, "APP_SETTINGS.LOOK_AND_FEEL", "dashboard/palette.svg")?;
options_dropdown::<wlx_common::locale::Language>(mp, c, &SettingType::Language)?; options_dropdown::<wlx_common::locale::Language>(mp, c, &SettingType::Language)?;
options_checkbox(mp, c, SettingType::OpaqueBackground)?;
options_checkbox(mp, c, SettingType::HideUsername)?; options_checkbox(mp, c, SettingType::HideUsername)?;
options_checkbox(mp, c, SettingType::HideGrabHelp)?; options_checkbox(mp, c, SettingType::HideGrabHelp)?;
options_slider_f32(mp, c, SettingType::UiAnimationSpeed, 0.5, 5.0, 0.1)?; // min, max, step options_slider_f32(mp, c, SettingType::UiAnimationSpeed, 0.5, 5.0, 0.1)?; // min, max, step
options_slider_f32(mp, c, SettingType::UiGradientIntensity, 0.0, 1.0, 0.05)?; // min, max, step options_slider_f32(mp, c, SettingType::UiGradientIntensity, 0.0, 1.0, 0.05)?; // min, max, step
options_slider_f32(mp, c, SettingType::UiRoundMultiplier, 0.5, 5.0, 0.1)?; options_slider_f32(mp, c, SettingType::UiRoundMultiplier, 0.5, 5.0, 0.1)?;
options_checkbox(mp, c, SettingType::SetsOnWatch)?; options_checkbox(mp, c, SettingType::SetsOnWatch)?;
options_checkbox(mp, c, SettingType::UseSkybox)?;
options_slider_f32(mp, c, SettingType::GridOpacity, 0.0, 1.0, 0.05)?; // min, max, step options_slider_f32(mp, c, SettingType::GridOpacity, 0.0, 1.0, 0.05)?; // min, max, step
options_checkbox(mp, c, SettingType::UsePassthrough)?; options_checkbox(mp, c, SettingType::UsePassthrough)?;
options_checkbox(mp, c, SettingType::Clock12h)?; options_checkbox(mp, c, SettingType::Clock12h)?;

View File

@ -0,0 +1,12 @@
use crate::tab::settings::{
SettingType,
macros::{MacroParams, options_category, options_checkbox},
};
use wgui::layout::WidgetID;
pub fn mount(mp: &mut MacroParams, parent: WidgetID) -> anyhow::Result<()> {
let c = options_category(mp, parent, "APP_SETTINGS.SKYBOX", "dashboard/globe.svg")?;
options_checkbox(mp, c, SettingType::UseSkybox)?;
options_checkbox(mp, c, SettingType::OpaqueBackground)?;
Ok(())
}

View File

@ -19,6 +19,8 @@ impl MonadoState {
Ok(res) Ok(res)
} }
#[allow(clippy::missing_const_for_fn)]
#[allow(clippy::unused_self)]
pub fn update(&mut self) { pub fn update(&mut self) {
#[cfg(feature = "feat-monado-metrics")] #[cfg(feature = "feat-monado-metrics")]
if let Some(metrics) = &mut self.metrics { if let Some(metrics) = &mut self.metrics {
@ -30,6 +32,10 @@ impl MonadoState {
} }
} }
#[allow(clippy::missing_const_for_fn)]
#[allow(clippy::unused_self)]
#[allow(clippy::unnecessary_wraps)]
#[cfg(feature = "feat-monado-metrics")]
pub fn set_metrics_enabled(&mut self, enabled: bool) -> anyhow::Result<()> { pub fn set_metrics_enabled(&mut self, enabled: bool) -> anyhow::Result<()> {
#[cfg(feature = "feat-monado-metrics")] #[cfg(feature = "feat-monado-metrics")]
{ {

View File

@ -9,7 +9,6 @@ use wgui::{
drawing, font_config::WguiFontConfig, gfx::WGfx, globals::WguiGlobals, parser::parse_color_hex, drawing, font_config::WguiFontConfig, gfx::WGfx, globals::WguiGlobals, parser::parse_color_hex,
renderer_vk::context::SharedContext as WSharedContext, renderer_vk::context::SharedContext as WSharedContext,
}; };
use wlx_common::async_executor::AsyncExecutor;
use wlx_common::locale::WayVRLangProvider; use wlx_common::locale::WayVRLangProvider;
use wlx_common::{ use wlx_common::{
audio, audio,
@ -38,7 +37,6 @@ use crate::{
pub struct AppState { pub struct AppState {
pub session: AppSession, pub session: AppSession,
pub tasks: TaskContainer, pub tasks: TaskContainer,
pub executor: AsyncExecutor,
pub gfx: Arc<WGfx>, pub gfx: Arc<WGfx>,
pub gfx_extras: WGfxExtras, pub gfx_extras: WGfxExtras,
@ -157,12 +155,9 @@ impl AppState {
let lang_provider = WayVRLangProvider::from_config(&session.config); let lang_provider = WayVRLangProvider::from_config(&session.config);
let executor = Rc::new(smol::LocalExecutor::new());
Ok(Self { Ok(Self {
session, session,
tasks, tasks,
executor,
gfx, gfx,
gfx_extras, gfx_extras,
hid_provider, hid_provider,

View File

@ -8,6 +8,7 @@ use crate::subsystem::monado_metrics::proto;
pub struct MonadoMetricsFd { pub struct MonadoMetricsFd {
stream_reader: UnixStream, stream_reader: UnixStream,
#[allow(dead_code)]
stream_writer: UnixStream, stream_writer: UnixStream,
records: VecDeque<proto::Record>, records: VecDeque<proto::Record>,