mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 19:44:52 +00:00
make text input not go over width
This commit is contained in:
parent
b77f8929d6
commit
cd7805bfda
1 changed files with 10 additions and 2 deletions
|
@ -109,9 +109,17 @@ class TextInput(InputField):
|
|||
if selected:
|
||||
if self.opts:
|
||||
self.parent.add_string(row+2,self.opts[self.opt_off:],screen,1,False,True)
|
||||
self.move_func(row+1,self.cursor+1)
|
||||
if self.cursor > (width-3):
|
||||
self.move_func(row+1,width-2)
|
||||
else:
|
||||
self.move_func(row+1,self.cursor+1)
|
||||
self.parent.add_string(row,self.message,screen,1,False,True)
|
||||
self.parent.add_string(row+1,"{!black,white,bold!}%s"%self.value.ljust(width-2),screen,1,False,False)
|
||||
slen = len(self.value)+3
|
||||
if slen > width:
|
||||
vstr = self.value[(slen-width):]
|
||||
else:
|
||||
vstr = self.value.ljust(width-2)
|
||||
self.parent.add_string(row+1,"{!black,white,bold!}%s"%vstr,screen,1,False,False)
|
||||
|
||||
return 3
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue