Skip to content

Commit 0b61588

Browse files
authored
Merge pull request #2086 from jb0/gcode-lexer
gcode_editor new lexer and qss updates
2 parents a00af64 + 63f7637 commit 0b61588

File tree

8 files changed

+429
-384
lines changed

8 files changed

+429
-384
lines changed

lib/python/qtvcp/widgets/gcode_editor.py

Lines changed: 340 additions & 339 deletions
Large diffs are not rendered by default.

share/qtvcp/screens/qtdragon/argentium.qss

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -456,19 +456,30 @@ JoyPad {
456456

457457
/** GCode Display **/
458458
EditorBase {
459-
qproperty-styleColorMarginBackground: #303030;
460-
qproperty-styleColorMarginText: #00aaff; /* margin line numbers */
461-
qproperty-styleFontMargin: "Lato Heavy, 10 ";
462459
qproperty-styleColorBackground: #202020;
463-
qproperty-styleColor0: #e0e0e0; /* digit characters */
464-
qproperty-styleColor1: #00eeee; /* comments */
465-
qproperty-styleColor2: #e0e0e0; /* alphabetic characters */
466-
qproperty-styleColor3: #e0e0e0; /* assignment characters */
467-
qproperty-styleColor4: #e0e0e0; /* value characters */
468-
qproperty-styleFont0: "Lato Heavy, 10";
469-
qproperty-styleFont2: "Lato Heavy, 10";
470-
qproperty-styleColorSelectionBackground: #00aaff; /* selection background */
471-
}
460+
qproperty-styleColorMarginBackground: #303030;
461+
qproperty-styleColorMarginText: #00aaff;
462+
qproperty-styleColorMarkerBackground: #505050;
463+
qproperty-styleColorSelectionBackground: #006aff;
464+
qproperty-styleColorSelectionText: #ffffff;
465+
qproperty-styleFont: "DejaVu Sans Mono,10,-1,5,50,0,0,0,1,0";
466+
qproperty-styleFont1: "DejaVu Sans Mono,9,-1,5,50,0,0,0,1,0";
467+
qproperty-styleFont2: "DejaVu Sans Mono,10,-1,5,90,0,0,0,1,0";
468+
qproperty-styleFont3: "DejaVu Sans Mono,10,-1,5,90,0,0,0,1,0";
469+
qproperty-styleFont4: "DejaVu Sans Mono,10,-1,5,90,0,0,0,1,0";
470+
qproperty-styleFont5: "DejaVu Sans Mono,10,-1,5,90,0,0,0,1,0";
471+
qproperty-styleFont6: "DejaVu Sans Mono,10,-1,5,90,0,0,0,1,0";
472+
qproperty-styleFont7: "DejaVu Sans Mono,10,-1,5,90,0,0,0,1,0";
473+
qproperty-styleFontMargin: "DejaVu Sans Mono,8,-1,5,50,0,0,0,1,0";
474+
qproperty-styleColor0: #efefef; /* default */
475+
qproperty-styleColor1: #655d5d; /* LineNo & Comments */
476+
qproperty-styleColor2: #cf4949; /* Gcodes */
477+
qproperty-styleColor3: #f06e3b; /* Mcodes */
478+
qproperty-styleColor4: #7272ca; /* Axes */
479+
qproperty-styleColor5: #fd5187; /* Other (feed, spindle, radius, etc) */
480+
qproperty-styleColor6: #8282aa; /* Axes Values */
481+
qproperty-styleColor7: #cd6197; /* Other Values */
482+
}
472483

473484
/* warning colors for SPINDLE overrides if out of normal range*/
474485

