bar: dash button

This commit is contained in:
galister
2026-01-05 21:30:48 +09:00
parent 164e9764eb
commit 85b6032586
3 changed files with 26 additions and 7 deletions

View File

@@ -168,7 +168,7 @@
</template>
<template name="Set">
<Button macro="button_style" id="set_${idx}" _release="::SetSwitch ${idx}" tooltip="WATCH.SWITCH_TO_SET" tooltip_side="bottom">
<Button macro="button_style" id="set_${idx}" _press="::SetSwitch ${idx}" tooltip="WATCH.SWITCH_TO_SET" tooltip_side="bottom">
<sprite width="56" height="56" color="~text_color" src_builtin="watch/set2.svg" />
<div position="absolute" margin_top="16" margin_left="-8">
<label text="${display}" size="26" color="~color_faded_20" weight="bold" />
@@ -180,6 +180,10 @@
<div flex_direction="column" interactable="0">
<rectangle macro="bg_rect" padding="16" align_items="center" justify_content="space_between">
<div gap="16">
<Button macro="button_style" id="btn_dashboard" _press="::DashToggle">
<sprite width="56" height="56" color="~text_color" src="watch/wayvr_dashboard_mono.svg" />
</Button>
<VerticalSeparator />
<div id="panels_root" gap="8">
<Screen idx="0" display="H1" name="HDMI-A-1" />
<Screen idx="1" display="D2" name="Screen: DP-2" />

View File

@@ -350,6 +350,23 @@ pub(super) fn create_keyboard_panel(
);
("App", apps_root)
}
OverlayCategory::Dashboard => {
let overlay_button = panel
.parser_state
.fetch_component_as::<ComponentButton>("btn_dashboard")?;
log::error!("Found dashboard at: {:?}", meta.id);
if meta.visible {
let mut com = CallbackDataCommon {
alterables: &mut alterables,
state: &panel.layout.state,
};
overlay_button.set_sticky_state(&mut com, true);
}
panel.state.overlay_buttons.insert(meta.id, overlay_button);
continue;
}
_ => continue,
};
@@ -362,7 +379,7 @@ pub(super) fn create_keyboard_panel(
root,
params,
)?;
let overlay_buttons = panel
let overlay_button = panel
.parser_state
.fetch_component_as::<ComponentButton>(&format!("overlay_{i}"))?;
if meta.visible {
@@ -370,9 +387,9 @@ pub(super) fn create_keyboard_panel(
alterables: &mut alterables,
state: &panel.layout.state,
};
overlay_buttons.set_sticky_state(&mut com, true);
overlay_button.set_sticky_state(&mut com, true);
}
panel.state.overlay_buttons.insert(meta.id, overlay_buttons);
panel.state.overlay_buttons.insert(meta.id, overlay_button);
}
panel.process_custom_elems(app);
}

View File

@@ -1,6 +1,6 @@
use std::{
cell::Cell,
collections::{HashMap, HashSet},
collections::HashMap,
process::{Child, Command},
rc::Rc,
sync::atomic::Ordering,
@@ -35,8 +35,6 @@ use wgui::{
components::button::ComponentButton,
drawing,
event::{InternalStateChangeEvent, MouseButton, MouseButtonIndex},
layout::{Layout, WidgetID},
parser::ParserState,
};
use wlx_common::overlays::{BackendAttrib, BackendAttribValue};
use wlx_common::windowing::{OverlayWindowState, Positioning};