mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-17 16:50:26 +02:00
Add settable ruler colouring.
This commit is contained in:
parent
f0db511724
commit
2a043c0b35
@ -285,6 +285,7 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
|
||||
int w;
|
||||
vRuler->ruler.GetMaxSize(&w, NULL);
|
||||
vRuler->SetMinSize(wxSize(w, 150)); // height needed for wxGTK
|
||||
vRuler->SetTickColour( theTheme.Colour( clrGraphLabels ));
|
||||
|
||||
S.AddSpace(wxDefaultCoord, 1);
|
||||
S.Prop(1);
|
||||
@ -354,6 +355,7 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
|
||||
int h;
|
||||
hRuler->ruler.GetMaxSize(NULL, &h);
|
||||
hRuler->SetMinSize(wxSize(wxDefaultCoord, h));
|
||||
hRuler->SetTickColour( theTheme.Colour( clrGraphLabels ));
|
||||
|
||||
S.AddSpace(1, wxDefaultCoord);
|
||||
S.Prop(1);
|
||||
|
@ -42,6 +42,8 @@
|
||||
#include "../widgets/Ruler.h"
|
||||
|
||||
#include "../WaveTrack.h"
|
||||
#include "../Theme.h"
|
||||
#include "../AllThemeResources.h"
|
||||
|
||||
enum
|
||||
{
|
||||
@ -685,6 +687,9 @@ void EffectCompressorPanel::OnPaint(wxPaintEvent & WXUNUSED(evt))
|
||||
vRuler.SetBounds(0, 0, w, height - h);
|
||||
hRuler.SetBounds(w, height - h, width, height);
|
||||
|
||||
vRuler.SetTickColour( theTheme.Colour( clrGraphLabels ));
|
||||
hRuler.SetTickColour( theTheme.Colour( clrGraphLabels ));
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
dc.Clear();
|
||||
#endif
|
||||
|
@ -100,7 +100,7 @@ using std::max;
|
||||
#define PLAY_REGION_RECT_HEIGHT 3
|
||||
#define PLAY_REGION_GLOBAL_OFFSET_Y 7
|
||||
|
||||
wxColour Ruler::mTickColour{ 153, 153, 153 };
|
||||
//wxColour Ruler::mTickColour{ 153, 153, 153 };
|
||||
|
||||
//
|
||||
// Ruler
|
||||
@ -126,6 +126,7 @@ Ruler::Ruler()
|
||||
mBottom = -1;
|
||||
mbTicksOnly = true;
|
||||
mbTicksAtExtremes = false;
|
||||
mTickColour = wxColour( 153, 153, 153 );
|
||||
mPen.SetColour(mTickColour);
|
||||
|
||||
// Note: the font size is now adjusted automatically whenever
|
||||
@ -1340,7 +1341,7 @@ void Ruler::Draw(wxDC& dc, const TimeTrack* timetrack)
|
||||
}
|
||||
}
|
||||
|
||||
mMajorLabels[i].Draw(*mDC, mTwoTone);
|
||||
mMajorLabels[i].Draw(*mDC, mTwoTone, mTickColour);
|
||||
}
|
||||
|
||||
if(mbMinor == true) {
|
||||
@ -1368,7 +1369,7 @@ void Ruler::Draw(wxDC& dc, const TimeTrack* timetrack)
|
||||
mRight, mTop + pos);
|
||||
}
|
||||
}
|
||||
mMinorLabels[i].Draw(*mDC, mTwoTone);
|
||||
mMinorLabels[i].Draw(*mDC, mTwoTone, mTickColour);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1400,7 +1401,7 @@ void Ruler::Draw(wxDC& dc, const TimeTrack* timetrack)
|
||||
mRight, mTop + pos);
|
||||
}
|
||||
}
|
||||
mMinorMinorLabels[i].Draw(*mDC, mTwoTone);
|
||||
mMinorMinorLabels[i].Draw(*mDC, mTwoTone, mTickColour);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1532,14 +1533,14 @@ void Ruler::SetCustomMinorLabels(wxArrayString *label, size_t numLabel, int star
|
||||
//Remember: DELETE majorlabels....
|
||||
}
|
||||
|
||||
void Ruler::Label::Draw(wxDC&dc, bool twoTone) const
|
||||
void Ruler::Label::Draw(wxDC&dc, bool twoTone, wxColour c) const
|
||||
{
|
||||
if (text != wxT("")) {
|
||||
bool altColor = twoTone && value < 0.0;
|
||||
|
||||
#ifdef EXPERIMENTAL_THEMING
|
||||
// TODO: handle color distinction
|
||||
dc.SetTextForeground(mTickColour);
|
||||
dc.SetTextForeground(c);
|
||||
#else
|
||||
dc.SetTextForeground(altColor ? *wxBLUE : *wxBLACK);
|
||||
#endif
|
||||
@ -3095,16 +3096,15 @@ void AdornedRulerPanel::ShowContextMenu( MenuChoice choice, const wxPoint *pPosi
|
||||
void AdornedRulerPanel::DoDrawBackground(wxDC * dc)
|
||||
{
|
||||
// Draw AdornedRulerPanel border
|
||||
AColor::MediumTrackInfo( dc, false );
|
||||
AColor::UseThemeColour( dc, clrTrackInfo );
|
||||
dc->DrawRectangle( mInner );
|
||||
|
||||
if (mShowScrubbing) {
|
||||
// Let's distinguish the scrubbing area by using the same gray as for
|
||||
// selected track control panel.
|
||||
AColor::MediumTrackInfo(dc, true);
|
||||
AColor::UseThemeColour(dc, clrScrubRuler );
|
||||
dc->DrawRectangle(mScrubZone);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void AdornedRulerPanel::DoDrawEdge(wxDC *dc)
|
||||
|
@ -171,7 +171,7 @@ public:
|
||||
wxRect mRect;
|
||||
|
||||
private:
|
||||
static wxColour mTickColour;
|
||||
wxColour mTickColour;
|
||||
wxPen mPen;
|
||||
|
||||
int mMaxWidth, mMaxHeight;
|
||||
@ -204,7 +204,7 @@ private:
|
||||
int lx, ly;
|
||||
wxString text;
|
||||
|
||||
void Draw(wxDC &dc, bool twoTone) const;
|
||||
void Draw(wxDC &dc, bool twoTone, wxColour c) const;
|
||||
};
|
||||
|
||||
int mNumMajor;
|
||||
@ -258,6 +258,7 @@ class AUDACITY_DLL_API RulerPanel final : public wxPanelWrapper {
|
||||
void OnErase(wxEraseEvent &evt);
|
||||
void OnPaint(wxPaintEvent &evt);
|
||||
void OnSize(wxSizeEvent &evt);
|
||||
void SetTickColour( wxColour & c){ ruler.SetTickColour( c );}
|
||||
|
||||
// We don't need or want to accept focus.
|
||||
bool AcceptsFocus() const { return false; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user