# HG changeset patch # User Chris Cannam # Date 1235477838 0 # Node ID 08e1ccfe289c5e25986bd8258a53378eb680b7df # Parent 666cdcae5f0d0b5625d27f1f9a0a504246d5b2ad * Show duration at both ends of selection if space permits (#2065013) * Tool tip for zoom reset button diff -r 666cdcae5f0d -r 08e1ccfe289c view/Pane.cpp --- a/view/Pane.cpp Tue Feb 24 12:02:19 2009 +0000 +++ b/view/Pane.cpp Tue Feb 24 12:17:18 2009 +0000 @@ -171,6 +171,7 @@ m_reset->setFixedHeight(16); m_reset->setFixedWidth(16); m_reset->setIcon(QPixmap(":/icons/zoom-reset.png")); + m_reset->setToolTip(tr("Reset zoom to default")); layout->addWidget(m_reset, 1, 2); layout->setColumnStretch(0, 20); diff -r 666cdcae5f0d -r 08e1ccfe289c view/View.cpp --- a/view/View.cpp Tue Feb 24 12:02:19 2009 +0000 +++ b/view/View.cpp Tue Feb 24 12:17:18 2009 +0000 @@ -1858,9 +1858,12 @@ int ex = sx; int dx = sx; + bool durationBothEnds = true; + if (sw + ew > (p1 - p0)) { ey += metrics.height(); dy += metrics.height(); + durationBothEnds = false; } if (ew < (p1 - p0)) { @@ -1874,6 +1877,9 @@ paint.drawText(sx, sy, startText); paint.drawText(ex, ey, endText); paint.drawText(dx, dy, durationText); + if (durationBothEnds) { + paint.drawText(sx, dy, durationText); + } } }