mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:58: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
|
@ -109,8 +109,18 @@ public:
|
|||
|
||||
void set_window(GWindow*);
|
||||
|
||||
GWidget* parent_widget() { return static_cast<GWidget*>(parent()); }
|
||||
const GWidget* parent_widget() const { return static_cast<const GWidget*>(parent()); }
|
||||
GWidget* parent_widget()
|
||||
{
|
||||
if (parent() && parent()->is_widget())
|
||||
return static_cast<GWidget*>(parent());
|
||||
return nullptr;
|
||||
}
|
||||
const GWidget* parent_widget() const
|
||||
{
|
||||
if (parent() && parent()->is_widget())
|
||||
return static_cast<const GWidget*>(parent());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void set_fill_with_background_color(bool b) { m_fill_with_background_color = b; }
|
||||
bool fill_with_background_color() const { return m_fill_with_background_color; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue