7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-20 00:21:31 +00:00

Remove previous version of disable-previews-when-menu-open.

(It had been rendered inoperative by the fix for
#16844.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19117
This commit is contained in:
Jeff Young 2025-01-13 19:44:39 +00:00
parent c52c41a1d5
commit ce483c848a
3 changed files with 12 additions and 19 deletions

View File

@ -129,8 +129,7 @@ struct TOOL_DISPATCHER::BUTTON_STATE
TOOL_DISPATCHER::TOOL_DISPATCHER( TOOL_MANAGER* aToolMgr ) :
m_toolMgr( aToolMgr ),
m_currentMenu( nullptr )
m_toolMgr( aToolMgr )
{
m_sysDragMinX = wxSystemSettings::GetMetric( wxSYS_DRAG_X );
m_sysDragMinY = wxSystemSettings::GetMetric( wxSYS_DRAG_Y );
@ -593,24 +592,26 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
// hotkey. So we keep track of menu highlighting so we can differentiate.
//
static ACTION_MENU* currentMenu;
if( type == wxEVT_MENU_OPEN )
{
m_currentMenu = dynamic_cast<ACTION_MENU*>( menuEvent.GetMenu() );
currentMenu = dynamic_cast<ACTION_MENU*>( menuEvent.GetMenu() );
if( m_currentMenu )
m_currentMenu->OnMenuEvent( menuEvent );
if( currentMenu )
currentMenu->OnMenuEvent( menuEvent );
}
else if( type == wxEVT_MENU_HIGHLIGHT )
{
if( m_currentMenu )
m_currentMenu->OnMenuEvent( menuEvent );
if( currentMenu )
currentMenu->OnMenuEvent( menuEvent );
}
else if( type == wxEVT_MENU_CLOSE )
{
if( m_currentMenu )
m_currentMenu->OnMenuEvent( menuEvent );
if( currentMenu )
currentMenu->OnMenuEvent( menuEvent );
m_currentMenu = nullptr;
currentMenu = nullptr;
}
#endif

View File

@ -808,10 +808,7 @@ void LIB_TREE::onHoverTimer( wxTimerEvent& aEvent )
{
hidePreview();
TOOL_DISPATCHER* toolDispatcher = m_adapter->GetToolDispatcher();
if( !m_tree_ctrl->IsShownOnScreen() || m_previewDisabled
|| ( toolDispatcher && toolDispatcher->GetCurrentMenu() ) )
if( !m_tree_ctrl->IsShownOnScreen() || m_previewDisabled )
return;
wxDataViewItem item;

View File

@ -77,8 +77,6 @@ public:
*/
std::optional<TOOL_EVENT> GetToolEvent( wxKeyEvent* aKeyEvent, bool* aSpecialKeyFlag );
ACTION_MENU* GetCurrentMenu() const { return m_currentMenu; }
private:
/// Handles mouse related events (click, motion, dragging).
bool handleMouseButton( wxEvent& aEvent, int aIndex, bool aMotion );
@ -125,9 +123,6 @@ private:
/// Instance of tool manager that cooperates with the dispatcher.
TOOL_MANAGER* m_toolMgr;
/// The menu from the main menubar currently shown (if any; nullptr otherwise)
ACTION_MENU* m_currentMenu;
};
#endif // TOOL_DISPATCHER_H