Add debug-widget-callstack and debug-interactive-widgets features
- they need to be separate, both on at once is too much
--features debug-widget-callstack
Show callstack for the current widget on hover if all modifier keys
are pressed down
--features debug-interactive-widgets
Show an overlay on all interactive widgets
Notes:
- debug-widget-callstack asserts `egui:callstack` feature when enabled
- Only works in debug builds, compile error w/ release builds
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -1050,6 +1050,7 @@ checksum = "53eafabcce0cb2325a59a98736efe0bf060585b437763f8c476957fb274bb974"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"ahash",
|
||||
"backtrace",
|
||||
"emath",
|
||||
"epaint",
|
||||
"log",
|
||||
|
||||
@@ -42,6 +42,8 @@ path = "src/preview.rs"
|
||||
[features]
|
||||
default = []
|
||||
profiling = ["notedeck_columns/puffin", "puffin", "puffin_egui"]
|
||||
debug-widget-callstack = ["egui/callstack"]
|
||||
debug-interactive-widgets = []
|
||||
|
||||
[target.'cfg(target_os = "android")'.dependencies]
|
||||
android_logger = "0.11.1"
|
||||
|
||||
@@ -124,9 +124,26 @@ pub fn add_custom_style(is_mobile: bool, style: &mut Style) {
|
||||
..Interaction::default()
|
||||
};
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
// debug: show callstack for the current widget on hover if all
|
||||
// modifier keys are pressed down.
|
||||
#[cfg(feature = "debug-widget-callstack")]
|
||||
{
|
||||
style.debug.show_interactive_widgets = true;
|
||||
#[cfg(not(debug_assertions))]
|
||||
compile_error!(
|
||||
"The `debug-widget-callstack` feature requires a debug build, \
|
||||
release builds are unsupported."
|
||||
);
|
||||
style.debug.debug_on_hover_with_all_modifiers = true;
|
||||
}
|
||||
|
||||
// debug: show an overlay on all interactive widgets
|
||||
#[cfg(feature = "debug-interactive-widgets")]
|
||||
{
|
||||
#[cfg(not(debug_assertions))]
|
||||
compile_error!(
|
||||
"The `debug-interactive-widgets` feature requires a debug build, \
|
||||
release builds are unsupported."
|
||||
);
|
||||
style.debug.show_interactive_widgets = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user