コード例 #1
3
ファイル: generic_example.py プロジェクト: hofoen/pcef-core
 def on_styleActionGroup_triggered(self, action):
     """ Change current editor style """
     self.ui.genericEditor.currentStyle = styles.getStyle(action.text())
     stylesheet = ""
     if action.text() == "Dark":
         try:
             import qdarkstyle
             stylesheet = qdarkstyle.load_stylesheet()
         except ImportError:
             print "Failed to use the qdarkstyle. Please execute <pip install qdarkstyle> to fully use this theme."
     QApplication.instance().setStyleSheet(stylesheet)
コード例 #2
0
ファイル: sh.py プロジェクト: hofoen/pcef-core
    def __init__(self, parent, lexer=None):
        super(QPygmentsHighlighter, self).__init__(parent)

        self._document = QtGui.QTextDocument()
        self._formatter = HtmlFormatter(nowrap=True)
        self._lexer = lexer if lexer else PythonLexer()
        self.style = styles.getStyle("Default").pygmentsStyle
        self.enabled = True