'Extends :meth:`spyder.api.Mode.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.widgets.sourcecode.CodeEditor'

def on_install(self, editor):

    Mode.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)
