Skip to content
Permalink
Browse files

Merge PR #2365: OverlayClient: hide QGraphicsPixmapItems when FPS and…

… time are disabled instead of setting an empty QPixmap.
  • Loading branch information...
mkrautz committed Jul 2, 2016
2 parents 52a7624 + 27abc98 commit 950fa156990f73097b757176916a0c28dd814dc5
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/mumble/OverlayClient.cpp
@@ -103,24 +103,26 @@ void OverlayClient::updateFPS() {
const BasepointPixmap &pm = OverlayTextLine(
QString(QLatin1String("%1")).arg(iroundf(framesPerSecond + 0.5f)),
g.s.os.qfFps).createPixmap(g.s.os.qcFps);
qgpiFPS->setVisible(true);
qgpiFPS->setPixmap(pm);
// offset to use basepoint
//TODO: settings are providing a top left anchor, so shift down by ascent
qgpiFPS->setOffset(-pm.qpBasePoint + QPoint(0, pm.iAscent));
qgpiFPS->updateRender();
} else {
qgpiFPS->setPixmap(QPixmap());
qgpiFPS->setVisible(false);
}
}

void OverlayClient::updateTime() {
if (g.s.os.bTime) {
const BasepointPixmap &pm = OverlayTextLine(QString(QLatin1String("%1")).arg(QTime::currentTime().toString()), g.s.os.qfFps).createPixmap(g.s.os.qcFps);
qgpiTime->setVisible(true);
qgpiTime->setPixmap(pm);
qgpiTime->setOffset(-pm.qpBasePoint + QPoint(0, pm.iAscent));
qgpiTime->updateRender();
} else {
qgpiTime->setPixmap(QPixmap());
qgpiTime->setVisible(false);
}
}

0 comments on commit 950fa15

Please sign in to comment.
You can’t perform that action at this time.