mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 20:25:07 +00:00

- If the GInputBox has a parent and the parent is a GWindow, center the input box window within the parent window. This looks quite nice. - Stop processing events in a nested event loop immediately after it's been asked to quit. - Fix GWidget::parent_widget() behavior for non-widget parents.
23 lines
442 B
C++
23 lines
442 B
C++
#pragma once
|
|
|
|
#include <LibGUI/GWindow.h>
|
|
#include <LibGUI/GEventLoop.h>
|
|
|
|
class GDialog : public GWindow {
|
|
public:
|
|
enum ExecResult { ExecOK = 0, ExecCancel = 1, ExecAborted = 2 };
|
|
|
|
virtual ~GDialog() override;
|
|
|
|
int exec();
|
|
|
|
int result() const { return m_result; }
|
|
void done(int result);
|
|
|
|
protected:
|
|
explicit GDialog(GObject* parent);
|
|
|
|
private:
|
|
OwnPtr<GEventLoop> m_event_loop;
|
|
int m_result { ExecAborted };
|
|
};
|