mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-19 09:30:06 +02:00
Tweak Theming. Reticules, Down buttons; Selected buttons.
This commit is contained in:
parent
ce37650d04
commit
8ad2e599ab
@ -228,9 +228,15 @@ void AColor::Bevel(wxDC & dc, bool up, const wxRect & r)
|
|||||||
AColor::Line(dc, r.x, r.y + r.height, r.x + r.width, r.y + r.height);
|
AColor::Line(dc, r.x, r.y + r.height, r.x + r.width, r.y + r.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AColor::Bevel2(wxDC & dc, bool up, const wxRect & r)
|
void AColor::Bevel2(wxDC & dc, bool up, const wxRect & r, bool bSel)
|
||||||
{
|
{
|
||||||
wxBitmap & Bmp = theTheme.Bitmap( up ? bmpUpButtonExpand : bmpDownButtonExpand );
|
int index = 0;
|
||||||
|
if( bSel )
|
||||||
|
index = up ? bmpUpButtonExpandSel : bmpDownButtonExpandSel;
|
||||||
|
else
|
||||||
|
index = up ? bmpUpButtonExpand : bmpDownButtonExpand;
|
||||||
|
|
||||||
|
wxBitmap & Bmp = theTheme.Bitmap( index );
|
||||||
wxMemoryDC memDC;
|
wxMemoryDC memDC;
|
||||||
memDC.SelectObject(Bmp);
|
memDC.SelectObject(Bmp);
|
||||||
int h = wxMin( r.height, Bmp.GetHeight() );
|
int h = wxMin( r.height, Bmp.GetHeight() );
|
||||||
@ -335,7 +341,7 @@ void AColor::Dark(wxDC * dc, bool selected)
|
|||||||
void AColor::TrackPanelBackground(wxDC * dc, bool selected)
|
void AColor::TrackPanelBackground(wxDC * dc, bool selected)
|
||||||
{
|
{
|
||||||
#ifdef EXPERIMENTAL_THEMING
|
#ifdef EXPERIMENTAL_THEMING
|
||||||
UseThemeColour( dc, selected ? clrMediumSelected : clrMedium);
|
UseThemeColour( dc, selected ? clrMediumSelected : clrTrackBackground );
|
||||||
#else
|
#else
|
||||||
Dark( dc, selected );
|
Dark( dc, selected );
|
||||||
#endif
|
#endif
|
||||||
|
@ -66,7 +66,7 @@ class AColor {
|
|||||||
static void Line(wxDC & dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
|
static void Line(wxDC & dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
|
||||||
static void DrawFocus(wxDC & dc, wxRect & r);
|
static void DrawFocus(wxDC & dc, wxRect & r);
|
||||||
static void Bevel(wxDC & dc, bool up, const wxRect & r);
|
static void Bevel(wxDC & dc, bool up, const wxRect & r);
|
||||||
static void Bevel2(wxDC & dc, bool up, const wxRect & r);
|
static void Bevel2(wxDC & dc, bool up, const wxRect & r, bool bSel=false);
|
||||||
static void BevelTrackInfo(wxDC & dc, bool up, const wxRect & r);
|
static void BevelTrackInfo(wxDC & dc, bool up, const wxRect & r);
|
||||||
static wxColour Blend(const wxColour & c1, const wxColour & c2);
|
static wxColour Blend(const wxColour & c1, const wxColour & c2);
|
||||||
|
|
||||||
|
@ -188,10 +188,13 @@ from there. Audacity will look for a file called "Pause.png".
|
|||||||
DEFINE_IMAGE( bmpSliderThumb, wxImage( 11, 20 ), wxT("SliderThumb"));
|
DEFINE_IMAGE( bmpSliderThumb, wxImage( 11, 20 ), wxT("SliderThumb"));
|
||||||
DEFINE_IMAGE( bmpSlider, wxImage( 80, 20 ), wxT("Slider"));
|
DEFINE_IMAGE( bmpSlider, wxImage( 80, 20 ), wxT("Slider"));
|
||||||
DEFINE_IMAGE( bmpHiliteSlider, wxImage( 80, 20 ), wxT("HiliteSlider"));
|
DEFINE_IMAGE( bmpHiliteSlider, wxImage( 80, 20 ), wxT("HiliteSlider"));
|
||||||
|
DEFINE_IMAGE( bmpUpButtonExpandSel, wxImage( 96, 18 ), wxT("UpButtonExpandSel"));
|
||||||
|
DEFINE_IMAGE( bmpDownButtonExpandSel, wxImage( 96, 18 ), wxT("DownButtonExpandSel"));
|
||||||
SET_THEME_FLAGS( resFlagNewLine );
|
SET_THEME_FLAGS( resFlagNewLine );
|
||||||
DEFINE_IMAGE( bmpUpButtonExpand, wxImage( 96, 18 ), wxT("UpButtonExpand"));
|
DEFINE_IMAGE( bmpUpButtonExpand, wxImage( 96, 18 ), wxT("UpButtonExpand"));
|
||||||
DEFINE_IMAGE( bmpDownButtonExpand, wxImage( 96, 18 ), wxT("DownButtonExpand"));
|
DEFINE_IMAGE( bmpDownButtonExpand, wxImage( 96, 18 ), wxT("DownButtonExpand"));
|
||||||
DEFINE_IMAGE( bmpHiliteButtonExpand, wxImage( 96, 18 ), wxT("HiliteButtonExpand"));
|
DEFINE_IMAGE( bmpHiliteButtonExpand, wxImage( 96, 18 ), wxT("HiliteButtonExpand"));
|
||||||
|
DEFINE_IMAGE( bmpHiliteButtonExpandSel, wxImage( 96, 18 ), wxT("HiliteButtonExpandSel"));
|
||||||
|
|
||||||
SET_THEME_FLAGS( resFlagNewLine );
|
SET_THEME_FLAGS( resFlagNewLine );
|
||||||
DEFINE_IMAGE( bmpUpButtonLarge, wxImage( 48, 48 ), wxT("UpButtonLarge"));
|
DEFINE_IMAGE( bmpUpButtonLarge, wxImage( 48, 48 ), wxT("UpButtonLarge"));
|
||||||
@ -357,3 +360,9 @@ from there. Audacity will look for a file called "Pause.png".
|
|||||||
// This is for waveform drawing, selected outside of clips
|
// This is for waveform drawing, selected outside of clips
|
||||||
DEFINE_COLOUR( clrBlankSelected, wxColour(170, 170, 192), wxT("BlankSelected"));
|
DEFINE_COLOUR( clrBlankSelected, wxColour(170, 170, 192), wxT("BlankSelected"));
|
||||||
|
|
||||||
|
DEFINE_COLOUR( clrSliderLight, wxColour( 1, 1, 1), wxT("SliderLight") );
|
||||||
|
DEFINE_COLOUR( clrSliderMain, wxColour( 43, 43, 43), wxT("SliderMain") );
|
||||||
|
DEFINE_COLOUR( clrSliderDark, wxColour( 1, 1, 1), wxT("SliderDark") );
|
||||||
|
DEFINE_COLOUR( clrTrackBackground, wxColour( 20, 20, 20), wxT("TrackBackground") );
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -4832,9 +4832,9 @@ void TrackPanel::HandleClosing(wxMouseEvent & event)
|
|||||||
wxClientDC dc(this);
|
wxClientDC dc(this);
|
||||||
|
|
||||||
if (event.Dragging())
|
if (event.Dragging())
|
||||||
mTrackInfo.DrawCloseBox(&dc, rect, closeRect.Contains(event.m_x, event.m_y));
|
mTrackInfo.DrawCloseBox(&dc, rect, t, closeRect.Contains(event.m_x, event.m_y));
|
||||||
else if (event.LeftUp()) {
|
else if (event.LeftUp()) {
|
||||||
mTrackInfo.DrawCloseBox(&dc, rect, false);
|
mTrackInfo.DrawCloseBox(&dc, rect, t, false);
|
||||||
if (closeRect.Contains(event.m_x, event.m_y)) {
|
if (closeRect.Contains(event.m_x, event.m_y)) {
|
||||||
AudacityProject *p = GetProject();
|
AudacityProject *p = GetProject();
|
||||||
p->StopIfPaused();
|
p->StopIfPaused();
|
||||||
@ -5432,7 +5432,7 @@ bool TrackPanel::CloseFunc(Track * t, wxRect rect, int x, int y)
|
|||||||
SetCapturedTrack( t, IsClosing );
|
SetCapturedTrack( t, IsClosing );
|
||||||
mCapturedRect = rect;
|
mCapturedRect = rect;
|
||||||
|
|
||||||
mTrackInfo.DrawCloseBox(&dc, rect, true);
|
mTrackInfo.DrawCloseBox(&dc, rect, t, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7265,7 +7265,7 @@ void TrackPanel::DrawOutside(Track * t, wxDC * dc, const wxRect & rec,
|
|||||||
|
|
||||||
rect.width = mTrackInfo.GetTrackInfoWidth();
|
rect.width = mTrackInfo.GetTrackInfoWidth();
|
||||||
bool captured = (t == mCapturedTrack);
|
bool captured = (t == mCapturedTrack);
|
||||||
mTrackInfo.DrawCloseBox(dc, rect, (captured && mMouseCapture==IsClosing));
|
mTrackInfo.DrawCloseBox(dc, rect, t, (captured && mMouseCapture==IsClosing));
|
||||||
mTrackInfo.DrawTitleBar(dc, rect, t, (captured && mMouseCapture==IsPopping));
|
mTrackInfo.DrawTitleBar(dc, rect, t, (captured && mMouseCapture==IsPopping));
|
||||||
|
|
||||||
mTrackInfo.DrawMinimize(dc, rect, t, (captured && mMouseCapture==IsMinimizing));
|
mTrackInfo.DrawMinimize(dc, rect, t, (captured && mMouseCapture==IsMinimizing));
|
||||||
@ -9371,11 +9371,11 @@ void TrackInfo::GetTrackControlsRect(const wxRect & rect, wxRect & dest) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TrackInfo::DrawCloseBox(wxDC * dc, const wxRect & rect, bool down) const
|
void TrackInfo::DrawCloseBox(wxDC * dc, const wxRect & rect, Track * t, bool down) const
|
||||||
{
|
{
|
||||||
wxRect bev;
|
wxRect bev;
|
||||||
GetCloseBoxRect(rect, bev);
|
GetCloseBoxRect(rect, bev);
|
||||||
AColor::Bevel2(*dc, !down, bev);
|
AColor::Bevel2(*dc, !down, bev, t->GetSelected() );
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_THEMING
|
#ifdef EXPERIMENTAL_THEMING
|
||||||
wxPen pen( theTheme.Colour( clrTrackPanelText ));
|
wxPen pen( theTheme.Colour( clrTrackPanelText ));
|
||||||
@ -9406,7 +9406,7 @@ void TrackInfo::DrawTitleBar(wxDC * dc, const wxRect & rect, Track * t,
|
|||||||
wxRect bev;
|
wxRect bev;
|
||||||
GetTitleBarRect(rect, bev);
|
GetTitleBarRect(rect, bev);
|
||||||
//bev.Inflate(-1, -1);
|
//bev.Inflate(-1, -1);
|
||||||
AColor::Bevel2(*dc, !down, bev);
|
AColor::Bevel2(*dc, !down, bev, t->GetSelected());
|
||||||
|
|
||||||
// Draw title text
|
// Draw title text
|
||||||
SetTrackInfoFont(dc);
|
SetTrackInfoFont(dc);
|
||||||
@ -9496,7 +9496,8 @@ void TrackInfo::DrawMuteSolo(wxDC * dc, const wxRect & rect, Track * t,
|
|||||||
AColor::Bevel2(
|
AColor::Bevel2(
|
||||||
*dc,
|
*dc,
|
||||||
(solo ? pt->GetSolo() : (pt && pt->GetMute())) == down,
|
(solo ? pt->GetSolo() : (pt && pt->GetMute())) == down,
|
||||||
bev
|
bev,
|
||||||
|
t->GetSelected()
|
||||||
);
|
);
|
||||||
|
|
||||||
SetTrackInfoFont(dc);
|
SetTrackInfoFont(dc);
|
||||||
@ -9517,10 +9518,10 @@ void TrackInfo::DrawMinimize(wxDC * dc, const wxRect & rect, Track * t, bool dow
|
|||||||
GetMinimizeRect(rect, bev);
|
GetMinimizeRect(rect, bev);
|
||||||
|
|
||||||
// Clear background to get rid of previous arrow
|
// Clear background to get rid of previous arrow
|
||||||
AColor::MediumTrackInfo(dc, t->GetSelected());
|
//AColor::MediumTrackInfo(dc, t->GetSelected());
|
||||||
dc->DrawRectangle(bev);
|
//dc->DrawRectangle(bev);
|
||||||
|
|
||||||
AColor::Bevel2(*dc, !down, bev);
|
AColor::Bevel2(*dc, !down, bev, t->GetSelected());
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_THEMING
|
#ifdef EXPERIMENTAL_THEMING
|
||||||
wxColour c = theTheme.Colour(clrTrackPanelText);
|
wxColour c = theTheme.Colour(clrTrackPanelText);
|
||||||
|
@ -102,7 +102,7 @@ private:
|
|||||||
|
|
||||||
void DrawBackground(wxDC * dc, const wxRect & rect, bool bSelected, bool bHasMuteSolo, const int labelw, const int vrul) const;
|
void DrawBackground(wxDC * dc, const wxRect & rect, bool bSelected, bool bHasMuteSolo, const int labelw, const int vrul) const;
|
||||||
void DrawBordersWithin(wxDC * dc, const wxRect & rect, bool bHasMuteSolo ) const;
|
void DrawBordersWithin(wxDC * dc, const wxRect & rect, bool bHasMuteSolo ) const;
|
||||||
void DrawCloseBox(wxDC * dc, const wxRect & rect, bool down) const;
|
void DrawCloseBox(wxDC * dc, const wxRect & rect, Track * t, bool down) const;
|
||||||
void DrawTitleBar(wxDC * dc, const wxRect & rect, Track * t, bool down) const;
|
void DrawTitleBar(wxDC * dc, const wxRect & rect, Track * t, bool down) const;
|
||||||
void DrawMuteSolo(wxDC * dc, const wxRect & rect, Track * t, bool down, bool solo, bool bHasSoloButton) const;
|
void DrawMuteSolo(wxDC * dc, const wxRect & rect, Track * t, bool down, bool solo, bool bHasSoloButton) const;
|
||||||
void DrawVRuler(wxDC * dc, const wxRect & rect, Track * t) const;
|
void DrawVRuler(wxDC * dc, const wxRect & rect, Track * t) const;
|
||||||
|
@ -744,7 +744,9 @@ void LWSlider::Draw(wxDC & paintDC)
|
|||||||
|
|
||||||
// Draw the line along which the thumb moves.
|
// Draw the line along which the thumb moves.
|
||||||
//AColor::Light(&dc, false);
|
//AColor::Light(&dc, false);
|
||||||
AColor::UseThemeColour( &dc, clrTrackPanelText );
|
//AColor::UseThemeColour( &dc, clrTrackPanelText );
|
||||||
|
//AColor::Dark(&dc, false);
|
||||||
|
AColor::UseThemeColour(&dc, clrSliderMain );
|
||||||
|
|
||||||
if (mOrientation == wxHORIZONTAL)
|
if (mOrientation == wxHORIZONTAL)
|
||||||
{
|
{
|
||||||
@ -776,7 +778,7 @@ void LWSlider::Draw(wxDC & paintDC)
|
|||||||
dc.SetTextBackground( theTheme.Colour( clrTrackInfo ) );
|
dc.SetTextBackground( theTheme.Colour( clrTrackInfo ) );
|
||||||
dc.SetBackground( theTheme.Colour( clrTrackInfo ) );
|
dc.SetBackground( theTheme.Colour( clrTrackInfo ) );
|
||||||
// HAVE to use solid and not transparent here,
|
// HAVE to use solid and not transparent here,
|
||||||
// otherwise windows will do it's clever font optimisation trick,
|
// otherwise windows will do its clever font optimisation trick,
|
||||||
// but against a default colour of white, which is not OK on a dark
|
// but against a default colour of white, which is not OK on a dark
|
||||||
// background.
|
// background.
|
||||||
dc.SetBackgroundMode( wxSOLID );
|
dc.SetBackgroundMode( wxSOLID );
|
||||||
@ -795,8 +797,7 @@ void LWSlider::Draw(wxDC & paintDC)
|
|||||||
{
|
{
|
||||||
// draw the '-' and the '+'
|
// draw the '-' and the '+'
|
||||||
#ifdef EXPERIMENTAL_THEMING
|
#ifdef EXPERIMENTAL_THEMING
|
||||||
wxPen pen( theTheme.Colour( clrTrackPanelText ));
|
AColor::UseThemeColour(&dc, clrTrackPanelText );
|
||||||
dc.SetPen( pen );
|
|
||||||
#else
|
#else
|
||||||
dc.SetPen(mEnabled ? *wxBLACK : wxColour(128, 128, 128));
|
dc.SetPen(mEnabled ? *wxBLACK : wxColour(128, 128, 128));
|
||||||
#endif
|
#endif
|
||||||
@ -821,6 +822,10 @@ void LWSlider::Draw(wxDC & paintDC)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use special colour to indicate no ticks.
|
||||||
|
wxColour TickColour = theTheme.Colour( clrSliderLight );
|
||||||
|
bool bTicks = TickColour != wxColour(60,60,60);
|
||||||
|
|
||||||
//v 20090820: Ruler doesn't align with slider correctly -- yet.
|
//v 20090820: Ruler doesn't align with slider correctly -- yet.
|
||||||
//if ((mOrientation == wxVERTICAL) && (mStyle == DB_SLIDER))
|
//if ((mOrientation == wxVERTICAL) && (mStyle == DB_SLIDER))
|
||||||
//{
|
//{
|
||||||
@ -849,7 +854,7 @@ void LWSlider::Draw(wxDC & paintDC)
|
|||||||
// mpRuler->Draw(*dc);
|
// mpRuler->Draw(*dc);
|
||||||
//}
|
//}
|
||||||
//else
|
//else
|
||||||
{
|
if( bTicks ) {
|
||||||
// tick marks
|
// tick marks
|
||||||
int divs = 10;
|
int divs = 10;
|
||||||
double upp;
|
double upp;
|
||||||
@ -873,7 +878,8 @@ void LWSlider::Draw(wxDC & paintDC)
|
|||||||
{
|
{
|
||||||
int_d = (int)d;
|
int_d = (int)d;
|
||||||
int tickLength = ((int_d == 0) || (int_d == divs)) ? 5: 3; // longer ticks at extremes
|
int tickLength = ((int_d == 0) || (int_d == divs)) ? 5: 3; // longer ticks at extremes
|
||||||
AColor::Light(&dc, false);
|
AColor::UseThemeColour(&dc, clrSliderLight );
|
||||||
|
|
||||||
if (mOrientation == wxHORIZONTAL)
|
if (mOrientation == wxHORIZONTAL)
|
||||||
{
|
{
|
||||||
AColor::Line(dc, mLeftX+p, mCenterY-tickLength, mLeftX+p, mCenterY-1); // ticks above
|
AColor::Line(dc, mLeftX+p, mCenterY-tickLength, mLeftX+p, mCenterY-1); // ticks above
|
||||||
@ -882,8 +888,9 @@ void LWSlider::Draw(wxDC & paintDC)
|
|||||||
{
|
{
|
||||||
AColor::Line(dc, mCenterX-tickLength, mTopY+p, mCenterX-1, mTopY+p); // ticks at left
|
AColor::Line(dc, mCenterX-tickLength, mTopY+p, mCenterX-1, mTopY+p); // ticks at left
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
AColor::Dark(&dc, false);
|
// AColor::Dark(&dc, false);
|
||||||
|
AColor::UseThemeColour(&dc, clrSliderDark );
|
||||||
|
|
||||||
if (mOrientation == wxHORIZONTAL)
|
if (mOrientation == wxHORIZONTAL)
|
||||||
{
|
{
|
||||||
@ -893,7 +900,6 @@ void LWSlider::Draw(wxDC & paintDC)
|
|||||||
{
|
{
|
||||||
AColor::Line(dc, mCenterX-tickLength+1, mTopY+p+1, mCenterX-1, mTopY+p+1); // ticks at left
|
AColor::Line(dc, mCenterX-tickLength+1, mTopY+p+1, mCenterX-1, mTopY+p+1); // ticks at left
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
d += upp;
|
d += upp;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user