Example #1
0
    def updateConfig(self):
        if not self.__lexer or not self.__do:
            return False

        qs = QsciScintilla
        c = self.__do.editorController.config
        self.setWhitespaceVisibility(qs.WsVisible if c.showWhiteSpaces.value else qs.WsInvisible)
        self.setIndentationGuides(c.showIndentationGuides.value)
        self.setTabWidth(int(c.tabWidth.value))
        self.setWrapMode(qs.WrapWord if c.wrapLines.value else qs.WrapNone)
        self.setBraceMatching(qs.SloppyBraceMatch if c.braceMatching.value else qs.NoBraceMatch)
        l = self.__lexer
        l.setFont(formlayout.tuple_to_qfont(c.font.value))
        l.setPaper(QColor(c.backgroundColor.value))
        l.setColor(QColor(c.identifierColor.value), l.Identifier)
        l.setColor(QColor(c.identifierColor.value), l.Operator)
        l.setColor(QColor(c.keywordColor.value), l.Keyword)
        l.setColor(QColor(c.stringColor.value), l.SingleQuotedString)
        l.setColor(QColor(c.stringColor.value), l.DoubleQuotedString)
        l.setColor(QColor(c.numberColor.value), l.Number)
        l.setColor(QColor(c.commentColor.value), l.Comment)
        self.setCaretForegroundColor(QColor(c.identifierColor.value))
        self.setIndicatorForegroundColor(QColor(c.tooltipIndicatorColor.value))

        return True
Example #2
0
    def updateConfig(self):
        if not ScintillaWrapper.updateConfig(self):
            return False
        # check whether we're supposed to use overlays and reload everything
        # that uses them
        qs = QsciScintilla
        c = self.distributedObjects.editorController.config
        l = self.lexer()
        self.setFolding(qs.BoxedTreeFoldStyle if c.folding.value else qs.NoFoldStyle, self.MARGIN_MARKER_FOLD)
        self.setMarkerBackgroundColor(QColor(c.highlightColor.value), self.MARKER_HIGHLIGHTED_LINE)
        l.setColor(QColor(c.preprocessorColor.value), l.PreProcessor)
        l.setColor(QColor(c.commentColor.value), l.CommentLine)
        l.setColor(QColor(c.commentColor.value), l.CommentDoc)

        self.__disAsmStyle.setFont(formlayout.tuple_to_qfont(self.distributedObjects.editorController.config.font.value))
        # make the annotation's background slightly shaded with the identifier color
        bg = QColor(self.distributedObjects.editorController.config.backgroundColor.value)
        fg = QColor(self.distributedObjects.editorController.config.identifierColor.value)
        self.__disAsmStyle.setPaper(mixColor(bg, .8, fg))
        self.__disAsmStyle.setColor(fg)

        self.__useBreakpointOverlays = c.useBreakpointOverlays.value
        self.getBreakpointsFromModel()
        self.setDisassemble(self.distributedObjects.editorController.config.showDisassemble.value)

        return True
    def updateConfig(self):
        if not self.__lexer or not self.__do:
            return False

        qs = QsciScintilla
        c = self.__do.editorController.config
        self.setWhitespaceVisibility(
            qs.WsVisible if c.showWhiteSpaces.value else qs.WsInvisible)
        self.setIndentationGuides(c.showIndentationGuides.value)
        self.setTabWidth(int(c.tabWidth.value))
        self.setWrapMode(qs.WrapWord if c.wrapLines.value else qs.WrapNone)
        self.setBraceMatching(
            qs.SloppyBraceMatch if c.braceMatching.value else qs.NoBraceMatch)
        l = self.__lexer
        l.setFont(formlayout.tuple_to_qfont(c.font.value))
        l.setPaper(QColor(c.backgroundColor.value))
        l.setColor(QColor(c.identifierColor.value), l.Identifier)
        l.setColor(QColor(c.identifierColor.value), l.Operator)
        l.setColor(QColor(c.keywordColor.value), l.Keyword)
        l.setColor(QColor(c.stringColor.value), l.SingleQuotedString)
        l.setColor(QColor(c.stringColor.value), l.DoubleQuotedString)
        l.setColor(QColor(c.numberColor.value), l.Number)
        l.setColor(QColor(c.commentColor.value), l.Comment)
        self.setCaretForegroundColor(QColor(c.identifierColor.value))
        self.setIndicatorForegroundColor(QColor(c.tooltipIndicatorColor.value))

        return True