diff options
author | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-08-09 00:23:59 +0000 |
---|---|---|
committer | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-08-09 00:23:59 +0000 |
commit | 6b4b32ffc565eb82e48eb5564f1f336eecaef4dc (patch) | |
tree | 409e067c1272662be390458eaae87c10b549d457 /src/window.py | |
parent | 835527e2d130cd427972cadfc82d10ee36391e52 (diff) | |
download | poezio-6b4b32ffc565eb82e48eb5564f1f336eecaef4dc.tar.gz poezio-6b4b32ffc565eb82e48eb5564f1f336eecaef4dc.tar.bz2 poezio-6b4b32ffc565eb82e48eb5564f1f336eecaef4dc.tar.xz poezio-6b4b32ffc565eb82e48eb5564f1f336eecaef4dc.zip |
Print a line separator to indicate the new messages. fixed #1487
Diffstat (limited to 'src/window.py')
-rw-r--r-- | src/window.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/window.py b/src/window.py index 2c030afe..fbdaa1de 100644 --- a/src/window.py +++ b/src/window.py @@ -218,6 +218,9 @@ class TextWin(Win): """ lines = [] for message in messages: + if message == None: # line separator + lines.append(None) + continue txt = message.txt if not txt: continue @@ -285,6 +288,10 @@ class TextWin(Win): y = 0 for line in lines: self.win.move(y, 0) + if line == None: + self.write_line_separator() + y += 1 + continue if line.time is not None: self.write_time(line.time) if line.nickname is not None: @@ -293,6 +300,13 @@ class TextWin(Win): y += 1 self.win.refresh() + def write_line_separator(self): + """ + """ + self.win.attron(curses.color_pair(7)) + self.win.addstr(' -'*(self.width/2)) + self.win.attroff(curses.color_pair(7)) + def write_text(self, y, x, txt, color): """ write the text of a line. |