[TD]allow showing units on individual dimensions

This commit is contained in:
wandererfan
2025-01-24 13:04:00 -05:00
parent 06143dcb15
commit 2bc9f2ea1f
7 changed files with 29 additions and 26 deletions

View File

@@ -231,6 +231,8 @@ DrawViewDimension::DrawViewDimension()
"If true, area dimensions return the area of the face minus the areas of any enclosed faces. \
If false, the area of the face's outer boundary is returned.");
ADD_PROPERTY_TYPE(ShowUnits, (Preferences::showUnits()), "Format", App::Prop_None,
"Show or hide the units.");
measurement = new Measure::Measurement();
// TODO: should have better initial datumLabel position than (0, 0) in the DVP?? something
// closer to the object being measured?
@@ -2076,7 +2078,7 @@ bool DrawViewDimension::hasOverUnderTolerance() const
bool DrawViewDimension::showUnits() const
{
return Preferences::getPreferenceGroup("Dimensions")->GetBool("ShowUnits", false);
return ShowUnits.getValue();
}
bool DrawViewDimension::useDecimals() const

View File

@@ -94,6 +94,8 @@ public:
App::PropertyVectorList BoxCorners;
App::PropertyBool UseActualArea;
App::PropertyBool ShowUnits;
enum RefType
{
invalidRef,

View File

@@ -682,3 +682,11 @@ bool Preferences::useLegacySvgScaling()
{
return getPreferenceGroup("General")->GetBool("LegacySvgScaling", false);
}
bool Preferences::showUnits()
{
return Preferences::getPreferenceGroup("Dimensions")->GetBool("ShowUnits", false);
}

View File

@@ -159,6 +159,8 @@ public:
static bool useLegacySvgScaling();
static bool showUnits();
};