Primitivus: subject in group chat can now be shown in 3 ways: clip, full, or hidden
This commit is contained in:
parent
ccea050bc5
commit
0bdb911415
1 changed files with 12 additions and 7 deletions
|
|
@ -85,7 +85,7 @@ class Chat(urwid.WidgetWrap, QuickChat):
|
|||
self.day_change = time.strptime(time.strftime("%a %b %d 00:00:00 %Y")) #struct_time of day changing time
|
||||
self.show_timestamp = True
|
||||
self.show_short_nick = False
|
||||
self.show_title = True
|
||||
self.show_title = 1 #0: clip title; 1: full title; 2: no title
|
||||
self.subject = None
|
||||
|
||||
def keypress(self, size, key):
|
||||
|
|
@ -110,10 +110,12 @@ class Chat(urwid.WidgetWrap, QuickChat):
|
|||
self._invalidate()
|
||||
elif key == "meta s": #user wants to (un)hide group's subject
|
||||
if self.subject:
|
||||
self.show_title = not self.show_title
|
||||
if self.show_title:
|
||||
self.setSubject(self.subject)
|
||||
else:
|
||||
self.show_title = (self.show_title + 1) % 3
|
||||
if self.show_title == 0:
|
||||
self.setSubject(self.subject,'clip')
|
||||
elif self.show_title == 1:
|
||||
self.setSubject(self.subject,'space')
|
||||
elif self.show_title == 2:
|
||||
self.chat_widget.header = None
|
||||
self._invalidate()
|
||||
|
||||
|
|
@ -154,11 +156,14 @@ class Chat(urwid.WidgetWrap, QuickChat):
|
|||
self.columns.widget_list.remove(self.present_panel)
|
||||
del self.columns.column_types[-1]
|
||||
|
||||
def setSubject(self, subject):
|
||||
def setSubject(self, subject, wrap='space'):
|
||||
"""Set title for a group chat"""
|
||||
QuickChat.setSubject(self, subject)
|
||||
self.subject = subject
|
||||
self.chat_widget.header = urwid.AttrMap(urwid.Text(unicode(subject),align='center'),'title')
|
||||
self.subj_wid = urwid.Text(unicode(subject.replace('\n','|') if wrap == 'clip' else subject ),
|
||||
align='left' if wrap=='clip' else 'center',wrap=wrap)
|
||||
self.chat_widget.header = urwid.AttrMap(self.subj_wid,'title')
|
||||
self.host.redraw()
|
||||
|
||||
def setPresents(self, param_nicks):
|
||||
"""Set the users presents in the contact list for a group chat
|
||||
|
|
|
|||
Loading…
Reference in a new issue