Tweak Theming. Reticules, Down buttons; Selected buttons.

This commit is contained in:
James Crook 2017-04-06 20:44:24 +01:00
parent ce37650d04
commit 8ad2e599ab
9 changed files with 10887 additions and 10757 deletions

View File

@ -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);
}
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;
memDC.SelectObject(Bmp);
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)
{
#ifdef EXPERIMENTAL_THEMING
UseThemeColour( dc, selected ? clrMediumSelected : clrMedium);
UseThemeColour( dc, selected ? clrMediumSelected : clrTrackBackground );
#else
Dark( dc, selected );
#endif

View File

@ -66,7 +66,7 @@ class AColor {
static void Line(wxDC & dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
static void DrawFocus(wxDC & dc, 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 wxColour Blend(const wxColour & c1, const wxColour & c2);

View File

@ -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( bmpSlider, wxImage( 80, 20 ), wxT("Slider"));
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 );
DEFINE_IMAGE( bmpUpButtonExpand, wxImage( 96, 18 ), wxT("UpButtonExpand"));
DEFINE_IMAGE( bmpDownButtonExpand, wxImage( 96, 18 ), wxT("DownButtonExpand"));
DEFINE_IMAGE( bmpHiliteButtonExpand, wxImage( 96, 18 ), wxT("HiliteButtonExpand"));
DEFINE_IMAGE( bmpHiliteButtonExpandSel, wxImage( 96, 18 ), wxT("HiliteButtonExpandSel"));
SET_THEME_FLAGS( resFlagNewLine );
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
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

View File

@ -4832,9 +4832,9 @@ void TrackPanel::HandleClosing(wxMouseEvent & event)
wxClientDC dc(this);
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()) {
mTrackInfo.DrawCloseBox(&dc, rect, false);
mTrackInfo.DrawCloseBox(&dc, rect, t, false);
if (closeRect.Contains(event.m_x, event.m_y)) {
AudacityProject *p = GetProject();
p->StopIfPaused();
@ -5432,7 +5432,7 @@ bool TrackPanel::CloseFunc(Track * t, wxRect rect, int x, int y)
SetCapturedTrack( t, IsClosing );
mCapturedRect = rect;
mTrackInfo.DrawCloseBox(&dc, rect, true);
mTrackInfo.DrawCloseBox(&dc, rect, t, true);
return true;
}
@ -7265,7 +7265,7 @@ void TrackPanel::DrawOutside(Track * t, wxDC * dc, const wxRect & rec,
rect.width = mTrackInfo.GetTrackInfoWidth();
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.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;
GetCloseBoxRect(rect, bev);
AColor::Bevel2(*dc, !down, bev);
AColor::Bevel2(*dc, !down, bev, t->GetSelected() );
#ifdef EXPERIMENTAL_THEMING
wxPen pen( theTheme.Colour( clrTrackPanelText ));
@ -9406,7 +9406,7 @@ void TrackInfo::DrawTitleBar(wxDC * dc, const wxRect & rect, Track * t,
wxRect bev;
GetTitleBarRect(rect, bev);
//bev.Inflate(-1, -1);
AColor::Bevel2(*dc, !down, bev);
AColor::Bevel2(*dc, !down, bev, t->GetSelected());
// Draw title text
SetTrackInfoFont(dc);
@ -9496,7 +9496,8 @@ void TrackInfo::DrawMuteSolo(wxDC * dc, const wxRect & rect, Track * t,
AColor::Bevel2(
*dc,
(solo ? pt->GetSolo() : (pt && pt->GetMute())) == down,
bev
bev,
t->GetSelected()
);
SetTrackInfoFont(dc);
@ -9517,10 +9518,10 @@ void TrackInfo::DrawMinimize(wxDC * dc, const wxRect & rect, Track * t, bool dow
GetMinimizeRect(rect, bev);
// Clear background to get rid of previous arrow
AColor::MediumTrackInfo(dc, t->GetSelected());
dc->DrawRectangle(bev);
//AColor::MediumTrackInfo(dc, t->GetSelected());
//dc->DrawRectangle(bev);
AColor::Bevel2(*dc, !down, bev);
AColor::Bevel2(*dc, !down, bev, t->GetSelected());
#ifdef EXPERIMENTAL_THEMING
wxColour c = theTheme.Colour(clrTrackPanelText);

View File

@ -102,7 +102,7 @@ private:
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 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 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;

View File

@ -744,7 +744,9 @@ void LWSlider::Draw(wxDC & paintDC)
// Draw the line along which the thumb moves.
//AColor::Light(&dc, false);
AColor::UseThemeColour( &dc, clrTrackPanelText );
//AColor::UseThemeColour( &dc, clrTrackPanelText );
//AColor::Dark(&dc, false);
AColor::UseThemeColour(&dc, clrSliderMain );
if (mOrientation == wxHORIZONTAL)
{
@ -776,7 +778,7 @@ void LWSlider::Draw(wxDC & paintDC)
dc.SetTextBackground( theTheme.Colour( clrTrackInfo ) );
dc.SetBackground( theTheme.Colour( clrTrackInfo ) );
// 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
// background.
dc.SetBackgroundMode( wxSOLID );
@ -795,8 +797,7 @@ void LWSlider::Draw(wxDC & paintDC)
{
// draw the '-' and the '+'
#ifdef EXPERIMENTAL_THEMING
wxPen pen( theTheme.Colour( clrTrackPanelText ));
dc.SetPen( pen );
AColor::UseThemeColour(&dc, clrTrackPanelText );
#else
dc.SetPen(mEnabled ? *wxBLACK : wxColour(128, 128, 128));
#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.
//if ((mOrientation == wxVERTICAL) && (mStyle == DB_SLIDER))
//{
@ -849,7 +854,7 @@ void LWSlider::Draw(wxDC & paintDC)
// mpRuler->Draw(*dc);
//}
//else
{
if( bTicks ) {
// tick marks
int divs = 10;
double upp;
@ -873,7 +878,8 @@ void LWSlider::Draw(wxDC & paintDC)
{
int_d = (int)d;
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)
{
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
}
#if 0
AColor::Dark(&dc, false);
// AColor::Dark(&dc, false);
AColor::UseThemeColour(&dc, clrSliderDark );
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
}
#endif
}
d += upp;
}