Popup border color is red
This commit is contained in:
@ -139,16 +139,22 @@ class HorizontalSplit(Display):
|
||||
|
||||
class Box(Display):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
def __init__(self, *args, fg_border_color: Optional[int] = None, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.pad = self.newpad(self.rows, self.cols)
|
||||
self.fg_border_color = fg_border_color or curses.COLOR_WHITE
|
||||
|
||||
pair_number = 4 + self.fg_border_color
|
||||
self.init_pair(pair_number, self.fg_border_color, curses.COLOR_BLACK)
|
||||
self.pair = self.color_pair(pair_number)
|
||||
|
||||
def display(self) -> None:
|
||||
self.addstr(self.pad, 0, 0, "┏" + "━" * (self.width - 2) + "┓")
|
||||
self.addstr(self.pad, 0, 0, "┏" + "━" * (self.width - 2) + "┓",
|
||||
self.pair)
|
||||
for i in range(1, self.height - 1):
|
||||
self.addstr(self.pad, i, 0, "┃")
|
||||
self.addstr(self.pad, i, self.width - 1, "┃")
|
||||
self.addstr(self.pad, i, 0, "┃", self.pair)
|
||||
self.addstr(self.pad, i, self.width - 1, "┃", self.pair)
|
||||
self.addstr(self.pad, self.height - 1, 0,
|
||||
"┗" + "━" * (self.width - 2) + "┛")
|
||||
"┗" + "━" * (self.width - 2) + "┛", self.pair)
|
||||
self.refresh_pad(self.pad, 0, 0, self.y, self.x,
|
||||
self.y + self.height - 1, self.x + self.width - 1)
|
||||
|
Reference in New Issue
Block a user