grab-help panel, FollowHand align_to_hmd
This commit is contained in:
@@ -4,8 +4,8 @@ use wlx_common::windowing::{OverlayWindowState, Positioning};
|
||||
|
||||
use crate::gui::panel::GuiPanel;
|
||||
use crate::state::AppState;
|
||||
use crate::windowing::Z_ORDER_ANCHOR;
|
||||
use crate::windowing::window::OverlayWindowConfig;
|
||||
use crate::windowing::{Z_ORDER_ANCHOR, Z_ORDER_HELP};
|
||||
|
||||
pub static ANCHOR_NAME: LazyLock<Arc<str>> = LazyLock::new(|| Arc::from("anchor"));
|
||||
|
||||
@@ -31,3 +31,27 @@ pub fn create_anchor(app: &mut AppState) -> anyhow::Result<OverlayWindowConfig>
|
||||
..OverlayWindowConfig::from_backend(Box::new(panel))
|
||||
})
|
||||
}
|
||||
|
||||
pub static GRAB_HELP_NAME: LazyLock<Arc<str>> = LazyLock::new(|| Arc::from("grab-help"));
|
||||
|
||||
pub fn create_grab_help(app: &mut AppState) -> anyhow::Result<OverlayWindowConfig> {
|
||||
let mut panel = GuiPanel::new_from_template(app, "gui/grab-help.xml", (), Default::default())?;
|
||||
panel.update_layout()?;
|
||||
|
||||
Ok(OverlayWindowConfig {
|
||||
name: GRAB_HELP_NAME.clone(),
|
||||
z_order: Z_ORDER_HELP,
|
||||
default_state: OverlayWindowState {
|
||||
interactable: false,
|
||||
grabbable: false,
|
||||
transform: Affine3A::from_scale_rotation_translation(
|
||||
Vec3::ONE * 0.15,
|
||||
Quat::IDENTITY,
|
||||
Vec3::ZERO,
|
||||
),
|
||||
..OverlayWindowState::default()
|
||||
},
|
||||
global: true,
|
||||
..OverlayWindowConfig::from_backend(Box::new(panel))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user