Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv20847
Modified Files:
AColor.cpp AColor.h TrackPanel.cpp TrackPanel.h
Log Message:
Changed appearance of focused track, from using a green pen for the border, to
a bright yellow gradient that fades out surrounding the track.
Index: AColor.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AColor.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- AColor.h 6 Nov 2006 05:36:45 -0000 1.9
+++ AColor.h 4 Mar 2007 06:05:23 -0000 1.10
@@ -42,6 +42,10 @@
static void LightMIDIChannel(wxDC * dc, int channel /* 1 - 16 */ );
static void DarkMIDIChannel(wxDC * dc, int channel /* 1 - 16 */ );
+ static void TrackFocusPen(wxDC * dc, int level /* 0 - 2 */);
+
+ // Member variables
+
static wxBrush lightBrush[2];
static wxBrush mediumBrush[2];
static wxBrush darkBrush[2];
@@ -70,6 +74,8 @@
static wxPen labelSelectedPen;
static wxPen labelSurroundPen;
+ static wxPen trackFocusPens[3];
+
static wxBrush tooltipBrush;
Index: AColor.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AColor.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- AColor.cpp 6 Nov 2006 05:36:45 -0000 1.20
+++ AColor.cpp 4 Mar 2007 06:05:23 -0000 1.21
@@ -53,6 +53,7 @@
wxPen AColor::labelUnselectedPen;
wxPen AColor::labelSelectedPen;
wxPen AColor::labelSurroundPen;
+wxPen AColor::trackFocusPens[3];
wxBrush AColor::tooltipBrush;
@@ -165,6 +166,13 @@
dc->SetBrush(playRegionBrush[(int)locked]);
}
+void AColor::TrackFocusPen(wxDC * dc, int level)
+{
+ if (!inited)
+ Init();
+ dc->SetPen(trackFocusPens[level]);
+}
+
void AColor::Mute(wxDC * dc, bool on, bool selected, bool soloing)
{
if (!inited)
@@ -240,6 +248,11 @@
//Determine tooltip color
tooltipBrush.SetColour(
wxSystemSettingsNative::GetColour(wxSYS_COLOUR_INFOBK) );
+ // A tiny gradient of yellow surrounding the current focused track
+ trackFocusPens[0].SetColour(255, 255, 128);
+ trackFocusPens[1].SetColour(215, 215, 138);
+ trackFocusPens[2].SetColour(185, 185, 142);
+
#if defined(__WXMSW__) || defined(__WXGTK__)
// unselected
lightBrush[0].SetColour(light);
Index: TrackPanel.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/TrackPanel.cpp,v
retrieving revision 1.338
retrieving revision 1.339
diff -u -d -r1.338 -r1.339
--- TrackPanel.cpp 29 Jan 2007 00:48:25 -0000 1.338
+++ TrackPanel.cpp 4 Mar 2007 06:05:23 -0000 1.339
@@ -4338,11 +4338,15 @@
TrackListIterator iter(mTracks);
wxRect trackRect = panelRect;
+ wxRect focusRect(-1, -1, 0, 0);
wxRect r;
int i = 0;
for (Track * t = iter.First(); t; t = iter.Next()) {
DrawEverythingElse(t, dc, r, trackRect, i);
+ if( mAx->IsFocused( t ) ) {
+ focusRect = mLastDrawnTrackRect;
+ }
i++;
}
@@ -4353,8 +4357,15 @@
GetSize(&trackRect.width, &trackRect.height);
AColor::Dark(dc, false);
dc->DrawRectangle(trackRect);
+
+ if (GetFocusedTrack() != NULL) {
+ HighlightFocusedTrack(dc, focusRect);
+ }
}
+/// Draws 'Everything else' for one particular track. Basically
+/// everything except the actual waveform.
+///
/// Note that this is being called in a loop and that the parameter values
/// are expected to be maintained each time through.
void TrackPanel::DrawEverythingElse(Track * t, wxDC * dc, wxRect & r,
@@ -4408,6 +4419,17 @@
trackRect.y += t->GetHeight();
}
+/// Draw a three-level highlight gradient around the focused track.
+void TrackPanel::HighlightFocusedTrack(wxDC * dc, const wxRect r) {
+ dc->SetBrush(*wxTRANSPARENT_BRUSH);
+ AColor::TrackFocusPen(dc, 0);
+ dc->DrawRectangle(r.x-1, r.y-1, r.width+2, r.height+2);
+ AColor::TrackFocusPen(dc, 1);
+ dc->DrawRectangle(r.x-2, r.y-2, r.width+4, r.height+4);
+ AColor::TrackFocusPen(dc, 2);
+ dc->DrawRectangle(r.x-3, r.y-3, r.width+6, r.height+6);
+}
+
/// Draw zooming indicator that shows the region that will
/// be zoomed into when the user clicks and drags with a
/// zoom cursor. Handles both vertical and horizontal
@@ -4450,6 +4472,8 @@
r.width -= kLeftInset * 2;
r.height -= kTopInset;
+ mLastDrawnTrackRect = r;
+
mTrackLabel.DrawBackground(dc, r, t->GetSelected(), labelw);
DrawBordersAroundTrack(t, dc, r, labelw, vrul);
DrawShadow(t, dc, r);
@@ -5363,10 +5387,7 @@
const int labelw)
{
// Borders around track and label area
- if( mAx->IsFocused( t ) )
- dc->SetPen(*wxGREEN_PEN);
- else
- dc->SetPen(*wxBLACK_PEN);
+ dc->SetPen(*wxBLACK_PEN);
dc->DrawLine(r.x, r.y, r.x + r.width - 1, r.y); // top
dc->DrawLine(r.x, r.y, r.x, r.y + r.height - 1); // left
dc->DrawLine(r.x, r.y + r.height - 2, r.x + r.width - 1, r.y + r.height -
2); // bottom
Index: TrackPanel.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/TrackPanel.h,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- TrackPanel.h 22 Oct 2006 19:34:18 -0000 1.108
+++ TrackPanel.h 4 Mar 2007 06:05:23 -0000 1.109
@@ -368,6 +368,7 @@
const int vrul, const wxRect trackRect, int index);
void DrawZooming(wxDC* dc, const wxRect clip);
+ void HighlightFocusedTrack (wxDC* dc, const wxRect r);
void DrawShadow (Track *t, wxDC* dc, const wxRect r);
void DrawBordersAroundTrack(Track *t, wxDC* dc, const wxRect r, const int
labelw, const int vrul);
void DrawOutsideOfTrack (Track *t, wxDC* dc, const wxRect r);
@@ -470,6 +471,7 @@
float mDrawingStartSampleValue; // value of last click-down
sampleCount mDrawingLastDragSample; // sample of last drag-over
float mDrawingLastDragSampleValue; // value of last drag-over
+ wxRect mLastDrawnTrackRect;
double PositionToTime(int mouseXCoordinate,
int trackLeftEdge) const;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs