debug: add crate features which enable egui DebugOptions

--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:
Ken Sedgwick
2024-09-18 16:04:38 -07:00
parent 5dcab460e5
commit aafddf5acb
3 changed files with 16 additions and 0 deletions

View File

@@ -69,6 +69,19 @@ pub fn create_custom_style(ctx: &Context, font_size: fn(&NotedeckTextStyle) -> f
..Interaction::default()
};
// debug: show callstack for the current widget on hover if all
// modifier keys are pressed down.
#[cfg(feature = "debug-widget-callstack")]
{
style.debug.debug_on_hover_with_all_modifiers = true;
}
// debug: show an overlay on all interactive widgets
#[cfg(feature = "debug-interactive-widgets")]
{
style.debug.show_interactive_widgets = true;
}
style
}