fixed incorrect width of conference participants list, when joining a new room and when manually resizing/maximizing gajim window in all-in-one mode
This commit is contained in:
parent
8a03cfde96
commit
ae43834dc6
|
@ -85,6 +85,7 @@
|
||||||
<property name="border_width">3</property>
|
<property name="border_width">3</property>
|
||||||
<property name="position">495</property>
|
<property name="position">495</property>
|
||||||
<property name="position_set">True</property>
|
<property name="position_set">True</property>
|
||||||
|
<signal name="notify" handler="on_hpaned_notify"/>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkVBox" id="gc_textviews_vbox">
|
<object class="GtkVBox" id="gc_textviews_vbox">
|
||||||
<property name="width_request">0</property>
|
<property name="width_request">0</property>
|
||||||
|
|
|
@ -377,11 +377,6 @@ class GroupchatControl(ChatControlBase):
|
||||||
self.name_label = self.xml.get_object('banner_name_label')
|
self.name_label = self.xml.get_object('banner_name_label')
|
||||||
self.event_box = self.xml.get_object('banner_eventbox')
|
self.event_box = self.xml.get_object('banner_eventbox')
|
||||||
|
|
||||||
# set the position of the current hpaned
|
|
||||||
hpaned_position = gajim.config.get('gc-hpaned-position')
|
|
||||||
self.hpaned = self.xml.get_object('hpaned')
|
|
||||||
self.hpaned.set_position(hpaned_position)
|
|
||||||
|
|
||||||
self.list_treeview = self.xml.get_object('list_treeview')
|
self.list_treeview = self.xml.get_object('list_treeview')
|
||||||
selection = self.list_treeview.get_selection()
|
selection = self.list_treeview.get_selection()
|
||||||
id_ = selection.connect('changed',
|
id_ = selection.connect('changed',
|
||||||
|
@ -390,13 +385,17 @@ class GroupchatControl(ChatControlBase):
|
||||||
id_ = self.list_treeview.connect('style-set',
|
id_ = self.list_treeview.connect('style-set',
|
||||||
self.on_list_treeview_style_set)
|
self.on_list_treeview_style_set)
|
||||||
self.handlers[id_] = self.list_treeview
|
self.handlers[id_] = self.list_treeview
|
||||||
self.resize_from_another_muc = False
|
self.resize_from_another_muc = True
|
||||||
# we want to know when the the widget resizes, because that is
|
# we want to know when the the widget resizes, because that is
|
||||||
# an indication that the hpaned has moved...
|
# an indication that the hpaned has moved...
|
||||||
# FIXME: Find a better indicator that the hpaned has moved.
|
self.hpaned = self.xml.get_object('hpaned')
|
||||||
id_ = self.list_treeview.connect('size-allocate',
|
id_ = self.hpaned.connect('notify', self.on_hpaned_notify)
|
||||||
self.on_treeview_size_allocate)
|
self.handlers[id_] = self.hpaned
|
||||||
self.handlers[id_] = self.list_treeview
|
|
||||||
|
# set the position of the current hpaned
|
||||||
|
hpaned_position = gajim.config.get('gc-hpaned-position')
|
||||||
|
self.hpaned.set_position(hpaned_position)
|
||||||
|
|
||||||
#status_image, shown_nick, type, nickname, avatar
|
#status_image, shown_nick, type, nickname, avatar
|
||||||
self.columns = [gtk.Image, str, str, str, gtk.gdk.Pixbuf]
|
self.columns = [gtk.Image, str, str, str, gtk.gdk.Pixbuf]
|
||||||
store = gtk.TreeStore(*self.columns)
|
store = gtk.TreeStore(*self.columns)
|
||||||
|
@ -552,23 +551,21 @@ class GroupchatControl(ChatControlBase):
|
||||||
|
|
||||||
menu.show_all()
|
menu.show_all()
|
||||||
|
|
||||||
def resize_occupant_treeview(self, position):
|
def on_hpaned_notify(self, pane, gparamspec):
|
||||||
self.resize_from_another_muc = True
|
|
||||||
self.hpaned.set_position(position)
|
|
||||||
def reset_flag():
|
|
||||||
self.resize_from_another_muc = False
|
|
||||||
# Reset the flag when everything will be redrawn, and in particular when
|
|
||||||
# on_treeview_size_allocate will have been called.
|
|
||||||
gobject.idle_add(reset_flag)
|
|
||||||
|
|
||||||
def on_treeview_size_allocate(self, widget, allocation):
|
|
||||||
"""
|
"""
|
||||||
The MUC treeview has resized. Move the hpaned in all tabs to match
|
The MUC treeview has resized. Move the hpaned in all tabs to match
|
||||||
"""
|
"""
|
||||||
if self.resize_from_another_muc:
|
def reset_flag():
|
||||||
|
self.resize_from_another_muc = True
|
||||||
|
|
||||||
|
if gparamspec.name != 'position':
|
||||||
|
return
|
||||||
|
if not self.resize_from_another_muc:
|
||||||
# Don't send the event to other MUC
|
# Don't send the event to other MUC
|
||||||
return
|
return
|
||||||
|
|
||||||
hpaned_position = self.hpaned.get_position()
|
hpaned_position = self.hpaned.get_position()
|
||||||
|
gajim.config.set('gc-hpaned-position', hpaned_position)
|
||||||
for account in gajim.gc_connected:
|
for account in gajim.gc_connected:
|
||||||
for room_jid in [i for i in gajim.gc_connected[account] if \
|
for room_jid in [i for i in gajim.gc_connected[account] if \
|
||||||
gajim.gc_connected[account][i] and i != self.room_jid]:
|
gajim.gc_connected[account][i] and i != self.room_jid]:
|
||||||
|
@ -578,7 +575,9 @@ class GroupchatControl(ChatControlBase):
|
||||||
gajim.interface.minimized_controls[account]:
|
gajim.interface.minimized_controls[account]:
|
||||||
ctrl = gajim.interface.minimized_controls[account][room_jid]
|
ctrl = gajim.interface.minimized_controls[account][room_jid]
|
||||||
if ctrl and gajim.config.get('one_message_window') != 'never':
|
if ctrl and gajim.config.get('one_message_window') != 'never':
|
||||||
ctrl.resize_occupant_treeview(hpaned_position)
|
ctrl.resize_from_another_muc = False
|
||||||
|
ctrl.hpaned.set_position(hpaned_position)
|
||||||
|
gobject.idle_add(reset_flag)
|
||||||
|
|
||||||
def iter_contact_rows(self):
|
def iter_contact_rows(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue