mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:57:36 +00:00
LibGUI: Clear previous main widget's window
This commit is contained in:
parent
d87f876946
commit
9844088964
1 changed files with 3 additions and 1 deletions
|
@ -460,8 +460,10 @@ void Window::set_main_widget(Widget* widget)
|
||||||
{
|
{
|
||||||
if (m_main_widget == widget)
|
if (m_main_widget == widget)
|
||||||
return;
|
return;
|
||||||
if (m_main_widget)
|
if (m_main_widget) {
|
||||||
|
m_main_widget->set_window(nullptr);
|
||||||
remove_child(*m_main_widget);
|
remove_child(*m_main_widget);
|
||||||
|
}
|
||||||
m_main_widget = widget;
|
m_main_widget = widget;
|
||||||
if (m_main_widget) {
|
if (m_main_widget) {
|
||||||
add_child(*widget);
|
add_child(*widget);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue