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

LibGUI: Flesh out focus implementation and more GTextBox work.

This commit is contained in:
Andreas Kling 2019-01-26 11:24:16 +01:00
parent d72575d196
commit de2423de5f
10 changed files with 54 additions and 27 deletions

View file

@ -139,8 +139,13 @@ void GWindow::set_focused_widget(GWidget* widget)
{
if (m_focused_widget == widget)
return;
if (m_focused_widget)
if (m_focused_widget) {
GEventLoop::main().post_event(m_focused_widget, make<GEvent>(GEvent::FocusOut));
m_focused_widget->update();
}
m_focused_widget = widget;
m_focused_widget->update();
if (m_focused_widget) {
GEventLoop::main().post_event(m_focused_widget, make<GEvent>(GEvent::FocusIn));
m_focused_widget->update();
}
}