Create GCTooltip window only when parent is available
This commit is contained in:
parent
d4f3488abe
commit
ec99e93a7c
|
@ -359,13 +359,14 @@ class GroupchatControl(ChatControlBase):
|
|||
if gtkgui_helpers.gtk_icon_theme.has_icon('document-open-recent'):
|
||||
img = self.xml.get_object('history_image')
|
||||
img.set_from_icon_name('document-open-recent', Gtk.IconSize.MENU)
|
||||
widget = self.xml.get_object('list_treeview')
|
||||
widget.set_has_tooltip(True)
|
||||
widget.set_tooltip_window(tooltips.GCTooltip(self.parent_win.window))
|
||||
self.current_tooltip = None
|
||||
id_ = widget.connect('query-tooltip', self.query_tooltip)
|
||||
self.handlers[id_] = widget
|
||||
|
||||
self.current_tooltip = None
|
||||
if parent_win:
|
||||
# On AutoJoin with minimize Groupchats are created without parent
|
||||
# Tooltip Window has to be created with parent
|
||||
self.set_tooltip()
|
||||
|
||||
widget = self.xml.get_object('list_treeview')
|
||||
id_ = widget.connect('row_expanded', self.on_list_treeview_row_expanded)
|
||||
self.handlers[id_] = widget
|
||||
|
||||
|
@ -526,6 +527,15 @@ class GroupchatControl(ChatControlBase):
|
|||
# instance object
|
||||
gajim.plugin_manager.gui_extension_point('groupchat_control', self)
|
||||
|
||||
def set_tooltip(self):
|
||||
widget = self.xml.get_object('list_treeview')
|
||||
if widget.get_tooltip_window():
|
||||
return
|
||||
widget.set_has_tooltip(True)
|
||||
widget.set_tooltip_window(tooltips.GCTooltip(self.parent_win.window))
|
||||
id_ = widget.connect('query-tooltip', self.query_tooltip)
|
||||
self.handlers[id_] = widget
|
||||
|
||||
def query_tooltip(self, widget, x_pos, y_pos, keyboard_mode, tooltip):
|
||||
try:
|
||||
row = self.list_treeview.get_path_at_pos(x_pos, y_pos)[0]
|
||||
|
|
|
@ -3419,6 +3419,7 @@ class RosterWindow:
|
|||
mw = gajim.interface.msg_win_mgr.create_window(ctrl.contact,
|
||||
ctrl.account, ctrl.type_id)
|
||||
ctrl.parent_win = mw
|
||||
ctrl.set_tooltip()
|
||||
mw.new_tab(ctrl)
|
||||
mw.set_active_tab(ctrl)
|
||||
mw.window.get_window().focus(Gtk.get_current_event_time())
|
||||
|
|
Loading…
Reference in New Issue