share/qtvcp/screens/qtdragon/qtdragon_dark.qss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ QComboBox:drop-down {
175175

176176
QComboBox::item {
177177
background-color: #404040;
178-
font: 10pt "Lato Heavy";
179178
color: white;
180179
}
181180

@@ -450,4 +449,4 @@ QTabBar::tab:selected {
450449

451450
QTabBar::tab:!selected {
452451
margin-top: 2px; /* make non-selected tabs look smaller */
453-
}
452+
}

share/qtvcp/screens/qtdragon/qtdragon_dark_grey.qss

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ QComboBox::drop-down {
105105

106106
QComboBox::item {
107107
background-color: #404040;
108-
font: 10pt "Lato Heavy";
109108
color: #9ad58d;
110109
}
111110

@@ -215,6 +214,7 @@ QListView,
215214
QTreeView {
216215
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(40, 40, 40, 255), stop:1 rgba(83, 83, 83, 255));
217216
selection-background-color: transparent;
217+
qproperty-alternatingRowColors: false;
218218
border: 1px solid black;
219219
gridline-color: black;
220220
font: 10pt "Lato Heavy";
@@ -387,8 +387,23 @@ QHeaderView::section {
387387
padding: 5px;
388388
}
389389

390-
GCodeEditor#gcode_viewer {
391-
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(40, 40, 40, 255), stop:1 rgba(83, 83, 83, 255));
390+
/** GCode Display **/
391+
EditorBase {
392+
qproperty-styleColorBackground: #303030;
393+
qproperty-styleColorMarginBackground: #202020;
394+
qproperty-styleColorMarginText: #E0E0E0; /* margin line numbers */
395+
qproperty-styleColorMarkerBackground: #505050; /* Current Line Marker Background */
396+
qproperty-styleFont: "Lato Heavy, 10";
397+
qproperty-styleFont1: "Lato Heavy, 9"; /* comments */
398+
qproperty-styleFontMargin: "Lato Heavy, 9";
399+
qproperty-styleColor0: #efefef; /* default */
400+
qproperty-styleColor1: #788a74; /* LineNo & Comments */
401+
qproperty-styleColor2: #5f6cd9; /* Gcodes */
402+
qproperty-styleColor3: #9157cf; /* Mcodes */
403+
qproperty-styleColor4: #598f4d; /* Axes */
404+
qproperty-styleColor5: #598f4d; /* Other (feed, spindle, radius, etc) */
405+
qproperty-styleColor6: #9ad58d; /* Axes Values */
406+
qproperty-styleColor7: #9ad58d; /* Other Values */
392407
}
393408

394409
QStackedWidget {
@@ -463,4 +478,4 @@ QTabWidget::pane {
463478
border: 1px solid gray;
464479
top:-1px;
465480
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #606060, stop:1 #202020);
466-
}
481+
}

share/qtvcp/screens/qtdragon_hd/argentium.qss

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -454,22 +454,33 @@ JoyPad {
454454
qproperty-HighlightColor: #00aaff;
455455
}
456456

457+
457458
/** GCode Display **/
458459
EditorBase {
459-
qproperty-styleColorMarginBackground: #303030;
460-
qproperty-styleColorMarginText: #00aaff; /* margin line numbers */
461-
qproperty-styleFontMargin: "Lato Heavy, 10 ";
462460
qproperty-styleColorBackground: #202020;
463-
qproperty-styleColorMarkerBackground: #505050; /* Current Line Marker Background */
464-
qproperty-styleColor0: #e0e0e0; /* digit characters */
465-
qproperty-styleColor1: #00eeee; /* comments */
466-
qproperty-styleColor2: #e0e0e0; /* alphabetic characters */
467-
qproperty-styleColor3: #e0e0e0; /* assignment characters */
468-
qproperty-styleColor4: #e0e0e0; /* value characters */
469-
qproperty-styleFont0: "Lato Heavy, 10";
470-
qproperty-styleFont2: "Lato Heavy, 10";
471-
qproperty-styleColorSelectionBackground: #00aaff; /* selection background */
472-
}
461+
qproperty-styleColorMarginBackground: #303030;
462+
qproperty-styleColorMarginText: #00aaff;
463+
qproperty-styleColorMarkerBackground: #505050;
464+
qproperty-styleColorSelectionBackground: #006aff;
465+
qproperty-styleColorSelectionText: #ffffff;
466+
qproperty-styleFont: "DejaVu Sans Mono,10,-1,5,50,0,0,0,1,0";
467+
qproperty-styleFont1: "DejaVu Sans Mono,9,-1,5,50,0,0,0,1,0";
468+
qproperty-styleFont2: "DejaVu Sans Mono,10,-1,5,90,0,0,0,1,0";
469+
qproperty-styleFont3: "DejaVu Sans Mono,10,-1,5,90,0,0,0,1,0";
470+
qproperty-styleFont4: "DejaVu Sans Mono,10,-1,5,90,0,0,0,1,0";
471+
qproperty-styleFont5: "DejaVu Sans Mono,10,-1,5,90,0,0,0,1,0";
472+
qproperty-styleFont6: "DejaVu Sans Mono,10,-1,5,90,0,0,0,1,0";
473+
qproperty-styleFont7: "DejaVu Sans Mono,10,-1,5,90,0,0,0,1,0";
474+
qproperty-styleFontMargin: "DejaVu Sans Mono,8,-1,5,50,0,0,0,1,0";
475+
qproperty-styleColor0: #efefef; /* default */
476+
qproperty-styleColor1: #655d5d; /* LineNo & Comments */
477+
qproperty-styleColor2: #cf4949; /* Gcodes */
478+
qproperty-styleColor3: #f06e3b; /* Mcodes */
479+
qproperty-styleColor4: #7272ca; /* Axes */
480+
qproperty-styleColor5: #fd5187; /* Other (feed, spindle, radius, etc) */
481+
qproperty-styleColor6: #8282aa; /* Axes Values */
482+
qproperty-styleColor7: #cd6197; /* Other Values */
483+
}
473484

