mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 12:50:04 -04:00
epi: drag native window (#728)
* feat: drag window * Update epi/src/lib.rs Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com> * Update egui_demo_lib/src/backend_panel.rs Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com> * cargo fmt Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
@@ -252,6 +252,14 @@ impl<'a> Frame<'a> {
|
||||
self.0.output.decorated = Some(decorated);
|
||||
}
|
||||
|
||||
/// When called, the native window will follow the
|
||||
/// movement of the cursor while the primary mouse button is down.
|
||||
///
|
||||
/// Does not work on the web, and works badly on Mac.
|
||||
pub fn drag_window(&mut self) {
|
||||
self.0.output.drag_window = true;
|
||||
}
|
||||
|
||||
/// If you need to request a repaint from another thread, clone this and send it to that other thread.
|
||||
pub fn repaint_signal(&self) -> std::sync::Arc<dyn RepaintSignal> {
|
||||
self.0.repaint_signal.clone()
|
||||
@@ -410,5 +418,8 @@ pub mod backend {
|
||||
|
||||
/// Set to some bool to change window decorations
|
||||
pub decorated: Option<bool>,
|
||||
|
||||
/// Set to true to drap window
|
||||
pub drag_window: bool,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user