diff --git a/src/Mod/Sketcher/Gui/ConstraintFilters.h b/src/Mod/Sketcher/Gui/ConstraintFilters.h
index c48d12e626..a4f1dca849 100644
--- a/src/Mod/Sketcher/Gui/ConstraintFilters.h
+++ b/src/Mod/Sketcher/Gui/ConstraintFilters.h
@@ -49,18 +49,18 @@ namespace ConstraintFilter {
Equality = 9,
Symmetric = 10,
Block = 11,
- Datums = 12,
- HorizontalDistance = 13,
- VerticalDistance = 14,
- Distance = 15,
- Radius = 16,
- Weight = 17,
- Diameter = 18,
- Angle = 19,
- SnellsLaw = 20,
- Named = 21,
- NonDriving = 22,
- InternalAlignment = 23,
+ InternalAlignment = 12,
+ Datums = 13,
+ HorizontalDistance = 14,
+ VerticalDistance = 15,
+ Distance = 16,
+ Radius = 17,
+ Weight = 18,
+ Diameter = 19,
+ Angle = 20,
+ SnellsLaw = 21,
+ Named = 22,
+ NonDriving = 23,
NumFilterValue // SpecialFilterValue shall start at the same index as this
};
@@ -120,24 +120,22 @@ namespace ConstraintFilter {
buildBitset(FilterValue::Equality), // Equality = Just this (9)
buildBitset(FilterValue::Symmetric), // Symmetric = Just this (10)
buildBitset(FilterValue::Block), // Block = Just this (11)
+ buildBitset(FilterValue::InternalAlignment), // InternalAlignment = Just this (12)
buildBitset(FilterValue::Datums, FilterValue::Distance, FilterValue::HorizontalDistance, FilterValue::VerticalDistance, FilterValue::Radius,
- FilterValue::Weight, FilterValue::Diameter, FilterValue::Angle, FilterValue::SnellsLaw), // Datum = all others not being geometric (12)
+ FilterValue::Weight, FilterValue::Diameter, FilterValue::Angle, FilterValue::SnellsLaw), // Datum = all others not being geometric (13)
- buildBitset(FilterValue::HorizontalDistance), // HorizontalDistance = Just this (13)
- buildBitset(FilterValue::VerticalDistance), // VerticalDistance = Just this (14)
- buildBitset(FilterValue::Distance), // Distance = Just this (15)
- buildBitset(FilterValue::Radius), // Radius = Just this (16)
- buildBitset(FilterValue::Weight), // Weight = Just this (17)
- buildBitset(FilterValue::Diameter), // Diameter = Just this (18)
- buildBitset(FilterValue::Angle), // Angle = Just this (19)
- buildBitset(FilterValue::SnellsLaw), // SnellsLaw = Just this (20)
+ buildBitset(FilterValue::HorizontalDistance), // HorizontalDistance = Just this (14)
+ buildBitset(FilterValue::VerticalDistance), // VerticalDistance = Just this (15)
+ buildBitset(FilterValue::Distance), // Distance = Just this (16)
+ buildBitset(FilterValue::Radius), // Radius = Just this (17)
+ buildBitset(FilterValue::Weight), // Weight = Just this (18)
+ buildBitset(FilterValue::Diameter), // Diameter = Just this (19)
+ buildBitset(FilterValue::Angle), // Angle = Just this (20)
+ buildBitset(FilterValue::SnellsLaw), // SnellsLaw = Just this (21)
- buildBitset(FilterValue::Named), // Named = Just this (21)
- buildBitset(FilterValue::NonDriving), // NonDriving = Just this (22)
-
-
- buildBitset(FilterValue::InternalAlignment) // InternalAlignment = Just this (23)
+ buildBitset(FilterValue::Named), // Named = Just this (22)
+ buildBitset(FilterValue::NonDriving) // NonDriving = Just this (23)
};
}
diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp
index 7c9304bf73..07278ce002 100644
--- a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp
+++ b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp
@@ -637,22 +637,22 @@ void ConstraintView::swapNamedOfSelectedItems()
ConstraintFilterList::ConstraintFilterList(QWidget* parent)
: QListWidget(parent)
{
+ normalFilterCount = filterItems.size() - 2; //All filter but selected and associated
+ selectedFilterIndex = normalFilterCount;
+ associatedFilterIndex = normalFilterCount + 1;
+
for (auto const& filterItem : filterItems) {
Q_UNUSED(filterItem);
auto it = new QListWidgetItem();
it->setFlags(it->flags() | Qt::ItemIsUserCheckable);
- if(row(it) < normalFilterCount)
+ addItem(it);
+ if (row(it) < normalFilterCount)
it->setCheckState(Qt::Checked);
else //associated and selected should not be checked by default.
it->setCheckState(Qt::Unchecked);
- addItem(it);
}
languageChange();
-
- normalFilterCount = count() - 2; //All filter but selected and associated
- selectedFilterIndex = normalFilterCount;
- associatedFilterIndex = normalFilterCount + 1;
}
ConstraintFilterList::~ConstraintFilterList()
@@ -878,7 +878,7 @@ void TaskSketcherConstraints::on_showHideButton_clicked(bool val)
bool allSelected = true;
for (int i = 0; i < ui->listWidgetConstraints->count(); ++i){
QListWidgetItem* it = ui->listWidgetConstraints->item(i);
- if (it->checkState() == Qt::Unchecked) {
+ if (it->isHidden() == false && it->checkState() == Qt::Unchecked) {
allSelected = false;
break;
}
diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.h b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.h
index 30780832c9..9005291122 100644
--- a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.h
+++ b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.h
@@ -108,6 +108,7 @@ private:
{QT_TR_NOOP("Equality"),1},
{QT_TR_NOOP("Symmetric"),1},
{QT_TR_NOOP("Block"),1},
+ {QT_TR_NOOP("Internal Alignment"),1},
{QT_TR_NOOP("Datums"),0},
{QT_TR_NOOP("Horizontal Distance"),1},
{QT_TR_NOOP("Vertical Distance"),1},
@@ -119,7 +120,6 @@ private:
{QT_TR_NOOP("Snell's Law"),1},
{QT_TR_NOOP("Named"),0},
{QT_TR_NOOP("Reference"),0},
- {QT_TR_NOOP("Internal Alignment"),0},
{QT_TR_NOOP("Selected constraints"),0},
{QT_TR_NOOP("Associated constraints"),0},
};
diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.ui b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.ui
index 359032c2de..fa30af1e1c 100644
--- a/src/Mod/Sketcher/Gui/TaskSketcherConstraints.ui
+++ b/src/Mod/Sketcher/Gui/TaskSketcherConstraints.ui
@@ -45,9 +45,6 @@
-
- false
-
-
@@ -64,9 +61,6 @@
padding-left: 0px; margin-left: 0px
-
- false
-
Filters