This commit is contained in:
galister
2026-01-09 11:48:44 +09:00
parent 9f79a034e7
commit e6e1764b36
23 changed files with 33 additions and 52 deletions

View File

@@ -19,8 +19,8 @@ use wlx_common::{audio, dash_interface::BoxDashInterface, timestep::Timestep};
use crate::{ use crate::{
assets, assets,
tab::{ tab::{
apps::TabApps, games::TabGames, home::TabHome, monado::TabMonado, processes::TabProcesses, settings::TabSettings, Tab, TabType, apps::TabApps, games::TabGames, home::TabHome, monado::TabMonado, processes::TabProcesses,
Tab, TabType, settings::TabSettings,
}, },
util::{ util::{
popup_manager::{MountPopupParams, PopupManager, PopupManagerParams}, popup_manager::{MountPopupParams, PopupManager, PopupManagerParams},

View File

@@ -8,9 +8,9 @@ use glam::Vec2;
use wgui::{ use wgui::{
assets::AssetPath, assets::AssetPath,
components::{ components::{
Component,
button::{ButtonClickCallback, ComponentButton}, button::{ButtonClickCallback, ComponentButton},
checkbox::ComponentCheckbox, checkbox::ComponentCheckbox,
Component,
}, },
drawing::Color, drawing::Color,
event::StyleSetRequest, event::StyleSetRequest,

View File

@@ -410,9 +410,7 @@ impl WayVRClient {
Ok(()) Ok(())
} }
pub async fn fn_wlx_overlay_show_hide( pub async fn fn_wlx_overlay_show_hide(client: WayVRClientMutex) -> anyhow::Result<()> {
client: WayVRClientMutex,
) -> anyhow::Result<()> {
send_only!(client, &PacketClient::WlxShowHide); send_only!(client, &PacketClient::WlxShowHide);
Ok(()) Ok(())
} }

View File

@@ -156,13 +156,9 @@ pub async fn wlx_device_haptics(
) )
} }
pub async fn wlx_overlay_show_hide( pub async fn wlx_overlay_show_hide(state: &mut WayVRClientState) {
state: &mut WayVRClientState,
) {
handle_empty_result( handle_empty_result(
WayVRClient::fn_wlx_overlay_show_hide( WayVRClient::fn_wlx_overlay_show_hide(state.wayvr_client.clone())
state.wayvr_client.clone(),
)
.await .await
.context("failed to trigger overlay show hide"), .context("failed to trigger overlay show hide"),
) )

View File

@@ -14,8 +14,8 @@ use wayvr_ipc::{
}; };
use crate::helper::{ use crate::helper::{
WayVRClientState, wlx_device_haptics, wlx_input_state, wlx_panel_modify, wvr_process_get, WayVRClientState, wlx_device_haptics, wlx_input_state, wlx_overlay_show_hide, wlx_panel_modify,
wvr_process_launch, wvr_process_list, wvr_process_terminate, wvr_window_list, wvr_process_get, wvr_process_launch, wvr_process_list, wvr_process_terminate, wvr_window_list,
wvr_window_set_visible, wvr_window_set_visible,
}; };

View File

@@ -1,10 +1,10 @@
use std::{cell::RefCell, rc::Rc}; use std::{cell::RefCell, rc::Rc};
use crate::{ use crate::{
components::{checkbox::ComponentCheckbox, Component, ComponentBase, ComponentTrait, RefreshData}, components::{Component, ComponentBase, ComponentTrait, RefreshData, checkbox::ComponentCheckbox},
event::CallbackDataCommon, event::CallbackDataCommon,
layout::WidgetPair, layout::WidgetPair,
widget::{div::WidgetDiv, ConstructEssentials}, widget::{ConstructEssentials, div::WidgetDiv},
}; };
pub struct RadioValueChangeEvent { pub struct RadioValueChangeEvent {

View File

@@ -9,11 +9,11 @@ use crate::{
layout::{self, LayoutTask, LayoutTasks, WidgetID, WidgetPair}, layout::{self, LayoutTask, LayoutTasks, WidgetID, WidgetPair},
renderer_vk::text::{FontWeight, TextStyle}, renderer_vk::text::{FontWeight, TextStyle},
widget::{ widget::{
ConstructEssentials,
div::WidgetDiv, div::WidgetDiv,
label::{WidgetLabel, WidgetLabelParams}, label::{WidgetLabel, WidgetLabelParams},
rectangle::{WidgetRectangle, WidgetRectangleParams}, rectangle::{WidgetRectangle, WidgetRectangleParams},
util::WLength, util::WLength,
ConstructEssentials,
}, },
}; };

View File

@@ -1,13 +1,12 @@
use crate::{ use crate::{
assets::AssetPath, assets::AssetPath,
components::{button, tooltip, Component}, components::{Component, button, tooltip},
drawing::Color, drawing::Color,
i18n::Translation, i18n::Translation,
layout::WidgetID, layout::WidgetID,
parser::{ parser::{
parse_children, parse_f32, process_component, AttribPair, ParserContext, ParserFile, parse_children, parse_f32, process_component,
style::{parse_color_opt, parse_round, parse_style, parse_text_style}, style::{parse_color_opt, parse_round, parse_style, parse_text_style},
AttribPair, ParserContext, ParserFile,
}, },
widget::util::WLength, widget::util::WLength,
}; };

View File

@@ -1,8 +1,8 @@
use crate::{ use crate::{
components::{checkbox, radio_group::ComponentRadioGroup, Component}, components::{Component, checkbox, radio_group::ComponentRadioGroup},
i18n::Translation, i18n::Translation,
layout::WidgetID, layout::WidgetID,
parser::{process_component, style::parse_style, AttribPair, Fetchable, ParserContext}, parser::{AttribPair, Fetchable, ParserContext, process_component, style::parse_style},
}; };
pub enum CheckboxKind { pub enum CheckboxKind {

View File

@@ -1,7 +1,7 @@
use crate::{ use crate::{
components::{radio_group, Component}, components::{Component, radio_group},
layout::WidgetID, layout::WidgetID,
parser::{parse_children, process_component, style::parse_style, AttribPair, ParserContext, ParserFile}, parser::{AttribPair, ParserContext, ParserFile, parse_children, process_component, style::parse_style},
}; };
pub fn parse_component_radio_group<'a>( pub fn parse_component_radio_group<'a>(

View File

@@ -1,7 +1,7 @@
use crate::{ use crate::{
components::{slider, Component}, components::{Component, slider},
layout::WidgetID, layout::WidgetID,
parser::{process_component, style::parse_style, AttribPair, ParserContext}, parser::{AttribPair, ParserContext, process_component, style::parse_style},
widget::ConstructEssentials, widget::ConstructEssentials,
}; };

View File

@@ -5,7 +5,7 @@ use taffy::{
use crate::{ use crate::{
drawing, drawing,
parser::{is_percent, parse_color_hex, parse_f32, AttribPair, ParserContext}, parser::{AttribPair, ParserContext, is_percent, parse_color_hex, parse_f32},
renderer_vk::text::{FontWeight, HorizontalAlign, TextStyle}, renderer_vk::text::{FontWeight, HorizontalAlign, TextStyle},
widget::util::WLength, widget::util::WLength,
}; };

View File

@@ -1,6 +1,6 @@
use crate::{ use crate::{
layout::WidgetID, layout::WidgetID,
parser::{parse_children, parse_widget_universal, style::parse_style, AttribPair, ParserContext, ParserFile}, parser::{AttribPair, ParserContext, ParserFile, parse_children, parse_widget_universal, style::parse_style},
widget::div::WidgetDiv, widget::div::WidgetDiv,
}; };

View File

@@ -2,9 +2,8 @@ use crate::{
assets::AssetPath, assets::AssetPath,
layout::WidgetID, layout::WidgetID,
parser::{ parser::{
parse_children, parse_widget_universal, AttribPair, ParserContext, ParserFile, parse_children, parse_widget_universal,
style::{parse_color, parse_round, parse_style}, style::{parse_color, parse_round, parse_style},
AttribPair, ParserContext, ParserFile,
}, },
renderer_vk::text::custom_glyph::CustomGlyphData, renderer_vk::text::custom_glyph::CustomGlyphData,
widget::image::{WidgetImage, WidgetImageParams}, widget::image::{WidgetImage, WidgetImageParams},

View File

@@ -2,9 +2,8 @@ use crate::{
i18n::Translation, i18n::Translation,
layout::WidgetID, layout::WidgetID,
parser::{ parser::{
parse_children, parse_i32, parse_widget_universal, AttribPair, ParserContext, ParserFile, parse_children, parse_i32, parse_widget_universal,
style::{parse_style, parse_text_style}, style::{parse_style, parse_text_style},
AttribPair, ParserContext, ParserFile,
}, },
widget::label::{WidgetLabel, WidgetLabelParams}, widget::label::{WidgetLabel, WidgetLabelParams},
}; };

View File

@@ -2,9 +2,8 @@ use crate::{
drawing::GradientMode, drawing::GradientMode,
layout::WidgetID, layout::WidgetID,
parser::{ parser::{
parse_children, parse_widget_universal, AttribPair, ParserContext, ParserFile, parse_children, parse_widget_universal,
style::{parse_color, parse_round, parse_style}, style::{parse_color, parse_round, parse_style},
AttribPair, ParserContext, ParserFile,
}, },
widget::rectangle::{WidgetRectangle, WidgetRectangleParams}, widget::rectangle::{WidgetRectangle, WidgetRectangleParams},
}; };

View File

@@ -1,7 +1,7 @@
use crate::{ use crate::{
assets::AssetPath, assets::AssetPath,
layout::WidgetID, layout::WidgetID,
parser::{parse_children, parse_widget_universal, style::parse_style, AttribPair, ParserContext, ParserFile}, parser::{AttribPair, ParserContext, ParserFile, parse_children, parse_widget_universal, style::parse_style},
renderer_vk::text::custom_glyph::CustomGlyphData, renderer_vk::text::custom_glyph::CustomGlyphData,
widget::sprite::{WidgetSprite, WidgetSpriteParams}, widget::sprite::{WidgetSprite, WidgetSpriteParams},
}; };

View File

@@ -77,11 +77,7 @@ impl From<&TextStyle> for Metrics {
impl From<&TextStyle> for Wrap { impl From<&TextStyle> for Wrap {
fn from(value: &TextStyle) -> Self { fn from(value: &TextStyle) -> Self {
if value.wrap { if value.wrap { Self::WordOrGlyph } else { Self::None }
Self::WordOrGlyph
} else {
Self::None
}
} }
} }

View File

@@ -4,7 +4,7 @@ use glam::Vec2;
use crate::{ use crate::{
assets::AssetPath, assets::AssetPath,
components::{button::ComponentButton, ComponentTrait}, components::{ComponentTrait, button::ComponentButton},
globals::WguiGlobals, globals::WguiGlobals,
i18n::Translation, i18n::Translation,
layout::Layout, layout::Layout,

View File

@@ -13,7 +13,7 @@ use crate::{
i18n::Translation, i18n::Translation,
layout::{Layout, LayoutTask, LayoutTasks, WidgetPair}, layout::{Layout, LayoutTask, LayoutTasks, WidgetPair},
parser::{self, Fetchable, ParserState}, parser::{self, Fetchable, ParserState},
widget::{div::WidgetDiv, label::WidgetLabel, rectangle::WidgetRectangle, EventResult}, widget::{EventResult, div::WidgetDiv, label::WidgetLabel, rectangle::WidgetRectangle},
}; };
struct OpenedWindow { struct OpenedWindow {

View File

@@ -120,9 +120,7 @@ pub(super) fn setup_custom_label<S: 'static>(
"%H:%M" "%H:%M"
} }
} }
unk => { unk => unk,
unk
}
}; };
let state = ClockLabelState { let state = ClockLabelState {

View File

@@ -51,8 +51,7 @@ where
.enqueue(TaskType::Input(InputTask::Haptics { device, haptics })); .enqueue(TaskType::Input(InputTask::Haptics { device, haptics }));
} }
WayVRSignal::ShowHide => { WayVRSignal::ShowHide => {
app.tasks app.tasks.enqueue(TaskType::Overlay(OverlayTask::ShowHide));
.enqueue(TaskType::Overlay(OverlayTask::ShowHide));
} }
WayVRSignal::DropOverlay(overlay_id) => { WayVRSignal::DropOverlay(overlay_id) => {
app.tasks app.tasks

View File

@@ -350,9 +350,7 @@ impl Connection {
)); ));
} }
fn handle_wlx_overlay_show_hide( fn handle_wlx_overlay_show_hide(params: &mut TickParams) {
params: &mut TickParams
) {
params.signals.send(WayVRSignal::ShowHide); params.signals.send(WayVRSignal::ShowHide);
} }