[TD] Balloon, move property LineVisible to View tab and fix a refresh bug.

This commit is contained in:
Aapo
2020-12-15 23:32:11 +02:00
committed by wwmayer
parent b41cf98583
commit f3bce14f29
5 changed files with 5 additions and 5 deletions

View File

@@ -113,8 +113,6 @@ DrawViewBalloon::DrawViewBalloon(void)
ADD_PROPERTY_TYPE(KinkLength,(prefKinkLength()),"",(App::PropertyType)(App::Prop_None),
"Distance from symbol to leader kink");
ADD_PROPERTY_TYPE(LineVisible,(true),"",(App::PropertyType)(App::Prop_None),"Balloon line visible or hidden");
SourceView.setScope(App::LinkScope::Global);
Rotation.setStatus(App::Property::Hidden,true);
Caption.setStatus(App::Property::Hidden,true);

View File

@@ -59,7 +59,6 @@ public:
App::PropertyDistance OriginY;
App::PropertyFloat TextWrapLen;
App::PropertyDistance KinkLength;
App::PropertyBool LineVisible;
short mustExecute() const override;

View File

@@ -766,7 +766,7 @@ void QGIViewBalloon::draw()
balloonLines->setPath(dLinePath);
// This overwrites the previously created QPainterPath with empty one, in case it should be hidden. Should be refactored.
if (!balloon->LineVisible.getValue()) {
if (!vp->LineVisible.getValue()) {
arrow->hide();
balloonLines->setPath(QPainterPath());
}

View File

@@ -75,6 +75,7 @@ ViewProviderBalloon::ViewProviderBalloon()
double weight = lg->getWeight("Thin");
delete lg; //Coverity CID 174670
ADD_PROPERTY_TYPE(LineWidth,(weight),group,(App::PropertyType)(App::Prop_None),"Leader line width");
ADD_PROPERTY_TYPE(LineVisible,(true),group,(App::PropertyType)(App::Prop_None),"Balloon line visible or hidden");
ADD_PROPERTY_TYPE(Color,(PreferencesGui::dimColor()),
group,App::Prop_None,"Color of the balloon");
@@ -148,7 +149,8 @@ void ViewProviderBalloon::onChanged(const App::Property* p)
if ((p == &Font) ||
(p == &Fontsize) ||
(p == &Color) ||
(p == &LineWidth)) {
(p == &LineWidth) ||
(p == &LineVisible)) {
QGIView* qgiv = getQView();
if (qgiv) {
qgiv->updateView(true);

View File

@@ -48,6 +48,7 @@ public:
App::PropertyFont Font;
App::PropertyLength Fontsize;
App::PropertyLength LineWidth;
App::PropertyBool LineVisible;
App::PropertyColor Color;
virtual void attach(App::DocumentObject *);