Gui: SoFrameLabel text color from base color support
This adds support for obtaining text color from the state of the graph (base color) to SoFrameLabel nodes.
This commit is contained in:
@@ -381,6 +381,7 @@ SoFrameLabel::SoFrameLabel()
|
||||
SO_NODE_ADD_FIELD(frame, (true));
|
||||
SO_NODE_ADD_FIELD(border, (true));
|
||||
SO_NODE_ADD_FIELD(backgroundUseBaseColor, (false));
|
||||
SO_NODE_ADD_FIELD(textUseBaseColor, (false));
|
||||
//SO_NODE_ADD_FIELD(image, (SbVec2s(0,0), 0, NULL));
|
||||
}
|
||||
|
||||
@@ -508,6 +509,15 @@ void SoFrameLabel::GLRender(SoGLRenderAction *action)
|
||||
}
|
||||
}
|
||||
|
||||
if (textUseBaseColor.getValue()) {
|
||||
SoState* state = action->getState();
|
||||
const SbColor& diffuse = SoLazyElement::getDiffuse(state, 0);
|
||||
|
||||
if (diffuse != this->textColor.getValue()) {
|
||||
this->textColor.setValue(diffuse);
|
||||
}
|
||||
}
|
||||
|
||||
inherited::GLRender(action);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ public:
|
||||
SoSFBool frame;
|
||||
SoSFBool border;
|
||||
SoSFBool backgroundUseBaseColor;
|
||||
SoSFBool textUseBaseColor;
|
||||
//SoSFImage image;
|
||||
QPixmap iconPixmap;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user