From 46def086def19c58fb9e577312c07f2f7e758b34 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 15 Sep 2016 17:54:15 +0300 Subject: [PATCH] Focus entry widget on touch press --- source/entry.cpp | 7 +++++++ source/entry.h | 1 + 2 files changed, 8 insertions(+) diff --git a/source/entry.cpp b/source/entry.cpp index 6616054..8d3c47f 100644 --- a/source/entry.cpp +++ b/source/entry.cpp @@ -126,6 +126,13 @@ void Entry::render_special(const Part &part, GL::Renderer &renderer) const slider->render(renderer); } +void Entry::touch_press(int x, int y, unsigned finger) +{ + if(finger==0) + set_focus(); + Widget::touch_press(x, y, finger); +} + bool Entry::key_press(unsigned key, unsigned) { got_key_press = true; diff --git a/source/entry.h b/source/entry.h index 82a9d79..a3b1607 100644 --- a/source/entry.h +++ b/source/entry.h @@ -70,6 +70,7 @@ private: virtual void render_special(const Part &, GL::Renderer &) const; public: + virtual void touch_press(int, int, unsigned); virtual bool key_press(unsigned, unsigned); virtual bool character(wchar_t); virtual void focus_out(); -- 2.43.0