Skip to content

Commit 8640fe4

Browse files
committed
make qcode editor visually disabled when non-writable
1 parent b4793e7 commit 8640fe4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

QCodeEditor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(self, parent, lang):
5555
def highlightBlock(self, text):
5656
cb = self.currentBlock()
5757
p = cb.position()
58-
text=self.document().toPlainText()+'\n'
58+
text=self.document().toPlainText()+' \n'
5959
highlight(text,self.lexer,self.formatter)
6060

6161
#dirty, dirty hack

__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ def __init__(self, context, parent=None):
230230
self.snippetDescription = QLineEdit()
231231
self.snippetDescription.setPlaceholderText("optional description")
232232

233+
#Make disabled edit boxes visually distinct
234+
self.setStyleSheet("QLineEdit:disabled, QCodeEditor:disabled { background-color: palette(window); }");
235+
236+
233237
#Set Editbox Size
234238
font = getMonospaceFont(self)
235239
self.edit.setFont(font)

0 commit comments

Comments
 (0)