File tree 12 files changed +14
-49
lines changed
12 files changed +14
-49
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,9 @@ All notable changes to the `egui-winit` integration will be noted in this file.
4
4
5
5
6
6
## Unreleased
7
- ### Added ⭐
8
7
* Add helper ` EpiIntegration ` ([ #871 ] ( https://github.com/emilk/egui/pull/871 ) ).
9
-
10
- ### Fixed 🐛
11
8
* Fix shift key getting stuck enabled with the X11 option ` shift:both_capslock ` enabled ([ #849 ] ( https://github.com/emilk/egui/pull/849 ) ).
12
-
9
+ * Remove ` State::is_quit_event ` and ` State::is_quit_shortcut ` ( [ # 881 ] ( https://github.com/emilk/egui/pull/881 ) ).
13
10
14
11
## 0.15.0 - 2021-10-24
15
12
First stand-alone release. Previously part of ` egui_glium ` .
Original file line number Diff line number Diff line change @@ -268,7 +268,8 @@ impl EpiIntegration {
268
268
}
269
269
270
270
pub fn on_event ( & mut self , event : & winit:: event:: WindowEvent < ' _ > ) {
271
- self . quit |= self . egui_winit . is_quit_event ( event) ;
271
+ use winit:: event:: WindowEvent ;
272
+ self . quit |= matches ! ( event, WindowEvent :: CloseRequested | WindowEvent :: Destroyed ) ;
272
273
self . egui_winit . on_event ( & self . egui_ctx , event) ;
273
274
}
274
275
Original file line number Diff line number Diff line change @@ -533,29 +533,6 @@ impl State {
533
533
}
534
534
}
535
535
536
- /// Returns `true` if Alt-F4 (windows/linux) or Cmd-Q (Mac)
537
- pub fn is_quit_shortcut ( & self , input : & winit:: event:: KeyboardInput ) -> bool {
538
- if cfg ! ( target_os = "macos" ) {
539
- input. state == winit:: event:: ElementState :: Pressed
540
- && self . egui_input . modifiers . mac_cmd
541
- && input. virtual_keycode == Some ( winit:: event:: VirtualKeyCode :: Q )
542
- } else {
543
- input. state == winit:: event:: ElementState :: Pressed
544
- && self . egui_input . modifiers . alt
545
- && input. virtual_keycode == Some ( winit:: event:: VirtualKeyCode :: F4 )
546
- }
547
- }
548
-
549
- /// Returns `true` if this a close event or a Cmd-Q/Alt-F4 keyboard command.
550
- pub fn is_quit_event ( & self , event : & winit:: event:: WindowEvent < ' _ > ) -> bool {
551
- use winit:: event:: WindowEvent ;
552
- match event {
553
- WindowEvent :: CloseRequested | WindowEvent :: Destroyed => true ,
554
- WindowEvent :: KeyboardInput { input, .. } => self . is_quit_shortcut ( input) ,
555
- _ => false ,
556
- }
557
- }
558
-
559
536
fn set_cursor_icon ( & mut self , window : & winit:: window:: Window , cursor_icon : egui:: CursorIcon ) {
560
537
// prevent flickering near frame boundary when Windows OS tries to control cursor icon for window resizing
561
538
if self . current_cursor_icon == cursor_icon {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ All notable changes to the `egui_glium` integration will be noted in this file.
4
4
5
5
## Unreleased
6
6
* Simplify ` EguiGlium ` interface ([ #871 ] ( https://github.com/emilk/egui/pull/871 ) ).
7
+ * Remove ` EguiGlium::is_quit_event ` ([ #881 ] ( https://github.com/emilk/egui/pull/881 ) ).
7
8
8
9
9
10
## 0.15.0 - 2021-10-24
Original file line number Diff line number Diff line change @@ -102,8 +102,9 @@ fn main() {
102
102
glutin:: event:: Event :: RedrawRequested ( _) if !cfg ! ( windows) => redraw ( ) ,
103
103
104
104
glutin:: event:: Event :: WindowEvent { event, .. } => {
105
- if egui_glium. is_quit_event ( & event) {
106
- * control_flow = glium:: glutin:: event_loop:: ControlFlow :: Exit ;
105
+ use glutin:: event:: WindowEvent ;
106
+ if matches ! ( event, WindowEvent :: CloseRequested | WindowEvent :: Destroyed ) {
107
+ * control_flow = glutin:: event_loop:: ControlFlow :: Exit ;
107
108
}
108
109
109
110
egui_glium. on_event ( & event) ;
Original file line number Diff line number Diff line change @@ -72,8 +72,9 @@ fn main() {
72
72
glutin:: event:: Event :: RedrawRequested ( _) if !cfg ! ( windows) => redraw ( ) ,
73
73
74
74
glutin:: event:: Event :: WindowEvent { event, .. } => {
75
- if egui_glium. is_quit_event ( & event) {
76
- * control_flow = glium:: glutin:: event_loop:: ControlFlow :: Exit ;
75
+ use glutin:: event:: WindowEvent ;
76
+ if matches ! ( event, WindowEvent :: CloseRequested | WindowEvent :: Destroyed ) {
77
+ * control_flow = glutin:: event_loop:: ControlFlow :: Exit ;
77
78
}
78
79
79
80
egui_glium. on_event ( & event) ;
Original file line number Diff line number Diff line change 1
1
use crate :: * ;
2
2
use egui:: Color32 ;
3
- #[ cfg( target_os = "windows" ) ]
4
- use glium:: glutin:: platform:: windows:: WindowBuilderExtWindows ;
3
+ use glium:: glutin;
5
4
6
5
impl epi:: TextureAllocator for Painter {
7
6
fn alloc_srgba_premultiplied (
Original file line number Diff line number Diff line change @@ -97,8 +97,6 @@ pub use epi_backend::{run, NativeOptions};
97
97
98
98
pub use egui_winit;
99
99
100
- use glium:: glutin;
101
-
102
100
// ----------------------------------------------------------------------------
103
101
104
102
/// Convenience wrapper for using [`egui`] from a [`glium`] app.
@@ -127,11 +125,6 @@ impl EguiGlium {
127
125
self . egui_winit . on_event ( & self . egui_ctx , event)
128
126
}
129
127
130
- /// Is this a close event or a Cmd-Q/Alt-F4 keyboard command?
131
- pub fn is_quit_event ( & self , event : & glutin:: event:: WindowEvent < ' _ > ) -> bool {
132
- self . egui_winit . is_quit_event ( event)
133
- }
134
-
135
128
/// Returns `needs_repaint` and shapes to draw.
136
129
pub fn run (
137
130
& mut self ,
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ All notable changes to the `egui_glow` integration will be noted in this file.
5
5
## Unreleased
6
6
* Make winit/glutin an optional dependency ([ #868 ] ( https://github.com/emilk/egui/pull/868 ) ).
7
7
* Simplify ` EguiGlow ` interface ([ #871 ] ( https://github.com/emilk/egui/pull/871 ) ).
8
+ * Remove ` EguiGlow::is_quit_event ` ([ #881 ] ( https://github.com/emilk/egui/pull/881 ) ).
8
9
9
10
10
11
## 0.15.0 - 2021-10-24
Original file line number Diff line number Diff line change @@ -90,7 +90,8 @@ fn main() {
90
90
glutin:: event:: Event :: RedrawRequested ( _) if !cfg ! ( windows) => redraw ( ) ,
91
91
92
92
glutin:: event:: Event :: WindowEvent { event, .. } => {
93
- if egui_glow. is_quit_event ( & event) {
93
+ use glutin:: event:: WindowEvent ;
94
+ if matches ! ( event, WindowEvent :: CloseRequested | WindowEvent :: Destroyed ) {
94
95
* control_flow = glutin:: event_loop:: ControlFlow :: Exit ;
95
96
}
96
97
Original file line number Diff line number Diff line change 1
1
use crate :: * ;
2
- #[ cfg( target_os = "windows" ) ]
3
- use glutin:: platform:: windows:: WindowBuilderExtWindows ;
4
2
5
3
struct RequestRepaintEvent ;
6
4
Original file line number Diff line number Diff line change @@ -141,11 +141,6 @@ impl EguiGlow {
141
141
self . egui_winit . on_event ( & self . egui_ctx , event)
142
142
}
143
143
144
- /// Is this a close event or a Cmd-Q/Alt-F4 keyboard command?
145
- pub fn is_quit_event ( & self , event : & glutin:: event:: WindowEvent < ' _ > ) -> bool {
146
- self . egui_winit . is_quit_event ( event)
147
- }
148
-
149
144
/// Returns `needs_repaint` and shapes to draw.
150
145
pub fn run (
151
146
& mut self ,
You can’t perform that action at this time.
0 commit comments