1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-04 22:29:27 +02:00

Lighten colors slightly for sync-selection.

This commit is contained in:
businessmanprogrammersteve 2010-02-17 17:54:32 +00:00
parent c334b080e8
commit 5a6b7a4ec9
11 changed files with 61 additions and 25 deletions

View File

@ -29,10 +29,10 @@ It is also a place to document colour usage policy in Audacity
bool AColor::inited = false; bool AColor::inited = false;
wxBrush AColor::lightBrush[2]; wxBrush AColor::lightBrush[2];
wxBrush AColor::mediumBrush[2]; wxBrush AColor::mediumBrush[3];
wxBrush AColor::darkBrush[2]; wxBrush AColor::darkBrush[2];
wxPen AColor::lightPen[2]; wxPen AColor::lightPen[2];
wxPen AColor::mediumPen[2]; wxPen AColor::mediumPen[3];
wxPen AColor::darkPen[2]; wxPen AColor::darkPen[2];
wxPen AColor::cursorPen; wxPen AColor::cursorPen;
@ -54,8 +54,10 @@ wxBrush AColor::labelTextNormalBrush;
wxBrush AColor::labelTextEditBrush; wxBrush AColor::labelTextEditBrush;
wxBrush AColor::labelUnselectedBrush; wxBrush AColor::labelUnselectedBrush;
wxBrush AColor::labelSelectedBrush; wxBrush AColor::labelSelectedBrush;
wxBrush AColor::labelSyncSelBrush;
wxPen AColor::labelUnselectedPen; wxPen AColor::labelUnselectedPen;
wxPen AColor::labelSelectedPen; wxPen AColor::labelSelectedPen;
wxPen AColor::labelSyncSelPen;
wxPen AColor::labelSurroundPen; wxPen AColor::labelSurroundPen;
wxPen AColor::trackFocusPens[3]; wxPen AColor::trackFocusPens[3];
wxPen AColor::snapGuidePen; wxPen AColor::snapGuidePen;
@ -252,11 +254,11 @@ void AColor::Light(wxDC * dc, bool selected)
dc->SetPen(lightPen[index]); 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) if (!inited)
Init(); Init();
int index = (int) selected;
dc->SetBrush(mediumBrush[index]); dc->SetBrush(mediumBrush[index]);
dc->SetPen(mediumPen[index]); dc->SetPen(mediumPen[index]);
} }
@ -270,12 +272,13 @@ void AColor::Medium(wxDC * dc, bool selected)
#endif #endif
#endif #endif
void AColor::MediumTrackInfo(wxDC * dc, bool selected) void AColor::MediumTrackInfo(wxDC * dc, bool selected, bool syncSel)
{ {
#ifdef EXPERIMENTAL_THEMING #ifdef EXPERIMENTAL_THEMING
UseThemeColour( dc, selected ? clrTrackInfoSelected : clrTrackInfo); UseThemeColour( dc, selected ? clrTrackInfo :
syncSel ? clrTrackInfoSyncSel : clrTrackInfo);
#else #else
Medium( dc, selected ); Medium( dc, selected ? 1 : syncSel ? 2 : 0 );
#endif #endif
} }
@ -397,8 +400,10 @@ void AColor::Init()
theTheme.SetBrushColour( labelTextEditBrush, clrLabelTextEditBrush ); theTheme.SetBrushColour( labelTextEditBrush, clrLabelTextEditBrush );
theTheme.SetBrushColour( labelUnselectedBrush, clrLabelUnselectedBrush ); theTheme.SetBrushColour( labelUnselectedBrush, clrLabelUnselectedBrush );
theTheme.SetBrushColour( labelSelectedBrush, clrLabelSelectedBrush ); theTheme.SetBrushColour( labelSelectedBrush, clrLabelSelectedBrush );
theTheme.SetBrushColour( labelSyncSelBrush, clrSyncSel );
theTheme.SetPenColour( labelUnselectedPen, clrLabelUnselectedPen ); theTheme.SetPenColour( labelUnselectedPen, clrLabelUnselectedPen );
theTheme.SetPenColour( labelSelectedPen, clrLabelSelectedPen ); theTheme.SetPenColour( labelSelectedPen, clrLabelSelectedPen );
theTheme.SetPenColour( labelSyncSelPen, clrSyncSel );
theTheme.SetPenColour( labelSurroundPen, clrLabelSurroundPen ); theTheme.SetPenColour( labelSurroundPen, clrLabelSurroundPen );
// These colors were modified to avoid using reserved colors red and green // 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); mediumPen[1].SetColour(200, 200, 214);
darkPen[1].SetColour(0, 0, 0); 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 #else
#if defined(__WXMAC__) // && defined(TARGET_CARBON) #if defined(__WXMAC__) // && defined(TARGET_CARBON)
@ -467,6 +476,10 @@ void AColor::Init()
mediumPen[1].SetColour(180, 180, 192); mediumPen[1].SetColour(180, 180, 192);
darkPen[1].SetColour(148, 148, 170); 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 #else
// unselected // unselected
@ -485,6 +498,10 @@ void AColor::Init()
mediumPen[1].SetColour(180, 180, 192); mediumPen[1].SetColour(180, 180, 192);
darkPen[1].SetColour(0, 0, 0); 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
#endif #endif

