mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
LibGUI: Implement nested event loops to support dialog boxes.
This patch adds a simple GMessageBox that can run in a nested event loop. Here's how you use it: GMessageBox box("Message text here", "Message window title"); int result = box.exec(); The next step is to make the WindowServer respect the modality flag of these windows and prevent interaction with other windows in the same process until the modal window has been closed.
This commit is contained in:
parent
55aa819077
commit
57ff293a51
29 changed files with 275 additions and 79 deletions
|
@ -15,6 +15,9 @@ public:
|
|||
|
||||
static GWindow* from_window_id(int);
|
||||
|
||||
bool is_modal() const { return m_modal; }
|
||||
void set_modal(bool);
|
||||
|
||||
void set_double_buffering_enabled(bool);
|
||||
void set_has_alpha_channel(bool);
|
||||
void set_opacity(float);
|
||||
|
@ -22,7 +25,7 @@ public:
|
|||
int window_id() const { return m_window_id; }
|
||||
|
||||
String title() const;
|
||||
void set_title(String&&);
|
||||
void set_title(const String&);
|
||||
|
||||
int x() const { return rect().x(); }
|
||||
int y() const { return rect().y(); }
|
||||
|
@ -62,8 +65,8 @@ public:
|
|||
GWidget* global_cursor_tracking_widget() { return m_global_cursor_tracking_widget.ptr(); }
|
||||
const GWidget* global_cursor_tracking_widget() const { return m_global_cursor_tracking_widget.ptr(); }
|
||||
|
||||
bool should_exit_app_on_close() const { return m_should_exit_app_on_close; }
|
||||
void set_should_exit_app_on_close(bool b) { m_should_exit_app_on_close = b; }
|
||||
bool should_exit_event_loop_on_close() const { return m_should_exit_app_on_close; }
|
||||
void set_should_exit_event_loop_on_close(bool b) { m_should_exit_app_on_close = b; }
|
||||
|
||||
GWidget* hovered_widget() { return m_hovered_widget.ptr(); }
|
||||
const GWidget* hovered_widget() const { return m_hovered_widget.ptr(); }
|
||||
|
@ -101,5 +104,6 @@ private:
|
|||
bool m_should_exit_app_on_close { false };
|
||||
bool m_has_alpha_channel { false };
|
||||
bool m_double_buffering_enabled { true };
|
||||
bool m_modal { false };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue