diff options
-rwxr-xr-x | panel.py | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -84,6 +84,18 @@ class Mod: def process_cmd(self, cmd): pass +class ModText(Mod): + def __init__(self, text, fg=None, bg=None, padding=0, **kwargs): + super().__init__(**kwargs) + buf = text + if padding: + buf = Fmt.pad(buf, padding) + if fg: + buf = Fmt.fg(fg, buf) + if bg: + buf = Fmt.bg(bg, buf) + self.out = buf + class ModRight(Mod): def __init__(self, **kwargs): kwargs.setdefault('spacing', 0) |