Open sborho opened 5 years ago
I don't think you can theme the QsciScintilla editor with Qt Style Sheets - the Scintilla editor has it's own methods for setting colors of the background, text, formatters, etc, which goes beyond what Qt style sheets do. I feel like a lot of work would have to be done in the Qt wrapper for Scintilla to translate style sheet properties to the necessary properties on the editor - which would be very complicated when you start dealing with Lexers, Syntax Highlighting, Formatters for Selection, Find/Replace, etc.
Here's some old evidence that it's not available. This isn't definitive, but at least supports my statement: https://www.riverbankcomputing.com/pipermail/qscintilla/2008-October/000373.html
For my application I had to develop my own color pallette for the editor and syntax highlighting lexer I built to match the qdarkstyle colors.
Hmm, I do see a mention in the Scintilla Changelog about CSS styling for GTK.
"Switch from deprecated style calls to CSS styling."
Need some more checks it should be nice if it works @flutefreak7
@goanpeca any thoughts about this? Tks
No idea on the topic, would have to investigate
Although there is no style sheet you can probably do a custom settings file, parse it and feed it into the methods given within QsciScintilla. For example:
self.editor = QsciScintilla()
self.editor.setPaper(QColor('#151516')) # this changes the text editor background
self.editor.setColor(QColor('#FFFFFF')) # set text color
self.editor.setCaretForegroundColor(QColor('#FFFFFF')) # sets text caret color
Found it here: https://riverbankcomputing.com/pipermail/pyqt/2009-July/023783.html
Works in PyQt6.
Hope this helps.
thank you