Icons have incorrect color
Symptom: the icon color is not valid : dark grey when it should be white with the default theme.
To reproduce the bug : with dtk-visualization 2.20.1, no saved config .ini file, open tst/resources/earth.vtp.
Here are multiple instances of this issue :
- click Surface Color, click Reset : the reset icon changes color
- click Delaunay 2D, click the Select Color button, dismiss the color dialog : the select-button icon changes color
- click Vertex & Edges, click any Show-Hide button twice: the arrow icon changes color
Expected behaviour:
Observed behaviour:
Hints for bug investigation :
- it's always icons from FontAwesome that trigger this bug
- it looks like the color-active is applied after an icon has been clicked.
- when retrieving the icon, adding this parameter prevents the bug from triggering, but it is not a satisfying patch because we'd prefer a global solution rather than patching all the icon retrieval calls :
src/dtkVisualization/dtkVisualizationDecoratorWithClut.cpp
@@ -108,7 +108,8 @@ dtkVisualizationDecoratorWithClutPrivate::dtkVisualizationDecoratorWithClutPriva
this->range_widget2->setObjectName("Range");
this->reset_range = new QPushButton;
- this->reset_range->setIcon(dtkFontAwesome::instance()->icon(fa::undo));
+ this->reset_range->setIcon(dtkFontAwesome::instance()->icon(fa::undo,
+ QVariantMap { { "color-active", dtkFontAwesome::instance()->defaultOption("color").value<QColor>() } }));