Put the list of rooms to the left of the RoomInfo bar, and the name to the right.

This commit is contained in:
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 2010-06-12 22:47:04 +00:00
parent 022afc405f
commit 41ce0c9118

View file

@ -129,7 +129,7 @@ class RoomInfo(Win):
def compare_room(a, b): def compare_room(a, b):
return a.nb - b.nb return a.nb - b.nb
self.win.erase() self.win.erase()
self.win.addnstr(0, 0, current.name+" [", self.width self.win.addnstr(0, 0, "[", self.width
,curses.color_pair(1)) ,curses.color_pair(1))
sorted_rooms = sorted(rooms, compare_room) sorted_rooms = sorted(rooms, compare_room)
for room in sorted_rooms: for room in sorted_rooms:
@ -144,7 +144,7 @@ class RoomInfo(Win):
break break
(y, x) = self.win.getyx() (y, x) = self.win.getyx()
try: try:
self.win.addstr(y, x-1, ']'+(' '*((self.width)-x)), curses.color_pair(1)) self.win.addstr(y, x-1, '] '+ current.name+ (' '*((self.width)-x)), curses.color_pair(1))
except: except:
pass pass
self.win.refresh() self.win.refresh()
@ -184,7 +184,6 @@ class TextWin(Win):
for message in messages: for message in messages:
txt = message.txt txt = message.txt
offset = 11 # length of the time offset = 11 # length of the time
debug(str(message.nickname) + ' : '+message.txt + '\n')
if message.nickname and len(message.nickname) >= 30: if message.nickname and len(message.nickname) >= 30:
nick = message.nickname[:30]+u'' nick = message.nickname[:30]+u''
else: else:
@ -202,6 +201,8 @@ class TextWin(Win):
if limit == 0: if limit == 0:
break break
color = message.user.color if message.user else None color = message.user.color if message.user else None
if not first:
nick = None
l = Line(nick, color, l = Line(nick, color,
message.time, message.time,
txt[:limit], message.color, txt[:limit], message.color,