Update cross hairshape (GAL).

This commit is contained in:
Maciej Suminski 2015-06-26 17:30:41 +02:00
parent a43a288e10
commit 37db33cbca
3 changed files with 9 additions and 10 deletions

View File

@ -331,6 +331,9 @@ void EDA_DRAW_FRAME::OnUpdateGrid( wxUpdateUIEvent& aEvent )
void EDA_DRAW_FRAME::OnUpdateCrossHairStyle( wxUpdateUIEvent& aEvent )
{
if( aEvent.IsChecked() != m_cursorShape && IsGalCanvasActive() )
GetToolManager()->RunAction( "pcbnew.Control.switchCursor" );
aEvent.Check( m_cursorShape );
}
@ -1043,6 +1046,8 @@ void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable )
gal->SetGridVisibility( IsGridVisible() );
gal->SetGridSize( VECTOR2D( screen->GetGridSize() ) );
gal->SetGridOrigin( VECTOR2D( GetGridOrigin() ) );
GetToolManager()->RunAction( "pcbnew.Control.switchCursor" );
}
else // Switch to standard rendering
{

View File

@ -644,9 +644,6 @@ boost::optional<TOOL_EVENT> COMMON_ACTIONS::TranslateLegacyId( int aId )
case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE:
return COMMON_ACTIONS::highContrastMode.MakeEvent();
case ID_TB_OPTIONS_SELECT_CURSOR:
return COMMON_ACTIONS::switchCursor.MakeEvent();
case ID_FIND_ITEMS:
return COMMON_ACTIONS::find.MakeEvent();

View File

@ -509,15 +509,12 @@ int PCBNEW_CONTROL::ResetCoords( const TOOL_EVENT& aEvent )
int PCBNEW_CONTROL::SwitchCursor( const TOOL_EVENT& aEvent )
{
const unsigned int BIG_CURSOR = 4000;
const unsigned int BIG_CURSOR = 8000;
const unsigned int SMALL_CURSOR = 80;
KIGFX::GAL* gal = getEditFrame<PCB_BASE_FRAME>()->GetGalCanvas()->GetGAL();
if( gal->GetCursorSize() == BIG_CURSOR )
gal->SetCursorSize( SMALL_CURSOR );
else
gal->SetCursorSize( BIG_CURSOR );
PCB_BASE_FRAME* frame = getEditFrame<PCB_BASE_FRAME>();
KIGFX::GAL* gal = frame->GetGalCanvas()->GetGAL();
gal->SetCursorSize( frame->GetCursorShape() ? BIG_CURSOR : SMALL_CURSOR );
return 0;
}