Skip to content

Commit

Permalink
example:UnicodeTextinput fix font selection
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayaurora committed Dec 12, 2013
1 parent 89cc504 commit 03616e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions examples/widgets/unicode_textinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Spinner:
id: fnt_spnr
text: 'DroidSansMono'
fnt_name: font.match_font(self.text)
fnt_name: font.match_font(self.text) if font.match_font(self.text) else ''
font_name: self.fnt_name if self.fnt_name else self.font_name
values: sorted(font.get_fonts())
option_cls: Factory.FntSpinnerOption
Expand All @@ -47,8 +47,7 @@
font_size: fntsz_spnr.text + 'sp'
text: root.unicode_string
size_hint: 1, None
height: 1494
on_font_name: self.height = (self.line_height + self.padding_y) * (len(self._lines)-1)
height: self.minimum_height
BoxLayout:
size_hint: 1, .05
Label:
Expand Down
7 changes: 4 additions & 3 deletions kivy/uix/textinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,9 @@ def _update_selection(self, finished=False):
a, b = b, a
self._selection_finished = finished
_selection_text = self._get_text(encode=False)[a:b]
self.selection_text = (('*' * (b - a)) if self.password else
(_selection_text if self.allow_copy else ''))
self.selection_text = ("" if not self.allow_copy else
(('*' * (b - a)) if self.password else
_selection_text))
if not finished:
self._selection = True
else:
Expand Down Expand Up @@ -1477,7 +1478,7 @@ def _update_graphics(self, *largs):
size[1] = vh
if viewport_pos:
tcx, tcy = viewport_pos
tcx = tcx / tw * ow
tcx = tcx / tw * (ow)
tcy = tcy / th * oh

# cropping
Expand Down

0 comments on commit 03616e0

Please sign in to comment.