Changeset View
Changeset View
Standalone View
Standalone View
plugins/extensions/pykrita/plugin/plugins/scripter/scripter.py
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 48 | def openSettings(self): | |||
---|---|---|---|---|---|
51 | self.settingsDialog.setFixedSize(400, 250) | 51 | self.settingsDialog.setFixedSize(400, 250) | ||
52 | self.settingsDialog.show() | 52 | self.settingsDialog.show() | ||
53 | self.settingsDialog.exec() | 53 | self.settingsDialog.exec() | ||
54 | 54 | | |||
55 | def showScripter(self): | 55 | def showScripter(self): | ||
56 | dialog = QDialog() | 56 | dialog = QDialog() | ||
57 | dialog.setWindowModality(Qt.NonModal) | 57 | dialog.setWindowModality(Qt.NonModal) | ||
58 | self.editor = pythoneditor.CodeEditor() | 58 | self.editor = pythoneditor.CodeEditor() | ||
59 | f = QFont("monospace", 10, QFont.Normal) | | |||
60 | f.setFixedPitch(True) | | |||
61 | self.editor.document().setDefaultFont(f) | | |||
62 | self.highlight = syntax.PythonHighlighter(self.editor.document(), syntaxstyles.DefaultSyntaxStyle()) | 59 | self.highlight = syntax.PythonHighlighter(self.editor.document(), syntaxstyles.DefaultSyntaxStyle()) | ||
63 | vbox = QVBoxLayout(dialog) | 60 | vbox = QVBoxLayout(dialog) | ||
64 | vbox.addWidget(self.editor) | 61 | vbox.addWidget(self.editor) | ||
65 | buttonLayout = QHBoxLayout() | 62 | buttonLayout = QHBoxLayout() | ||
66 | button = QPushButton("Run") | 63 | button = QPushButton("Run") | ||
67 | settingsButton = QPushButton("Settings") | 64 | settingsButton = QPushButton("Settings") | ||
68 | button.clicked.connect(self.execute) | 65 | button.clicked.connect(self.execute) | ||
69 | settingsButton.clicked.connect(self.openSettings) | 66 | settingsButton.clicked.connect(self.openSettings) | ||
Show All 14 Lines |