Hotkey feedback for inactive layer display mode
This commit is contained in:
parent
fc69939190
commit
b424dc11e1
|
@ -77,7 +77,7 @@ void HOTKEY_CYCLE_POPUP::Popup( const wxString& aTitle, const wxArrayString& aIt
|
||||||
m_listBox->SetSelection( std::min( aSelection,
|
m_listBox->SetSelection( std::min( aSelection,
|
||||||
static_cast<int>( m_listBox->GetCount() ) - 1 ) );
|
static_cast<int>( m_listBox->GetCount() ) - 1 ) );
|
||||||
|
|
||||||
int width = 0;
|
int width = m_stTitle->GetTextExtent( aTitle ).x;
|
||||||
int height = 0;
|
int height = 0;
|
||||||
|
|
||||||
for( const wxString& item : aItems )
|
for( const wxString& item : aItems )
|
||||||
|
|
|
@ -708,3 +708,6 @@ const TOOL_EVENT EVENTS::DisambiguatePoint( TC_MESSAGE, TA_ACTION, "common.Inter
|
||||||
|
|
||||||
const TOOL_EVENT EVENTS::GridChangedByKeyEvent( TC_MESSAGE, TA_ACTION,
|
const TOOL_EVENT EVENTS::GridChangedByKeyEvent( TC_MESSAGE, TA_ACTION,
|
||||||
"common.Interactive.gridChangedByKey" );
|
"common.Interactive.gridChangedByKey" );
|
||||||
|
|
||||||
|
const TOOL_EVENT EVENTS::ContrastModeChangedByKeyEvent( TC_MESSAGE, TA_ACTION,
|
||||||
|
"common.Interactive.contrastModeChangedByKeyEvent" );
|
||||||
|
|
|
@ -225,6 +225,7 @@ public:
|
||||||
|
|
||||||
///< Used for hotkey feedback
|
///< Used for hotkey feedback
|
||||||
const static TOOL_EVENT GridChangedByKeyEvent;
|
const static TOOL_EVENT GridChangedByKeyEvent;
|
||||||
|
const static TOOL_EVENT ContrastModeChangedByKeyEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __ACTIONS_H
|
#endif // __ACTIONS_H
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#include <confirm.h>
|
#include <confirm.h>
|
||||||
#include <connectivity/connectivity_data.h>
|
#include <connectivity/connectivity_data.h>
|
||||||
#include <core/kicad_algo.h>
|
#include <core/kicad_algo.h>
|
||||||
|
#include <dialogs/hotkey_cycle_popup.h>
|
||||||
#include <kicad_clipboard.h>
|
#include <kicad_clipboard.h>
|
||||||
#include <origin_viewitem.h>
|
#include <origin_viewitem.h>
|
||||||
#include <pcb_edit_frame.h>
|
#include <pcb_edit_frame.h>
|
||||||
|
@ -318,6 +319,33 @@ int PCB_CONTROL::HighContrastModeCycle( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
m_frame->SetDisplayOptions( opts );
|
m_frame->SetDisplayOptions( opts );
|
||||||
|
|
||||||
|
m_toolMgr->PostEvent( EVENTS::ContrastModeChangedByKeyEvent );
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int PCB_CONTROL::ContrastModeFeedback( const TOOL_EVENT& aEvent )
|
||||||
|
{
|
||||||
|
if( !Pgm().GetCommonSettings()->m_Input.hotkey_feedback )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
PCB_DISPLAY_OPTIONS opts = frame()->GetDisplayOptions();
|
||||||
|
|
||||||
|
wxArrayString labels;
|
||||||
|
labels.Add( _( "Normal" ) );
|
||||||
|
labels.Add( _( "Dimmed" ) );
|
||||||
|
labels.Add( _( "Hidden" ) );
|
||||||
|
|
||||||
|
if( !m_frame->GetHotkeyPopup() )
|
||||||
|
m_frame->CreateHotkeyPopup();
|
||||||
|
|
||||||
|
HOTKEY_CYCLE_POPUP* popup = m_frame->GetHotkeyPopup();
|
||||||
|
|
||||||
|
if( popup )
|
||||||
|
popup->Popup( _( "Inactive Layer Display" ), labels,
|
||||||
|
static_cast<int>( opts.m_ContrastModeDisplay ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1553,6 +1581,7 @@ void PCB_CONTROL::setTransitions()
|
||||||
Go( &PCB_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayToggle.MakeEvent() );
|
Go( &PCB_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayToggle.MakeEvent() );
|
||||||
Go( &PCB_CONTROL::HighContrastMode, ACTIONS::highContrastMode.MakeEvent() );
|
Go( &PCB_CONTROL::HighContrastMode, ACTIONS::highContrastMode.MakeEvent() );
|
||||||
Go( &PCB_CONTROL::HighContrastModeCycle, ACTIONS::highContrastModeCycle.MakeEvent() );
|
Go( &PCB_CONTROL::HighContrastModeCycle, ACTIONS::highContrastModeCycle.MakeEvent() );
|
||||||
|
Go( &PCB_CONTROL::ContrastModeFeedback, EVENTS::ContrastModeChangedByKeyEvent );
|
||||||
Go( &PCB_CONTROL::NetColorModeCycle, PCB_ACTIONS::netColorModeCycle.MakeEvent() );
|
Go( &PCB_CONTROL::NetColorModeCycle, PCB_ACTIONS::netColorModeCycle.MakeEvent() );
|
||||||
Go( &PCB_CONTROL::RatsnestModeCycle, PCB_ACTIONS::ratsnestModeCycle.MakeEvent() );
|
Go( &PCB_CONTROL::RatsnestModeCycle, PCB_ACTIONS::ratsnestModeCycle.MakeEvent() );
|
||||||
Go( &PCB_CONTROL::FlipPcbView, PCB_ACTIONS::flipBoard.MakeEvent() );
|
Go( &PCB_CONTROL::FlipPcbView, PCB_ACTIONS::flipBoard.MakeEvent() );
|
||||||
|
|
|
@ -65,6 +65,8 @@ public:
|
||||||
// Update the view with the new high-contrast mode from the display settings
|
// Update the view with the new high-contrast mode from the display settings
|
||||||
int HighContrastMode( const TOOL_EVENT& aEvent );
|
int HighContrastMode( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
|
int ContrastModeFeedback( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
// Rotate through the available high-contrast, net color and ratsnest color modes
|
// Rotate through the available high-contrast, net color and ratsnest color modes
|
||||||
int HighContrastModeCycle( const TOOL_EVENT& aEvent );
|
int HighContrastModeCycle( const TOOL_EVENT& aEvent );
|
||||||
int NetColorModeCycle( const TOOL_EVENT& aEvent );
|
int NetColorModeCycle( const TOOL_EVENT& aEvent );
|
||||||
|
|
Loading…
Reference in New Issue