| 230 | } |
| 231 | |
| 232 | void AeqPreviewPlot::onLegendClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event) |
| 233 | { |
| 234 | Q_UNUSED(legend) |
| 235 | Q_UNUSED(event) |
| 236 | |
| 237 | if (item) |
| 238 | { |
| 239 | bool dark = AppConfig::instance().get<bool>(AppConfig::AeqPlotDarkMode); |
| 240 | |
| 241 | QCPPlottableLegendItem *plItem = qobject_cast<QCPPlottableLegendItem*>(item); |
| 242 | bool visible = plItem->plottable()->visible(); |
| 243 | plItem->plottable()->setVisible(!visible); |
| 244 | |
| 245 | if(dark) |
| 246 | { |
| 247 | plItem->setTextColor(!visible ? QColor(Qt::white) : QColor(Qt::darkGray)); |
| 248 | } |
| 249 | else |
| 250 | { |
| 251 | plItem->setTextColor(!visible ? QColor(Qt::black) : QColor(Qt::gray)); |
| 252 | } |
| 253 | replot(); |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | void AeqPreviewPlot::onLegendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event) |
| 258 | { |
nothing calls this directly
no test coverage detected