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::{
assets,
tab::{
apps::TabApps, games::TabGames, home::TabHome, monado::TabMonado, processes::TabProcesses, settings::TabSettings,
Tab, TabType,
Tab, TabType, apps::TabApps, games::TabGames, home::TabHome, monado::TabMonado, processes::TabProcesses,
settings::TabSettings,
},
util::{
popup_manager::{MountPopupParams, PopupManager, PopupManagerParams},

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,13 +1,12 @@
use crate::{
assets::AssetPath,
components::{button, tooltip, Component},
components::{Component, button, tooltip},
drawing::Color,
i18n::Translation,
layout::WidgetID,
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},
AttribPair, ParserContext, ParserFile,
},
widget::util::WLength,
};

View File

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

View File

@@ -1,7 +1,7 @@
use crate::{
components::{radio_group, Component},
components::{Component, radio_group},
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>(

View File

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

View File

@@ -5,7 +5,7 @@ use taffy::{
use crate::{
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},
widget::util::WLength,
};

View File

@@ -1,6 +1,6 @@
use crate::{
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,
};

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
use crate::{
assets::AssetPath,
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,
widget::sprite::{WidgetSprite, WidgetSpriteParams},
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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