mirror of
https://github.com/cookiengineer/audacity
synced 2026-01-12 07:35:51 +01:00
Improve appearance of disabled mixer toolbar sliders.
This commit is contained in:
@@ -3,7 +3,7 @@ static const char * SliderThumbDisabled[] = {
|
|||||||
"11 14 7 1",
|
"11 14 7 1",
|
||||||
" c None",
|
" c None",
|
||||||
". c #DEDEDE",
|
". c #DEDEDE",
|
||||||
"+ c #888888",
|
"+ c #777777",
|
||||||
"@ c #EEEEEE",
|
"@ c #EEEEEE",
|
||||||
"# c #C8C8C8",
|
"# c #C8C8C8",
|
||||||
"$ c #999999",
|
"$ c #999999",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ static const char * SliderThumb_VerticalDisabled[] = {
|
|||||||
"14 11 7 1",
|
"14 11 7 1",
|
||||||
" c None",
|
" c None",
|
||||||
". c #DEDEDE",
|
". c #DEDEDE",
|
||||||
"+ c #888888",
|
"+ c #777777",
|
||||||
"@ c #EEEEEE",
|
"@ c #EEEEEE",
|
||||||
"# c #C8C8C8",
|
"# c #C8C8C8",
|
||||||
"$ c #F2F2F2",
|
"$ c #F2F2F2",
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ void MixerToolBar::Populate()
|
|||||||
|
|
||||||
// Show or hide the input slider based on whether it works
|
// Show or hide the input slider based on whether it works
|
||||||
mInputSlider->Enable(gAudioIO->InputMixerWorks());
|
mInputSlider->Enable(gAudioIO->InputMixerWorks());
|
||||||
|
SetToolTips();
|
||||||
|
|
||||||
UpdateControls();
|
UpdateControls();
|
||||||
|
|
||||||
@@ -227,6 +228,7 @@ void MixerToolBar::UpdatePrefs()
|
|||||||
|
|
||||||
// Show or hide the input slider based on whether it works
|
// Show or hide the input slider based on whether it works
|
||||||
mInputSlider->Enable(gAudioIO->InputMixerWorks());
|
mInputSlider->Enable(gAudioIO->InputMixerWorks());
|
||||||
|
SetToolTips();
|
||||||
|
|
||||||
// Layout the toolbar
|
// Layout the toolbar
|
||||||
Layout();
|
Layout();
|
||||||
@@ -379,6 +381,27 @@ void MixerToolBar::AdjustInputGain(int adj)
|
|||||||
UpdateControls();
|
UpdateControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MixerToolBar::SetToolTips()
|
||||||
|
{
|
||||||
|
#if wxUSE_TOOLTIPS
|
||||||
|
if (mInputSlider->IsEnabled()) {
|
||||||
|
mInputSlider->SetToolTip(_("Input Level Slider"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mInputSlider->SetToolTip(
|
||||||
|
_("Cannot control input level; use system mixer."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mOutputSlider->IsEnabled()) {
|
||||||
|
mOutputSlider->SetToolTip(_("Output Level Slider"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mOutputSlider->SetToolTip(
|
||||||
|
_("Cannot control output level; use system mixer."));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
|
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
|
||||||
// version control system. Please do not modify past this point.
|
// version control system. Please do not modify past this point.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ class MixerToolBar:public ToolBar {
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
void InitializeMixerToolBar();
|
void InitializeMixerToolBar();
|
||||||
|
void SetToolTips();
|
||||||
|
|
||||||
wxBitmap *mPlayBitmap;
|
wxBitmap *mPlayBitmap;
|
||||||
wxBitmap *mRecordBitmap;
|
wxBitmap *mRecordBitmap;
|
||||||
|
|||||||
@@ -678,10 +678,7 @@ void LWSlider::Draw()
|
|||||||
dc->Clear();
|
dc->Clear();
|
||||||
|
|
||||||
// Draw the line along which the thumb moves.
|
// Draw the line along which the thumb moves.
|
||||||
if (mEnabled)
|
AColor::Dark(dc, false);
|
||||||
AColor::Dark(dc, false);
|
|
||||||
else
|
|
||||||
AColor::Medium(dc, 0);
|
|
||||||
|
|
||||||
if (mOrientation == wxHORIZONTAL)
|
if (mOrientation == wxHORIZONTAL)
|
||||||
AColor::Line(*dc, mLeftX, mCenterY+1, mRightX+2, mCenterY+1);
|
AColor::Line(*dc, mLeftX, mCenterY+1, mRightX+2, mCenterY+1);
|
||||||
@@ -699,8 +696,10 @@ void LWSlider::Draw()
|
|||||||
wxFont labelFont(sliderFontSize-3, wxSWISS, wxNORMAL, wxNORMAL);
|
wxFont labelFont(sliderFontSize-3, wxSWISS, wxNORMAL, wxNORMAL);
|
||||||
dc->SetFont(labelFont);
|
dc->SetFont(labelFont);
|
||||||
|
|
||||||
|
// Colors
|
||||||
#ifdef EXPERIMENTAL_THEMING
|
#ifdef EXPERIMENTAL_THEMING
|
||||||
dc->SetTextForeground( theTheme.Colour( clrTrackPanelText ));
|
dc->SetTextForeground( theTheme.Colour( clrTrackPanelText ));
|
||||||
|
|
||||||
// TransparentColour should be same as clrTrackInfo.
|
// TransparentColour should be same as clrTrackInfo.
|
||||||
dc->SetTextBackground( theTheme.Colour( clrTrackInfo ) );
|
dc->SetTextBackground( theTheme.Colour( clrTrackInfo ) );
|
||||||
dc->SetBackground( theTheme.Colour( clrTrackInfo ) );
|
dc->SetBackground( theTheme.Colour( clrTrackInfo ) );
|
||||||
@@ -710,7 +709,11 @@ void LWSlider::Draw()
|
|||||||
// background.
|
// background.
|
||||||
dc->SetBackgroundMode( wxSOLID );
|
dc->SetBackgroundMode( wxSOLID );
|
||||||
#else
|
#else
|
||||||
dc->SetTextForeground( wxColour( 0,0,0) );
|
if (mEnabled)
|
||||||
|
dc->SetTextForeground( wxColour( 0,0,0) );
|
||||||
|
else
|
||||||
|
dc->SetTextForeground( wxColour(128, 128, 128));
|
||||||
|
|
||||||
dc->SetTextBackground( wxColour( 255,255,255));
|
dc->SetTextBackground( wxColour( 255,255,255));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -726,7 +729,10 @@ void LWSlider::Draw()
|
|||||||
wxPen pen( theTheme.Colour( clrTrackPanelText ));
|
wxPen pen( theTheme.Colour( clrTrackPanelText ));
|
||||||
dc->SetPen( pen );
|
dc->SetPen( pen );
|
||||||
#else
|
#else
|
||||||
dc->SetPen(*wxBLACK_PEN);
|
if (mEnabled)
|
||||||
|
dc->SetPen(*wxBLACK_PEN);
|
||||||
|
else
|
||||||
|
dc->SetPen(wxColour(128, 128, 128));
|
||||||
#endif
|
#endif
|
||||||
if (mOrientation == wxHORIZONTAL)
|
if (mOrientation == wxHORIZONTAL)
|
||||||
{
|
{
|
||||||
@@ -801,10 +807,7 @@ void LWSlider::Draw()
|
|||||||
else
|
else
|
||||||
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 (mEnabled)
|
AColor::Dark(dc, false);
|
||||||
AColor::Dark(dc, false);
|
|
||||||
else
|
|
||||||
AColor::Medium(dc, 0);
|
|
||||||
|
|
||||||
if (mOrientation == wxHORIZONTAL)
|
if (mOrientation == wxHORIZONTAL)
|
||||||
AColor::Line(*dc, mLeftX+p+1, mCenterY-tickLength+1, mLeftX+p+1, mCenterY-1); // ticks above
|
AColor::Line(*dc, mLeftX+p+1, mCenterY-tickLength+1, mLeftX+p+1, mCenterY-1); // ticks above
|
||||||
|
|||||||
Reference in New Issue
Block a user