Show
Ignore:
Timestamp:
12/16/07 01:47:20 (11 months ago)
Author:
nicfit
Message:

Resizing fixes and make the roster window shrink when last tab is removed

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/one_window/src/message_window.py

    r9155 r9157  
    428428                        # dnd clean up 
    429429                        self.notebook.drag_dest_unset() 
    430                         self.window.destroy() 
     430                        if self.parent_paned: 
     431                                # Don't close parent window, just remove the child 
     432                                child = self.parent_paned.get_child2() 
     433                                self.parent_paned.remove(child) 
     434                                # FIXME: restore preferred roster size 
     435                        else: 
     436                                self.window.destroy() 
    431437                        return # don't show_title, we are dead 
    432438                elif self.get_num_controls() == 1: # we are going from two tabs to one 
     
    694700 
    695701################################################################################ 
    696 class MessageWindowMgr: 
     702class MessageWindowMgr(gobject.GObject): 
    697703        '''A manager and factory for MessageWindow objects''' 
     704        __gsignals__ = { 
     705                'window-delete': (gobject.SIGNAL_RUN_LAST, None, (object,)), 
     706        } 
    698707 
    699708        # These constants map to common.config.opt_one_window_types indices 
     
    717726                ONE_MSG_WINDOW_PERACCT: The key is the account name 
    718727                ONE_MSG_WINDOW_PERTYPE: The key is a message type constant''' 
     728                gobject.GObject.__init__(self) 
    719729                self._windows = {} 
    720730 
     
    879889                for k in self._windows.keys(): 
    880890                        if self._windows[k].window == win: 
     891                                self.emit('window-delete', self._windows[k]) 
    881892                                del self._windows[k] 
    882893                                return 
     
    945956                        size_height_key = type + '-msgwin-height' 
    946957                elif self.mode == self.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER: 
    947                         width -= msg_win.parent_paned.get_position() 
     958                        # Ignore any hpaned width 
     959                        width = msg_win.notebook.allocation.width 
    948960 
    949961                if acct: