add ppbr export dialog, implement text input focus

This commit is contained in:
2019-09-12 19:10:42 +02:00
parent c875323516
commit 61bcd86d2c
10 changed files with 97 additions and 16 deletions

View File

@@ -12,10 +12,16 @@ Node* NodeTextInput::clone_instantiate() const
void NodeTextInput::on_tick(float dt)
{
timer += dt;
bool focus = root()->current_key_capture.get() == this;
if (m_cursor && !focus)
m_cursor->m_display = false;
m_thinkness = focus;
if (timer > 1.0)
{
timer = 0;
if (m_cursor)
if (focus && m_cursor)
{
m_cursor->m_display = !m_cursor->m_display;
app_redraw();
@@ -67,6 +73,9 @@ kEventResult NodeTextInput::handle_event(Event* e)
break;
case kEventType::MouseUpL:
key_capture();
timer = 0;
if (m_cursor)
m_cursor->m_display = true;
break;
case kEventType::KeyDown:
//switch (ke->m_key)