def __init__(self, dynamic=False): EditorExtension.__init__(self) QWidget.__init__(self) # Specifies whether the panel is dynamic. A dynamic panel is a panel # that will be shown/hidden depending on the context. # Dynamic panel should not appear in any GUI menu self.dynamic = dynamic # Panel order into the zone it is installed to. This value is # automatically set when installing the panel but it can be changed # later (negative values can also be used). self.order_in_zone = -1 self._scrollable = False self._background_brush = None self._foreground_pen = None # Position in the editor (top, left, right, bottom) self.position = -1
def __init__(self): EditorExtension.__init__(self) self.is_snippet_active = False self.active_snippet = -1 self.node_number = 0 self.index = None self.ast = None self.starting_position = None self.modification_lock = QMutex() self.event_lock = QMutex() self.node_position = {} self.snippets_map = {} self.undo_stack = [] self.redo_stack = [] if rtree_available: self.index = index.Index()
def on_install(self, editor): """ Extends :meth:`spyder.api.EditorExtension.on_install` method to set the editor instance as the parent widget. .. warning:: Don't forget to call **super** if you override this method! :param editor: editor instance :type editor: spyder.plugins.editor.widgets.codeeditor.CodeEditor """ EditorExtension.on_install(self, editor) self.setParent(editor) self.setPalette(QApplication.instance().palette()) self.setFont(QApplication.instance().font()) self.editor.panels.refresh() self._background_brush = QBrush(QColor( self.palette().window().color())) self._foreground_pen = QPen(QColor( self.palette().windowText().color())) if self.position == self.Position.FLOATING: self.setAttribute(Qt.WA_TransparentForMouseEvents)