panel: per-element interactibility

This commit is contained in:
galister
2025-10-31 17:32:10 +09:00
parent 01d11e8485
commit fa562f7b12
19 changed files with 423 additions and 361 deletions

View File

@@ -3,7 +3,7 @@ use std::sync::Arc;
use vulkano::{format::Format, image::view::ImageView};
use crate::{
backend::input::{Haptics, PointerHit},
backend::input::{HoverResult, PointerHit},
graphics::CommandBuffers,
state::AppState,
};
@@ -48,7 +48,7 @@ pub trait OverlayBackend {
/// Must be true if should_render was also true on the same frame.
fn frame_meta(&mut self) -> Option<FrameMeta>;
fn on_hover(&mut self, app: &mut AppState, hit: &PointerHit) -> Option<Haptics>;
fn on_hover(&mut self, app: &mut AppState, hit: &PointerHit) -> HoverResult;
fn on_left(&mut self, app: &mut AppState, pointer: usize);
fn on_pointer(&mut self, app: &mut AppState, hit: &PointerHit, pressed: bool);
fn on_scroll(&mut self, app: &mut AppState, hit: &PointerHit, delta_y: f32, delta_x: f32);

View File

@@ -91,7 +91,9 @@ where
Ok(me)
}
}
impl<T> OverlayWindowManager<T> {
pub fn mut_by_selector(
&mut self,
selector: &OverlaySelector,

View File

@@ -63,10 +63,7 @@ where
}
}
impl<T> OverlayWindowData<T>
where
T: Default,
{
impl<T> OverlayWindowData<T> {
pub fn init(&mut self, app: &mut AppState) -> anyhow::Result<()> {
//TODO: load state?