Browse Source

trying to make the statusicon hide/display the main window

master
Julio Biason 15 years ago
parent
commit
ce52823cb7
  1. 9
      mitterlib/ui/ui_pygtk.py

9
mitterlib/ui/ui_pygtk.py

@ -635,6 +635,14 @@ class Interface(object):
return return
def _window_to_tray(self, statusicon, user_data=None):
"""Minimize/display main window (as in minimize to tray.)"""
if self._main_window.get_property('visible'):
self._main_window.hide_all()
else:
self._main_window.show_all()
return
# ------------------------------------------------------------ # ------------------------------------------------------------
# Helper functions # Helper functions
# ------------------------------------------------------------ # ------------------------------------------------------------
@ -1421,6 +1429,7 @@ class Interface(object):
if self._options[self.NAMESPACE]['statusicon']: if self._options[self.NAMESPACE]['statusicon']:
self._statusicon = gtk.StatusIcon() self._statusicon = gtk.StatusIcon()
self._statusicon.set_from_pixbuf(self._images['icon']) self._statusicon.set_from_pixbuf(self._images['icon'])
self._statusicon.connect('activate', self._window_to_tray)
else: else:
self._statusicon = None self._statusicon = None

Loading…
Cancel
Save