From cfe369f232f73369cddf61f1d5c23cc30f158700 Mon Sep 17 00:00:00 2001 From: "v.audacity" Date: Tue, 24 Aug 2010 19:32:54 +0000 Subject: [PATCH] Sync-Lock: Remove tiles from rulers. They were interfering with visibility of ruler marks. Restore the icon to TrackInfo, but not in the title bar. Instead, when sync-lock is on and the track IsSyncLockSelected(), decrease the width of the minimize button and show the icon to the right of it. This way, it shows even when the track is minimized. --- src/AllThemeResources.h | 14 ++---------- src/TrackArtist.cpp | 13 +---------- src/TrackPanel.cpp | 49 ++++++++++++++++------------------------- 3 files changed, 22 insertions(+), 54 deletions(-) diff --git a/src/AllThemeResources.h b/src/AllThemeResources.h index 5a7fc50d7..95f1f07e1 100644 --- a/src/AllThemeResources.h +++ b/src/AllThemeResources.h @@ -208,8 +208,8 @@ from there. Audacity will look for a file called "Pause.png". DEFINE_IMAGE( bmpAudacityLogo, wxImage( 215, 190 ), wxT("AudacityLogo")); DEFINE_IMAGE( bmpAudacityLogo48x48, wxImage( 48, 48 ), wxT("AudacityLogo48x48")); - DEFINE_IMAGE( bmpLinkSelect, wxImage(27, 27), wxT("LinkSelect")); - DEFINE_IMAGE( bmpLinkTP, wxImage(12, 12), wxT("LinkTP")); + DEFINE_IMAGE( bmpSyncLockSelTile, wxImage(27, 27), wxT("SyncLockSelTile")); + DEFINE_IMAGE( bmpSyncLockIcon, wxImage(12, 12), wxT("SyncLockIcon")); #ifdef OLD_COLOURS DEFINE_COLOUR( clrBlank, wxColour(214, 214, 214), wxT("Blank")); @@ -328,13 +328,3 @@ from there. Audacity will look for a file called "Pause.png". DEFINE_COLOUR( clrTrackInfoSyncLockSel, wxColour( 64, 64, 64), wxT("TrackInfoSyncLockSel")); DEFINE_COLOUR( clrSelTranslucent, wxColour(104, 104, 148, 127), wxT("SelTranslucent")); -// Indentation settings for Vim and Emacs and unique identifier for Arch, a -// version control system. Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// arch-tag: b8a9d878-fa18-4cba-a5ce-3c61b5d77f0e diff --git a/src/TrackArtist.cpp b/src/TrackArtist.cpp index 551a1f19c..275cb558c 100644 --- a/src/TrackArtist.cpp +++ b/src/TrackArtist.cpp @@ -2642,7 +2642,7 @@ void TrackArtist::SetSpectrumLogMaxFreq(int freq) // Draws the sync-lock bitmap, tiled; always draws stationary relative to the DC void TrackArtist::DrawSyncLockTiles(wxDC *dc, wxRect r) { - wxBitmap syncLockBitmap(theTheme.Image(bmpLinkSelect)); + wxBitmap syncLockBitmap(theTheme.Image(bmpSyncLockSelTile)); int xOffset = r.x % syncLockBitmap.GetWidth(); if (xOffset < 0) xOffset += syncLockBitmap.GetWidth(); @@ -2678,14 +2678,3 @@ void TrackArtist::DrawSyncLockTiles(wxDC *dc, wxRect r) } } -// Indentation settings for Vim and Emacs and unique identifier for Arch, a -// version control system. Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// arch-tag: cd156c5b-b867-48eb-9289-03d21bdf14e5 - diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 1a1bd3a78..e081bac56 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -5135,13 +5135,14 @@ void TrackPanel::DrawOutside(Track * t, wxDC * dc, const wxRect rec, mTrackInfo.DrawBackground(dc, r, t->GetSelected(), bIsWave, labelw, vrul); + // Vaughan, 2010-08-24: No longer doing this. // Draw sync-lock tiles in ruler area. - if (t->IsSyncLockSelected()) { - wxRect tileFill = r; - tileFill.x = GetVRulerOffset(); - tileFill.width = GetVRulerWidth(); - TrackArtist::DrawSyncLockTiles(dc, tileFill); - } + //if (t->IsSyncLockSelected()) { + // wxRect tileFill = r; + // tileFill.x = GetVRulerOffset(); + // tileFill.width = GetVRulerWidth(); + // TrackArtist::DrawSyncLockTiles(dc, tileFill); + //} DrawBordersAroundTrack(t, dc, r, labelw, vrul); DrawShadow(t, dc, r); @@ -7352,18 +7353,6 @@ void TrackInfo::DrawTitleBar(wxDC * dc, const wxRect r, Track * t, bev.y + ((bev.height - (s / 2)) / 2), s); - // Link icon: drawn to the left of the dropdown arrow - //vvvvv May want to put this elsewhere in the TrackInfo. - //wxBitmap link(theTheme.Image(bmpLinkTP)); - //if (t->IsSyncLockSelected()) { - // wxBitmap link(theTheme.Image(bmpLinkTP)); - // dc->DrawBitmap(link, - // // Arrow's left minus our width and an extra px - // bev.GetRight() - s - 3 - link.GetWidth() - 1, - // bev.y + 1, - // true); - //} - AColor::BevelTrackInfo(*dc, !down, bev); } @@ -7420,7 +7409,18 @@ void TrackInfo::DrawMinimize(wxDC * dc, const wxRect r, Track * t, bool down, bo { wxRect bev; GetMinimizeRect(r, bev, minimized); - + + wxBitmap syncLockBitmap(theTheme.Image(bmpSyncLockIcon)); + if (t->IsSyncLockSelected()) + { + // GetMinimizeRect() sets height to 15, and syncLockBitmap is 12x12. + bev.width -= syncLockBitmap.GetWidth() + 4; + dc->DrawBitmap(syncLockBitmap, + bev.GetRight() + 4, + bev.y + 2, + true); + } + // Clear background to get rid of previous arrow AColor::MediumTrackInfo(dc, t->GetSelected()); dc->DrawRectangle(bev); @@ -7597,14 +7597,3 @@ LWSlider * TrackInfo::PanSlider(int trackIndex) return mPans[trackIndex - mSliderOffset]; } -// Indentation settings for Vim and Emacs and unique identifier for Arch, a -// version control system. Please do not modify past this point. -// -// Local Variables: -// c-basic-offset: 3 -// indent-tabs-mode: nil -// End: -// -// vim: et sts=3 sw=3 -// arch-tag: 5bb3d18e-9ba7-47c3-beef-29f5d791442a -