changeset 501:08e1ccfe289c

* Show duration at both ends of selection if space permits (#2065013) * Tool tip for zoom reset button
author Chris Cannam
date Tue, 24 Feb 2009 12:17:18 +0000
parents 666cdcae5f0d
children 73a58a4dfebd
files view/Pane.cpp view/View.cpp
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- 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);
+            }
 	}
     }