Merge pull request #1844 from DarkSir23/master
Fix header and footer to use DEFAULT_CLIENT_WIDTH
This commit is contained in:
commit
52699c06e8
2 changed files with 5 additions and 5 deletions
|
|
@ -929,9 +929,9 @@ class EvEditor(object):
|
||||||
nchars = len(buf)
|
nchars = len(buf)
|
||||||
|
|
||||||
sep = self._sep
|
sep = self._sep
|
||||||
header = "|n" + sep * 10 + "Line Editor [%s]" % self._key + sep * (_DEFAULT_WIDTH - 20 - len(self._key))
|
header = "|n" + sep * 10 + "Line Editor [%s]" % self._key + sep * (_DEFAULT_WIDTH - 24 - len(self._key))
|
||||||
footer = "|n" + sep * 10 +\
|
footer = "|n" + sep * 10 +\
|
||||||
"[l:%02i w:%03i c:%04i]" % (nlines, nwords, nchars) + sep * 12 + "(:h for help)" + sep * 28
|
"[l:%02i w:%03i c:%04i]" % (nlines, nwords, nchars) + sep * 12 + "(:h for help)" + sep * (_DEFAULT_WIDTH - 54)
|
||||||
if linenums:
|
if linenums:
|
||||||
main = "\n".join("|b%02i|||n %s" % (iline + 1 + offset, raw(line)) for iline, line in enumerate(lines))
|
main = "\n".join("|b%02i|||n %s" % (iline + 1 + offset, raw(line)) for iline, line in enumerate(lines))
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -1005,13 +1005,13 @@ class EvMenu(object):
|
||||||
else:
|
else:
|
||||||
# add a default white color to key
|
# add a default white color to key
|
||||||
table.append(" |lc%s|lt|w%s|n|le%s" % (raw_key, raw_key, desc_string))
|
table.append(" |lc%s|lt|w%s|n|le%s" % (raw_key, raw_key, desc_string))
|
||||||
|
ncols = (_MAX_TEXT_WIDTH // table_width_max) # number of ncols
|
||||||
|
|
||||||
ncols = (_MAX_TEXT_WIDTH // table_width_max) + 1 # number of ncols
|
if ncols < 0:
|
||||||
|
|
||||||
if ncols <= 0:
|
|
||||||
# no visible option at all
|
# no visible option at all
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
ncols = ncols + 1 if ncols == 0 else ncols
|
||||||
# get the amount of rows needed (start with 4 rows)
|
# get the amount of rows needed (start with 4 rows)
|
||||||
nrows = 4
|
nrows = 4
|
||||||
while nrows * ncols < nlist:
|
while nrows * ncols < nlist:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue