random shapecolor with toggle in settings dialog

This commit is contained in:
Arne Schmidt
2018-03-01 01:26:51 +01:00
committed by Arne
parent 85f926be97
commit 767d23b987
3 changed files with 47 additions and 3 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

@@ -292,6 +292,22 @@
</widget>
</item>
<item>
<item row="0" column="2">
<widget class="Gui::PrefCheckBox" name="checkRandomColor">
<property name="text">
<string>random shapecolor</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>randomColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -322,13 +338,26 @@
<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>
<tabstop>checkRandomColor</tabstop>
<tabstop>DefaultShapeLineWidth</tabstop>
<tabstop>DefaultShapeLineColor</tabstop>
<tabstop>BoundingBoxColor</tabstop>
</tabstops>
<resources/>
<connections/>
<connections>
<connection>
<sender>checkRandomColor</sender>
<signal>toggled(bool)</signal>
<receiver>DefaultShapeColor</receiver>
<slot>setDisabled(bool)</slot>
</connection>
</connections>
</ui>