1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 06:40:06 -04:00

[demo] Refactor and minor cleanup

This commit is contained in:
Emil Ernerfeldt
2021-02-07 14:46:53 +01:00
parent e82fb81f07
commit 6377a4231f
11 changed files with 147 additions and 116 deletions

View File

@@ -873,6 +873,11 @@ impl Context {
ui.shrink_width_to_current(); // don't let the text below grow this window wider
ui.label("NOTE: the position of this window cannot be reset from within itself.");
ui.collapsing("Interaction", |ui| {
let interaction = self.memory().interaction.clone();
interaction.ui(ui);
});
}
}

View File

@@ -142,3 +142,16 @@ impl Widget for &mut epaint::TessellationOptions {
.response
}
}
impl Widget for &memory::Interaction {
fn ui(self, ui: &mut Ui) -> Response {
ui.vertical(|ui| {
ui.label(format!("click_id: {:?}", self.click_id));
ui.label(format!("drag_id: {:?}", self.drag_id));
ui.label(format!("drag_is_window: {:?}", self.drag_is_window));
ui.label(format!("click_interest: {:?}", self.click_interest));
ui.label(format!("drag_interest: {:?}", self.drag_interest));
})
.response
}
}