mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 05:10:03 -04:00
Some work making the native window to look like the egui one, and to work the same
This commit is contained in:
@@ -513,7 +513,7 @@ impl Default for NativeOptions {
|
||||
min_window_size: None,
|
||||
max_window_size: None,
|
||||
resizable: true,
|
||||
transparent: false,
|
||||
transparent: true,
|
||||
mouse_passthrough: false,
|
||||
|
||||
active: true,
|
||||
|
||||
@@ -424,7 +424,10 @@ mod glow_integration {
|
||||
prelude::{GlDisplay, NotCurrentGlContextSurfaceAccessor, PossiblyCurrentGlContext},
|
||||
surface::GlSurface,
|
||||
};
|
||||
use winit::dpi::{PhysicalPosition, PhysicalSize};
|
||||
use winit::{
|
||||
dpi::{PhysicalPosition, PhysicalSize},
|
||||
window::ResizeDirection,
|
||||
};
|
||||
|
||||
use super::*;
|
||||
|
||||
@@ -1252,6 +1255,45 @@ mod glow_integration {
|
||||
}
|
||||
}
|
||||
}
|
||||
egui::window::ViewportCommand::InnerSize(width, height) => {
|
||||
win.set_inner_size(PhysicalSize::new(width, height));
|
||||
}
|
||||
egui::window::ViewportCommand::Resize(
|
||||
top,
|
||||
bottom,
|
||||
right,
|
||||
left,
|
||||
) => {
|
||||
win.drag_resize_window(
|
||||
match (top, bottom, right, left) {
|
||||
(true, false, false, false) => {
|
||||
ResizeDirection::North
|
||||
}
|
||||
(false, true, false, false) => {
|
||||
ResizeDirection::South
|
||||
}
|
||||
(false, false, true, false) => {
|
||||
ResizeDirection::East
|
||||
}
|
||||
(false, false, false, true) => {
|
||||
ResizeDirection::West
|
||||
}
|
||||
(true, false, true, false) => {
|
||||
ResizeDirection::NorthEast
|
||||
}
|
||||
(false, true, true, false) => {
|
||||
ResizeDirection::SouthEast
|
||||
}
|
||||
(true, false, false, true) => {
|
||||
ResizeDirection::NorthWest
|
||||
}
|
||||
(false, true, false, true) => {
|
||||
ResizeDirection::SouthWest
|
||||
}
|
||||
_ => ResizeDirection::East,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user