[TD]change misleading prop name - Shape

This commit is contained in:
wandererfan
2020-06-11 09:25:31 -04:00
committed by WandererFan
parent 0e4d893651
commit c92d725aed
4 changed files with 22 additions and 22 deletions

View File

@@ -50,7 +50,7 @@
#include <Mod/Measure/App/Measurement.h>
#include "Preferences.h"
#include "Preferences.h"
#include "Geometry.h"
#include "DrawViewPart.h"
#include "DrawViewBalloon.h"
@@ -99,8 +99,8 @@ DrawViewBalloon::DrawViewBalloon(void)
EndType.setEnums(ArrowPropEnum::ArrowTypeEnums);
ADD_PROPERTY(EndType,(prefEnd()));
Shape.setEnums(balloonTypeEnums);
ADD_PROPERTY(Shape,(prefShape()));
BubbleShape.setEnums(balloonTypeEnums);
ADD_PROPERTY(BubbleShape,(prefShape()));
ADD_PROPERTY_TYPE(ShapeScale,(1.0),"",(App::PropertyType)(App::Prop_None),"Balloon shape scale");
ShapeScale.setConstraints(&SymbolScaleRange);
@@ -124,7 +124,7 @@ void DrawViewBalloon::onChanged(const App::Property* prop)
{
if (!isRestoring()) {
if ( (prop == &EndType) ||
(prop == &Shape) ||
(prop == &BubbleShape) ||
(prop == &Text) ||
(prop == &KinkLength) ) {
requestPaint();
@@ -137,20 +137,20 @@ void DrawViewBalloon::handleChangedPropertyName(Base::XMLReader &reader, const c
{
Base::Type type = Base::Type::fromName(TypeName);
// was sourceView in the past, now is SourceView
if (SourceView.getClassTypeId() == type && strcmp(PropName, "sourceView") == 0)
if (SourceView.getClassTypeId() == type && strcmp(PropName, "sourceView") == 0) {
SourceView.Restore(reader);
else
DrawView::handleChangedPropertyName(reader, TypeName, PropName);
// was Symbol in the past, now is Shape
if (Shape.getClassTypeId() == type && strcmp(PropName, "Symbol") == 0)
Shape.Restore(reader);
else
DrawView::handleChangedPropertyName(reader, TypeName, PropName);
// was SymbolScale in the past, now is ShapeScale
if (ShapeScale.getClassTypeId() == type && strcmp(PropName, "SymbolScale") == 0)
} else if (BubbleShape.getClassTypeId() == type && strcmp(PropName, "Symbol") == 0) {
// was Symbol, then Shape in the past, now is BubbleShape
BubbleShape.Restore(reader);
} else if (BubbleShape.getClassTypeId() == type && strcmp(PropName, "Shape") == 0) {
// was Symbol, then Shape in the past, now is BubbleShape
BubbleShape.Restore(reader);
} else if (ShapeScale.getClassTypeId() == type && strcmp(PropName, "SymbolScale") == 0) {
// was SymbolScale in the past, now is ShapeScale
ShapeScale.Restore(reader);
else
} else {
DrawView::handleChangedPropertyName(reader, TypeName, PropName);
}
}
void DrawViewBalloon::handleChangedPropertyType(Base::XMLReader &reader, const char *TypeName, App::Property *prop)
@@ -274,7 +274,7 @@ int DrawViewBalloon::prefShape(void) const
}
int DrawViewBalloon::prefEnd(void) const
{
{
return Preferences::balloonArrow();
}

View File

@@ -52,7 +52,7 @@ public:
App::PropertyLink SourceView;
App::PropertyString Text;
App::PropertyEnumeration EndType;
App::PropertyEnumeration Shape;
App::PropertyEnumeration BubbleShape;
App::PropertyFloatConstraint ShapeScale;
App::PropertyDistance OriginX;
App::PropertyDistance OriginY;

View File

@@ -440,7 +440,7 @@ void QGIViewBalloon::updateBalloon(bool obtuse)
balloonLabel->verticalSep = false;
balloonLabel->seps.clear();
if (strcmp(balloon->Shape.getValueAsString(), "Rectangle") == 0) {
if (strcmp(balloon->BubbleShape.getValueAsString(), "Rectangle") == 0) {
while (labelText.contains(QString::fromUtf8("|"))) {
int pos = labelText.indexOf(QString::fromUtf8("|"));
labelText.replace(pos, 1, QString::fromUtf8(" "));
@@ -614,7 +614,7 @@ void QGIViewBalloon::draw()
Base::Vector3d kinkPoint;
double kinkLength = Rez::guiX(balloon->KinkLength.getValue());
const char *balloonType = balloon->Shape.getValueAsString();
const char *balloonType = balloon->BubbleShape.getValueAsString();
float scale = balloon->ShapeScale.getValue();
double offsetLR = 0;

View File

@@ -83,7 +83,7 @@ TaskBalloon::TaskBalloon(QGIViewBalloon *parent, ViewProviderBalloon *balloonVP)
ui->comboEndType->setCurrentIndex(i);
connect(ui->comboEndType, SIGNAL(currentIndexChanged(int)), this, SLOT(onEndTypeChanged()));
i = parent->dvBalloon->Shape.getValue();
i = parent->dvBalloon->BubbleShape.getValue();
ui->comboSymbol->setCurrentIndex(i);
connect(ui->comboSymbol, SIGNAL(currentIndexChanged(int)), this, SLOT(onShapeChanged()));
@@ -122,7 +122,7 @@ bool TaskBalloon::accept()
m_balloonVP->Fontsize.setValue(ui->qsbFontSize->value().getValue());
m_parent->dvBalloon->ShapeScale.setValue(ui->inputScale->value().getValue());
m_parent->dvBalloon->EndType.setValue(ui->comboEndType->currentIndex());
m_parent->dvBalloon->Shape.setValue(ui->comboSymbol->currentIndex());
m_parent->dvBalloon->BubbleShape.setValue(ui->comboSymbol->currentIndex());
m_balloonVP->LineWidth.setValue(ui->qsbLineWidth->value().getValue());
m_parent->dvBalloon->KinkLength.setValue(ui->qsbBalloonKink->value().getValue());
m_parent->updateView(true);
@@ -164,7 +164,7 @@ void TaskBalloon::onFontsizeChanged()
void TaskBalloon::onShapeChanged()
{
m_parent->dvBalloon->Shape.setValue(ui->comboSymbol->currentIndex());
m_parent->dvBalloon->BubbleShape.setValue(ui->comboSymbol->currentIndex());
recomputeFeature();
}