LibGUI: GTextBox should only run a caret blink timer when focused.

This commit is contained in:
Andreas Kling 2019-02-04 10:34:56 +01:00
parent c0cffe1134
commit bc6ff35428
Notes: sideshowbarker 2024-07-19 15:52:32 +09:00
3 changed files with 14 additions and 2 deletions

View file

@ -8,7 +8,6 @@
GTextBox::GTextBox(GWidget* parent)
: GWidget(parent)
{
start_timer(500);
}
GTextBox::~GTextBox()
@ -138,3 +137,13 @@ void GTextBox::timer_event(GTimerEvent&)
m_cursor_blink_state = !m_cursor_blink_state;
update();
}
void GTextBox::focusin_event(GEvent&)
{
start_timer(500);
}
void GTextBox::focusout_event(GEvent&)
{
stop_timer();
}