pub enum DebugLayer {
All,
TopMost,
BaseOnly,
}Expand description
Which layers the F12 debug overlay should outline (issue #201).
All (the default) outlines both the base layer and any active
overlays/modals — matching the user’s expectation for “show everything
the renderer is producing this frame.” TopMost only outlines the
topmost overlay (or the base if no overlay is active), and BaseOnly
keeps the legacy pre-fix behavior of skipping overlays entirely.
At runtime, Shift+F12 cycles All → TopMost → BaseOnly → All so a
developer debugging a stacked modal can shrink the visible outlines to
just the layer they care about without leaving the keyboard. Plain
F12 independently toggles the overlay on/off.
§Example
use slt::{Context, DebugLayer};
slt::run(|ui: &mut Context| {
// Match on the current layer to drive bespoke debug UI.
let label = match ui.debug_layer() {
DebugLayer::All => "showing base + overlays",
DebugLayer::TopMost => "showing topmost overlay only",
DebugLayer::BaseOnly => "showing base layer only",
};
ui.text(label);
})
.unwrap();Variants§
All
Outline both the base tree and every active overlay/modal.
Default. Matches the reporter expectation that F12 reflects everything the renderer is producing this frame. Each layer family gets its own hue so a glance distinguishes base, overlay, and modal containers.
TopMost
Outline only the topmost overlay (or the base if no overlay is active).
Useful when modals or popovers stack and you only care about the active dialog — base-tree outlines become noise underneath an open modal.
BaseOnly
Outline only the base layer (legacy v0.19.x behavior).
Skips overlays and modals entirely. Use when an overlay is confirmed correct and you want to inspect the base layout underneath it.
Trait Implementations§
Source§impl Clone for DebugLayer
impl Clone for DebugLayer
Source§fn clone(&self) -> DebugLayer
fn clone(&self) -> DebugLayer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more