This commit is contained in:
Nicolas Margulies 2020-11-20 18:09:39 +01:00
parent ca57fae19d
commit 223c20e792
2 changed files with 7 additions and 5 deletions

View File

@ -91,6 +91,7 @@ class HorizontalSplit(Display):
self.pad.addstr(0, i, "")
self.pad.refresh(0, 0, self.y, self.x, self.y, self.x + self.width - 1)
class Box(Display):
def __init__(self, *args, **kwargs):
@ -102,6 +103,6 @@ class Box(Display):
for i in range(1, self.height - 1):
self.pad.addstr(i, 0, "")
self.pad.addstr(i, self.width - 1, "")
self.pad.addstr(self.height - 1, 0,
"" + "" * (self.width - 2) + "")
self.pad.refresh(0, 0, self.y, self.x, self.y + self.height - 1, self.x + self.width - 1)
self.pad.addstr(self.height - 1, 0, "" + "" * (self.width - 2) + "")
self.pad.refresh(0, 0, self.y, self.x, self.y + self.height - 1,
self.x + self.width - 1)

View File

@ -81,7 +81,8 @@ class MainMenuDisplay(Display):
for i in range(len(self.title)):
self.pad.addstr(4 + i, max(self.width // 2
- len(self.title[0]) // 2 - 1, 0), self.title[i])
self.pad.refresh(0, 0, self.y, self.x, self.height + self.y - 1, self.width + self.x - 1)
self.pad.refresh(0, 0, self.y, self.x, self.height + self.y - 1,
self.width + self.x - 1)
menuwidth = min(self.menudisplay.preferred_width, self.width)
menuy, menux = len(self.title) + 8, self.width // 2 - menuwidth // 2 - 1
self.menudisplay.refresh(