Merge branch 'randomshapecolor' of https://github.com/dulouie/FreeCAD into dul

This commit is contained in:
Yorik van Havre
2018-04-25 09:45:12 -03:00
3 changed files with 162 additions and 108 deletions

View File

@@ -41,6 +41,7 @@ DlgSettingsObjectColor::DlgSettingsObjectColor(QWidget* parent)
: PreferencePage(parent)
{
this->setupUi(this);
this->DefaultShapeColor->setDisabled(this->checkRandomColor->isChecked());
}
/**
@@ -55,6 +56,7 @@ void DlgSettingsObjectColor::saveSettings()
{
// Part
DefaultShapeColor->onSave();
checkRandomColor->onSave();
DefaultShapeLineColor->onSave();
DefaultShapeLineWidth->onSave();
DefaultShapeVertexColor->onSave();
@@ -68,6 +70,7 @@ void DlgSettingsObjectColor::loadSettings()
{
// Part
DefaultShapeColor->onRestore();
checkRandomColor->onRestore();
DefaultShapeLineColor->onRestore();
DefaultShapeLineWidth->onRestore();
DefaultShapeVertexColor->onRestore();

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>332</width>
<height>331</height>
<width>476</width>
<height>395</height>
</rect>
</property>
<property name="windowTitle">
@@ -22,6 +22,32 @@
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0">
<widget class="QLabel" name="label_10">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Default vertex color</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_8">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Bounding box color</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="minimumSize">
@@ -35,45 +61,12 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::PrefColorButton" name="DefaultShapeColor">
<property name="toolTip">
<string>The default color for new shapes</string>
</property>
<property name="color">
<color>
<red>204</red>
<green>204</green>
<blue>204</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>DefaultShapeColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Default line color</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefColorButton" name="DefaultShapeLineColor">
<property name="toolTip">
<string>The default line color for new shapes</string>
</property>
<property name="color">
<property name="color" stdset="0">
<color>
<red>25</red>
<green>25</green>
@@ -88,16 +81,23 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
<item row="0" column="1">
<widget class="Gui::PrefColorButton" name="DefaultShapeColor">
<property name="toolTip">
<string>The default color for new shapes</string>
</property>
<property name="text">
<string>Default line width</string>
<property name="color" stdset="0">
<color>
<red>204</red>
<green>204</green>
<blue>204</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>DefaultShapeColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
@@ -123,52 +123,6 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_10">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Default vertex color</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::PrefColorButton" name="DefaultShapeVertexColor">
<property name="toolTip">
<string>The default line color for new shapes</string>
</property>
<property name="color">
<color>
<red>25</red>
<green>25</green>
<blue>25</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>DefaultShapeVertexColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_11">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Default vertex size</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="Gui::PrefSpinBox" name="DefaultShapeVertexWidth">
<property name="toolTip">
@@ -191,25 +145,12 @@
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_8">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Bounding box color</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="Gui::PrefColorButton" name="BoundingBoxColor">
<property name="toolTip">
<string>The color of bounding boxes in the 3D view</string>
</property>
<property name="color">
<property name="color" stdset="0">
<color>
<red>255</red>
<green>255</green>
@@ -224,6 +165,81 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_11">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Default vertex size</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Default line width</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="minimumSize">
<size>
<width>182</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Default line color</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::PrefColorButton" name="DefaultShapeVertexColor">
<property name="toolTip">
<string>The default line color for new shapes</string>
</property>
<property name="color" stdset="0">
<color>
<red>25</red>
<green>25</green>
<blue>25</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>DefaultShapeVertexColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="Gui::PrefCheckBox" name="checkRandomColor">
<property name="text">
<string>random shapecolor</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>RandomColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item>
@@ -322,6 +338,11 @@
<extends>Gui::ColorButton</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefCheckBox</class>
<extends>QCheckBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>DefaultShapeColor</tabstop>
@@ -330,5 +351,22 @@
<tabstop>BoundingBoxColor</tabstop>
</tabstops>
<resources/>
<connections/>
<connections>
<connection>
<sender>checkRandomColor</sender>
<signal>toggled(bool)</signal>
<receiver>DefaultShapeColor</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>