Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add colored emoji support to TextInput #8491

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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