diff --git a/src/AColor.cpp b/src/AColor.cpp index 6ce901550..89377596f 100644 --- a/src/AColor.cpp +++ b/src/AColor.cpp @@ -29,10 +29,10 @@ It is also a place to document colour usage policy in Audacity bool AColor::inited = false; wxBrush AColor::lightBrush[2]; -wxBrush AColor::mediumBrush[2]; +wxBrush AColor::mediumBrush[3]; wxBrush AColor::darkBrush[2]; wxPen AColor::lightPen[2]; -wxPen AColor::mediumPen[2]; +wxPen AColor::mediumPen[3]; wxPen AColor::darkPen[2]; wxPen AColor::cursorPen; @@ -54,8 +54,10 @@ wxBrush AColor::labelTextNormalBrush; wxBrush AColor::labelTextEditBrush; wxBrush AColor::labelUnselectedBrush; wxBrush AColor::labelSelectedBrush; +wxBrush AColor::labelSyncSelBrush; wxPen AColor::labelUnselectedPen; wxPen AColor::labelSelectedPen; +wxPen AColor::labelSyncSelPen; wxPen AColor::labelSurroundPen; wxPen AColor::trackFocusPens[3]; wxPen AColor::snapGuidePen; @@ -252,11 +254,11 @@ void AColor::Light(wxDC * dc, bool selected) dc->SetPen(lightPen[index]); } -void AColor::Medium(wxDC * dc, bool selected) +// index: 0 for unselected, 1 for selected, 2 for sync-selected +void AColor::Medium(wxDC * dc, int index) { if (!inited) Init(); - int index = (int) selected; dc->SetBrush(mediumBrush[index]); dc->SetPen(mediumPen[index]); } @@ -270,12 +272,13 @@ void AColor::Medium(wxDC * dc, bool selected) #endif #endif -void AColor::MediumTrackInfo(wxDC * dc, bool selected) +void AColor::MediumTrackInfo(wxDC * dc, bool selected, bool syncSel) { #ifdef EXPERIMENTAL_THEMING - UseThemeColour( dc, selected ? clrTrackInfoSelected : clrTrackInfo); + UseThemeColour( dc, selected ? clrTrackInfo : + syncSel ? clrTrackInfoSyncSel : clrTrackInfo); #else - Medium( dc, selected ); + Medium( dc, selected ? 1 : syncSel ? 2 : 0 ); #endif } @@ -397,8 +400,10 @@ void AColor::Init() theTheme.SetBrushColour( labelTextEditBrush, clrLabelTextEditBrush ); theTheme.SetBrushColour( labelUnselectedBrush, clrLabelUnselectedBrush ); theTheme.SetBrushColour( labelSelectedBrush, clrLabelSelectedBrush ); + theTheme.SetBrushColour( labelSyncSelBrush, clrSyncSel ); theTheme.SetPenColour( labelUnselectedPen, clrLabelUnselectedPen ); theTheme.SetPenColour( labelSelectedPen, clrLabelSelectedPen ); + theTheme.SetPenColour( labelSyncSelPen, clrSyncSel ); theTheme.SetPenColour( labelSurroundPen, clrLabelSurroundPen ); // These colors were modified to avoid using reserved colors red and green @@ -447,6 +452,10 @@ void AColor::Init() mediumPen[1].SetColour(200, 200, 214); darkPen[1].SetColour(0, 0, 0); + // sync-selected (only need medium so far) + mediumBrush[2].SetColour(215, 215, 220); + mediumPen[2].SetColour(215, 215, 220); + #else #if defined(__WXMAC__) // && defined(TARGET_CARBON) @@ -467,6 +476,10 @@ void AColor::Init() mediumPen[1].SetColour(180, 180, 192); darkPen[1].SetColour(148, 148, 170); + // sync-selected (only need medium so far) + mediumBrush[2].SetColour(195, 195, 200); + mediumPen[2].SetColour(195, 195, 200); + #else // unselected @@ -485,6 +498,10 @@ void AColor::Init() mediumPen[1].SetColour(180, 180, 192); darkPen[1].SetColour(0, 0, 0); + // sync-selected (only need medium so far) + mediumBrush[2].SetColour(195, 195, 200); + mediumPen[2].SetColour(195, 195, 200); + #endif #endif diff --git a/src/AColor.h b/src/AColor.h index 629da482b..90d07e956 100644 --- a/src/AColor.h +++ b/src/AColor.h @@ -36,8 +36,8 @@ class AColor { static void TrackPanelBackground(wxDC * dc, bool selected); static void Light(wxDC * dc, bool selected); - static void Medium(wxDC * dc, bool selected); - static void MediumTrackInfo(wxDC * dc, bool selected); + static void Medium(wxDC * dc, int index); + static void MediumTrackInfo(wxDC * dc, bool selected, bool syncSel); static void Dark(wxDC * dc, bool selected); static void CursorColor(wxDC * dc); @@ -57,10 +57,10 @@ class AColor { // Member variables static wxBrush lightBrush[2]; - static wxBrush mediumBrush[2]; + static wxBrush mediumBrush[3]; static wxBrush darkBrush[2]; static wxPen lightPen[2]; - static wxPen mediumPen[2]; + static wxPen mediumPen[3]; static wxPen darkPen[2]; static wxPen cursorPen; @@ -82,8 +82,10 @@ class AColor { static wxBrush labelTextEditBrush; static wxBrush labelUnselectedBrush; static wxBrush labelSelectedBrush; + static wxBrush labelSyncSelBrush; static wxPen labelUnselectedPen; static wxPen labelSelectedPen; + static wxPen labelSyncSelPen; static wxPen labelSurroundPen; static wxPen trackFocusPens[3]; diff --git a/src/AllThemeResources.h b/src/AllThemeResources.h index 55bc57f7e..4804488af 100644 --- a/src/AllThemeResources.h +++ b/src/AllThemeResources.h @@ -335,6 +335,8 @@ from there. Audacity will look for a file called "Pause.png". DEFINE_COLOUR( clrProgressDone, wxColour(60, 240, 60, 128), wxT("ProgressDone")); DEFINE_COLOUR( clrProgressNotYet, wxColour(255, 255, 255,220), wxT("ProgressNotYet")); + DEFINE_COLOUR( clrSyncSel, wxColour(165, 165, 185), wxT("SyncSel")); + DEFINE_COLOUR( clrTrackInfoSyncSel, wxColour( 80, 64, 80), wxT("TrackInfoSyncSel")); // Indentation settings for Vim and Emacs and unique identifier for Arch, a // version control system. Please do not modify past this point. diff --git a/src/LabelTrack.cpp b/src/LabelTrack.cpp index 1780d81cc..e8e1268ca 100644 --- a/src/LabelTrack.cpp +++ b/src/LabelTrack.cpp @@ -733,8 +733,17 @@ void LabelTrack::Draw(wxDC & dc, const wxRect & r, double h, double pps, wxRect selr = r; selr.x += before.width; selr.width = int ((dsel1 - dsel0) * pps); - dc.SetBrush(AColor::labelSelectedBrush); - dc.SetPen(AColor::labelSelectedPen); + + // If selection is synchro use synchro colors + if (IsSynchroSelected() && !GetSelected()) { + dc.SetBrush(AColor::labelSyncSelBrush); + dc.SetPen(AColor::labelSyncSelPen); + } + else { + dc.SetBrush(AColor::labelSelectedBrush); + dc.SetPen(AColor::labelSelectedPen); + } + dc.DrawRectangle(selr); // If selection is synchro, draw in linked graphics diff --git a/src/MixerBoard.cpp b/src/MixerBoard.cpp index 1dbdb6f4c..e9bf7e47d 100644 --- a/src/MixerBoard.cpp +++ b/src/MixerBoard.cpp @@ -501,7 +501,7 @@ void MixerTrackCluster::OnPaint(wxPaintEvent &evt) #ifdef __WXMAC__ // Fill with correct color, not scroller background. Done automatically on Windows. - AColor::Medium(&dc, false); + AColor::Medium(&dc, 0); dc.DrawRectangle(this->GetClientRect()); #endif diff --git a/src/TrackArtist.cpp b/src/TrackArtist.cpp index 3b276afdd..90e03e602 100644 --- a/src/TrackArtist.cpp +++ b/src/TrackArtist.cpp @@ -110,6 +110,7 @@ void TrackArtist::SetColours() theTheme.SetBrushColour( blankBrush, clrBlank ); theTheme.SetBrushColour( unselectedBrush, clrUnselected); theTheme.SetBrushColour( selectedBrush, clrSelected); + theTheme.SetBrushColour( syncSelBrush, clrSyncSel); theTheme.SetBrushColour( sampleBrush, clrSample); theTheme.SetBrushColour( selsampleBrush, clrSelSample); theTheme.SetBrushColour( dragsampleBrush, clrDragSample); @@ -117,6 +118,7 @@ void TrackArtist::SetColours() theTheme.SetPenColour( blankPen, clrBlank); theTheme.SetPenColour( unselectedPen, clrUnselected); theTheme.SetPenColour( selectedPen, clrSelected); + theTheme.SetPenColour( syncSelPen, clrSyncSel); theTheme.SetPenColour( samplePen, clrSample); theTheme.SetPenColour( selsamplePen, clrSelSample); theTheme.SetPenColour( muteSamplePen, clrMuteSample); @@ -721,7 +723,8 @@ void TrackArtist::DrawWaveformBackground(wxDC &dc, const wxRect &r, const double continue; } - dc.SetBrush(lsel ? selectedBrush : unselectedBrush); + dc.SetBrush(lsel ? (synchroSelection ? syncSelBrush : selectedBrush) : + unselectedBrush); l = r.x + lx; w = x - lx; @@ -741,7 +744,8 @@ void TrackArtist::DrawWaveformBackground(wxDC &dc, const wxRect &r, const double lx = x; } - dc.SetBrush(lsel ? selectedBrush : unselectedBrush); + dc.SetBrush(lsel ? (synchroSelection ? syncSelBrush : selectedBrush) : + unselectedBrush); l = r.x + lx; w = x - lx; if (lmaxbot != lmintop - 1) { diff --git a/src/TrackArtist.h b/src/TrackArtist.h index ebbeed8b0..a0355736c 100644 --- a/src/TrackArtist.h +++ b/src/TrackArtist.h @@ -190,6 +190,7 @@ class AUDACITY_DLL_API TrackArtist { wxBrush blankBrush; wxBrush unselectedBrush; wxBrush selectedBrush; + wxBrush syncSelBrush; wxBrush sampleBrush; wxBrush selsampleBrush; wxBrush dragsampleBrush;// for samples which are draggable. @@ -197,6 +198,7 @@ class AUDACITY_DLL_API TrackArtist { wxPen blankPen; wxPen unselectedPen; wxPen selectedPen; + wxPen syncSelPen; wxPen samplePen; wxPen rmsPen; wxPen muteRmsPen; diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 48aef80cc..af6fb1a93 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -7243,7 +7243,7 @@ void TrackInfo::DrawBackground(wxDC * dc, const wxRect r, bool bSelected, // fill in label wxRect fill = r; fill.width = labelw-4; - AColor::MediumTrackInfo(dc, bSelected || bSyncSel); + AColor::MediumTrackInfo(dc, bSelected, bSyncSel); dc->DrawRectangle(fill); // Draw in linked tiles for synchro selection @@ -7330,7 +7330,7 @@ void TrackInfo::DrawTitleBar(wxDC * dc, const wxRect r, Track * t, // characters if they are repeatedly drawn. This // happens when holding down mouse button and moving // in and out of the title bar. So clear it first. - AColor::MediumTrackInfo(dc, t->GetSelected() || t->IsSynchroSelected()); + AColor::MediumTrackInfo(dc, t->GetSelected(), t->IsSynchroSelected()); dc->DrawRectangle(bev); dc->DrawText(titleStr, r.x + 19, r.y + 2); @@ -7366,7 +7366,7 @@ void TrackInfo::DrawMuteSolo(wxDC * dc, const wxRect r, Track * t, if (bev.y + bev.height >= r.y + r.height - 19) return; // don't draw mute and solo buttons, because they don't fit into track label - AColor::MediumTrackInfo( dc, t->GetSelected() || t->IsSynchroSelected()); + AColor::MediumTrackInfo( dc, t->GetSelected(), t->IsSynchroSelected()); if( solo ) { if( t->GetSolo() ) @@ -7410,7 +7410,7 @@ void TrackInfo::DrawMinimize(wxDC * dc, const wxRect r, Track * t, bool down, bo GetMinimizeRect(r, bev, minimized); // Clear background to get rid of previous arrow - AColor::MediumTrackInfo(dc, t->GetSelected() || t->IsSynchroSelected()); + AColor::MediumTrackInfo(dc, t->GetSelected(), t->IsSynchroSelected()); dc->DrawRectangle(bev); #ifdef EXPERIMENTAL_THEMING diff --git a/src/widgets/ASlider.cpp b/src/widgets/ASlider.cpp index fb9311b37..79ffeb8d1 100644 --- a/src/widgets/ASlider.cpp +++ b/src/widgets/ASlider.cpp @@ -681,7 +681,7 @@ void LWSlider::Draw() if (mEnabled) AColor::Dark(dc, false); else - AColor::Medium(dc, false); + AColor::Medium(dc, 0); if (mOrientation == wxHORIZONTAL) AColor::Line(*dc, mLeftX, mCenterY+1, mRightX+2, mCenterY+1); @@ -804,7 +804,7 @@ void LWSlider::Draw() if (mEnabled) AColor::Dark(dc, false); else - AColor::Medium(dc, false); + AColor::Medium(dc, 0); if (mOrientation == wxHORIZONTAL) AColor::Line(*dc, mLeftX+p+1, mCenterY-tickLength+1, mLeftX+p+1, mCenterY-1); // ticks above diff --git a/src/widgets/Grabber.cpp b/src/widgets/Grabber.cpp index 826c8f618..67f88235e 100644 --- a/src/widgets/Grabber.cpp +++ b/src/widgets/Grabber.cpp @@ -95,13 +95,13 @@ void Grabber::DrawGrabber( wxDC & dc ) int y, left, right, top, bottom; #ifndef EXPERIMENTAL_THEMING - AColor::Medium(&dc, mOver); + AColor::Medium(&dc, mOver ? 1 : 0); dc.DrawRectangle(r); #else // Paint the background if( mOver ) { - AColor::Medium(&dc, mOver); + AColor::Medium(&dc, mOver ? 1 : 0); dc.DrawRectangle(r); } else diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index e6d80e966..c5b71a87e 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -1881,7 +1881,7 @@ void AdornedRulerPanel::DoDrawPlayRegion(wxDC * dc) void AdornedRulerPanel::DoDrawBorder(wxDC * dc) { // Draw AdornedRulerPanel border - AColor::MediumTrackInfo( dc, false ); + AColor::MediumTrackInfo( dc, false, false ); dc->DrawRectangle( mInner ); wxRect r = mOuter;