1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-29 18:46:05 +02:00

Bug1669: Close and Menu buttons should never disappear...

... As they did with Ctrl+Shift+F, with a certain minimimum number of wave
tracks that depends on screen resolution.  On my Macbook, that was 13 tracks.

This bug was a consequence of James' TCP layout changes making buttons a little
taller plus my changes to hide any top controls for which there is not
sufficient height.

The fix makes the height of tracks after Ctrl+Shift+F a bit more (44 pixels
not 40) than in 2.1.3.

This fix also replaces some more "magic numbers" with calculation from
tabled data about TCP layout.
This commit is contained in:
Paul Licameli
2017-07-14 11:53:17 -04:00
parent 2185b42d84
commit 903cebafe1
4 changed files with 25 additions and 5 deletions

View File

@@ -1313,6 +1313,18 @@ std::pair< int, int > CalcBottomItemY
}
unsigned TrackInfo::MinimumTrackHeight()
{
unsigned height = 0;
if (!commonTrackTCPLines.empty())
height += commonTrackTCPLines.front().height;
if (!commonTrackTCPBottomLines.empty())
height += commonTrackTCPBottomLines.front().height;
// + 1 prevents the top item from disappearing for want of enough space,
// according to the rules in HideTopItem.
return height + kTopMargin + kBottomMargin + 1;
}
bool TrackInfo::HideTopItem( const wxRect &rect, const wxRect &subRect,
int allowance ) {
auto limit = CalcBottomItemY