Support 3 drag vs. select options, and unifiy with other drag prefs.

Fixes https://gitlab.com/kicad/code/kicad/issues/5493
This commit is contained in:
Jeff Young
2021-01-11 11:50:14 +00:00
parent 7134ff2da6
commit 6c648df4c6
17 changed files with 435 additions and 199 deletions
+10 -3
View File
@@ -325,6 +325,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
m_exclusive_or = true;
bool modifier_enabled = m_subtractive || m_additive || m_exclusive_or;
KIGFX::MOUSE_DRAG_ACTION drag_action = m_frame->GetDragAction();
// Is the user requesting that the selection list include all possible
// items without removing less likely selection candidates
@@ -431,7 +432,11 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
if( SCH_EDIT_FRAME* schframe = dynamic_cast<SCH_EDIT_FRAME*>( m_frame ) )
schframe->FocusOnItem( nullptr );
if( modifier_enabled || ( m_selection.Empty() && m_frame->GetDragSelects() ) )
if( modifier_enabled || drag_action == KIGFX::MOUSE_DRAG_ACTION::SELECT )
{
selectMultiple();
}
else if( m_selection.Empty() && drag_action != KIGFX::MOUSE_DRAG_ACTION::DRAG_ANY )
{
selectMultiple();
}
@@ -576,8 +581,10 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
{
m_nonModifiedCursor = KICURSOR::HAND;
}
else if( !m_selection.Empty() && !m_frame->GetDragSelects() && evt->HasPosition()
&& selectionContains( evt->Position() ) ) //move/drag option prediction
else if( !m_selection.Empty()
&& drag_action == KIGFX::MOUSE_DRAG_ACTION::DRAG_SELECTED
&& evt->HasPosition()
&& selectionContains( evt->Position() ) ) //move/drag option prediction
{
m_nonModifiedCursor = KICURSOR::MOVING;
}