(self, widget, event)
return False
Handler for the group button
Handler for the group button
Handler for the group button
def on_group_button_press(self, widget, event):
        """Handler for the group button"""
        if event.button == 1:
            if event.type == Gdk.EventType._2BUTTON_PRESS or \
               event.type == Gdk.EventType._3BUTTON_PRESS:
                # Ignore these, or they make the interaction bad
                return True
            # Super key applies interaction to all terms in group
            include_siblings=event.get_state() & Gdk.ModifierType.MOD4_MASK == Gdk.ModifierType.MOD4_MASK
            if include_siblings:
                targets=self.terminator.get_sibling_terms(self)
            else:
                targets=[self]
            if event.get_state() & Gdk.ModifierType.CONTROL_MASK == Gdk.ModifierType.CONTROL_MASK:
                dbg('on_group_button_press: toggle terminal to focused terminals group')
                focused=self.get_toplevel().get_focussed_terminal()
                if focused in targets: targets.remove(focused)
                if self != focused:
                    if self.group == focused.group:
                        new_group = None
                    else:
                        new_group = focused.group
                    [term.set_group(None, new_group) for term in targets]
                    [term.titlebar.update(focused) for term in targets]
                return True
            elif event.get_state() & Gdk.ModifierType.SHIFT_MASK == Gdk.ModifierType.SHIFT_MASK:
                dbg('on_group_button_press: rename of terminals group')
                self.targets_for_new_group = targets
                self.titlebar.create_group()
                return True
            elif event.type == Gdk.EventType.BUTTON_PRESS:
                # Single Click gives popup
                dbg('on_group_button_press: group menu popup')
                window = self.get_toplevel()
                window.preventHide = True
                self.create_popup_group_menu(widget, event)
                return True
            else:
                dbg('on_group_button_press: unknown group button interaction')
        return False
def on_group_button_press ( self , widget , event ) : if event . button == 1 : if event . type == Gdk . EventType . _2BUTTON_PRESS or event . type == Gdk . EventType . _3BUTTON_PRESS : # Ignore these, or they make the interaction bad return True # Super key applies interaction to all terms in group include_siblings = event . get_state ( ) & Gdk . ModifierType . MOD4_MASK == Gdk . ModifierType . MOD4_MASK if include_siblings : targets = self . terminator . get_sibling_terms ( self ) else : targets = [ self ] if event . get_state ( ) & Gdk . ModifierType . CONTROL_MASK == Gdk . ModifierType . CONTROL_MASK : dbg ( 'on_group_button_press: toggle terminal to focused terminals group' ) focused = self . get_toplevel ( ) . get_focussed_terminal ( ) if focused in targets : targets . remove ( focused ) if self != focused : if self . group == focused . group : new_group = None else : new_group = focused . group [ term . set_group ( None , new_group ) for term in targets ] [ term . titlebar . update ( focused ) for term in targets ] return True elif event . get_state ( ) & Gdk . ModifierType . SHIFT_MASK == Gdk . ModifierType . SHIFT_MASK : dbg ( 'on_group_button_press: rename of terminals group' ) self . targets_for_new_group = targets self . titlebar . create_group ( ) return True elif event . type == Gdk . EventType . BUTTON_PRESS : # Single Click gives popup dbg ( 'on_group_button_press: group menu popup' ) window = self . get_toplevel ( ) window . preventHide = True self . create_popup_group_menu ( widget , event ) return True else : dbg ( 'on_group_button_press: unknown group button interaction' ) return False