1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:58:11 +00:00

Close the MsgBox when clicking the OK button.

This feels vaguely crashy. I haven't tested window/widget destruction
before so there's sure to be bugs.
This commit is contained in:
Andreas Kling 2018-10-14 01:23:01 +02:00
parent 3ebea05996
commit 959a1b0750
9 changed files with 65 additions and 9 deletions

View file

@ -11,6 +11,10 @@ Window::Window(Object* parent)
Window::~Window()
{
delete m_mainWidget;
m_mainWidget = nullptr;
if (parent())
parent()->removeChild(*this);
WindowManager::the().removeWindow(*this);
}
@ -96,6 +100,11 @@ bool Window::isActive() const
return WindowManager::the().activeWindow() == this;
}
bool Window::isVisible() const
{
return WindowManager::the().isVisible(const_cast<Window&>(*this));
}
void Window::setFocusedWidget(Widget* widget)
{
if (m_focusedWidget.ptr() == widget)
@ -113,5 +122,7 @@ void Window::setFocusedWidget(Widget* widget)
void Window::close()
{
WindowManager::the().removeWindow(*this);
deleteLater();
}