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