Refactoring.

Use Visualization::AngleToUser method to show angle values in a tooltip.
This commit is contained in:
Roman Telezhynskyi 2022-08-24 19:52:47 +03:00
parent f9bc111159
commit b5ec1e61b8
7 changed files with 17 additions and 36 deletions

View File

@ -169,22 +169,14 @@ void VisToolMove::RefreshGeometry()
{
SetToolTip(tr("Length = %1%2, angle = %3°, <b>%4</b> - sticking angle, "
"<b>Mouse click</b> - finish selecting a position")
.arg(VAbstractApplication::VApp()->TrVars()->FormulaToUser(
QString::number(VAbstractValApplication::VApp()->fromPixel(tempLength)),
VAbstractApplication::VApp()->Settings()->GetOsSeparator()), prefix)
.arg(tempAngle)
.arg(VModifierKey::Shift()));
.arg(LengthToUser(tempLength), prefix, AngleToUser(tempAngle), VModifierKey::Shift()));
}
else
{
SetToolTip(tr("Length = %1%2, angle = %3°, rotation angle = %4°, <b>%5</b> - sticking angle, "
"<b>%6</b> - change rotation origin point, <b>Mouse click</b> - finish creating")
.arg(VAbstractApplication::VApp()->TrVars()->FormulaToUser(
QString::number(VAbstractValApplication::VApp()->fromPixel(tempLength)),
VAbstractApplication::VApp()->Settings()->GetOsSeparator()), prefix)
.arg(tempAngle)
.arg(tempRoationAngle)
.arg(VModifierKey::Shift(), VModifierKey::Control()));
.arg(LengthToUser(tempLength), prefix, AngleToUser(tempAngle), AngleToUser(tempRoationAngle),
VModifierKey::Shift(), VModifierKey::Control()));
}
CreateMovedRotatedObjects(iPoint, iCurve, tempLength, tempAngle, tempRoationAngle, origin);

View File

@ -114,8 +114,7 @@ void VisToolRotation::RefreshGeometry()
SetToolTip(tr("Rotating angle = %1°, <b>%2</b> - sticking angle, "
"<b>Mouse click</b> - finish creation")
.arg(tempAngle)
.arg(VModifierKey::Shift()));
.arg(AngleToUser(tempAngle), VModifierKey::Shift()));
}
int iPoint = -1;

View File

@ -92,8 +92,7 @@ void VisToolCurveIntersectAxis::RefreshGeometry()
SetToolTip(tr("<b>Intersection curve and axis</b>: angle = %1°; <b>%2</b> - "
"sticking angle, <b>%3</b> - finish creation")
.arg(this->line().angle())
.arg(VModifierKey::Shift(), VModifierKey::EnterKey()));
.arg(AngleToUser(this->line().angle()), VModifierKey::Shift(), VModifierKey::EnterKey()));
}
}
}

View File

@ -88,12 +88,8 @@ void VisToolEndLine::RefreshGeometry()
static const QString prefix = UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true);
SetToolTip(tr("<b>Point at distance and angle</b>: angle = %1°, length = %2%3; "
"<b>%4</b> - sticking angle, <b>%5</b> - finish creation")
.arg(this->line().angle())
.arg(VAbstractApplication::VApp()->TrVars()
->FormulaToUser(
QString::number(VAbstractValApplication::VApp()->fromPixel(this->line().length())),
VAbstractApplication::VApp()->Settings()->GetOsSeparator()),
prefix, VModifierKey::Shift(), VModifierKey::EnterKey()));
.arg(AngleToUser(this->line().angle()), LengthToUser(this->line().length()), prefix,
VModifierKey::Shift(), VModifierKey::EnterKey()));
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -107,8 +107,8 @@ void VisToolLineIntersectAxis::RefreshGeometry()
SetToolTip(tr("<b>Intersection line and axis</b>: angle = %1°; <b>%2</b> - "
"sticking angle, <b>%3</b> - finish creation")
.arg(this->line().angle())
.arg(VModifierKey::Shift(), VModifierKey::EnterKey()));
.arg(AngleToUser(this->line().angle()), VModifierKey::Shift(),
VModifierKey::EnterKey()));
}
}
}

View File

@ -112,9 +112,8 @@ void VisToolArc::RefreshGeometry()
"<b>Mouse click</b> - finish selecting the first angle, "
"<b>%4</b> - sticking angle, "
"<b>%5</b> - skip")
.arg(LengthToUser(m_radius), prefix)
.arg(f1Angle)
.arg(VModifierKey::Shift(), VModifierKey::EnterKey()));
.arg(LengthToUser(m_radius), prefix, AngleToUser(f1Angle), VModifierKey::Shift(),
VModifierKey::EnterKey()));
}
else if (m_f1 >= 0)
{
@ -129,10 +128,8 @@ void VisToolArc::RefreshGeometry()
"<b>%5</b> - sticking angle, "
"<b>%6</b> - sticking end, "
"<b>%7</b> - skip")
.arg(LengthToUser(m_radius), prefix)
.arg(m_f1)
.arg(f2Angle)
.arg(VModifierKey::Shift(), VModifierKey::Control(), VModifierKey::EnterKey()));
.arg(LengthToUser(m_radius), prefix, AngleToUser(m_f1), AngleToUser(f2Angle),
VModifierKey::Shift(), VModifierKey::Control(), VModifierKey::EnterKey()));
}
}
else

View File

@ -109,9 +109,8 @@ void VisToolArcWithLength::RefreshGeometry()
"<b>Mouse click</b> - finish selecting the first angle, "
"<b>%4</b> - sticking angle, "
"<b>%5</b> - skip")
.arg(LengthToUser(m_radius), prefix)
.arg(f1Angle)
.arg(VModifierKey::Shift(), VModifierKey::EnterKey()));
.arg(LengthToUser(m_radius), prefix, AngleToUser(f1Angle), VModifierKey::Shift(),
VModifierKey::EnterKey()));
}
else if (m_f1 >= 0)
{
@ -123,9 +122,8 @@ void VisToolArcWithLength::RefreshGeometry()
SetToolTip(tr("<b>Arc</b>: radius = %1%2, first angle = %3°, arc length = %4%2; "
"<b>Mouse click</b> - finish creating, "
"<b>%5</b> - skip")
.arg(LengthToUser(m_radius), prefix)
.arg(m_f1)
.arg(LengthToUser(arc.GetLength()), VModifierKey::EnterKey()));
.arg(LengthToUser(m_radius), prefix, AngleToUser(m_f1), LengthToUser(arc.GetLength()),
VModifierKey::EnterKey()));
}
}
else