app/events.rs
1use crate::{ThemeDefault, Window, Cursor};
2
3/// List of Events
4#[derive(Debug, PartialEq)]
5pub enum Event {
6 /// Mouse enters the window
7 MouseIn {
8 /// The cursor position
9 cursor: Cursor,
10 /// The specified window
11 window: Window,
12 },
13 /// Mouse leaves the window
14 MouseOut {
15 /// The cursor position
16 cursor: Cursor,
17 /// The specified window
18 window: Window
19 },
20 /// Element clicked with left button
21 LeftClick {
22 /// The cursor position
23 cursor: Cursor,
24 /// The specified window
25 window: Window
26 },
27 /// Element clicked with right button
28 RightClick {
29 /// The cursor position
30 cursor: Cursor,
31 /// The specified window
32 window: Window
33 },
34 /// Window resized (action by user)
35 WindowResized {
36 /// The specified window
37 window: Window,
38 /// The new window size
39 new_size: (f64, f64)
40 },
41 /// Window moved (action by user)
42 WindowMoved {
43 /// The specified window
44 window: Window,
45 /// The new window position
46 new_positon: (f64, f64)
47 },
48 /// User changed global theme
49 OsThemeChange {
50 /// The new theme
51 new_theme: ThemeDefault
52 },
53 /// Redraw frame
54 RedrawRequest {
55 /// The specified window
56 window: Window
57 },
58 /// The user focused the window
59 Focused {
60 /// The specified window
61 window: Window
62 },
63 /// User wants to leave
64 CloseRequest,
65 /// Temporary argument to handle with the impossibility of implementation (todo)
66 Generic,
67}