Skip to content

Commit

Permalink
add colored emoji support to textinput
Browse files Browse the repository at this point in the history
  • Loading branch information
DexerBR committed Dec 2, 2023
1 parent 1e3e520 commit 3fc5250
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kivy/data/style.kv
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
pos: self._cursor_visual_pos
size: root.cursor_width, -self._cursor_visual_height
Color:
rgba: self.disabled_foreground_color if self.disabled else (self.hint_text_color if not self.text else self.foreground_color)
rgba: 1, 1, 1, 1

<TextInputCutCopyPaste>:
content: content.__self__
Expand Down
7 changes: 7 additions & 0 deletions kivy/uix/textinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,9 @@ def __init__(self, **kwargs):
fbind('font_family', refresh_line_options)
fbind('base_direction', refresh_line_options)
fbind('text_language', refresh_line_options)
fbind('foreground_color', update_text_options)
fbind('disabled_foreground_color', update_text_options)
fbind('hint_text_color', update_text_options)

def handle_readonly(instance, value):
if value and (not _is_desktop or not self.allow_copy):
Expand Down Expand Up @@ -2671,6 +2674,10 @@ def _create_line_label(self, text, hint=False):
ntext = self.password_mask * len(ntext)

kw = self._get_line_options()
kw["color"] = (
self.disabled_foreground_color if self.disabled
else (self.hint_text_color if hint else self.foreground_color)
)
cid = '%s\0%s' % (ntext, str(kw))
texture = Cache_get('textinput.label', cid)

Expand Down

0 comments on commit 3fc5250

Please sign in to comment.