switch cursor label to black on light background
This commit is contained in:
parent
658e8252b1
commit
6552100775
@ -43,7 +43,6 @@ TracePlot::TracePlot(TraceModel &model, QWidget *parent)
|
|||||||
plots.insert(this);
|
plots.insert(this);
|
||||||
|
|
||||||
cursorLabel = new QLabel("Test", this);
|
cursorLabel = new QLabel("Test", this);
|
||||||
cursorLabel->setStyleSheet("color: white;");
|
|
||||||
cursorLabel->hide();
|
cursorLabel->hide();
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
@ -372,6 +371,11 @@ void TracePlot::mouseMoveEvent(QMouseEvent *event)
|
|||||||
cursorLabel->move(event->pos() + QPoint(15, 0));
|
cursorLabel->move(event->pos() + QPoint(15, 0));
|
||||||
auto font = cursorLabel->font();
|
auto font = cursorLabel->font();
|
||||||
font.setPixelSize(Preferences::getInstance().Graphs.fontSizeCursorOverlay);
|
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->setFont(font);
|
||||||
cursorLabel->show();
|
cursorLabel->show();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user