summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpanel.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/panel.py b/panel.py
index b522dc5..0248838 100755
--- a/panel.py
+++ b/panel.py
@@ -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)