[node-patches] Change in ovirt-node[master]: Make Entry fields scroll when input exceeds max columns

rbarry at redhat.com rbarry at redhat.com
Thu Nov 14 17:45:04 UTC 2013


Ryan Barry has uploaded a new change for review.

Change subject: Make Entry fields scroll when input exceeds max columns
......................................................................

Make Entry fields scroll when input exceeds max columns

Previously, when a user input a value longer than the TUI could
display, the excess was clipped not visible. Be smarter about how
we display it to users.

Change-Id: Ica8768fa011fcfdbef19251d313bc4b1cc0c8a6b
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=981189
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/ui/widgets.py
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/87/21287/1

diff --git a/src/ovirt/node/ui/widgets.py b/src/ovirt/node/ui/widgets.py
index df46a8a..a9c9fe3 100644
--- a/src/ovirt/node/ui/widgets.py
+++ b/src/ovirt/node/ui/widgets.py
@@ -713,6 +713,9 @@
         self._shift_view_to_cursor = bool(focus)
 
         txt = self.get_edit_text()
+        if len(txt) > maxcol:
+            chop = len(txt) - maxcol
+            txt = txt[chop:]
         txt = u"".join([self._mask] * len(txt)) if self._mask else txt
         txt = txt.ljust(maxcol, self.char)[:maxcol]
         canv = urwid.Text(txt).render((maxcol,))


-- 
To view, visit http://gerrit.ovirt.org/21287
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica8768fa011fcfdbef19251d313bc4b1cc0c8a6b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list