Customizing GCodeDisplay
28 Sep 2020 11:03 #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!
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)
The following user(s) said Thank You: pinder
Please Log in or Create an account to join the conversation.
28 Sep 2020 12:16 #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
The following user(s) said Thank You: phillc54
Please Log in or Create an account to join the conversation.
28 Sep 2020 12:32 #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.
The following user(s) said Thank You: phillc54
Please Log in or Create an account to join the conversation.
28 Sep 2020 12:37 #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
The following user(s) said Thank You: phillc54, tommylight
Please Log in or Create an account to join the conversation.
23 Nov 2020 19:09 #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 or Create an account to join the conversation.
24 Nov 2020 03:04 #190185
by cmorley
Replied by cmorley on topic Customizing GCodeDisplay
I think I could - I'll look into it.
Please Log in or Create an account to join the conversation.
24 Nov 2020 05:45 #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:
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";
}
The following user(s) said Thank You: phillc54
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.452 seconds