egui_pop_api/bus/zen.rs
1//! The panel zen mode shows, on the bus (ADR 0029): `pop.zen.panel` asks
2//! the application which panel matters now, when zen mode starts without
3//! a panel named and the focused panel is not a view
4//! ([`AppHandle::zen_target`]).
5//!
6//! egui-pop has no listener of its own: an application answers with the
7//! panel its own rules pick (an image viewer, the surface a double click
8//! reaches), by its id; `None`, or a panel that is not open, lets the
9//! centre's active tab be shown.
10//!
11//! [`AppHandle::zen_target`]: crate::AppHandle::zen_target
12
13use bus_contract::{Point, PointId, PointKind};
14
15/// Which panel zen mode shows (`pop.zen.panel`): the value is the panel's
16/// id, `None` while no listener picks one.
17#[derive(Debug)]
18pub struct ZenPanel;
19impl Point for ZenPanel {
20 const KIND: PointKind = PointKind::Alter;
21 const ID: PointId = PointId::new("pop.zen.panel");
22 type Input = ();
23 type Value = Option<String>;
24}
25
26/// The zen points, in the order [`super::order_dump`] prints them.
27pub const ZEN_POINTS: [&str; 1] = [ZenPanel::ID.as_str()];