always visible checkbox

This commit is contained in:
galister
2026-01-13 23:59:03 +09:00
parent 40cd532134
commit d02efc2657
4 changed files with 14 additions and 1 deletions

View File

@@ -72,6 +72,9 @@
<div id="pos_align_to_hmd" >
<CheckBox id="align_box" translation="EDIT_MODE.ALIGN_TO_HMD" tooltip_side="bottom" />
</div>
<div id="pos_global">
<CheckBox id="global_box" translation="EDIT_MODE.GLOBAL" tooltip_side="bottom" />
</div>
</div>
</div>
<div id="tab_stereo" display="none" height="100" flex_direction="column">

View File

@@ -44,6 +44,7 @@
"POS_HMD": "Follow the HMD.",
"POS_STATIC": "Static: Not part of any set, no recenter.",
"POSITIONING": "Positioning",
"GLOBAL": "Always visible",
"RESIZE_PRESS_AND_DRAG": "Resize (press & drag)",
"STEREO_3D_MODE": {
"SPLIT_BOTTOM_TOP": "BOTTOM→TOP",

View File

@@ -431,6 +431,7 @@ fn make_edit_panel(app: &mut AppState) -> anyhow::Result<EditModeWrapPanel> {
set_up_checkbox(&mut panel, "additive_box", cb_assign_additive)?;
set_up_checkbox(&mut panel, "align_box", cb_assign_align)?;
set_up_checkbox(&mut panel, "global_box", cb_assign_global)?;
set_up_checkbox(
&mut panel,
"stereo_full_frame_box",
@@ -487,6 +488,11 @@ fn reset_panel(
.fetch_component_as::<ComponentCheckbox>("align_box")?;
c.set_checked(&mut common, state.positioning.get_align().unwrap_or(false));
let c = panel
.parser_state
.fetch_component_as::<ComponentCheckbox>("global_box")?;
c.set_checked(&mut common, owc.global);
panel
.state
.pos
@@ -576,6 +582,10 @@ const fn cb_assign_align(_app: &mut AppState, owc: &mut OverlayWindowConfig, ali
active_state.positioning = active_state.positioning.with_align(align);
}
const fn cb_assign_global(_app: &mut AppState, owc: &mut OverlayWindowConfig, global: bool) {
owc.global = global;
}
fn cb_assign_stereo_full_frame(
_app: &mut AppState,
owc: &mut OverlayWindowConfig,

View File

@@ -41,7 +41,6 @@ pub fn new_pos_tab_handler(
Box::new(|_common, state| {
let positioning = state.pos;
Box::new(move |app, owc| {
owc.global = matches!(positioning, Positioning::Static);
let state = owc.active_state.as_mut().unwrap(); //want panic
state.positioning = positioning;
window::save_transform(state, app);