1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 00:45:08 +00:00

LibGUI: Start bringing up GTextBox in the standalone world.

This commit is contained in:
Andreas Kling 2019-01-26 06:39:13 +01:00
parent 57fb027216
commit d72575d196
10 changed files with 165 additions and 121 deletions

View file

@ -96,6 +96,12 @@ void GWindow::event(GEvent& event)
ASSERT(rc == 0);
}
if (event.is_key_event()) {
if (!m_focused_widget)
return;
return m_focused_widget->event(event);
}
return GObject::event(event);
}
@ -128,3 +134,13 @@ void GWindow::set_main_widget(GWidget* widget)
widget->set_window(this);
update();
}
void GWindow::set_focused_widget(GWidget* widget)
{
if (m_focused_widget == widget)
return;
if (m_focused_widget)
m_focused_widget->update();
m_focused_widget = widget;
m_focused_widget->update();
}