Allow disambiguation menu configurability

Adds an advanced config flag to all testing different values for
different users.

Related to https://gitlab.com/kicad/code/kicad/-/issues/15128
This commit is contained in:
Seth Hillbrand 2023-09-24 16:33:05 -07:00
parent 63558d4b09
commit 91450c22cc
5 changed files with 24 additions and 5 deletions

View File

@ -212,6 +212,11 @@ static const wxChar V3DRT_BevelHeight_um[] = wxT( "V3DRT_BevelHeight_um" );
static const wxChar V3DRT_BevelExtentFactor[] = wxT( "V3DRT_BevelExtentFactor" );
static const wxChar UseClipper2[] = wxT( "UseClipper2" );
/**
* The time in milliseconds to wait before displaying a disambiguation menu.
*/
static const wxChar DisambiguationTime[] = wxT( "DisambiguationTime" );
} // namespace KEYS
@ -347,6 +352,8 @@ ADVANCED_CFG::ADVANCED_CFG()
m_IncrementalConnectivity = false;
m_DisambiguationMenuDelay = 500;
loadFromConfigFile();
}
@ -501,6 +508,10 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::IncrementalConnectivity,
&m_IncrementalConnectivity, m_IncrementalConnectivity ) );
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::DisambiguationTime,
&m_DisambiguationMenuDelay, m_DisambiguationMenuDelay,
50, 10000 ) );
// Special case for trace mask setting...we just grab them and set them immediately

View File

@ -22,6 +22,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <advanced_config.h>
#include <core/typeinfo.h>
#include <core/kicad_algo.h>
#include <gal/graphics_abstraction_layer.h>
@ -380,13 +381,13 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
if( hasModifier() )
{
m_originalCursor = m_toolMgr->GetMousePosition();
m_disambiguateTimer.StartOnce( 500 );
m_disambiguateTimer.StartOnce( ADVANCED_CFG::GetCfg().m_DisambiguationMenuDelay );
}
}
else
{
m_originalCursor = m_toolMgr->GetMousePosition();
m_disambiguateTimer.StartOnce( 500 );
m_disambiguateTimer.StartOnce( ADVANCED_CFG::GetCfg().m_DisambiguationMenuDelay );
}
}
// Single click? Select single object

View File

@ -267,6 +267,11 @@ public:
*/
bool m_IncrementalConnectivity;
/**
* The number of milliseconds to wait in a click before showing a disambiguation menu.
*/
int m_DisambiguationMenuDelay;
///@}

View File

@ -22,7 +22,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <advanced_config.h>
#include <view/view.h>
#include <view/view_controls.h>
#include <preview_items/selection_area.h>
@ -97,7 +97,7 @@ int PL_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
if( m_frame->ToolStackIsEmpty() && pt_tool && !pt_tool->HasPoint() )
{
m_originalCursor = m_toolMgr->GetMousePosition();
m_disambiguateTimer.StartOnce( 500 );
m_disambiguateTimer.StartOnce( ADVANCED_CFG::GetCfg().m_DisambiguationMenuDelay );
}
}
// Single click? Select single object

View File

@ -29,6 +29,8 @@
#include <functional>
#include <stack>
using namespace std::placeholders;
#include <advanced_config.h>
#include <macros.h>
#include <core/kicad_algo.h>
#include <board.h>
@ -285,7 +287,7 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
if( m_frame->ToolStackIsEmpty() && pt_tool && !pt_tool->HasPoint() )
{
m_originalCursor = m_toolMgr->GetMousePosition();
m_disambiguateTimer.StartOnce( 500 );
m_disambiguateTimer.StartOnce( ADVANCED_CFG::GetCfg().m_DisambiguationMenuDelay );
}
}
else if( evt->IsClick( BUT_LEFT ) )