474485
/* warning colors for SPINDLE overrides if out of normal range*/
475486

share/qtvcp/screens/qtdragon_hd/dark.qss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ QStatusBar {
88
color: #FFFFD0;
99
}
1010

11+
/** Pushbuttons **/
12+
QToolButton,
1113
QPushButton,
1214
ActionButton,
1315
SystemToolButton,
@@ -168,7 +170,6 @@ QComboBox:drop-down {
168170

169171
QComboBox::item {
170172
background-color: #404040;
171-
font: 10pt "Lato Heavy";
172173
color: white;
173174
}
174175

@@ -445,4 +446,4 @@ QTabBar::tab:selected {
445446

446447
QTabBar::tab:!selected {
447448
margin-top: 2px; /* make non-selected tabs look smaller */
448-
}
449+
}

share/qtvcp/screens/qtdragon_hd/dark_grey.qss

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ QToolTip
1313
}
1414

1515
/** Pushbuttons **/
16+
QToolButton,
1617
QPushButton,
1718
ActionButton,
1819
SystemToolButton,
@@ -104,7 +105,6 @@ QComboBox::drop-down {
104105

105106
QComboBox::item {
106107
background-color: #404040;
107-
font: 10pt "Lato Heavy";
108108
color: #9ad58d;
109109
}
110110

@@ -235,6 +235,7 @@ QListView,
235235
QTreeView {
236236
background: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(40, 40, 40, 255), stop:1 rgba(83, 83, 83, 255));
237237
selection-background-color: transparent;
238+
qproperty-alternatingRowColors: false;
238239
border: 1px solid black;
239240
gridline-color: black;
240241
font: 10pt "Lato Heavy";
@@ -461,16 +462,19 @@ QStatusBar {
461462

462463
/** GCode Display **/
463464
EditorBase {
464-
qproperty-styleColorMarginBackground: #303030;
465-
qproperty-styleColorMarginText: #E0E0E0; /* margin line numbers */
466-
qproperty-styleFontMargin: "Lato Heavy, 10 ";
467465
qproperty-styleColorBackground: #303030;
466+
qproperty-styleColorMarginBackground: #202020;
467+
qproperty-styleColorMarginText: #E0E0E0; /* margin line numbers */
468468
qproperty-styleColorMarkerBackground: #505050; /* Current Line Marker Background */
469-
qproperty-styleColor0: #9ad58d; /* digit characters */
470-
qproperty-styleColor1: #9ad58d; /* comments */
471-
qproperty-styleColor2: #9ad58d; /* alphabetic characters */
472-
qproperty-styleColor3: #9ad58d; /* assignment characters */
473-
qproperty-styleColor4: #9ad58d; /* value characters */
474-
qproperty-styleFont0: "Lato Heavy, 10";
475-
qproperty-styleFont2: "Lato Heavy, 10";
469+
qproperty-styleFont: "Lato Heavy, 10";
470+
qproperty-styleFont1: "Lato Heavy, 9"; /* comments */
471+
qproperty-styleFontMargin: "Lato Heavy, 9";
472+
qproperty-styleColor0: #efefef; /* default */
473+
qproperty-styleColor1: #788a74; /* LineNo & Comments */
474+
qproperty-styleColor2: #5f6cd9; /* Gcodes */
475+
qproperty-styleColor3: #9157cf; /* Mcodes */
476+
qproperty-styleColor4: #598f4d; /* Axes */
477+
qproperty-styleColor5: #598f4d; /* Other (feed, spindle, radius, etc) */
478+
qproperty-styleColor6: #9ad58d; /* Axes Values */
479+
qproperty-styleColor7: #9ad58d; /* Other Values */
476480
}

share/qtvcp/screens/qtdragon_hd/metal.qss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ QMainWindow {
22
background-image: url(:/images/images/brushed_metal.png);
33
}
44

5+
6+
/** Pushbuttons **/
7+
QToolButton,
58
QPushButton,
69
ActionButton,
710
SystemToolButton,
@@ -225,4 +228,4 @@ QCheckBox::indicator:unchecked {
225228
background-color: darkgray;
226229
height: 25px;
227230
width: 25px;
228-
}
231+
}

0 commit comments

Comments
 (0)