1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Add option to show a callstack to the widget under the mouse (#3391)

This commit is contained in:
Emil Ernerfeldt
2023-09-26 15:50:35 +02:00
committed by GitHub
parent e8986b1e59
commit 23ce4e70ca
18 changed files with 457 additions and 119 deletions

View File

@@ -82,8 +82,6 @@ impl BackendPanel {
}
pub fn ui(&mut self, ui: &mut egui::Ui, frame: &mut eframe::Frame) {
egui::trace!(ui);
self.integration_ui(ui, frame);
ui.separator();
@@ -101,11 +99,9 @@ impl BackendPanel {
ui.separator();
{
let mut debug_on_hover = ui.ctx().debug_on_hover();
ui.checkbox(&mut debug_on_hover, "🐛 Debug on hover")
.on_hover_text("Show structure of the ui when you hover with the mouse");
ui.ctx().set_debug_on_hover(debug_on_hover);
#[cfg(debug_assertions)]
if ui.ctx().style().debug.debug_on_hover_with_all_modifiers {
ui.label("Press down all modifiers and hover a widget to see a callstack for it");
}
#[cfg(target_arch = "wasm32")]

View File

@@ -164,21 +164,21 @@ pub struct WrapApp {
}
impl WrapApp {
pub fn new(_cc: &eframe::CreationContext<'_>) -> Self {
egui_extras::install_image_loaders(&_cc.egui_ctx);
pub fn new(cc: &eframe::CreationContext<'_>) -> Self {
egui_extras::install_image_loaders(&cc.egui_ctx);
#[allow(unused_mut)]
let mut slf = Self {
state: State::default(),
#[cfg(any(feature = "glow", feature = "wgpu"))]
custom3d: crate::apps::Custom3d::new(_cc),
custom3d: crate::apps::Custom3d::new(cc),
dropped_files: Default::default(),
};
#[cfg(feature = "persistence")]
if let Some(storage) = _cc.storage {
if let Some(storage) = cc.storage {
if let Some(state) = eframe::get_value(storage, eframe::APP_KEY) {
slf.state = state;
}
@@ -263,7 +263,6 @@ impl eframe::App for WrapApp {
let mut cmd = Command::Nothing;
egui::TopBottomPanel::top("wrap_app_top_bar").show(ctx, |ui| {
egui::trace!(ui);
ui.horizontal_wrapped(|ui| {
ui.visuals_mut().button_frame = false;
self.bar_contents(ui, frame, &mut cmd);