Skip to content

Commit 6854b4b

Browse files
cncc-morley
authored andcommitted
gcode_editor/qtdragon: add styleColorMarkerBackground in qtvcp gcode_editor
-to set current line marker bg color. -Updated argentinium.qss and dark_grey.qss in qtdragon_hd to use this style for better readability coded by jb0 on github cleanup
1 parent 984bbf6 commit 6854b4b

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

lib/python/qtvcp/widgets/gcode_editor.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ class EditorBase(QsciScintilla):
231231
_styleBackgroundColor = QColor("#000000")
232232
_styleSelectionForegroundColor = QColor("#ffffff")
233233
_styleSelectionBackgroundColor = QColor("#000000")
234+
_styleMarkerBackgroundColor = QColor("yellow")
234235

235236
def __init__(self, parent=None):
236237
super(EditorBase, self).__init__(parent)
@@ -262,7 +263,7 @@ def __init__(self, parent=None):
262263
# Gcode highlight line
263264
self.currentHandle = self.markerDefine(QsciScintilla.Background,
264265
self.CURRENT_MARKER_NUM)
265-
self.setMarkerBackgroundColor(QColor("yellow"),
266+
self.setMarkerBackgroundColor(self.markerBackgroundColor(),
266267
self.CURRENT_MARKER_NUM)
267268

268269
# user Highlight line
@@ -328,6 +329,9 @@ def setBackgroundColor(self, color):
328329
def backgroundColor(self):
329330
return self._styleBackgroundColor
330331

332+
def markerBackgroundColor(self):
333+
return self._styleMarkerBackgroundColor
334+
331335
# must set lexer paper background color _and_ editor background color it seems
332336
def set_background_color(self, color):
333337
self.SendScintilla(QsciScintilla.SCI_STYLESETBACK, QsciScintilla.STYLE_DEFAULT, QColor(color))
@@ -501,6 +505,13 @@ def setColorBackground(self, value):
501505
self.setBackgroundColor(value)
502506
styleColorBackground = pyqtProperty(QColor, getColorBackground, setColorBackground)
503507

508+
def getColorMarkerBackground(self):
509+
return self.markerBackgroundColor()
510+
def setColorMarkerBackground(self, value):
511+
self.setMarkerBackgroundColor(QColor(value), self.CURRENT_MARKER_NUM)
512+
self._styleMarkerBackgroundColor = QColor(value)
513+
styleColorMarkerBackground = pyqtProperty(QColor, getColorMarkerBackground, setColorMarkerBackground)
514+
504515
def getFont0(self):
505516
return self.lexer.font(0)
506517
def setFont0(self, value):

share/qtvcp/screens/qtdragon_hd/argentium.qss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ EditorBase {
460460
qproperty-styleColorMarginText: #00aaff; /* margin line numbers */
461461
qproperty-styleFontMargin: "Lato Heavy, 10 ";
462462
qproperty-styleColorBackground: #202020;
463+
qproperty-styleColorMarkerBackground: #505050; /* Current Line Marker Background */
463464
qproperty-styleColor0: #e0e0e0; /* digit characters */
464465
qproperty-styleColor1: #00eeee; /* comments */
465466
qproperty-styleColor2: #e0e0e0; /* alphabetic characters */

share/qtvcp/screens/qtdragon_hd/dark_grey.qss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ EditorBase {
465465
qproperty-styleColorMarginText: #E0E0E0; /* margin line numbers */
466466
qproperty-styleFontMargin: "Lato Heavy, 10 ";
467467
qproperty-styleColorBackground: #303030;
468+
qproperty-styleColorMarkerBackground: #505050; /* Current Line Marker Background */
468469
qproperty-styleColor0: #9ad58d; /* digit characters */
469470
qproperty-styleColor1: #9ad58d; /* comments */
470471
qproperty-styleColor2: #9ad58d; /* alphabetic characters */

0 commit comments

Comments
 (0)