- Posts: 5712
- Thank you received: 0
Customizing GCodeDisplay
6 years 1 month ago #184137
by phillc54
Customizing GCodeDisplay was created by phillc54
Is there a way to change colors, fonts, backgrounds etc. with stylesheets for the GCodeDisplay?
After playing around I managed to change the ScrollBars with a qss file but I couldn't change anything else.
I did manage to change some of the margin stuff from the handler file but I don't seem to be able to get any further.
This is what I did manage to do:
After playing around I managed to change the ScrollBars with a qss file but I couldn't change anything else.
I did manage to change some of the margin stuff from the handler file but I don't seem to be able to get any further.
This is what I did manage to do:
Warning: Spoiler!
Code:
self.w.gcode_display.setMarginWidth(0,44)
self.w.gcode_display.setMarginsForegroundColor(QColor('#ddbb00'))
self.w.gcode_display.setMarginsBackgroundColor(QColor('#2d2d2d'))
self.w.gcode_display.setMarkerBackgroundColor(QColor('#3d3d3d'))
self.w.gcode_display.set_background_color('#4d4d4d')
font = QFont()
font.setFamily('Lato')
font.setFixedPitch(False)
font.setPointSize(12)
font.setBold(False)
self.w.gcode_display.setMarginsFont(font)
Please Log in to join the conversation.
6 years 1 month ago #184153
by cmorley
Replied by cmorley on topic Customizing GCodeDisplay
AFAIK there is no way to change colors of the actual editor with stylesheets.
There is not a lot of info on scintilla/Qscintilla.
The best reference links are in the gcode_editor.py file
Chris
There is not a lot of info on scintilla/Qscintilla.
The best reference links are in the gcode_editor.py file
Chris
Please Log in to join the conversation.
6 years 1 month ago #184160
by cmorley
Replied by cmorley on topic Customizing GCodeDisplay
I could add a hook to catch when the styling changes and call a function in the handler file so you can parce it and decide what to do.
Please Log in to join the conversation.
6 years 1 month ago #184162
by cmorley
Replied by cmorley on topic Customizing GCodeDisplay
I forgot this reference too:
docs.huihoo.com/pyqt/QScintilla2/classQsciScintilla.html
docs.huihoo.com/pyqt/QScintilla2/classQsciScintilla.html
Please Log in to join the conversation.
5 years 11 months ago #190137
by persei8
Replied by persei8 on topic Customizing GCodeDisplay
I see you have now added the ability to style the gcodeDisplay via .qss file but none of them seem to apply to the line numbers in the left margin. The default black is hard to see with a dark background. Can this be added or should I set a lighter background? Thanks.
Jim
Jim
Please Log in to join the conversation.
5 years 11 months ago #190185
by cmorley
Replied by cmorley on topic Customizing GCodeDisplay
I think I could - I'll look into it.
Please Log in to join the conversation.
5 years 11 months ago #190189
by cmorley
Replied by cmorley on topic Customizing GCodeDisplay
ok pushed to master, here is the full deal - note background color setting has changed from previous:
Code:
EditorBase{
qproperty-styleColorBackground: lightblue;
qproperty-styleColor0: black;
qproperty-styleColor1: #000000; /* black */
qproperty-styleColor2: red;
qproperty-styleColor3: black;
qproperty-styleColor4: yellow;
qproperty-styleColorMarginText: White;
qproperty-styleColorMarginBackground: blue;
qproperty-styleFont0: "Times,12,-1,0,90,0,0,0,0,0";
qproperty-styleFont1: "Times,18,-1,0,90,1,0,0,0,0";
qproperty-styleFont2: "Times,12,-1,0,90,0,0,0,0,0";
qproperty-styleFont3: "Times,12,-1,0,90,0,0,0,0,0";
qproperty-styleFont4: "Times,12,-1,0,90,0,0,0,0,0";
qproperty-styleFontMargin: "Times,14,-1,0,90,0,0,0,0,0";
}
Please Log in to join the conversation.
Time to create page: 0.093 seconds
