diff --git a/pcbnew/menubar_footprint_editor.cpp b/pcbnew/menubar_footprint_editor.cpp index 471cfda625..6bcdc0c980 100644 --- a/pcbnew/menubar_footprint_editor.cpp +++ b/pcbnew/menubar_footprint_editor.cpp @@ -313,16 +313,16 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() contrastModeSubMenu->AppendSeparator(); - text = AddHotkeyName( _( "&Dim Current Layer" ), g_Pcbnew_Editor_Hotkeys_Descr, + text = AddHotkeyName( _( "&Decrease Layer Opacity" ), g_Pcbnew_Editor_Hotkeys_Descr, HK_DEC_LAYER_ALHPA ); AddMenuItem( contrastModeSubMenu, ID_DEC_LAYER_ALPHA, - text, _( "Dim the current layer" ), + text, _( "Make the current layer more transparent" ), KiBitmap( contrast_mode_xpm ) ); - text = AddHotkeyName( _( "&Brighten Current Layer" ), g_Pcbnew_Editor_Hotkeys_Descr, + text = AddHotkeyName( _( "&Increase Layer Opacity" ), g_Pcbnew_Editor_Hotkeys_Descr, HK_INC_LAYER_ALHPA ); AddMenuItem( contrastModeSubMenu, ID_INC_LAYER_ALPHA, - text, _( "Brighten the current layer" ), + text, _( "Make the current layer less transparent" ), KiBitmap( contrast_mode_xpm ) ); AddMenuItem( viewMenu, contrastModeSubMenu, diff --git a/pcbnew/menubar_pcb_editor.cpp b/pcbnew/menubar_pcb_editor.cpp index 75ef20cfa0..2bdc626fb2 100644 --- a/pcbnew/menubar_pcb_editor.cpp +++ b/pcbnew/menubar_pcb_editor.cpp @@ -755,16 +755,16 @@ void prepareViewMenu( wxMenu* aParentMenu, bool aUseGal ) contrastModeSubMenu->AppendSeparator(); - text = AddHotkeyName( _( "&Dim Current Layer" ), g_Pcbnew_Editor_Hotkeys_Descr, + text = AddHotkeyName( _( "&Decrease Layer Opacity" ), g_Pcbnew_Editor_Hotkeys_Descr, HK_DEC_LAYER_ALHPA ); AddMenuItem( contrastModeSubMenu, ID_DEC_LAYER_ALPHA, - text, _( "Dim the current layer" ), + text, _( "Make the current layer more transparent" ), KiBitmap( contrast_mode_xpm ) ); - text = AddHotkeyName( _( "&Brighten Current Layer" ), g_Pcbnew_Editor_Hotkeys_Descr, + text = AddHotkeyName( _( "&Increase Layer Opacity" ), g_Pcbnew_Editor_Hotkeys_Descr, HK_INC_LAYER_ALHPA ); AddMenuItem( contrastModeSubMenu, ID_INC_LAYER_ALPHA, - text, _( "Brighten the current layer" ), + text, _( "Make the current layer less transparent" ), KiBitmap( contrast_mode_xpm ) ); AddMenuItem( aParentMenu, contrastModeSubMenu, diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index 7a6ea11452..632c14179e 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -515,6 +515,12 @@ int PCBNEW_CONTROL::LayerToggle( const TOOL_EVENT& aEvent ) } +// It'd be nice to share the min/max with the COLOR4D_PICKER_DLG, but those are +// set in wxFormBuilder. +#define ALPHA_MIN 0.20 +#define ALPHA_MAX 1.00 +#define ALPHA_STEP 0.05 + int PCBNEW_CONTROL::LayerAlphaInc( const TOOL_EVENT& aEvent ) { auto painter = static_cast( getView()->GetPainter() ); @@ -523,15 +529,17 @@ int PCBNEW_CONTROL::LayerAlphaInc( const TOOL_EVENT& aEvent ) LAYER_NUM currentLayer = m_frame->GetActiveLayer(); KIGFX::COLOR4D currentColor = settings->GetLayerColor( currentLayer ); - if( currentColor.a <= 0.95 ) + if( currentColor.a <= ALPHA_MAX - ALPHA_STEP ) { - currentColor.a += 0.05; + currentColor.a += ALPHA_STEP; settings->SetLayerColor( currentLayer, currentColor ); m_frame->GetGalCanvas()->GetView()->UpdateLayerColor( currentLayer ); wxUpdateUIEvent dummy; static_cast( m_frame )->OnUpdateLayerAlpha( dummy ); } + else + wxBell(); return 0; } @@ -545,15 +553,17 @@ int PCBNEW_CONTROL::LayerAlphaDec( const TOOL_EVENT& aEvent ) LAYER_NUM currentLayer = m_frame->GetActiveLayer(); KIGFX::COLOR4D currentColor = settings->GetLayerColor( currentLayer ); - if( currentColor.a >= 0.05 ) + if( currentColor.a >= ALPHA_MIN + ALPHA_STEP ) { - currentColor.a -= 0.05; + currentColor.a -= ALPHA_STEP; settings->SetLayerColor( currentLayer, currentColor ); m_frame->GetGalCanvas()->GetView()->UpdateLayerColor( currentLayer ); wxUpdateUIEvent dummy; static_cast( m_frame )->OnUpdateLayerAlpha( dummy ); } + else + wxBell(); return 0; }