Browse Source

Disable search ctrl cursor management on non-OSX.

Buggy at least on GTK and MSW.
8.0
Alex Shvartzkop 2 years ago
committed by dsa-t
parent
commit
764de7257f
  1. 7
      common/widgets/lib_tree.cpp

7
common/widgets/lib_tree.cpp

@ -128,11 +128,14 @@ LIB_TREE::LIB_TREE( wxWindow* aParent, const wxString& aRecentSearchesKey, LIB_T
m_query_ctrl->Bind( wxEVT_SEARCH_CANCEL, &LIB_TREE::onQueryText, this );
m_query_ctrl->Bind( wxEVT_CHAR_HOOK, &LIB_TREE::onQueryCharHook, this );
m_query_ctrl->Bind( wxEVT_MOTION, &LIB_TREE::onQueryMouseMoved, this );
#if defined( __WXOSX__ ) || wxCHECK_VERSION( 3, 3, 0 ) // Doesn't work properly on other ports
m_query_ctrl->Bind( wxEVT_LEAVE_WINDOW,
[this] ( wxMouseEvent& aEvt )
[this]( wxMouseEvent& aEvt )
{
SetCursor( wxCURSOR_ARROW );
} );
#endif
m_query_ctrl->Bind( wxEVT_MENU,
[this]( wxCommandEvent& aEvent )
@ -618,6 +621,7 @@ void LIB_TREE::onQueryCharHook( wxKeyEvent& aKeyStroke )
void LIB_TREE::onQueryMouseMoved( wxMouseEvent& aEvent )
{
#if defined( __WXOSX__ ) || wxCHECK_VERSION( 3, 3, 0 ) // Doesn't work properly on other ports
wxPoint pos = aEvent.GetPosition();
wxRect ctrlRect = m_query_ctrl->GetScreenRect();
int buttonWidth = ctrlRect.GetHeight(); // Presume buttons are square
@ -628,6 +632,7 @@ void LIB_TREE::onQueryMouseMoved( wxMouseEvent& aEvent )
SetCursor( wxCURSOR_ARROW );
else
SetCursor( wxCURSOR_IBEAM );
#endif
}

Loading…
Cancel
Save