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">
<Tabs id="tabs">
<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="controls" translation="APP_SETTINGS.CONTROLS" sprite_src_builtin="dashboard/controller.svg" />
<Tab name="misc" translation="APP_SETTINGS.MISC" sprite_src_builtin="dashboard/blocks.svg" />
@ -59,4 +60,4 @@
</div>
</div>
</elements>
</layout>
</layout>

View File

@ -99,6 +99,7 @@
"SCREEN_RENDER_DOWN_HELP": "Helps with aliasing on high-res screens",
"SCROLL_SPEED": "Scroll speed",
"SETS_ON_WATCH": "Sets on watch",
"SKYBOX": "Skybox",
"SPACE_DRAG_MULTIPLIER": "Space drag multiplier",
"SPACE_DRAG_UNLOCKED": "Allow space drag 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_look_and_feel;
mod tab_misc;
mod tab_skybox;
mod tab_troubleshooting;
#[derive(Clone)]
@ -43,6 +44,7 @@ enum TabNameEnum {
Misc,
AutostartApps,
Troubleshooting,
Skybox,
}
impl TabNameEnum {
@ -54,6 +56,7 @@ impl TabNameEnum {
"misc" => Some(TabNameEnum::Misc),
"autostart_apps" => Some(TabNameEnum::AutostartApps),
"troubleshooting" => Some(TabNameEnum::Troubleshooting),
"skybox" => Some(TabNameEnum::Skybox),
_ => None,
}
}
@ -533,6 +536,9 @@ impl<T> TabSettings<T> {
TabNameEnum::Troubleshooting => {
tab_troubleshooting::mount(&mut mp, root)?;
}
TabNameEnum::Skybox => {
tab_skybox::mount(&mut mp, root)?;
}
}
Ok(())

View File

@ -7,14 +7,12 @@ use wgui::layout::WidgetID;
pub fn mount(mp: &mut MacroParams, parent: WidgetID) -> anyhow::Result<()> {
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_checkbox(mp, c, SettingType::OpaqueBackground)?;
options_checkbox(mp, c, SettingType::HideUsername)?;
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::UiGradientIntensity, 0.0, 1.0, 0.05)?; // min, max, step
options_slider_f32(mp, c, SettingType::UiRoundMultiplier, 0.5, 5.0, 0.1)?;
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_checkbox(mp, c, SettingType::UsePassthrough)?;
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)
}
#[allow(clippy::missing_const_for_fn)]
#[allow(clippy::unused_self)]
pub fn update(&mut self) {
#[cfg(feature = "feat-monado-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<()> {
#[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,
renderer_vk::context::SharedContext as WSharedContext,
};
use wlx_common::async_executor::AsyncExecutor;
use wlx_common::locale::WayVRLangProvider;
use wlx_common::{
audio,
@ -38,7 +37,6 @@ use crate::{
pub struct AppState {
pub session: AppSession,
pub tasks: TaskContainer,
pub executor: AsyncExecutor,
pub gfx: Arc<WGfx>,
pub gfx_extras: WGfxExtras,
@ -157,12 +155,9 @@ impl AppState {
let lang_provider = WayVRLangProvider::from_config(&session.config);
let executor = Rc::new(smol::LocalExecutor::new());
Ok(Self {
session,
tasks,
executor,
gfx,
gfx_extras,
hid_provider,

View File

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