Browse Source

Use a wxSearchCtrl instead of wxTextCtrl for the symbol chooser window

This just makes it prettier with the search icon and cancel
6.0.7
Marek Roszko 4 years ago
parent
commit
3b33f94c56
  1. 5
      common/widgets/lib_tree.cpp
  2. 3
      include/widgets/lib_tree.h

5
common/widgets/lib_tree.cpp

@ -30,6 +30,7 @@
#include <wx/html/htmlwin.h>
#include <tool/tool_interactive.h>
#include <tool/tool_manager.h>
#include <wx/srchctrl.h>
#include <wx/settings.h>
#include <wx/statbmp.h>
@ -51,9 +52,11 @@ LIB_TREE::LIB_TREE( wxWindow* aParent, LIB_TABLE* aLibTable,
{
auto search_sizer = new wxBoxSizer( wxHORIZONTAL );
m_query_ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition,
m_query_ctrl = new wxSearchCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition,
wxDefaultSize, wxTE_PROCESS_ENTER );
m_query_ctrl->ShowCancelButton( true );
// Additional visual cue for GTK, which hides the placeholder text on focus
#ifdef __WXGTK__
auto bitmap = new wxStaticBitmap( this, wxID_ANY, wxArtProvider::GetBitmap( wxART_FIND, wxART_FRAME_ICON ) );

3
include/widgets/lib_tree.h

@ -32,6 +32,7 @@ class wxDataViewCtrl;
class wxTextCtrl;
class wxHtmlWindow;
class wxHtmlLinkEvent;
class wxSearchCtrl;
class ACTION_MENU;
class LIB_ID;
class LIB_TABLE;
@ -171,7 +172,7 @@ protected:
wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER> m_adapter;
wxTextCtrl* m_query_ctrl;
wxSearchCtrl* m_query_ctrl;
wxDataViewCtrl* m_tree_ctrl;
wxHtmlWindow* m_details_ctrl;

Loading…
Cancel
Save