mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 05:10:03 -04:00
Now we can drag any viewport but only the viewport that is focused will be draged because if not on x11 the input will be taken until the application is killed
This commit is contained in:
@@ -53,15 +53,18 @@ fn main() -> Result<(), eframe::Error> {
|
||||
"Current rendering window: {}",
|
||||
ctx.current_rendering_viewport()
|
||||
));
|
||||
if ui.button("Drag").is_pointer_button_down_on() {
|
||||
ctx.viewport_command(id, egui::window::ViewportCommand::Drag)
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
let clone = window2_embedded.clone();
|
||||
let embedded = *window2_embedded.read().unwrap();
|
||||
egui::CollapsingHeader::new("Shout Test2").show(ui, |ui| {
|
||||
egui::Window::new("Test2")
|
||||
.embedded(embedded)
|
||||
.show(ctx, move |ui, _, parent_id| {
|
||||
egui::Window::new("Test2").embedded(embedded).show(
|
||||
ctx,
|
||||
move |ui, id, parent_id| {
|
||||
if ui
|
||||
.checkbox(&mut *clone.write().unwrap(), "Should embedd?")
|
||||
.clicked()
|
||||
@@ -73,7 +76,12 @@ fn main() -> Result<(), eframe::Error> {
|
||||
"Current rendering window: {}",
|
||||
ctx.current_rendering_viewport()
|
||||
));
|
||||
});
|
||||
|
||||
if ui.button("Drag").is_pointer_button_down_on() {
|
||||
ctx.viewport_command(id, egui::window::ViewportCommand::Drag)
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user