From 7cc893db36c91c815d04478d17088510b6ab33ce Mon Sep 17 00:00:00 2001 From: Meet Udeshi Date: Mon, 22 Feb 2016 23:04:59 +0530 Subject: [PATCH 01/17] Always show the textinput cursor at the moment of touch Fixes #4017 --- kivy/uix/textinput.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kivy/uix/textinput.py b/kivy/uix/textinput.py index 21c2759ab2..c6b53cdb0f 100644 --- a/kivy/uix/textinput.py +++ b/kivy/uix/textinput.py @@ -1293,6 +1293,12 @@ def on_touch_down(self, touch): if super(TextInput, self).on_touch_down(touch): return True + if self.focused: + Clock.unschedule(self._do_blink_cursor) + self.cursor_blink=0 + self._cursor_blink_time=Clock.get_time() + Clock.schedule_interval(self._do_blink_cursor, .5) + # Check for scroll wheel if 'button' in touch.profile and touch.button.startswith('scroll'): scroll_type = touch.button[6:] From 6121c879d9170100bf0aae848f9c70fe2db3c1cf Mon Sep 17 00:00:00 2001 From: Meet Udeshi Date: Tue, 23 Feb 2016 00:05:25 +0530 Subject: [PATCH 02/17] Remove _cursor_blink_time reset --- kivy/uix/textinput.py | 1 - 1 file changed, 1 deletion(-) diff --git a/kivy/uix/textinput.py b/kivy/uix/textinput.py index c6b53cdb0f..c65832dfe0 100644 --- a/kivy/uix/textinput.py +++ b/kivy/uix/textinput.py @@ -1296,7 +1296,6 @@ def on_touch_down(self, touch): if self.focused: Clock.unschedule(self._do_blink_cursor) self.cursor_blink=0 - self._cursor_blink_time=Clock.get_time() Clock.schedule_interval(self._do_blink_cursor, .5) # Check for scroll wheel From a090051e140b67ac737bded5076d3a6238186343 Mon Sep 17 00:00:00 2001 From: Meet Udeshi Date: Tue, 23 Feb 2016 00:27:05 +0530 Subject: [PATCH 03/17] Change _do_blink_cursor to flip cursor_blink on every call instead of calculating it from Clock.get_time() --- kivy/uix/textinput.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kivy/uix/textinput.py b/kivy/uix/textinput.py index c65832dfe0..f4f364a2ee 100644 --- a/kivy/uix/textinput.py +++ b/kivy/uix/textinput.py @@ -447,7 +447,6 @@ class TextInput(FocusBehavior, Widget): def __init__(self, **kwargs): self.is_focusable = kwargs.get('is_focusable', True) - self._cursor_blink_time = Clock.get_time() self._cursor = [0, 0] self._selection = False self._selection_finished = True @@ -1721,13 +1720,11 @@ def _get_text_width(self, text, tab_width, _label_cached): def _do_blink_cursor(self, dt): # Callback called by the timer to blink the cursor, according to the # last activity in the widget - b = (Clock.get_time() - self._cursor_blink_time) - self.cursor_blink = int(b * 2) % 2 + self.cursor_blink = not self.cursor_blink def on_cursor(self, instance, value): # When the cursor is moved, reset the activity timer, and update all # the graphics. - self._cursor_blink_time = Clock.get_time() self._trigger_update_graphics() def _delete_line(self, idx): From 244a8f5d9904b05518436d1279fb0c5418445090 Mon Sep 17 00:00:00 2001 From: Jonas Zimmermann Date: Wed, 24 Feb 2016 13:27:12 -0500 Subject: [PATCH 04/17] check upper bound of value; under certain circumstances due to floating point inaccuracies, value may be exceeded --- kivy/uix/slider.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kivy/uix/slider.py b/kivy/uix/slider.py index c29b80c7a2..048848280a 100644 --- a/kivy/uix/slider.py +++ b/kivy/uix/slider.py @@ -117,13 +117,14 @@ def get_norm_value(self): def set_norm_value(self, value): vmin = self.min + vmax = self.max step = self.step - val = value * (self.max - vmin) + vmin + val = min(value * (vmax - vmin) + vmin, vmax) if step == 0: self.value = val else: self.value = min(round((val - vmin) / step) * step + vmin, - self.max) + vmax) value_normalized = AliasProperty(get_norm_value, set_norm_value, bind=('value', 'min', 'max', 'step')) '''Normalized value inside the :attr:`range` (min/max) to 0-1 range:: From 1fcec99af502dbf1d377b5afdf4bcf8502125e34 Mon Sep 17 00:00:00 2001 From: dessant Date: Wed, 24 Feb 2016 23:10:51 +0200 Subject: [PATCH 05/17] ignore the exit code of the first pdf build --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 633c5533aa..25422b607b 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ ios: cp -R "iosbuild/usr/local/lib/python2.7/site-packages/kivy" "$(BUILDROOT)/python/lib/python2.7/site-packages" pdf: build - cd doc && $(MAKE) pdf + cd doc && $(MAKE) pdf || True cd doc && $(MAKE) pdf html: build From 1a7208f01c691962ef72be801f5d48d5acb47fd6 Mon Sep 17 00:00:00 2001 From: dessant Date: Wed, 24 Feb 2016 23:53:48 +0200 Subject: [PATCH 06/17] ignore errors from the first call of make pdf --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 25422b607b..5ed986bb4e 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ ios: cp -R "iosbuild/usr/local/lib/python2.7/site-packages/kivy" "$(BUILDROOT)/python/lib/python2.7/site-packages" pdf: build - cd doc && $(MAKE) pdf || True + -cd doc && $(MAKE) pdf cd doc && $(MAKE) pdf html: build From 218c704121714b4ac897cc609b08d2b5a5962f8c Mon Sep 17 00:00:00 2001 From: dessant Date: Thu, 25 Feb 2016 01:16:06 +0200 Subject: [PATCH 07/17] call make pdf only once from travis 'make pdf' is now executed twice in makefile https://github.com/kivy/kivy/commit/a06e325cf22922ae11c1f138aebae878edc24069 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8367378cf5..40425bc9f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -116,7 +116,6 @@ script: fi; if [ "${RUN}" == "docs" ]; then make html; - make pdf || true; make pdf; fi; fi; From edcd46f396560e2fde6d30705d546209188fe5e9 Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Thu, 25 Feb 2016 16:58:59 -0500 Subject: [PATCH 08/17] Don't limit size to cols/rows_minimum, but treat it as real min. --- kivy/uix/gridlayout.py | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/kivy/uix/gridlayout.py b/kivy/uix/gridlayout.py index f92e773cc8..5e2b54d645 100644 --- a/kivy/uix/gridlayout.py +++ b/kivy/uix/gridlayout.py @@ -198,7 +198,8 @@ class GridLayout(Layout): ''' cols_minimum = DictProperty({}) - '''List of minimum sizes for each column. + '''Dict of minimum width for each column. The dictionary keys are the + column numbers, e.g. 0, 1, 2... .. versionadded:: 1.0.7 @@ -207,7 +208,8 @@ class GridLayout(Layout): ''' rows_minimum = DictProperty({}) - '''List of minimum sizes for each row. + '''Dict of minimum height for each row. The dictionary keys are the + row numbers, e.g. 0, 1, 2... .. versionadded:: 1.0.7 @@ -216,31 +218,32 @@ class GridLayout(Layout): ''' minimum_width = NumericProperty(0) - '''Minimum width needed to contain all children. + '''Automatically computed minimum width needed to contain all children. .. versionadded:: 1.0.8 :attr:`minimum_width` is a :class:`~kivy.properties.NumericProperty` and - defaults to 0. + defaults to 0. It is read only. ''' minimum_height = NumericProperty(0) - '''Minimum height needed to contain all children. + '''Automatically computed minimum height needed to contain all children. .. versionadded:: 1.0.8 :attr:`minimum_height` is a :class:`~kivy.properties.NumericProperty` and - defaults to 0. + defaults to 0. It is read only. ''' minimum_size = ReferenceListProperty(minimum_width, minimum_height) - '''Minimum size needed to contain all children. + '''Automatically computed minimum size needed to contain all children. .. versionadded:: 1.0.8 :attr:`minimum_size` is a :class:`~kivy.properties.ReferenceListProperty` of - (:attr:`minimum_width`, :attr:`minimum_height`) properties. + (:attr:`minimum_width`, :attr:`minimum_height`) properties. It is read + only. ''' def __init__(self, **kwargs): @@ -391,14 +394,10 @@ def do_layout(self, *largs): for index in range(len(cols)): # if the col don't have strech information, nothing to do col_stretch = cols_sh[index] - if col_stretch is None: + if not col_stretch: continue - # calculate the column stretch, and take the maximum from - # minimum size and the calculated stretch - col_width = cols[index] - col_width = max(col_width, - strech_w * col_stretch / cols_weigth) - cols[index] = col_width + # add to the min width whatever remains from size_hint + cols[index] += strech_w * col_stretch / cols_weigth # same algo for rows if self.row_force_default: @@ -413,14 +412,10 @@ def do_layout(self, *largs): for index in range(len(rows)): # if the row don't have strech information, nothing to do row_stretch = rows_sh[index] - if row_stretch is None: + if not row_stretch: continue - # calculate the row stretch, and take the maximum from minimum - # size and the calculated stretch - row_height = rows[index] - row_height = max(row_height, - strech_h * row_stretch / rows_weigth) - rows[index] = row_height + # add to the min height whatever remains from size_hint + rows[index] += strech_h * row_stretch / rows_weigth # reposition every child i = len_children - 1 From 7567f14f9309fb75eadc977f0323286117e4e65f Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Thu, 25 Feb 2016 20:05:21 -0500 Subject: [PATCH 09/17] Respect size_hint in gridlayout. --- kivy/uix/gridlayout.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kivy/uix/gridlayout.py b/kivy/uix/gridlayout.py index 5e2b54d645..c1c305fa27 100644 --- a/kivy/uix/gridlayout.py +++ b/kivy/uix/gridlayout.py @@ -428,8 +428,11 @@ def do_layout(self, *largs): c = children[i] c.x = x c.y = y - row_height - c.width = col_width - c.height = row_height + shx, shy = c.size_hint + if shx is not None: + c.width = col_width + if shy is not None: + c.height = row_height i = i - 1 x = x + col_width + spacing_x y -= row_height + spacing_y From b39058910f9acf29a91e503b51f62fe6e2e0c6a9 Mon Sep 17 00:00:00 2001 From: Ryan Pessa Date: Sun, 7 Dec 2014 12:43:57 -0600 Subject: [PATCH 10/17] don't require a text argument for CompositeListItems --- kivy/uix/listview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kivy/uix/listview.py b/kivy/uix/listview.py index efba458b0a..1636c75c51 100644 --- a/kivy/uix/listview.py +++ b/kivy/uix/listview.py @@ -703,7 +703,7 @@ def __init__(self, **kwargs): if cls_kwargs: cls_kwargs['index'] = index - if 'text' not in cls_kwargs: + if 'text' not in cls_kwargs and text: cls_kwargs['text'] = text if 'is_representing_cls' in cls_kwargs: From 8f12370f284e5725830654cd90eb76c49a3d5b51 Mon Sep 17 00:00:00 2001 From: Meet Udeshi Date: Sat, 27 Feb 2016 17:32:41 +0530 Subject: [PATCH 11/17] Make _reset_cursor_blink method and call it on focus, mouse_click, cursor_move --- kivy/uix/textinput.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/kivy/uix/textinput.py b/kivy/uix/textinput.py index f4f364a2ee..d35fd16004 100644 --- a/kivy/uix/textinput.py +++ b/kivy/uix/textinput.py @@ -1293,9 +1293,7 @@ def on_touch_down(self, touch): return True if self.focused: - Clock.unschedule(self._do_blink_cursor) - self.cursor_blink=0 - Clock.schedule_interval(self._do_blink_cursor, .5) + self._reset_cursor_blink() # Check for scroll wheel if 'button' in touch.profile and touch.button.startswith('scroll'): @@ -1638,7 +1636,7 @@ def _on_textinput_focused(self, instance, value, *largs): if value: if (not (self.readonly or self.disabled) or _is_desktop and self._keyboard_mode == 'system'): - Clock.schedule_interval(self._do_blink_cursor, 1 / 2.) + self._reset_cursor_blink() self._editable = True else: self._editable = False @@ -1722,9 +1720,15 @@ def _do_blink_cursor(self, dt): # last activity in the widget self.cursor_blink = not self.cursor_blink + def _reset_cursor_blink(self): + Clock.unschedule(self._do_blink_cursor) + self.cursor_blink=0 + Clock.schedule_interval(self._do_blink_cursor, .5) + def on_cursor(self, instance, value): - # When the cursor is moved, reset the activity timer, and update all - # the graphics. + # When the cursor is moved, reset cursor blinking to keep it showing, + # and update all the graphics. + self._reset_cursor_blink() self._trigger_update_graphics() def _delete_line(self, idx): From 10254296632df3bb69fa590fa7e65d11131ca020 Mon Sep 17 00:00:00 2001 From: dessant Date: Sat, 27 Feb 2016 15:55:54 +0200 Subject: [PATCH 12/17] a bit of travis refactoring --- .travis.yml | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 40425bc9f8..8b99e00209 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,7 @@ matrix: dist: trusty - language: python python: 3.5 - env: - - RUN=unit COVERALLS=true + env: RUN=unit COVERALLS=true os: linux dist: trusty - language: python @@ -23,10 +22,10 @@ matrix: os: linux dist: trusty - language: generic - env: RUN=build PY=2 + env: RUN=unit PY=2 os: osx - language: generic - env: RUN=build PY=3 + env: RUN=unit PY=3 os: osx install: @@ -95,10 +94,10 @@ before_script: export PYTHONPATH=$PYTHONPATH:$(pwd); fi; - if [ "${TRAVIS_OS_NAME}" == "osx" ]; then - export USE_SDL2=1; export CC=clang; export CXX=clang; export FFLAGS=-ff2c; + export USE_OPENGL_MOCK=1; fi; script: @@ -120,7 +119,6 @@ script: fi; fi; - if [ "${TRAVIS_OS_NAME}" == "osx" ]; then - export USE_OPENGL_MOCK=1; if [ "${PY}" == "3" ]; then python3 setup.py build_ext --inplace; python3 -m nose.core kivy/tests; @@ -132,24 +130,24 @@ script: after_success: - - if [ "${TRAVIS_OS_NAME}" == "os" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then - openssl aes-256-cbc -K $encrypted_675f1a0c317c_key -iv $encrypted_675f1a0c317c_iv -in ./kivy/tools/travis/id_rsa.enc -out ~/.ssh/id_rsa -d; - chmod 600 ~/.ssh/id_rsa; - echo -e "Host kivy.org\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config; - git clone https://github.com/kivy/kivy-sdk-packager; - cd kivy-sdk-packager/osx; - if [ "${PY}" == "3" ]; then - yes | ./create-osx-bundle.sh python3 master > output.txt; - mv Kivy.app Kivy3.app; - /Volumes/Keka/Keka.app/Contents/Resources/keka7z a Kivy3.7z Kivy3.app; - rsync --delete --force -r -e ssh ./Kivy3.7z kivy@kivy.org:~/kivy.org/downloads/tests/Kivy3.7z; - else - ./create-osx-bundle.sh python2 master > output.txt; - mv Kivy.app Kivy2.app; - /Volumes/Keka/Keka.app/Contents/Resources/keka7z a Kivy2.7z Kivy2.app; - rsync --delete --force -r -e ssh ./Kivy2.7z kivy@kivy.org:~/kivy.org/downloads/tests/Kivy2.7z; - fi; - fi; + # - if [ "${TRAVIS_OS_NAME}" == "osx" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then + # openssl aes-256-cbc -K $encrypted_675f1a0c317c_key -iv $encrypted_675f1a0c317c_iv -in ./kivy/tools/travis/id_rsa.enc -out ~/.ssh/id_rsa -d; + # chmod 600 ~/.ssh/id_rsa; + # echo -e "Host kivy.org\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config; + # git clone https://github.com/kivy/kivy-sdk-packager; + # cd kivy-sdk-packager/osx; + # if [ "${PY}" == "3" ]; then + # yes | ./create-osx-bundle.sh python3 master > output.txt; + # mv Kivy.app Kivy3.app; + # /Volumes/Keka/Keka.app/Contents/Resources/keka7z a Kivy3.7z Kivy3.app; + # rsync --delete --force -r -e ssh ./Kivy3.7z kivy@kivy.org:~/kivy.org/downloads/tests/Kivy3.7z; + # else + # ./create-osx-bundle.sh python2 master > output.txt; + # mv Kivy.app Kivy2.app; + # /Volumes/Keka/Keka.app/Contents/Resources/keka7z a Kivy2.7z Kivy2.app; + # rsync --delete --force -r -e ssh ./Kivy2.7z kivy@kivy.org:~/kivy.org/downloads/tests/Kivy2.7z; + # fi; + # fi; - if [ "${TRAVIS_OS_NAME}" == "linux" ] && [ "${RUN}" == "docs" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ] && [ "${TRAVIS_BRANCH}" == "master" ]; then openssl aes-256-cbc -K $encrypted_675f1a0c317c_key -iv $encrypted_675f1a0c317c_iv -in ./kivy/tools/travis/id_rsa.enc -out ~/.ssh/id_rsa -d; chmod 600 ~/.ssh/id_rsa; From b407f30baa9a86f3cf0b427c4e81cc4707fd0be4 Mon Sep 17 00:00:00 2001 From: dessant Date: Sun, 28 Feb 2016 14:43:45 +0200 Subject: [PATCH 13/17] doc: textinput suggestion_text is shown at the end of the current line --- kivy/uix/textinput.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kivy/uix/textinput.py b/kivy/uix/textinput.py index 21c2759ab2..51326e5e8e 100644 --- a/kivy/uix/textinput.py +++ b/kivy/uix/textinput.py @@ -2762,15 +2762,15 @@ def on_padding_y(self, instance, value): ''' suggestion_text = StringProperty('') - '''Shows a suggestion text/word from currentcursor position onwards, - that can be used as a possible completion. Usefull for suggesting completion - text. This can also be used by the IME to setup the current word being - edited + '''Shows a suggestion text at the end of the current line. + The feature is useful for text autocompletion, and it does not implement + validation (accepting the suggested text on enter etc.). + This can also be used by the IME to setup the current word being edited. .. versionadded:: 1.9.0 - :attr:`suggestion_text` is a :class:`~kivy.properties.StringProperty` - defaults to `''` + :attr:`suggestion_text` is a :class:`~kivy.properties.StringProperty` and + defaults to `''`. ''' def on_suggestion_text(self, instance, value): From 9453724b0758aa8713167f58119b1537d9a7631f Mon Sep 17 00:00:00 2001 From: dessant Date: Sun, 28 Feb 2016 15:03:24 +0200 Subject: [PATCH 14/17] doc: remove a reference to the textinput cursor blink timer --- kivy/uix/textinput.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kivy/uix/textinput.py b/kivy/uix/textinput.py index 5d8b3d974c..eb45c2f028 100644 --- a/kivy/uix/textinput.py +++ b/kivy/uix/textinput.py @@ -1716,13 +1716,12 @@ def _get_text_width(self, text, tab_width, _label_cached): return width def _do_blink_cursor(self, dt): - # Callback called by the timer to blink the cursor, according to the - # last activity in the widget + # Callback for blinking the cursor. self.cursor_blink = not self.cursor_blink def _reset_cursor_blink(self): Clock.unschedule(self._do_blink_cursor) - self.cursor_blink=0 + self.cursor_blink = 0 Clock.schedule_interval(self._do_blink_cursor, .5) def on_cursor(self, instance, value): From ccf09c0b08b6acd01f5eb097090c626e8d9843a1 Mon Sep 17 00:00:00 2001 From: dessant Date: Sun, 28 Feb 2016 15:57:01 +0200 Subject: [PATCH 15/17] late import window for wm_touch, fixes #4040, credit to tshirtman --- kivy/input/providers/wm_touch.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kivy/input/providers/wm_touch.py b/kivy/input/providers/wm_touch.py index 71e8c0400e..73f25e7a17 100644 --- a/kivy/input/providers/wm_touch.py +++ b/kivy/input/providers/wm_touch.py @@ -14,7 +14,8 @@ TOUCHEVENTF_MOVE, SM_CYCAPTION) from kivy.input.motionevent import MotionEvent from kivy.input.shape import ShapeRect -from kivy.core.window import Window + +Window = None class WM_MotionEvent(MotionEvent): @@ -134,6 +135,10 @@ class RECT(Structure): class WM_MotionEventProvider(MotionEventProvider): def start(self): + global Window + if not Window: + from kivy.core.window import Window + self.touch_events = deque() self.touches = {} self.uid = 0 From 6c8723693a3a964d919802eb895a0e5384b0fe23 Mon Sep 17 00:00:00 2001 From: dessant Date: Sun, 28 Feb 2016 19:50:46 +0200 Subject: [PATCH 16/17] register missing properties in factory, fixes #4046 --- kivy/factory_registers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kivy/factory_registers.py b/kivy/factory_registers.py index 23fbf2aa77..a6751b10ce 100644 --- a/kivy/factory_registers.py +++ b/kivy/factory_registers.py @@ -37,6 +37,9 @@ r('ReferenceListProperty', module='kivy.properties') r('AliasProperty', module='kivy.properties') r('NumericProperty', module='kivy.properties') +r('DictProperty', module='kivy.properties') +r('VariableListProperty', module='kivy.properties') +r('ConfigParserProperty', module='kivy.properties') r('Property', module='kivy.properties') r('SafeList', module='kivy.utils') r('Vector', module='kivy.vector') From 597f0c11e78ac91cdb6c2bfe4a17fd6cb835c63f Mon Sep 17 00:00:00 2001 From: dessant Date: Mon, 29 Feb 2016 19:05:12 +0200 Subject: [PATCH 17/17] use a trigger when resetting the textinput cursor state --- kivy/uix/textinput.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/kivy/uix/textinput.py b/kivy/uix/textinput.py index eb45c2f028..b6bbb65f24 100644 --- a/kivy/uix/textinput.py +++ b/kivy/uix/textinput.py @@ -526,6 +526,8 @@ def handle_readonly(instance, value): self._position_handles) self._trigger_show_handles = Clock.create_trigger( self._show_handles, .05) + self._trigger_cursor_reset = Clock.create_trigger( + self._reset_cursor_blink) self._trigger_update_cutbuffer = Clock.create_trigger( self._update_cutbuffer) refresh_line_options() @@ -1292,8 +1294,8 @@ def on_touch_down(self, touch): if super(TextInput, self).on_touch_down(touch): return True - if self.focused: - self._reset_cursor_blink() + if self.focus: + self._trigger_cursor_reset() # Check for scroll wheel if 'button' in touch.profile and touch.button.startswith('scroll'): @@ -1636,7 +1638,7 @@ def _on_textinput_focused(self, instance, value, *largs): if value: if (not (self.readonly or self.disabled) or _is_desktop and self._keyboard_mode == 'system'): - self._reset_cursor_blink() + self._trigger_cursor_reset() self._editable = True else: self._editable = False @@ -1719,7 +1721,7 @@ def _do_blink_cursor(self, dt): # Callback for blinking the cursor. self.cursor_blink = not self.cursor_blink - def _reset_cursor_blink(self): + def _reset_cursor_blink(self, *args): Clock.unschedule(self._do_blink_cursor) self.cursor_blink = 0 Clock.schedule_interval(self._do_blink_cursor, .5) @@ -1727,7 +1729,8 @@ def _reset_cursor_blink(self): def on_cursor(self, instance, value): # When the cursor is moved, reset cursor blinking to keep it showing, # and update all the graphics. - self._reset_cursor_blink() + if self.focus: + self._trigger_cursor_reset() self._trigger_update_graphics() def _delete_line(self, idx):