View File

@ -36,8 +36,8 @@ class AColor {
static void TrackPanelBackground(wxDC * dc, bool selected); static void TrackPanelBackground(wxDC * dc, bool selected);
static void Light(wxDC * dc, bool selected); static void Light(wxDC * dc, bool selected);
static void Medium(wxDC * dc, bool selected); static void Medium(wxDC * dc, int index);
static void MediumTrackInfo(wxDC * dc, bool selected); static void MediumTrackInfo(wxDC * dc, bool selected, bool syncSel);
static void Dark(wxDC * dc, bool selected); static void Dark(wxDC * dc, bool selected);
static void CursorColor(wxDC * dc); static void CursorColor(wxDC * dc);
@ -57,10 +57,10 @@ class AColor {
// Member variables // Member variables
static wxBrush lightBrush[2]; static wxBrush lightBrush[2];
static wxBrush mediumBrush[2]; static wxBrush mediumBrush[3];
static wxBrush darkBrush[2]; static wxBrush darkBrush[2];
static wxPen lightPen[2]; static wxPen lightPen[2];
static wxPen mediumPen[2]; static wxPen mediumPen[3];
static wxPen darkPen[2]; static wxPen darkPen[2];
static wxPen cursorPen; static wxPen cursorPen;
@ -82,8 +82,10 @@ class AColor {
static wxBrush labelTextEditBrush; static wxBrush labelTextEditBrush;
static wxBrush labelUnselectedBrush; static wxBrush labelUnselectedBrush;
static wxBrush labelSelectedBrush; static wxBrush labelSelectedBrush;
static wxBrush labelSyncSelBrush;
static wxPen labelUnselectedPen; static wxPen labelUnselectedPen;
static wxPen labelSelectedPen; static wxPen labelSelectedPen;
static wxPen labelSyncSelPen;
static wxPen labelSurroundPen; static wxPen labelSurroundPen;
static wxPen trackFocusPens[3]; static wxPen trackFocusPens[3];

View File

@ -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( clrProgressDone, wxColour(60, 240, 60, 128), wxT("ProgressDone"));
DEFINE_COLOUR( clrProgressNotYet, wxColour(255, 255, 255,220), wxT("ProgressNotYet")); 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 // Indentation settings for Vim and Emacs and unique identifier for Arch, a
// version control system. Please do not modify past this point. // version control system. Please do not modify past this point.

View File

@ -733,8 +733,17 @@ void LabelTrack::Draw(wxDC & dc, const wxRect & r, double h, double pps,
wxRect selr = r; wxRect selr = r;
selr.x += before.width; selr.x += before.width;
selr.width = int ((dsel1 - dsel0) * pps); 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); dc.DrawRectangle(selr);
// If selection is synchro, draw in linked graphics // If selection is synchro, draw in linked graphics

View File

@ -501,7 +501,7 @@ void MixerTrackCluster::OnPaint(wxPaintEvent &evt)
#ifdef __WXMAC__ #ifdef __WXMAC__
// Fill with correct color, not scroller background. Done automatically on Windows. // Fill with correct color, not scroller background. Done automatically on Windows.
AColor::Medium(&dc, false); AColor::Medium(&dc, 0);
dc.DrawRectangle(this->GetClientRect()); dc.DrawRectangle(this->GetClientRect());
#endif #endif

View File

@ -110,6 +110,7 @@ void TrackArtist::SetColours()
theTheme.SetBrushColour( blankBrush, clrBlank ); theTheme.SetBrushColour( blankBrush, clrBlank );
theTheme.SetBrushColour( unselectedBrush, clrUnselected); theTheme.SetBrushColour( unselectedBrush, clrUnselected);
theTheme.SetBrushColour( selectedBrush, clrSelected); theTheme.SetBrushColour( selectedBrush, clrSelected);
theTheme.SetBrushColour( syncSelBrush, clrSyncSel);
theTheme.SetBrushColour( sampleBrush, clrSample); theTheme.SetBrushColour( sampleBrush, clrSample);
theTheme.SetBrushColour( selsampleBrush, clrSelSample); theTheme.SetBrushColour( selsampleBrush, clrSelSample);
theTheme.SetBrushColour( dragsampleBrush, clrDragSample); theTheme.SetBrushColour( dragsampleBrush, clrDragSample);
@ -117,6 +118,7 @@ void TrackArtist::SetColours()
theTheme.SetPenColour( blankPen, clrBlank); theTheme.SetPenColour( blankPen, clrBlank);
theTheme.SetPenColour( unselectedPen, clrUnselected); theTheme.SetPenColour( unselectedPen, clrUnselected);
theTheme.SetPenColour( selectedPen, clrSelected); theTheme.SetPenColour( selectedPen, clrSelected);
theTheme.SetPenColour( syncSelPen, clrSyncSel);
theTheme.SetPenColour( samplePen, clrSample); theTheme.SetPenColour( samplePen, clrSample);
theTheme.SetPenColour( selsamplePen, clrSelSample); theTheme.SetPenColour( selsamplePen, clrSelSample);
theTheme.SetPenColour( muteSamplePen, clrMuteSample); theTheme.SetPenColour( muteSamplePen, clrMuteSample);
@ -721,7 +723,8 @@ void TrackArtist::DrawWaveformBackground(wxDC &dc, const wxRect &r, const double
continue; continue;
} }
dc.SetBrush(lsel ? selectedBrush : unselectedBrush); dc.SetBrush(lsel ? (synchroSelection ? syncSelBrush : selectedBrush) :
unselectedBrush);
l = r.x + lx; l = r.x + lx;
w = x - lx; w = x - lx;
@ -741,7 +744,8 @@ void TrackArtist::DrawWaveformBackground(wxDC &dc, const wxRect &r, const double
lx = x; lx = x;
} }
dc.SetBrush(lsel ? selectedBrush : unselectedBrush); dc.SetBrush(lsel ? (synchroSelection ? syncSelBrush : selectedBrush) :
unselectedBrush);
l = r.x + lx; l = r.x + lx;
w = x - lx; w = x - lx;
if (lmaxbot != lmintop - 1) { if (lmaxbot != lmintop - 1) {

View File

@ -190,6 +190,7 @@ class AUDACITY_DLL_API TrackArtist {
wxBrush blankBrush; wxBrush blankBrush;
wxBrush unselectedBrush; wxBrush unselectedBrush;
wxBrush selectedBrush; wxBrush selectedBrush;
wxBrush syncSelBrush;
wxBrush sampleBrush; wxBrush sampleBrush;
wxBrush selsampleBrush; wxBrush selsampleBrush;
wxBrush dragsampleBrush;// for samples which are draggable. wxBrush dragsampleBrush;// for samples which are draggable.
@ -197,6 +198,7 @@ class AUDACITY_DLL_API TrackArtist {
wxPen blankPen; wxPen blankPen;
wxPen unselectedPen; wxPen unselectedPen;
wxPen selectedPen; wxPen selectedPen;
wxPen syncSelPen;
wxPen samplePen; wxPen samplePen;
wxPen rmsPen; wxPen rmsPen;
wxPen muteRmsPen; wxPen muteRmsPen;

View File

@ -7243,7 +7243,7 @@ void TrackInfo::DrawBackground(wxDC * dc, const wxRect r, bool bSelected,
// fill in label // fill in label
wxRect fill = r; wxRect fill = r;
fill.width = labelw-4; fill.width = labelw-4;
AColor::MediumTrackInfo(dc, bSelected || bSyncSel); AColor::MediumTrackInfo(dc, bSelected, bSyncSel);
dc->DrawRectangle(fill); dc->DrawRectangle(fill);
// Draw in linked tiles for synchro selection // 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 // characters if they are repeatedly drawn. This
// happens when holding down mouse button and moving // happens when holding down mouse button and moving
// in and out of the title bar. So clear it first. // 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->DrawRectangle(bev);
dc->DrawText(titleStr, r.x + 19, r.y + 2); 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) 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 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( solo )
{ {
if( t->GetSolo() ) if( t->GetSolo() )
@ -7410,7 +7410,7 @@ void TrackInfo::DrawMinimize(wxDC * dc, const wxRect r, Track * t, bool down, bo
GetMinimizeRect(r, bev, minimized); GetMinimizeRect(r, bev, minimized);
// Clear background to get rid of previous arrow // 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); dc->DrawRectangle(bev);
#ifdef EXPERIMENTAL_THEMING #ifdef EXPERIMENTAL_THEMING

View File

@ -681,7 +681,7 @@ void LWSlider::Draw()
if (mEnabled) if (mEnabled)
AColor::Dark(dc, false); AColor::Dark(dc, false);
else else
AColor::Medium(dc, false); AColor::Medium(dc, 0);
if (mOrientation == wxHORIZONTAL) if (mOrientation == wxHORIZONTAL)
AColor::Line(*dc, mLeftX, mCenterY+1, mRightX+2, mCenterY+1); AColor::Line(*dc, mLeftX, mCenterY+1, mRightX+2, mCenterY+1);
@ -804,7 +804,7 @@ void LWSlider::Draw()
if (mEnabled) if (mEnabled)
AColor::Dark(dc, false); AColor::Dark(dc, false);
else else
AColor::Medium(dc, false); AColor::Medium(dc, 0);
if (mOrientation == wxHORIZONTAL) if (mOrientation == wxHORIZONTAL)
AColor::Line(*dc, mLeftX+p+1, mCenterY-tickLength+1, mLeftX+p+1, mCenterY-1); // ticks above AColor::Line(*dc, mLeftX+p+1, mCenterY-tickLength+1, mLeftX+p+1, mCenterY-1); // ticks above

View File

@ -95,13 +95,13 @@ void Grabber::DrawGrabber( wxDC & dc )
int y, left, right, top, bottom; int y, left, right, top, bottom;
#ifndef EXPERIMENTAL_THEMING #ifndef EXPERIMENTAL_THEMING
AColor::Medium(&dc, mOver); AColor::Medium(&dc, mOver ? 1 : 0);
dc.DrawRectangle(r); dc.DrawRectangle(r);
#else #else
// Paint the background // Paint the background
if( mOver ) if( mOver )
{ {
AColor::Medium(&dc, mOver); AColor::Medium(&dc, mOver ? 1 : 0);
dc.DrawRectangle(r); dc.DrawRectangle(r);
} }
else else

View File

@ -1881,7 +1881,7 @@ void AdornedRulerPanel::DoDrawPlayRegion(wxDC * dc)
void AdornedRulerPanel::DoDrawBorder(wxDC * dc) void AdornedRulerPanel::DoDrawBorder(wxDC * dc)
{ {
// Draw AdornedRulerPanel border // Draw AdornedRulerPanel border
AColor::MediumTrackInfo( dc, false ); AColor::MediumTrackInfo( dc, false, false );
dc->DrawRectangle( mInner ); dc->DrawRectangle( mInner );
wxRect r = mOuter; wxRect r = mOuter;