# HG changeset patch # User matthiasm # Date 1405436046 -3600 # Node ID b2349053c5f81628e6e92b0b83da2621cdfa70c3 # Parent 24f18a7dd26d0cb175adfa807b606ace84795327 adding number to display of illuminated note diff -r 24f18a7dd26d -r b2349053c5f8 layer/FlexiNoteLayer.cpp --- a/layer/FlexiNoteLayer.cpp Wed Jul 02 19:22:05 2014 +0100 +++ b/layer/FlexiNoteLayer.cpp Tue Jul 15 15:54:06 2014 +0100 @@ -801,7 +801,7 @@ int frame0 = v->getFrameForX(x0); int frame1 = v->getFrameForX(x1); - FlexiNoteModel::PointList points(m_model->getPoints(frame0, frame1)); + FlexiNoteModel::PointList points(m_model->getPoints(0, frame1)); if (points.empty()) return; paint.setPen(getBaseQColor()); @@ -828,9 +828,12 @@ paint.save(); paint.setRenderHint(QPainter::Antialiasing, false); + int noteNumber = 0; + for (FlexiNoteModel::PointList::const_iterator i = points.begin(); i != points.end(); ++i) { + ++noteNumber; const FlexiNoteModel::Point &p(*i); int x = v->getXForFrame(p.frame); @@ -882,6 +885,11 @@ x, y + h + 2 + paint.fontMetrics().descent(), llabel, View::OutlinedText); + QString nlabel = QString("%1").arg(noteNumber); + v->drawVisibleText(paint, + x + paint.fontMetrics().averageCharWidth() / 2, + y + h/2 - paint.fontMetrics().descent(), + nlabel, View::OutlinedText); } paint.drawRect(x, y - h/2, w, h);