blitz_traits/
devtools.rs

1//! Types configure developer inspection and debug tools
2
3/// Configuration for debug overlays and other debugging tools
4#[derive(Debug, Default, Clone, Copy)]
5pub struct DevtoolSettings {
6    /// Outline elements with different border colors depending on
7    /// inner display style of that element
8    pub show_layout: bool,
9    /// Render browser-style colored overlay showing the content-box,
10    /// padding, border, and margin of the hovered element
11    pub highlight_hover: bool,
12}
13
14impl DevtoolSettings {
15    /// Toggle the [`show_layout`](Self::show_layout) setting
16    pub fn toggle_show_layout(&mut self) {
17        self.show_layout = !self.show_layout
18    }
19
20    /// Toggle the [`highlight_hover`](Self::highlight_hover) setting
21    pub fn toggle_highlight_hover(&mut self) {
22        self.highlight_hover = !self.highlight_hover
23    }
24}