diff options
author | Robert Adam <dev@robert-adam.de> | 2019-12-23 12:26:40 +0300 |
---|---|---|
committer | Davide Beatrici <davidebeatrici@gmail.com> | 2019-12-27 01:30:56 +0300 |
commit | 70985ae6713269a408da8813901177c3b6ce947f (patch) | |
tree | 08106a443c9a45e0825dfdd3803497d63b2810bb /src/mumble/ManualPlugin.cpp | |
parent | f1ac6c35b4b7d54e92d08f479d9a7dff08abba6e (diff) |
ManualPlugin: restyle position indicator so that it's bigger and displays the azimuth
Diffstat (limited to 'src/mumble/ManualPlugin.cpp')
-rw-r--r-- | src/mumble/ManualPlugin.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mumble/ManualPlugin.cpp b/src/mumble/ManualPlugin.cpp index 0bdd5a338..f9f1b5839 100644 --- a/src/mumble/ManualPlugin.cpp +++ b/src/mumble/ManualPlugin.cpp @@ -44,7 +44,16 @@ Manual::Manual(QWidget *p) : QDialog(p) { qgvPosition->viewport()->installEventFilter(this); qgvPosition->scale(1.0f, 1.0f); qgsScene = new QGraphicsScene(QRectF(-5.0f, -5.0f, 10.0f, 10.0f), this); - qgiPosition = qgsScene->addEllipse(QRectF(-0.5f, -0.5f, 1.0f, 1.0f), QApplication::palette().text().color(), QBrush(Qt::red)); + + const float indicatorDiameter = 4.0f; + QPainterPath indicator; + // The center of the indicator's circle will represent the current position + indicator.addEllipse(QRectF(-indicatorDiameter / 2, -indicatorDiameter / 2, indicatorDiameter, indicatorDiameter)); + // A line will indicate the indicator's orientation (azimuth) + indicator.moveTo(0, indicatorDiameter / 2); + indicator.lineTo(0, indicatorDiameter); + + qgiPosition = qgsScene->addPath(indicator); qgvPosition->setScene(qgsScene); qgvPosition->fitInView(-5.0f, -5.0f, 10.0f, 10.0f, Qt::KeepAspectRatio); @@ -181,6 +190,8 @@ void Manual::updateTopAndFront(int azimuth, int elevation) { iAzimuth = azimuth; iElevation = elevation; + qgiPosition->setRotation(azimuth); + double azim = azimuth * M_PI / 180.; double elev = elevation * M_PI / 180.; |