(self, widget, font_scale=True)
Zoom a terminal widget
Zoom a terminal widget
Zoom a terminal widget
def zoom(self, widget, font_scale=True):
        """Zoom a terminal widget"""
        children = self.get_children()

        if widget in children:
            # This widget is a direct child of ours and we're a Window
            # so zooming is a no-op
            return

        self.zoom_data = widget.get_zoom_data()
        self.zoom_data['widget'] = widget
        self.zoom_data['old_child'] = children[0]
        self.zoom_data['font_scale'] = font_scale

        self.remove(self.zoom_data['old_child'])
        self.zoom_data['old_parent'].remove(widget)
        self.add(widget)
        self.set_property('term_zoomed', True)

        if font_scale:
            widget.cnxids.new(widget, 'size-allocate', 
                    widget.zoom_scale, self.zoom_data)

        widget.grab_focus()
def zoom ( self , widget , font_scale = True ) : children = self . get_children ( ) if widget in children : # This widget is a direct child of ours and we're a Window # so zooming is a no-op return self . zoom_data = widget . get_zoom_data ( ) self . zoom_data [ 'widget' ] = widget self . zoom_data [ 'old_child' ] = children [ 0 ] self . zoom_data [ 'font_scale' ] = font_scale self . remove ( self . zoom_data [ 'old_child' ] ) self . zoom_data [ 'old_parent' ] . remove ( widget ) self . add ( widget ) self . set_property ( 'term_zoomed' , True ) if font_scale : widget . cnxids . new ( widget , 'size-allocate' , widget . zoom_scale , self . zoom_data ) widget . grab_focus ( )