use std::collections::HashMap;
use crate::core::types::Rect;
#[derive(Debug, Clone)]
pub enum DragOutcome {
ModalBodyScroll,
ModalResize,
PopupBodyScroll,
PopupResize,
ToolbarResize { which: &'static str },
SidebarResize { which: &'static str },
SidebarScrollbar {
track_rect: Rect,
content_h: f64,
viewport_h: f64,
},
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub enum EdgeSide {
#[default]
Top,
Bottom,
Left,
Right,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum OverlayKind {
Dropdown,
Popup,
Modal,
ContextMenu,
ColorPicker,
Tooltip,
}
pub type SlotId = String;
#[derive(Debug, Clone, Default)]
pub struct EdgeRects {
pub top: Vec<Rect>,
pub bottom: Vec<Rect>,
pub left: Vec<Rect>,
pub right: Vec<Rect>,
}
#[derive(Debug, Clone)]
pub struct OverlayRect {
pub kind: OverlayKind,
pub rect: Rect,
pub z: i32,
}
#[derive(Debug, Clone, Default)]
pub struct LayoutSolved {
pub chrome: Option<Rect>,
pub edges: EdgeRects,
pub dock_area: Rect,
pub floating_area: Rect,
pub overlays: HashMap<SlotId, OverlayRect>,
}