center focus out line

This commit is contained in:
Nikos Kouremenos 2005-10-08 15:37:07 +00:00
parent d473aa7a8b
commit 4d15c54010
2 changed files with 7 additions and 6 deletions

View File

@ -682,12 +682,14 @@ class Chat:
tag = conversation_buffer.create_tag('underline') tag = conversation_buffer.create_tag('underline')
tag.set_property('underline', pango.UNDERLINE_SINGLE) tag.set_property('underline', pango.UNDERLINE_SINGLE)
conversation_buffer.create_tag('focus-out-line',
justification = gtk.JUSTIFY_CENTER) # FIXME: make it gtk.JUSTIFY_FILL when GTK+ REALLY supports it
self.xmls[jid].signal_autoconnect(self) self.xmls[jid].signal_autoconnect(self)
conversation_scrolledwindow = self.xmls[jid].get_widget( conversation_scrolledwindow = self.xmls[jid].get_widget(
'conversation_scrolledwindow') 'conversation_scrolledwindow')
conversation_scrolledwindow.get_vadjustment().connect('value-changed', conversation_scrolledwindow.get_vadjustment().connect('value-changed',
self.on_conversation_vadjustment_value_changed) self.on_conversation_vadjustment_value_changed)
if len(self.xmls) > 1: if len(self.xmls) > 1:
self.notebook.set_show_tabs(True) self.notebook.set_show_tabs(True)

View File

@ -223,7 +223,7 @@ class GroupchatWindow(chat.Chat):
end_iter_for_previous_line = buffer.get_iter_at_offset( end_iter_for_previous_line = buffer.get_iter_at_offset(
self.focus_out_end_iter_offset[room_jid]) self.focus_out_end_iter_offset[room_jid])
begin_iter_for_previous_line = end_iter_for_previous_line.copy() begin_iter_for_previous_line = end_iter_for_previous_line.copy()
begin_iter_for_previous_line.backward_chars(16) # FIXME: position stuff not always 15+1 (the '\n') after fix begin_iter_for_previous_line.backward_chars(16) # 15+1 (the '\n')
# remove focus out line # remove focus out line
buffer.delete(begin_iter_for_previous_line, buffer.delete(begin_iter_for_previous_line,
@ -232,11 +232,10 @@ class GroupchatWindow(chat.Chat):
# add the new focus out line # add the new focus out line
dash_char = unicodedata.lookup( dash_char = unicodedata.lookup(
'BOX DRAWINGS HEAVY HORIZONTAL').encode('utf-8') 'BOX DRAWINGS HEAVY HORIZONTAL').encode('utf-8')
focus_out_line = '\n' + dash_char * 15
# maybe add gtk.JUSTIFY_FILL on 'justify' in texttag
focus_out_line = '\n' + dash_char * 15 # FIXME: do better position stuff
end_iter = buffer.get_end_iter() end_iter = buffer.get_end_iter()
buffer.insert(end_iter, focus_out_line) buffer.insert_with_tags_by_name(end_iter, focus_out_line,
'focus-out-line')
self.allow_focus_out_line[room_jid] = False self.allow_focus_out_line[room_jid] = False