mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
LibGUI: More work on GInputBox.
- 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.
This commit is contained in:
parent
a6538feed1
commit
f88e550998
9 changed files with 74 additions and 34 deletions
|
@ -2,10 +2,11 @@
|
|||
|
||||
#include <LibGUI/GDialog.h>
|
||||
|
||||
class GButton;
|
||||
class GTextEditor;
|
||||
|
||||
class GInputBox : public GDialog {
|
||||
public:
|
||||
enum ExecResult { ExecOK = 0, ExecCancel = 1 };
|
||||
|
||||
explicit GInputBox(const String& prompt, const String& title, GObject* parent = nullptr);
|
||||
virtual ~GInputBox() override;
|
||||
|
||||
|
@ -15,4 +16,8 @@ private:
|
|||
void build();
|
||||
String m_prompt;
|
||||
String m_text_value;
|
||||
|
||||
GButton* m_ok_button { nullptr };
|
||||
GButton* m_cancel_button { nullptr };
|
||||
GTextEditor* m_text_editor { nullptr };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue