Skip to content

Commit

Permalink
Fix Dimension Text Color
Browse files Browse the repository at this point in the history
- Dimension text did not respect Color property setting.
  • Loading branch information
WandererFan authored and wwmayer committed Feb 14, 2019
1 parent 9207e2e commit 2135377
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Mod/TechDraw/Gui/QGCustomText.cpp
Expand Up @@ -58,6 +58,7 @@ QGCustomText::QGCustomText()

isHighlighted = false;
m_colCurrent = getNormalColor();
m_colNormal = m_colCurrent;
}

void QGCustomText::centerAt(QPointF centerPos)
Expand Down Expand Up @@ -111,7 +112,8 @@ void QGCustomText::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
}

void QGCustomText::setPrettyNormal() {
m_colCurrent = getNormalColor();
// m_colCurrent = getNormalColor();
m_colCurrent = m_colNormal;
update();
}

Expand Down
2 changes: 2 additions & 0 deletions src/Mod/TechDraw/Gui/QGCustomText.h
Expand Up @@ -58,6 +58,7 @@ class TechDrawGuiExport QGCustomText : public QGraphicsTextItem
virtual QColor getNormalColor(void);
virtual QColor getPreColor(void);
virtual QColor getSelectColor(void);
virtual void setColor(QColor c) { m_colNormal = c; }
void makeMark(double x, double y);
void makeMark(Base::Vector3d v);

Expand All @@ -70,6 +71,7 @@ class TechDrawGuiExport QGCustomText : public QGraphicsTextItem

bool isHighlighted;
QColor m_colCurrent;
QColor m_colNormal;

private:

Expand Down
11 changes: 11 additions & 0 deletions src/Mod/TechDraw/Gui/QGIViewDimension.cpp
Expand Up @@ -274,6 +274,13 @@ void QGIDatumLabel::setPrettyNormal(void)
m_tolText->setPrettyNormal();
}

void QGIDatumLabel::setColor(QColor c)
{
m_colNormal = c;
m_dimText->setColor(m_colNormal);
m_tolText->setColor(m_colNormal);
}

//**************************************************************
QGIViewDimension::QGIViewDimension() :
hasHover(false),
Expand All @@ -286,6 +293,7 @@ QGIViewDimension::QGIViewDimension() :

datumLabel = new QGIDatumLabel();
addToGroup(datumLabel);
datumLabel->setColor(getNormalColor());
datumLabel->setPrettyNormal();
dimLines = new QGIDimLines();
addToGroup(dimLines);
Expand Down Expand Up @@ -482,6 +490,9 @@ void QGIViewDimension::draw()
return;
}

m_colNormal = getNormalColor();
datumLabel->setColor(m_colNormal);

m_lineWidth = Rez::guiX(vp->LineWidth.getValue());
float margin = Rez::guiX(5.f);

Expand Down
2 changes: 2 additions & 0 deletions src/Mod/TechDraw/Gui/QGIViewDimension.h
Expand Up @@ -77,6 +77,7 @@ Q_OBJECT
void setPrettySel(void);
void setPrettyPre(void);
void setPrettyNormal(void);
void setColor(QColor c);

QGCustomText* getDimText(void) { return m_dimText; }
void setDimText(QGCustomText* newText) { m_dimText = newText; }
Expand All @@ -101,6 +102,7 @@ Q_OBJECT
QGCustomText* m_tolText;
int getPrecision(void);
double getTolAdjust(void);
QColor m_colNormal;

double posX;
double posY;
Expand Down

0 comments on commit 2135377

Please sign in to comment.