@@ -264,8 +264,6 @@ ScatterplotPlugin::ScatterplotPlugin(const PluginFactory* factory) :
264264 getLearningCenterAction ().addVideos (QStringList ({ " Practitioner" , " Developer" }));
265265
266266 setOverlayActionsTargetWidget (_scatterPlotWidget);
267-
268-
269267}
270268
271269ScatterplotPlugin::~ScatterplotPlugin ()
@@ -376,6 +374,10 @@ void ScatterplotPlugin::init()
376374 connect (&_settingsAction.getColoringAction ().getColorByAction (), &OptionAction::currentIndexChanged, this , &ScatterplotPlugin::updateHeadsUpDisplay);
377375 connect (&_settingsAction.getPlotAction ().getPointPlotAction ().getSizeAction (), &ScalarAction::sourceDataChanged, this , &ScatterplotPlugin::updateHeadsUpDisplay);
378376 connect (&_settingsAction.getPlotAction ().getPointPlotAction ().getOpacityAction (), &ScalarAction::sourceDataChanged, this , &ScatterplotPlugin::updateHeadsUpDisplay);
377+
378+ updateHeadsUpDisplayTextColor ();
379+
380+ connect (&_settingsAction.getMiscellaneousAction ().getBackgroundColorAction (), &ColorAction::colorChanged, this , &ScatterplotPlugin::updateHeadsUpDisplayTextColor);
379381}
380382
381383void ScatterplotPlugin::loadData (const Datasets& datasets)
@@ -993,6 +995,19 @@ void ScatterplotPlugin::updateHeadsUpDisplay()
993995 }
994996}
995997
998+ void ScatterplotPlugin::updateHeadsUpDisplayTextColor ()
999+ {
1000+ if (auto headsUpDisplayWidget = getWidget ().findChild <QWidget*>(" HeadsUpDisplayWidget" )) {
1001+ if (auto headsUpDisplayWidgetTreeView = headsUpDisplayWidget->findChild <QTreeView*>(" TreeView" )) {
1002+ QPalette palette = headsUpDisplayWidgetTreeView->palette ();
1003+
1004+ palette.setColor (QPalette::Text, _settingsAction.getMiscellaneousAction ().getBackgroundColorAction ().getColor ().lightnessF () > .5f ? Qt::black : Qt::white);
1005+
1006+ headsUpDisplayWidgetTreeView->setPalette (palette);
1007+ }
1008+ }
1009+ }
1010+
9961011void ScatterplotPlugin::fromVariantMap (const QVariantMap& variantMap)
9971012{
9981013 ViewPlugin::fromVariantMap (variantMap);
@@ -1014,6 +1029,8 @@ void ScatterplotPlugin::fromVariantMap(const QVariantMap& variantMap)
10141029
10151030 _scatterPlotWidget->update ();
10161031 }
1032+
1033+ updateHeadsUpDisplayTextColor ();
10171034}
10181035
10191036QVariantMap ScatterplotPlugin::toVariantMap () const
0 commit comments