From 2f99621bd3558b09d2c82922c1ce32f397af44a3 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 13 Nov 2021 11:21:00 +0000 Subject: [PATCH] Fix some layout issues; change packaage highlight scheme. --- kicad/pcm/dialogs/dialog_pcm_base.cpp | 2 +- kicad/pcm/dialogs/dialog_pcm_base.fbp | 2 +- kicad/pcm/dialogs/panel_package.cpp | 11 +- kicad/pcm/dialogs/panel_packages_view.cpp | 2 +- .../pcm/dialogs/panel_packages_view_base.cpp | 22 +- .../pcm/dialogs/panel_packages_view_base.fbp | 283 +++++++++++++----- kicad/pcm/dialogs/panel_packages_view_base.h | 3 + 7 files changed, 234 insertions(+), 91 deletions(-) diff --git a/kicad/pcm/dialogs/dialog_pcm_base.cpp b/kicad/pcm/dialogs/dialog_pcm_base.cpp index d8c8333a03..003e2d1108 100644 --- a/kicad/pcm/dialogs/dialog_pcm_base.cpp +++ b/kicad/pcm/dialogs/dialog_pcm_base.cpp @@ -13,7 +13,7 @@ DIALOG_PCM_BASE::DIALOG_PCM_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { - this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); + this->SetSizeHints( wxSize( 940,550 ), wxDefaultSize ); wxBoxSizer* m_MainSizer; m_MainSizer = new wxBoxSizer( wxVERTICAL ); diff --git a/kicad/pcm/dialogs/dialog_pcm_base.fbp b/kicad/pcm/dialogs/dialog_pcm_base.fbp index 4705985db1..e0f89fb129 100644 --- a/kicad/pcm/dialogs/dialog_pcm_base.fbp +++ b/kicad/pcm/dialogs/dialog_pcm_base.fbp @@ -42,7 +42,7 @@ 0 wxID_ANY - -1,-1 + 940,550 DIALOG_PCM_BASE -1,-1 diff --git a/kicad/pcm/dialogs/panel_package.cpp b/kicad/pcm/dialogs/panel_package.cpp index b0f9a5f7b2..ad16a91ca7 100644 --- a/kicad/pcm/dialogs/panel_package.cpp +++ b/kicad/pcm/dialogs/panel_package.cpp @@ -157,17 +157,18 @@ void PANEL_PACKAGE::OnClick( wxMouseEvent& event ) void PANEL_PACKAGE::OnPaint( wxPaintEvent& event ) { + wxRect rect( wxPoint( 1, 1 ), GetClientSize() - wxSize( 1, 1 ) ); wxPaintDC dc( this ); dc.SetBrush( wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK ) ); dc.SetPen( wxPen( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ), 1 ) ); if( m_selected ) - dc.SetPen( wxPen( *wxBLACK, 3 ) ); + { + rect.Deflate( 1 ); + dc.SetPen( wxPen( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ), 4 ) ); + } - dc.DrawRectangle( wxPoint( 0, 0 ), GetClientSize() ); - - if( !m_selected ) - dc.DrawLine( 0, 0, GetClientSize().GetX(), 0 ); + dc.DrawRectangle( rect ); } diff --git a/kicad/pcm/dialogs/panel_packages_view.cpp b/kicad/pcm/dialogs/panel_packages_view.cpp index 89f5fe587f..ac5f768d55 100644 --- a/kicad/pcm/dialogs/panel_packages_view.cpp +++ b/kicad/pcm/dialogs/panel_packages_view.cpp @@ -580,7 +580,7 @@ void PANEL_PACKAGES_VIEW::updatePackageList() } } - sizer->FitInside( m_packageListWindow ); + m_packageListWindow->FitInside(); m_packageListWindow->SetScrollRate( 0, 15 ); m_packageListWindow->Layout(); } diff --git a/kicad/pcm/dialogs/panel_packages_view_base.cpp b/kicad/pcm/dialogs/panel_packages_view_base.cpp index 04b5e871e0..9b794c4c16 100644 --- a/kicad/pcm/dialogs/panel_packages_view_base.cpp +++ b/kicad/pcm/dialogs/panel_packages_view_base.cpp @@ -22,16 +22,19 @@ PANEL_PACKAGES_VIEW_BASE::PANEL_PACKAGES_VIEW_BASE( wxWindow* parent, wxWindowID m_panelList = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bPanelListSizer; - bPanelListSizer = new wxBoxSizer( wxVERTICAL ); + bPanelListSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bColumnSizer; + bColumnSizer = new wxBoxSizer( wxVERTICAL ); m_searchCtrl = new wxSearchCtrl( m_panelList, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); #ifndef __WXMAC__ m_searchCtrl->ShowSearchButton( true ); #endif m_searchCtrl->ShowCancelButton( false ); - bPanelListSizer->Add( m_searchCtrl, 0, wxEXPAND, 5 ); + bColumnSizer->Add( m_searchCtrl, 0, wxEXPAND|wxBOTTOM, 5 ); - m_packageListWindow = new wxScrolledWindow( m_panelList, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxALWAYS_SHOW_SB|wxBORDER_SUNKEN|wxFULL_REPAINT_ON_RESIZE|wxVSCROLL ); + m_packageListWindow = new wxScrolledWindow( m_panelList, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE|wxFULL_REPAINT_ON_RESIZE|wxVSCROLL ); m_packageListWindow->SetScrollRate( 5, 5 ); wxBoxSizer* bSizer2; bSizer2 = new wxBoxSizer( wxVERTICAL ); @@ -40,7 +43,13 @@ PANEL_PACKAGES_VIEW_BASE::PANEL_PACKAGES_VIEW_BASE( wxWindow* parent, wxWindowID m_packageListWindow->SetSizer( bSizer2 ); m_packageListWindow->Layout(); bSizer2->Fit( m_packageListWindow ); - bPanelListSizer->Add( m_packageListWindow, 1, wxEXPAND, 5 ); + bColumnSizer->Add( m_packageListWindow, 1, wxEXPAND, 5 ); + + + bPanelListSizer->Add( bColumnSizer, 1, wxEXPAND|wxALL, 5 ); + + m_staticline2 = new wxStaticLine( m_panelList, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bPanelListSizer->Add( m_staticline2, 0, wxEXPAND|wxBOTTOM, 5 ); m_panelList->SetSizer( bPanelListSizer ); @@ -48,7 +57,10 @@ PANEL_PACKAGES_VIEW_BASE::PANEL_PACKAGES_VIEW_BASE( wxWindow* parent, wxWindowID bPanelListSizer->Fit( m_panelList ); m_panelDetails = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bPanelDetailsSizer; - bPanelDetailsSizer = new wxBoxSizer( wxVERTICAL ); + bPanelDetailsSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_staticline1 = new wxStaticLine( m_panelDetails, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bPanelDetailsSizer->Add( m_staticline1, 0, wxEXPAND|wxBOTTOM, 5 ); m_infoScrollWindow = new wxScrolledWindow( m_panelDetails, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL ); m_infoScrollWindow->SetScrollRate( 5, 5 ); diff --git a/kicad/pcm/dialogs/panel_packages_view_base.fbp b/kicad/pcm/dialogs/panel_packages_view_base.fbp index 10f8d7a726..46cc260dae 100644 --- a/kicad/pcm/dialogs/panel_packages_view_base.fbp +++ b/kicad/pcm/dialogs/panel_packages_view_base.fbp @@ -170,13 +170,154 @@ bPanelListSizer - wxVERTICAL + wxHORIZONTAL none 5 - wxEXPAND + wxEXPAND|wxALL + 1 + + + bColumnSizer + wxVERTICAL + none + + 5 + wxEXPAND|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + 0 + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_searchCtrl + 1 + + + protected + 1 + + Resizable + 1 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + 5 + wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + -1,-1 + 1 + m_packageListWindow + 1 + + + protected + 1 + + Resizable + 5 + 5 + 1 + + ; ; forward_declare + 0 + + + + wxBORDER_NONE|wxFULL_REPAINT_ON_RESIZE|wxVSCROLL + + + bSizer2 + wxVERTICAL + none + + + + + + + 5 + wxEXPAND|wxBOTTOM 0 - + 1 1 1 @@ -187,7 +328,6 @@ - 0 1 0 @@ -212,7 +352,7 @@ 0 1 - m_searchCtrl + m_staticline2 1 @@ -220,88 +360,17 @@ 1 Resizable - 1 1 - + wxLI_VERTICAL ; ; forward_declare 0 - - wxFILTER_NONE - wxDefaultValidator - - - - 5 - wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - -1,-1 - 1 - m_packageListWindow - 1 - - - protected - 1 - - Resizable - 5 - 5 - 1 - - ; ; forward_declare - 0 - - - - wxALWAYS_SHOW_SB|wxBORDER_SUNKEN|wxFULL_REPAINT_ON_RESIZE|wxVSCROLL - - - bSizer2 - wxVERTICAL - none - - - @@ -360,8 +429,66 @@ -1,-1 bPanelDetailsSizer - wxVERTICAL + wxHORIZONTAL none + + 5 + wxEXPAND|wxBOTTOM + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_VERTICAL + ; ; forward_declare + 0 + + + + + + 5 wxEXPAND diff --git a/kicad/pcm/dialogs/panel_packages_view_base.h b/kicad/pcm/dialogs/panel_packages_view_base.h index 445cb786cd..570f693d83 100644 --- a/kicad/pcm/dialogs/panel_packages_view_base.h +++ b/kicad/pcm/dialogs/panel_packages_view_base.h @@ -22,6 +22,7 @@ class HTML_WINDOW; #include #include #include +#include #include #include #include @@ -47,7 +48,9 @@ class PANEL_PACKAGES_VIEW_BASE : public wxPanel wxPanel* m_panelList; wxSearchCtrl* m_searchCtrl; wxScrolledWindow* m_packageListWindow; + wxStaticLine* m_staticline2; wxPanel* m_panelDetails; + wxStaticLine* m_staticline1; wxScrolledWindow* m_infoScrollWindow; HTML_WINDOW* m_infoText; wxBoxSizer* m_sizerVersions;