]> git.tdb.fi Git - libs/gltk.git/commitdiff
Focus entry widget on touch press
authorMikko Rasa <tdb@tdb.fi>
Thu, 15 Sep 2016 14:54:15 +0000 (17:54 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 15 Sep 2016 14:54:15 +0000 (17:54 +0300)
source/entry.cpp
source/entry.h

index 6616054f799b2be0f5dd1cf445989a6771ff30bd..8d3c47f82331ab5e3eb643b3e8af0f2941268b72 100644 (file)
@@ -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;
index 82a9d79f259e62d6969ee82aba7671a33c316c78..a3b160735b61ad22b31704296db48ff9c71b5d70 100644 (file)
@@ -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();