From f2a902c0b193b4bb6380decd0f18541c97b295c2 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 18 Aug 2020 15:42:56 +0100 Subject: [PATCH] Remove extraneous drag actions. --- pcbnew/tools/edit_tool.cpp | 10 ++++------ pcbnew/tools/pcb_actions.cpp | 10 ++-------- pcbnew/tools/pcb_actions.h | 1 - pcbnew/tools/selection_tool.cpp | 2 +- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 181fb92550..1e22f986fd 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -396,8 +396,7 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, bool aPickReference ) grid.SetUseGrid( !evt->Modifier( MD_ALT ) ); controls->SetSnapping( !evt->Modifier( MD_ALT ) ); - if( evt->IsAction( &PCB_ACTIONS::move ) || evt->IsMotion() - || evt->IsAction( &PCB_ACTIONS::drag ) || evt->IsDrag( BUT_LEFT ) + if( evt->IsAction( &PCB_ACTIONS::move ) || evt->IsMotion() || evt->IsDrag( BUT_LEFT ) || evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsAction( &PCB_ACTIONS::moveWithReference ) ) { @@ -1656,7 +1655,6 @@ void EDIT_TOOL::setTransitions() { Go( &EDIT_TOOL::GetAndPlace, PCB_ACTIONS::getAndPlace.MakeEvent() ); Go( &EDIT_TOOL::Move, PCB_ACTIONS::move.MakeEvent() ); - Go( &EDIT_TOOL::Move, PCB_ACTIONS::drag.MakeEvent() ); Go( &EDIT_TOOL::Drag, PCB_ACTIONS::drag45Degree.MakeEvent() ); Go( &EDIT_TOOL::Drag, PCB_ACTIONS::dragFreeAngle.MakeEvent() ); Go( &EDIT_TOOL::Rotate, PCB_ACTIONS::rotateCw.MakeEvent() ); @@ -1665,9 +1663,9 @@ void EDIT_TOOL::setTransitions() Go( &EDIT_TOOL::Remove, ACTIONS::doDelete.MakeEvent() ); Go( &EDIT_TOOL::Remove, PCB_ACTIONS::deleteFull.MakeEvent() ); Go( &EDIT_TOOL::Properties, PCB_ACTIONS::properties.MakeEvent() ); - Go( &EDIT_TOOL::MoveExact, PCB_ACTIONS::moveExact.MakeEvent() ); - Go( &EDIT_TOOL::MoveWithReference, PCB_ACTIONS::moveWithReference.MakeEvent() ); - Go( &EDIT_TOOL::Duplicate, ACTIONS::duplicate.MakeEvent() ); + Go( &EDIT_TOOL::MoveExact, PCB_ACTIONS::moveExact.MakeEvent() ); + Go( &EDIT_TOOL::MoveWithReference, PCB_ACTIONS::moveWithReference.MakeEvent() ); + Go( &EDIT_TOOL::Duplicate, ACTIONS::duplicate.MakeEvent() ); Go( &EDIT_TOOL::Duplicate, PCB_ACTIONS::duplicateIncrement.MakeEvent() ); Go( &EDIT_TOOL::CreateArray, PCB_ACTIONS::createArray.MakeEvent() ); Go( &EDIT_TOOL::Mirror, PCB_ACTIONS::mirror.MakeEvent() ); diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index fe48d9971c..97825a124a 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -204,10 +204,6 @@ TOOL_ACTION PCB_ACTIONS::moveWithReference( "pcbnew.InteractiveMove.moveWithRefe _( "Moves the selected item(s) with a specified starting point" ), move_xpm, AF_ACTIVATE ); -TOOL_ACTION PCB_ACTIONS::drag( "pcbnew.InteractiveMove.drag", - AS_GLOBAL, 0, "", "", "", - move_xpm, AF_ACTIVATE ); - TOOL_ACTION PCB_ACTIONS::duplicateIncrement( "pcbnew.InteractiveEdit.duplicateIncrementPads", AS_GLOBAL, MD_SHIFT + MD_CTRL + 'D', LEGACY_HK_NAME( "Duplicate Item and Increment" ), @@ -1242,9 +1238,7 @@ TOOL_ACTION PCB_ACTIONS::routerTuneDiffPairSkew( "pcbnew.LengthTuner.TuneDiffPai ps_diff_pair_tune_phase_xpm, AF_ACTIVATE, (void*) PNS::PNS_MODE_TUNE_DIFF_PAIR_SKEW ); TOOL_ACTION PCB_ACTIONS::routerInlineDrag( "pcbnew.InteractiveRouter.InlineDrag", - AS_CONTEXT, 0, "", - _( "Drag Track/Via" ), _( "Drags tracks and vias without breaking connections" ), - drag_xpm ); + AS_CONTEXT ); TOOL_ACTION PCB_ACTIONS::inlineBreakTrack( "pcbnew.InteractiveRouter.InlineBreakTrack", AS_GLOBAL, 0, "", @@ -1270,4 +1264,4 @@ TOOL_ACTION PCB_ACTIONS::dragFreeAngle( "pcbnew.InteractiveRouter.DragFreeAngle" 'G', LEGACY_HK_NAME( "Drag Item" ), _( "Drag (free angle)" ), _( "Drags the nearest joint in the track without restricting the track angle." ), - move_xpm ); + drag_xpm ); diff --git a/pcbnew/tools/pcb_actions.h b/pcbnew/tools/pcb_actions.h index 36848226ec..8351eea8d1 100644 --- a/pcbnew/tools/pcb_actions.h +++ b/pcbnew/tools/pcb_actions.h @@ -90,7 +90,6 @@ public: /// move or drag an item static TOOL_ACTION move; - static TOOL_ACTION drag; /// move with a reference point static TOOL_ACTION moveWithReference; diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 8d25565ba9..8d71faf6dd 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -292,7 +292,7 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) else if( track && dragAction == TRACK_DRAG_ACTION::DRAG_FREE_ANGLE ) m_toolMgr->RunAction( PCB_ACTIONS::dragFreeAngle, true ); else - m_toolMgr->RunAction( PCB_ACTIONS::drag, true ); + m_toolMgr->RunAction( PCB_ACTIONS::move, true ); } else {