Sketcher: Hide Internal Alignment Constraints
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
#include <boost/bind.hpp>
|
||||
#include <Gui/Command.h>
|
||||
#include <Gui/MainWindow.h>
|
||||
#include <Gui/PrefWidgets.h>
|
||||
|
||||
using namespace SketcherGui;
|
||||
using namespace Gui::TaskView;
|
||||
@@ -547,17 +548,24 @@ TaskSketcherConstrains::TaskSketcherConstrains(ViewProviderSketch *sketchView)
|
||||
ui->listWidgetConstraints, SIGNAL(onUpdateDrivingStatus(QListWidgetItem *, bool)),
|
||||
this , SLOT (on_listWidgetConstraints_updateDrivingStatus(QListWidgetItem *, bool))
|
||||
);
|
||||
QObject::connect(
|
||||
ui->filterInternalAlignment, SIGNAL(stateChanged(int)),
|
||||
this , SLOT (on_filterInternalAlignment_stateChanged(int))
|
||||
);
|
||||
|
||||
connectionConstraintsChanged = sketchView->signalConstraintsChanged.connect(
|
||||
boost::bind(&SketcherGui::TaskSketcherConstrains::slotConstraintsChanged, this));
|
||||
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
||||
this->ui->filterInternalAlignment->onRestore();
|
||||
|
||||
slotConstraintsChanged();
|
||||
}
|
||||
|
||||
TaskSketcherConstrains::~TaskSketcherConstrains()
|
||||
{
|
||||
this->ui->filterInternalAlignment->onSave();
|
||||
connectionConstraintsChanged.disconnect();
|
||||
delete ui;
|
||||
}
|
||||
@@ -610,6 +618,12 @@ void TaskSketcherConstrains::on_comboBoxFilter_currentIndexChanged(int)
|
||||
slotConstraintsChanged();
|
||||
}
|
||||
|
||||
void TaskSketcherConstrains::on_filterInternalAlignment_stateChanged(int state)
|
||||
{
|
||||
Q_UNUSED(state);
|
||||
slotConstraintsChanged();
|
||||
}
|
||||
|
||||
void TaskSketcherConstrains::on_listWidgetConstraints_emitCenterSelectedItems()
|
||||
{
|
||||
sketchView->centerSelection();
|
||||
@@ -740,6 +754,7 @@ void TaskSketcherConstrains::slotConstraintsChanged(void)
|
||||
bool showDatums = (Filter < 3);
|
||||
bool showNamed = (Filter == 3 && !(constraint->Name.empty()));
|
||||
bool showNonDriving = (Filter == 4 && !constraint->isDriving);
|
||||
bool hideInternalAligment = this->ui->filterInternalAlignment->isChecked();
|
||||
|
||||
switch(constraint->Type) {
|
||||
case Sketcher::Horizontal:
|
||||
@@ -762,7 +777,7 @@ void TaskSketcherConstrains::slotConstraintsChanged(void)
|
||||
visible = (showDatums || showNamed || showNonDriving);
|
||||
break;
|
||||
case Sketcher::InternalAlignment:
|
||||
visible = (showNormal || showNamed);
|
||||
visible = ((showNormal || showNamed) && !hideInternalAligment);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ public Q_SLOTS:
|
||||
void on_listWidgetConstraints_itemChanged(QListWidgetItem * item);
|
||||
void on_listWidgetConstraints_updateDrivingStatus(QListWidgetItem *item, bool status);
|
||||
void on_listWidgetConstraints_emitCenterSelectedItems(void);
|
||||
void on_filterInternalAlignment_stateChanged(int state);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
@@ -57,6 +57,22 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefCheckBox" name="filterInternalAlignment">
|
||||
<property name="text">
|
||||
<string>Hide Internal Aligment</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>HideInternalAlignment</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Sketcher</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ConstraintView" name="listWidgetConstraints">
|
||||
<property name="modelColumn">
|
||||
@@ -72,6 +88,11 @@
|
||||
<extends>QListWidget</extends>
|
||||
<header location="global">QListWidget</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Gui::PrefCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
Reference in New Issue
Block a user