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:
@@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user