diff --git a/src/Mod/Draft/DraftTrackers.py b/src/Mod/Draft/DraftTrackers.py
index c38bb770eb..ba69cca357 100644
--- a/src/Mod/Draft/DraftTrackers.py
+++ b/src/Mod/Draft/DraftTrackers.py
@@ -808,7 +808,7 @@ class wireTracker(Tracker):
class gridTracker(Tracker):
"A grid tracker"
def __init__(self):
- col = [0.2,0.2,0.3]
+ col = self.getGridColor()
pick = coin.SoPickStyle()
pick.style.setValue(coin.SoPickStyle.UNPICKABLE)
self.trans = coin.SoTransform()
@@ -844,6 +844,13 @@ class gridTracker(Tracker):
Tracker.__init__(self,children=[s],name="gridTracker")
self.reset()
+ def getGridColor(self):
+ color = Draft.getParam("gridColor", 842157055)
+ r = ((color>>24)&0xFF)/255
+ g = ((color>>16)&0xFF)/255
+ b = ((color>>8)&0xFF)/255
+ return [r, g, b]
+
def update(self):
"redraws the grid"
# resize the grid to make sure it fits an exact pair number of main lines
diff --git a/src/Mod/Draft/Resources/ui/preferences-draftsnap.ui b/src/Mod/Draft/Resources/ui/preferences-draftsnap.ui
index fa099ca5c1..e4ea23bc79 100644
--- a/src/Mod/Draft/Resources/ui/preferences-draftsnap.ui
+++ b/src/Mod/Draft/Resources/ui/preferences-draftsnap.ui
@@ -468,6 +468,50 @@
+ -
+
+
-
+
+
+ Grid color
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ The default color for new objects
+
+
+
+ 50
+ 50
+ 75
+
+
+
+ gridColor
+
+
+ Mod/Draft
+
+
+
+
+
@@ -489,11 +533,21 @@
qPixmapFromMimeSource
+
+ Gui::ColorButton
+ QPushButton
+
+
Gui::PrefSpinBox
QSpinBox
+
+ Gui::PrefColorButton
+ Gui::ColorButton
+
+
Gui::PrefCheckBox
QCheckBox