1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 22:00:03 -04:00

Move viewports stuff to crates/egui/src/viewports.rs

This commit is contained in:
Konkitoman
2023-08-07 19:02:18 +03:00
parent ee2f2a7986
commit d45fc14a13
12 changed files with 513 additions and 509 deletions

View File

@@ -16,7 +16,7 @@ pub use accesskit_winit;
pub use egui;
#[cfg(feature = "accesskit")]
use egui::accesskit;
use egui::{mutex::RwLock, window::ViewportCommand};
use egui::{mutex::RwLock, ViewportCommand};
pub use winit;
pub mod clipboard;
@@ -916,7 +916,7 @@ pub fn process_viewport_commands(
let win = window.read();
match command {
egui::window::ViewportCommand::Drag => {
egui::ViewportCommand::Drag => {
// if this is not checked on x11 the input will be permanently taken until the app is killed!
if let Some(focus) = focused {
if focus == viewport_id {
@@ -924,10 +924,10 @@ pub fn process_viewport_commands(
}
}
}
egui::window::ViewportCommand::InnerSize(width, height) => {
egui::ViewportCommand::InnerSize(width, height) => {
win.set_inner_size(PhysicalSize::new(width, height));
}
egui::window::ViewportCommand::Resize(top, bottom, right, left) => {
egui::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,

View File

@@ -1,4 +1,4 @@
use egui::window::ViewportBuilder;
use egui::ViewportBuilder;
/// Can be used to store native window settings (position and size).
#[derive(Clone, Copy, Debug)]