Add draft grid color setting
This commit is contained in:
committed by
Yorik van Havre
parent
32969dde1f
commit
8cf155fbc9
@@ -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
|
||||
|
||||
@@ -468,6 +468,50 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Grid color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefColorButton" name="gui::prefcolorbutton">
|
||||
<property name="toolTip">
|
||||
<string>The default color for new objects</string>
|
||||
</property>
|
||||
<property name="color" stdset="0">
|
||||
<color>
|
||||
<red>50</red>
|
||||
<green>50</green>
|
||||
<blue>75</blue>
|
||||
</color>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>gridColor</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Draft</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -489,11 +533,21 @@
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::ColorButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>Gui/Widgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefSpinBox</class>
|
||||
<extends>QSpinBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefColorButton</class>
|
||||
<extends>Gui::ColorButton</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
|
||||
Reference in New Issue
Block a user