From 6552100775d9370d231675477809fb50a0b520d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Sat, 29 Oct 2022 19:11:55 +0200 Subject: [PATCH] switch cursor label to black on light background --- Software/PC_Application/LibreVNA-GUI/Traces/traceplot.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Software/PC_Application/LibreVNA-GUI/Traces/traceplot.cpp b/Software/PC_Application/LibreVNA-GUI/Traces/traceplot.cpp index 250dc94..856c2d4 100644 --- a/Software/PC_Application/LibreVNA-GUI/Traces/traceplot.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Traces/traceplot.cpp @@ -43,7 +43,6 @@ TracePlot::TracePlot(TraceModel &model, QWidget *parent) plots.insert(this); cursorLabel = new QLabel("Test", this); - cursorLabel->setStyleSheet("color: white;"); cursorLabel->hide(); setMouseTracking(true); setAcceptDrops(true); @@ -372,6 +371,11 @@ void TracePlot::mouseMoveEvent(QMouseEvent *event) cursorLabel->move(event->pos() + QPoint(15, 0)); auto font = cursorLabel->font(); font.setPixelSize(Preferences::getInstance().Graphs.fontSizeCursorOverlay); + if(Util::getFontColorFromBackground(Preferences::getInstance().Graphs.Color.background) == Qt::black) { + cursorLabel->setStyleSheet("color: black;"); + } else { + cursorLabel->setStyleSheet("color: white;"); + } cursorLabel->setFont(font); cursorLabel->show(); } else {