From 0b6a14eb70fc1be283fe2d4d84645f4d96615dc5 Mon Sep 17 00:00:00 2001 From: Ivan Gorinov Date: Thu, 3 Nov 2011 21:22:10 -0700 Subject: [PATCH] Numbers on gravity scale --- ameterwidget.cpp | 10 ++++++++++ debian/changelog | 6 ++++++ debian/control | 3 ++- debian/files | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ameterwidget.cpp b/ameterwidget.cpp index f5576ce..f11ee02 100644 --- a/ameterwidget.cpp +++ b/ameterwidget.cpp @@ -88,6 +88,7 @@ void AMeterWidget::resizeEvent(QResizeEvent *e) void AMeterWidget::drawScale() { QPainter *paint; + QString str; qreal cx, cy, rx, ry, dx, dy; qreal r, a; qreal id = 1.0 / divisions; @@ -131,11 +132,20 @@ void AMeterWidget::drawScale() { paint->drawEllipse(QPointF(cx, cy), rx * i, ry * i); } + paint->setPen(QPen(QBrush(QColor(64, 64, 64, 255)), 1)); for (j = 0; j < divisions; j++) { paint->drawEllipse(QPointF(cx, cy), rx * (i + id * j), ry * (i + id * j)); } + if (i != 0) { + str = QString::number(i) + "g"; + paint->setPen(QPen(QBrush(QColor(192, 192, 192, 255)), 1)); + paint->drawText(QPointF(cx - rx * i, cy), str); + paint->drawText(QPointF(cx + rx * i, cy), str); + paint->drawText(QPointF(cx, cy - ry * i), str); + paint->drawText(QPointF(cx, cy + ry * i), str); + } } for (i = 0; i < 360; i += angle_step) diff --git a/debian/changelog b/debian/changelog index 0e29294..d4fe276 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ameter (1.0.3) unstable; urgency=low + + * Added numbers to gravity scale + + -- Ivan Gorinov Thu, 3 Nov 2011 20:57:53 -0700 + ameter (1.0.2) unstable; urgency=low * Stop accelerometer when the screen is locked diff --git a/debian/control b/debian/control index 8e5bef8..bb80619 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,8 @@ Package: ameter Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Graphical acceleration indicator - This application displays a 2D acceleration indicator + This application displays a 2-dimentional acceleration indicator + with gravity/inclinometer scale, using the phone accelerometer XB-Maemo-Display-Name: ameter XB-Maemo-Icon-26: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c diff --git a/debian/files b/debian/files index 9f7d883..5d33ff8 100644 --- a/debian/files +++ b/debian/files @@ -1 +1 @@ -ameter_1.0.2_armel.deb user/utilities optional +ameter_1.0.3_armel.deb user/utilities optional -- 1.7.9.5