pub struct PanelDesc<'a> {
pub namespace: &'a str,
pub monitor: Option<MonitorId>,
pub layer: PanelLayer,
pub anchor: PanelAnchor,
pub reserve: Reserve,
pub margins: Margins,
pub keyboard: PanelKeyboard,
}Expand description
Where a panel goes and how it behaves.
Laid out the way wlr-layer-shell describes a surface, because that
protocol is the most complete statement of what a panel is: the other
window systems implement a subset, and the backend docs say which.
Its size is WindowDesc::size, with one
exception: along an axis where it is anchored to both opposite edges, that
size is ignored and the panel stretches between them. A bar anchored
TOP | LEFT | RIGHT with a size of (0, 50) is 50 high and as wide as the
monitor. Either way the size it actually gets arrives as the first
Resized, as for any window, and is the one
to draw at.
Fields§
§namespace: &'a strThe name window-system rules match the panel by: the layer-shell
namespace on Wayland, which Sway’s and Hyprland’s per-layer rules key
on. Empty means WindowDesc::app_id.
monitor: Option<MonitorId>The monitor it is placed on, or None for the system’s choice, which
is where the user is rather than the primary monitor: the
compositor’s pick on Wayland (the focused output on Sway, Hyprland and
niri), and the monitor under the pointer on Win32 and AppKit. A launcher
opening on a screen the user is not looking at is the failure this
avoids.
layer: PanelLayerWhich band of the stack it lives in.
anchor: PanelAnchorThe edges it is held against. A panel held against two opposite edges stretches between them; one held against none is centred.
reserve: ReserveWhether, and how, it keeps other windows out of its space.
margins: MarginsSpace between the panel and the edges it is anchored to, in logical units. A margin on an edge it is not anchored to does nothing.
keyboard: PanelKeyboardWhether it takes the keyboard.
Implementations§
Source§impl PanelDesc<'_>
impl PanelDesc<'_>
Sourcepub fn reserved_edge(&self) -> Option<PanelAnchor>
pub fn reserved_edge(&self) -> Option<PanelAnchor>
The edge Reserve::OwnExtent would reserve: the one anchored edge,
alone or with both of its neighbours. None for any other anchoring,
which has no single edge to give up.