comparison view/View.cpp @ 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 b77b79413cdb
children 683c46d7500b
comparison
equal deleted inserted replaced
500:666cdcae5f0d 501:08e1ccfe289c
1856 1856
1857 int sx = p0 + 2; 1857 int sx = p0 + 2;
1858 int ex = sx; 1858 int ex = sx;
1859 int dx = sx; 1859 int dx = sx;
1860 1860
1861 bool durationBothEnds = true;
1862
1861 if (sw + ew > (p1 - p0)) { 1863 if (sw + ew > (p1 - p0)) {
1862 ey += metrics.height(); 1864 ey += metrics.height();
1863 dy += metrics.height(); 1865 dy += metrics.height();
1866 durationBothEnds = false;
1864 } 1867 }
1865 1868
1866 if (ew < (p1 - p0)) { 1869 if (ew < (p1 - p0)) {
1867 ex = p1 - 2 - ew; 1870 ex = p1 - 2 - ew;
1868 } 1871 }
1872 } 1875 }
1873 1876
1874 paint.drawText(sx, sy, startText); 1877 paint.drawText(sx, sy, startText);
1875 paint.drawText(ex, ey, endText); 1878 paint.drawText(ex, ey, endText);
1876 paint.drawText(dx, dy, durationText); 1879 paint.drawText(dx, dy, durationText);
1880 if (durationBothEnds) {
1881 paint.drawText(sx, dy, durationText);
1882 }
1877 } 1883 }
1878 } 1884 }
1879 1885
1880 paint.restore(); 1886 paint.restore();
1881 } 1887 }