mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-28 09:19:51 +01:00
Say a modal layer hosts a menu, and that the press zone leaves its host out
The host a menu's press zone stops at is a modal layer, a dialog's card or a full-window modal, and the press-zone test hook left that host unmentioned.
This commit is contained in:
1 parent
b2594e6914
commit
9950c36992
2 files changed
+3
-2
No files matched your search
@@ -923,7 +923,7 @@ fn absorb_zone(members: &[OpenEntry], top: &OpenEntry) -> Vec<Rect> {
|
||||
}
|
||||
|
||||
/// Whether a press outside `entry` stops at it, so `entry` hosts the menus opened inside it (`absorb_zone`): a floating
|
||||
/// window or panel (`Rank::Window`), a dialog's card (`Rank::Modal`), which absorbs the presses outside itself, or the
|
||||
/// window or panel (`Rank::Window`), a modal layer (`Rank::Modal`), whose card takes the presses outside itself, or the
|
||||
/// entry of an OS window mount. A layer shown in a popup window of its own is no host: its presses are judged in the
|
||||
/// window that opened it.
|
||||
fn stops_presses(entry: &OpenEntry) -> bool {
|
||||
|
||||
@@ -7,7 +7,8 @@ use egui::{Context, Id, Pos2, Rect};
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct PressJudgement {
|
||||
/// The screen rects a press may land in without closing the top menu family, as the last pass left them: the
|
||||
/// family, its anchors and its peers. `None` when the top layer does not absorb outside presses.
|
||||
/// family, its anchors and its peers, without the layer that hosts them. `None` when the top layer does not absorb
|
||||
/// outside presses.
|
||||
pub zone: Option<Vec<Rect>>,
|
||||
/// The outside press the input hook recorded for this pass, which closes the layers that absorb outside presses.
|
||||
pub absorbed: Option<Pos2>,
|
||||
|
||||
Reference in new issue
Block a user