From 0cf866d4fb6e88c53ea6adac3cd1f496b2ec27cd Mon Sep 17 00:00:00 2001 From: aris-kimi Date: Wed, 21 May 2025 02:16:01 +0300 Subject: [PATCH] Inline static bool Fp/3Dmode members to remember panel layout Layout is remembered for Schematic/Symbol Editors and Footprint Chooser frames until KiCad restarts Also Added a new button toggle to show/hide the description panel with some new images too Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17610 --- common/bitmap_info.cpp | 8 + common/tool/common_tools.cpp | 8 +- include/bitmaps/bitmaps_list.h | 2 + pcbnew/footprint_chooser_frame.cpp | 90 +++++++++-- pcbnew/footprint_chooser_frame.h | 8 +- pcbnew/tools/pcb_grid_helper.cpp | 3 +- pcbnew/widgets/panel_footprint_chooser.cpp | 16 +- pcbnew/widgets/panel_footprint_chooser.h | 5 + resources/bitmaps_png/CMakeLists.txt | 2 + .../bitmaps_png/png/text_visibility_16.png | Bin 0 -> 499 bytes .../bitmaps_png/png/text_visibility_32.png | Bin 0 -> 953 bytes .../png/text_visibility_dark_16.png | Bin 0 -> 543 bytes .../png/text_visibility_dark_32.png | Bin 0 -> 1031 bytes .../png/text_visibility_off_16.png | Bin 0 -> 375 bytes .../png/text_visibility_off_32.png | Bin 0 -> 710 bytes .../png/text_visibility_off_dark_16.png | Bin 0 -> 581 bytes .../png/text_visibility_off_dark_32.png | Bin 0 -> 994 bytes .../sources/dark/text_visibility.svg | 133 ++++++++++++++++ .../sources/dark/text_visibility_off.svg | 140 +++++++++++++++++ .../sources/light/text_visibility.svg | 134 +++++++++++++++++ .../sources/light/text_visibility_off.svg | 142 ++++++++++++++++++ 21 files changed, 663 insertions(+), 28 deletions(-) create mode 100644 resources/bitmaps_png/png/text_visibility_16.png create mode 100644 resources/bitmaps_png/png/text_visibility_32.png create mode 100644 resources/bitmaps_png/png/text_visibility_dark_16.png create mode 100644 resources/bitmaps_png/png/text_visibility_dark_32.png create mode 100644 resources/bitmaps_png/png/text_visibility_off_16.png create mode 100644 resources/bitmaps_png/png/text_visibility_off_32.png create mode 100644 resources/bitmaps_png/png/text_visibility_off_dark_16.png create mode 100644 resources/bitmaps_png/png/text_visibility_off_dark_32.png create mode 100644 resources/bitmaps_png/sources/dark/text_visibility.svg create mode 100644 resources/bitmaps_png/sources/dark/text_visibility_off.svg create mode 100644 resources/bitmaps_png/sources/light/text_visibility.svg create mode 100644 resources/bitmaps_png/sources/light/text_visibility_off.svg diff --git a/common/bitmap_info.cpp b/common/bitmap_info.cpp index 83477b8277..f85168b7ca 100644 --- a/common/bitmap_info.cpp +++ b/common/bitmap_info.cpp @@ -102,6 +102,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::text_valign_top].emplace_back( BITMAPS::text_valign_top, wxT( "text_valign_top_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::text_valign_center].emplace_back( BITMAPS::text_valign_center, wxT( "text_valign_center_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::text_valign_bottom].emplace_back( BITMAPS::text_valign_bottom, wxT( "text_valign_bottom_16.png" ), 16, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::text_visibility].emplace_back( BITMAPS::text_visibility, wxT( "text_visibility_16.png" ), 16, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::text_visibility_off].emplace_back( BITMAPS::text_visibility_off, wxT( "text_visibility_off_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::text_bold].emplace_back( BITMAPS::text_bold, wxT( "text_bold_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::text_italic].emplace_back( BITMAPS::text_italic, wxT( "text_italic_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::text_mirrored].emplace_back( BITMAPS::text_mirrored, wxT( "text_mirrored_16.png" ), 16, wxT( "light" ) ); @@ -185,6 +187,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::text_valign_top].emplace_back( BITMAPS::text_valign_top, wxT( "text_valign_top_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::text_valign_center].emplace_back( BITMAPS::text_valign_center, wxT( "text_valign_center_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::text_valign_bottom].emplace_back( BITMAPS::text_valign_bottom, wxT( "text_valign_bottom_dark_16.png" ), 16, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::text_visibility].emplace_back( BITMAPS::text_visibility, wxT( "text_visibility_dark_16.png" ), 16, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::text_visibility_off].emplace_back( BITMAPS::text_visibility_off, wxT( "text_visibility_off_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::text_bold].emplace_back( BITMAPS::text_bold, wxT( "text_bold_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::text_italic].emplace_back( BITMAPS::text_italic, wxT( "text_italic_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::text_mirrored].emplace_back( BITMAPS::text_mirrored, wxT( "text_mirrored_dark_16.png" ), 16, wxT( "dark" ) ); @@ -268,6 +272,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::text_valign_top].emplace_back( BITMAPS::text_valign_top, wxT( "text_valign_top_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::text_valign_center].emplace_back( BITMAPS::text_valign_center, wxT( "text_valign_center_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::text_valign_bottom].emplace_back( BITMAPS::text_valign_bottom, wxT( "text_valign_bottom_32.png" ), 32, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::text_visibility].emplace_back( BITMAPS::text_visibility, wxT( "text_visibility_32.png" ), 32, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::text_visibility_off].emplace_back( BITMAPS::text_visibility_off, wxT( "text_visibility_off_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::text_bold].emplace_back( BITMAPS::text_bold, wxT( "text_bold_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::text_italic].emplace_back( BITMAPS::text_italic, wxT( "text_italic_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::text_mirrored].emplace_back( BITMAPS::text_mirrored, wxT( "text_mirrored_32.png" ), 32, wxT( "light" ) ); @@ -351,6 +357,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::text_valign_top].emplace_back( BITMAPS::text_valign_top, wxT( "text_valign_top_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::text_valign_center].emplace_back( BITMAPS::text_valign_center, wxT( "text_valign_center_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::text_valign_bottom].emplace_back( BITMAPS::text_valign_bottom, wxT( "text_valign_bottom_dark_32.png" ), 32, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::text_visibility].emplace_back( BITMAPS::text_visibility, wxT( "text_visibility_dark_32.png" ), 32, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::text_visibility_off].emplace_back( BITMAPS::text_visibility_off, wxT( "text_visibility_off_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::text_bold].emplace_back( BITMAPS::text_bold, wxT( "text_bold_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::text_italic].emplace_back( BITMAPS::text_italic, wxT( "text_italic_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::text_mirrored].emplace_back( BITMAPS::text_mirrored, wxT( "text_mirrored_dark_32.png" ), 32, wxT( "dark" ) ); diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp index 5c7e9506fd..179e88a3a9 100644 --- a/common/tool/common_tools.cpp +++ b/common/tool/common_tools.cpp @@ -460,6 +460,12 @@ int COMMON_TOOLS::doZoomToPreset( int idx, bool aCenterOnCursor ) { std::vector& zoomList = m_toolMgr->GetSettings()->m_Window.zoom_factors; + if( zoomList.empty() ) // When called from footprint chooser, zoomList is empty for some reason + zoomList = m_frame->config()->m_Window.zoom_factors; + // or: zoomList = Kiface().KifaceSettings()->m_Window.zoom_factors; + + wxCHECK( !zoomList.empty(), 0 ); // To avoid a crash lower on scale from Fp Chooser panel + if( idx == 0 ) // Zoom Auto { TOOL_EVENT dummy; @@ -801,5 +807,3 @@ void COMMON_TOOLS::setTransitions() Go( &COMMON_TOOLS::ToggleCursorStyle, ACTIONS::toggleCursorStyle.MakeEvent() ); Go( &COMMON_TOOLS::ToggleBoundingBoxes, ACTIONS::toggleBoundingBoxes.MakeEvent() ); } - - diff --git a/include/bitmaps/bitmaps_list.h b/include/bitmaps/bitmaps_list.h index e3ce4a3907..67b751cb27 100644 --- a/include/bitmaps/bitmaps_list.h +++ b/include/bitmaps/bitmaps_list.h @@ -616,6 +616,8 @@ enum class BITMAPS : unsigned int text_valign_top, text_valign_center, text_valign_bottom, + text_visibility, + text_visibility_off, text_horizontal, text_vertical, text_bold, diff --git a/pcbnew/footprint_chooser_frame.cpp b/pcbnew/footprint_chooser_frame.cpp index 99b7b248ac..082f991957 100644 --- a/pcbnew/footprint_chooser_frame.cpp +++ b/pcbnew/footprint_chooser_frame.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -99,11 +100,9 @@ FOOTPRINT_CHOOSER_FRAME::FOOTPRINT_CHOOSER_FRAME( KIWAY* aKiway, wxWindow* aPare { SetModal( true ); - m_showFpMode = true; - m_show3DMode = false; m_messagePanel->Hide(); - wxPanel* bottomPanel = new wxPanel( this ); + m_bottomPanel = new wxPanel( this ); wxBoxSizer* bottomSizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* frameSizer = new wxBoxSizer( wxVERTICAL ); @@ -134,39 +133,46 @@ FOOTPRINT_CHOOSER_FRAME::FOOTPRINT_CHOOSER_FRAME( KIWAY* aKiway, wxWindow* aPare GetBoard()->SetBoardUse( BOARD_USE::FPHOLDER ); build3DCanvas(); // must be called after creating m_chooserPanel - m_preview3DCanvas->Show( !m_showFpMode ); + m_preview3DCanvas->Show( m_show3DMode ); // buttonsSizer contains the BITMAP buttons wxBoxSizer* buttonsSizer = new wxBoxSizer( wxHORIZONTAL ); buttonsSizer->Add( 0, 0, 1, 0, 5 ); // Add spacer to right-align buttons - BITMAP_BUTTON* separator = new BITMAP_BUTTON( bottomPanel, wxID_ANY, wxNullBitmap ); + + m_toggleDescription = new BITMAP_BUTTON( m_bottomPanel, wxID_ANY, wxNullBitmap ); + m_toggleDescription->SetIsRadioButton(); + m_toggleDescription->SetBitmap( KiBitmapBundle( BITMAPS::text_visibility_off ) ); + m_toggleDescription->Check( m_showDescription ); + buttonsSizer->Add( m_toggleDescription, 0, wxRIGHT | wxLEFT | wxALIGN_CENTER_VERTICAL, 1 ); + + BITMAP_BUTTON* separator = new BITMAP_BUTTON( m_bottomPanel, wxID_ANY, wxNullBitmap ); separator->SetIsSeparator(); buttonsSizer->Add( separator, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 1 ); - m_grButton3DView = new BITMAP_BUTTON( bottomPanel, wxID_ANY, wxNullBitmap ); + m_grButton3DView = new BITMAP_BUTTON( m_bottomPanel, wxID_ANY, wxNullBitmap ); m_grButton3DView->SetIsRadioButton(); m_grButton3DView->SetBitmap( KiBitmapBundle( BITMAPS::shape_3d ) ); - m_grButton3DView->Check( !m_showFpMode ); + m_grButton3DView->Check( m_show3DMode ); buttonsSizer->Add( m_grButton3DView, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 1 ); - m_grButtonFpView = new BITMAP_BUTTON( bottomPanel, wxID_ANY, wxNullBitmap ); + m_grButtonFpView = new BITMAP_BUTTON( m_bottomPanel, wxID_ANY, wxNullBitmap ); m_grButtonFpView->SetIsRadioButton(); m_grButtonFpView->SetBitmap( KiBitmapBundle( BITMAPS::module ) ); m_grButtonFpView->Check( m_showFpMode ); buttonsSizer->Add( m_grButtonFpView, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 1 ); - separator = new BITMAP_BUTTON( bottomPanel, wxID_ANY, wxNullBitmap ); + separator = new BITMAP_BUTTON( m_bottomPanel, wxID_ANY, wxNullBitmap ); separator->SetIsSeparator(); buttonsSizer->Add( separator, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, 1 ); - m_show3DViewer = new wxCheckBox( bottomPanel, wxID_ANY, _( "Show 3D viewer in own window" ) ); + m_show3DViewer = new wxCheckBox( m_bottomPanel, wxID_ANY, _( "Show 3D viewer in own window" ) ); buttonsSizer->Add( m_show3DViewer, 0, wxALL | wxALIGN_CENTER_VERTICAL, 3 ); wxStdDialogButtonSizer* sdbSizer = new wxStdDialogButtonSizer(); - wxButton* okButton = new wxButton( bottomPanel, wxID_OK ); - wxButton* cancelButton = new wxButton( bottomPanel, wxID_CANCEL ); + wxButton* okButton = new wxButton( m_bottomPanel, wxID_OK ); + wxButton* cancelButton = new wxButton( m_bottomPanel, wxID_CANCEL ); sdbSizer->AddButton( okButton ); sdbSizer->AddButton( cancelButton ); @@ -176,8 +182,8 @@ FOOTPRINT_CHOOSER_FRAME::FOOTPRINT_CHOOSER_FRAME( KIWAY* aKiway, wxWindow* aPare buttonsSizer->Add( sdbSizer, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5 ); bottomSizer->Add( buttonsSizer, 0, wxEXPAND, 5 ); - bottomPanel->SetSizer( bottomSizer ); - frameSizer->Add( bottomPanel, 0, wxEXPAND ); + m_bottomPanel->SetSizer( bottomSizer ); + frameSizer->Add( m_bottomPanel, 0, wxEXPAND ); SetSizer( frameSizer ); @@ -187,6 +193,15 @@ FOOTPRINT_CHOOSER_FRAME::FOOTPRINT_CHOOSER_FRAME( KIWAY* aKiway, wxWindow* aPare Layout(); m_chooserPanel->FinishSetup(); + if( !m_showDescription ) + { + m_chooserPanel->GetVerticalSpliter()->SetMinimumPaneSize( 0 ); + m_chooserPanel->GetVerticalSpliter()->GetWindow2()->Hide(); + m_chooserPanel->GetVerticalSpliter()->SetSashInvisible(); + + m_toggleDescription->SetBitmap( KiBitmapBundle( BITMAPS::text_visibility ) ); + } + // Create the manager and dispatcher & route draw panel events to the dispatcher m_toolManager = new TOOL_MANAGER; m_toolManager->SetEnvironment( GetBoard(), GetCanvas()->GetView(), @@ -207,8 +222,14 @@ FOOTPRINT_CHOOSER_FRAME::FOOTPRINT_CHOOSER_FRAME( KIWAY* aKiway, wxWindow* aPare m_toolManager->InitTools(); setupUIConditions(); + updatePanelsVisibility(); + // clang-format off // Connect Events + m_toggleDescription->Connect( wxEVT_COMMAND_BUTTON_CLICKED , + wxCommandEventHandler( FOOTPRINT_CHOOSER_FRAME::toggleBottomSplit ), + nullptr,this ); + m_grButton3DView->Connect( wxEVT_COMMAND_BUTTON_CLICKED , wxCommandEventHandler( FOOTPRINT_CHOOSER_FRAME::on3DviewReq ), nullptr, this ); @@ -223,6 +244,7 @@ FOOTPRINT_CHOOSER_FRAME::FOOTPRINT_CHOOSER_FRAME( KIWAY* aKiway, wxWindow* aPare Connect( FP_SELECTION_EVENT, // custom event fired by a PANEL_FOOTPRINT_CHOOSER wxCommandEventHandler( FOOTPRINT_CHOOSER_FRAME::onFpChanged ), nullptr, this ); + // clang-format on // Needed on Linux to fix the position of widgets in bottomPanel PostSizeEvent(); @@ -242,7 +264,12 @@ FOOTPRINT_CHOOSER_FRAME::~FOOTPRINT_CHOOSER_FRAME() // Disconnect board, which is owned by FOOTPRINT_PREVIEW_PANEL. m_pcb = nullptr; + // clang-format off // Disconnect Events + m_toggleDescription->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, + wxCommandEventHandler( FOOTPRINT_CHOOSER_FRAME::toggleBottomSplit ), + nullptr, this ); + m_grButton3DView->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FOOTPRINT_CHOOSER_FRAME::on3DviewReq ), nullptr, this ); @@ -256,6 +283,7 @@ FOOTPRINT_CHOOSER_FRAME::~FOOTPRINT_CHOOSER_FRAME() Disconnect( FP_SELECTION_EVENT, wxCommandEventHandler( FOOTPRINT_CHOOSER_FRAME::onFpChanged ), nullptr, this ); + // clang-format on if( PCBNEW_SETTINGS* cfg = dynamic_cast( Kiface().KifaceSettings() ) ) { @@ -665,6 +693,40 @@ void FOOTPRINT_CHOOSER_FRAME::build3DCanvas() } +void FOOTPRINT_CHOOSER_FRAME::toggleBottomSplit( wxCommandEvent& event ) +{ + m_showDescription = !m_showDescription; + + m_toggleDescription->Check( m_showDescription ); + + m_chooserPanel->GetDetailsPanel()->Show( m_showDescription ); + + if( !m_showDescription ) + { + m_chooserPanel->GetVerticalSpliter()->SetMinimumPaneSize( GetSize().GetHeight() ); + m_chooserPanel->GetVerticalSpliter()->SetSashPosition( + GetSize().GetHeight() + m_chooserPanel->GetDetailsPanel()->GetSize().GetHeight() ); + + m_chooserPanel->GetVerticalSpliter()->GetWindow2()->Hide(); + m_chooserPanel->GetVerticalSpliter()->SetSashInvisible(); + + m_toggleDescription->SetBitmap( KiBitmapBundle( BITMAPS::text_visibility ) ); + } + else + { + m_chooserPanel->GetVerticalSpliter()->SetMinimumPaneSize( 80 ); + m_chooserPanel->GetVerticalSpliter()->GetWindow2()->Show(); + m_chooserPanel->GetVerticalSpliter()->SetSashInvisible( false ); + + m_toggleDescription->SetBitmap( KiBitmapBundle( BITMAPS::text_visibility_off ) ); + } + + m_chooserPanel->GetVerticalSpliter()->UpdateSize(); + + m_chooserPanel->Layout(); + m_chooserPanel->Refresh(); +} + void FOOTPRINT_CHOOSER_FRAME::on3DviewReq( wxCommandEvent& event ) { if( m_show3DMode == true ) diff --git a/pcbnew/footprint_chooser_frame.h b/pcbnew/footprint_chooser_frame.h index 1f398f997b..9bcbba5f15 100644 --- a/pcbnew/footprint_chooser_frame.h +++ b/pcbnew/footprint_chooser_frame.h @@ -95,6 +95,7 @@ private: WINDOW_SETTINGS* GetWindowSettings( APP_SETTINGS_BASE* aCfg ) override; COLOR_SETTINGS* GetColorSettings( bool aForceRefresh ) const override; + void toggleBottomSplit( wxCommandEvent& event ); void on3DviewReq( wxCommandEvent& event ); void onFpViewReq( wxCommandEvent& event ); void onExternalViewer3DEnable( wxCommandEvent& aEvent ); @@ -121,8 +122,10 @@ private: private: PANEL_FOOTPRINT_CHOOSER* m_chooserPanel; - bool m_showFpMode; // True to show the footprint - bool m_show3DMode; // True to show the 3D model + wxPanel* m_bottomPanel; + inline static bool m_showDescription = true; // Init true to show the m_details panel + inline static bool m_showFpMode = true; // Init true to show the footprint + inline static bool m_show3DMode = false; // Init false to hide the 3D model wxCheckBox* m_filterByPinCount; wxCheckBox* m_filterByFPFilters; wxCheckBox* m_show3DViewer; @@ -131,6 +134,7 @@ private: EDA_3D_CANVAS* m_preview3DCanvas; CAMERA& m_currentCamera; TRACK_BALL m_trackBallCamera; + BITMAP_BUTTON* m_toggleDescription; BITMAP_BUTTON* m_grButtonFpView; BITMAP_BUTTON* m_grButton3DView; diff --git a/pcbnew/tools/pcb_grid_helper.cpp b/pcbnew/tools/pcb_grid_helper.cpp index cbf0bfc0d7..da695d032a 100644 --- a/pcbnew/tools/pcb_grid_helper.cpp +++ b/pcbnew/tools/pcb_grid_helper.cpp @@ -69,7 +69,7 @@ std::optional GetBoardIntersectable( const BOARD_ITEM& aItem { case PCB_SHAPE_T: { - const PCB_SHAPE& shape = static_cast( aItem ); + PCB_SHAPE shape = static_cast( aItem ); switch( shape.GetShape() ) { @@ -1770,6 +1770,7 @@ PCB_GRID_HELPER::ANCHOR* PCB_GRID_HELPER::nearestAnchor( const VECTOR2I& aPos, i for( ANCHOR* const anchor : anchorsAtMinDistance ) { ecoord distToNearestItem = std::numeric_limits::max(); + for( EDA_ITEM* const item : anchor->items ) { if( !item ) diff --git a/pcbnew/widgets/panel_footprint_chooser.cpp b/pcbnew/widgets/panel_footprint_chooser.cpp index 5dd8fe720b..8c06a9fed9 100644 --- a/pcbnew/widgets/panel_footprint_chooser.cpp +++ b/pcbnew/widgets/panel_footprint_chooser.cpp @@ -121,19 +121,19 @@ PANEL_FOOTPRINT_CHOOSER::PANEL_FOOTPRINT_CHOOSER( PCB_BASE_FRAME* aFrame, wxTopL m_vsplitter->SetExtraStyle( wxWS_EX_TRANSIENT ); m_hsplitter->SetExtraStyle( wxWS_EX_TRANSIENT ); - auto detailsPanel = new wxPanel( m_vsplitter ); + m_detailsPanel = new wxPanel( m_vsplitter ); auto detailsSizer = new wxBoxSizer( wxVERTICAL ); - detailsPanel->SetSizer( detailsSizer ); + m_detailsPanel->SetSizer( detailsSizer ); - m_details = new HTML_WINDOW( detailsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize ); + m_details = new HTML_WINDOW( m_detailsPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize ); detailsSizer->Add( m_details, 1, wxEXPAND, 5 ); - detailsPanel->Layout(); - detailsSizer->Fit( detailsPanel ); + m_detailsPanel->Layout(); + detailsSizer->Fit( m_detailsPanel ); m_vsplitter->SetSashGravity( 0.5 ); - // Ensure the splitted areas are always shown (i.e. 0 size not allowed) + // Ensure splitted areas are always shown (i.e. 0 size not allowed) when m_detailsPanel is shown m_vsplitter->SetMinimumPaneSize( 80 ); // arbitrary value but reasonable min size - m_vsplitter->SplitHorizontally( m_hsplitter, detailsPanel ); + m_vsplitter->SplitHorizontally( m_hsplitter, m_detailsPanel ); sizer->Add( m_vsplitter, 1, wxEXPAND, 5 ); @@ -414,5 +414,3 @@ void PANEL_FOOTPRINT_CHOOSER::OnDetailsCharHook( wxKeyEvent& e ) e.Skip(); } } - - diff --git a/pcbnew/widgets/panel_footprint_chooser.h b/pcbnew/widgets/panel_footprint_chooser.h index 882ac26775..93c855b2d2 100644 --- a/pcbnew/widgets/panel_footprint_chooser.h +++ b/pcbnew/widgets/panel_footprint_chooser.h @@ -79,6 +79,10 @@ public: FOOTPRINT_PREVIEW_WIDGET* GetViewerPanel() const { return m_preview_ctrl; } + wxSplitterWindow* GetVerticalSpliter() const { return m_vsplitter; } + + wxPanel* GetDetailsPanel() const { return m_detailsPanel; } + protected: static constexpr int DblClickDelay = 100; // milliseconds @@ -109,6 +113,7 @@ public: const FOOTPRINT* m_CurrFootprint; protected: + wxPanel* m_detailsPanel; wxTimer* m_dbl_click_timer; wxTimer* m_open_libs_timer; wxSplitterWindow* m_hsplitter; diff --git a/resources/bitmaps_png/CMakeLists.txt b/resources/bitmaps_png/CMakeLists.txt index 3d06cfd7f7..8d59abaaa1 100644 --- a/resources/bitmaps_png/CMakeLists.txt +++ b/resources/bitmaps_png/CMakeLists.txt @@ -143,6 +143,8 @@ set( BMAPS_SMALL text_valign_top text_valign_center text_valign_bottom + text_visibility + text_visibility_off text_bold text_italic text_mirrored diff --git a/resources/bitmaps_png/png/text_visibility_16.png b/resources/bitmaps_png/png/text_visibility_16.png new file mode 100644 index 0000000000000000000000000000000000000000..80248b09942844a3015117c17c4cd865485ebfff GIT binary patch literal 499 zcmVBb5Qgs`*jN~1j8Pj)8xxH`f^Z)|dv^s5A~b@8ghUf*kZ1*kqLDkog@znhVCz?* zV4{MJ)}HF=Y4i|XHNhCL6Ri+qio?HfG?lVx5NRTZnt}06va8N zKp?Oei9~>e@jlOE?W!!x7x?Y?{r*V?z=b@0Nw#gzG!00xSge=LW^2i0 zav9C%xbrLm4lte&xRIOF>GTsWjI>NSRaHL{iNwmF=NEu>=4M4vU?Uh}qL@Rlld2=2 zUaz~b)h-pKc2aPE)dVANfQf2eHdv0<;_-N=R;x{o04&S$YN`gslOnu6yr9v9_FW5} z8*MO;43@J_EzorxuvQuYlu9K<*K{zCO;&86iOlWW7VClm3O|5yxhy&!f!gCoptg;} z0t2xlZ11vrz?wJ5BamoR{Y#V;2nE-fC?2>(d+Zcw&NQlVW6WeSkCjTrm1^RT%O;AVPZe1SmpjKkqDU}tN?#y-HwOv2m(Z{O?nE{+9YVVNL2 pfrd@YUDMApa0gw~4Qgu`@C{DVU`^?$NofE8002ovPDHLkV1jJD-+=%C literal 0 HcmV?d00001 diff --git a/resources/bitmaps_png/png/text_visibility_32.png b/resources/bitmaps_png/png/text_visibility_32.png new file mode 100644 index 0000000000000000000000000000000000000000..33f139333495966837e7a1372f10c34fe1621089 GIT binary patch literal 953 zcmV;q14jIbP)SFBnG&CXY7n^x$`P0i<92DbME=RIrlsF+*%l87P6X}8up*97nZji zB7t4ljYA_~wOT`jduRlztEgPb!^s{&V>tln1gObr0b00F9%u(JNfZZ&B-^TB>7J+Fs;HjypGl@iETolFiU@*Ad+S+yJey}7x02Z6MN#adcgcE~rCO1aCy z3k0eN3vynH(A&9o=v^9EJr(z8;Tfs~ntXn&3#~wXw0WZ!nJ?#M0x{N#HDQ}GzSpLKO~F~KXamDkIENWo_~IxMY`*N4O5ACr@lHp2v<{JSV8X|dDc zWaH1$QgGS2JG$B8+$-gIe)gqAqSz-ZW>{@)t-KACg^*za5KfW~7^l<8a@pCEz?5>o z;4hgY6Fh>FA=z@-oD_p%#bPnhFafX?{}RaUCE(jjpa)rz^`H>Q%t|rbZZ}m!%rF7e zZkW9gDIlJLs6U?DfJJTE+7fF^oMd{R$S()Lk|wzf8gn0NLi!uydSCB-B-BH;%p zeL0PbMM%EIB19~6BBYYxl_8Z_{Bc|=IbIpYAH`V1)dpS}u0hyGOdUj6kVGYHs~to> zuTMFMe4b9tg9ro?rcXj_!|8)KiYb#g*iKg3jGEBZHY+87M)nO3g3Lcl2aKOtZS z{J;qmz;^+Di|2s(6Y#kVA0O-ip6BrUg+t&g>;-%u!UT-3z*kp{^fh@Rq4Bks_VNF( bUXQ?UgzyeG|M$zA00000NkvXXu0mjfmk7Z1 literal 0 HcmV?d00001 diff --git a/resources/bitmaps_png/png/text_visibility_dark_16.png b/resources/bitmaps_png/png/text_visibility_dark_16.png new file mode 100644 index 0000000000000000000000000000000000000000..12ffed3b07630f650172470c521bac897342bced GIT binary patch literal 543 zcmV+)0^t3LP)HX;%Wv5>A&F|;KOeO}E&kO~V! z^r4!%uVTkmEcH0&a&Ov3Hx~a6|98&s4EH`00GJG&!9S&${tHOov&_rGORWHWzUrxR zEwo;vbarjFwzxAhQ!_HyH|+!RlunNtJ3OgFFJ{EqTQZp};Q)5e{0@hs*lM-vC?HLY zO-R7x_$2q58k=BW-TR1!qSc0O_}CRI<^Yn-W($bqzW|gR4Qt?TcGL4Ek;gymc6$|? z8IkPm^TO%wi3FS<#Nc@ANFgcPguPd%7WU{RmGt2@VlH#ZaupVwubCV4lqEwv{f0Cnv5R z`ETJ<48>y6*#aX3c)QfL2S=bz)K&FogoOel&_cu#Y1_20o%L;5b#qOH{@#9hLfHNn zepg5U3C)%4qiSnylYox)4w+2Cju&%|k)(yS3c4iXs0snF(4EWWD#`(*?oy=~ctAG{ zgO+KWd;qmgm9vvMKqRMc(`CY>oeX#frUYPUaA;c0oG*Hj!UPdUI?jd-{rLj@HvvGs hNupW@Z5l@RKrVG61B#t$l+R z=X64B7ZrdBG56RYTY$fT`iz`-G5`*{gL~KM==_Zq!70?oX7&69J%za|U63qzC{`N5IyV#EXke#5Xo00q~9c zh^f#dD~<+}`=!-t56J=mVVj(A&Gj1MdE-fFzxO`tRa(JTSpXpPi$BOamq&*BhT>-n zD^O>yBYM4_GfRzyOu9eD`3w&XlZ)ps&;aJB0Ptdu*!gN{Iq^>}NW_h~Msn6@BzCKv zwA^mtAh2&1!XWg;Z_7){#Q>W*IXSy%04IfxwJ@utxlfYi#hIhn%;@x1-;{fjgQz#x zOZ-32FOvpKeH;YrwBr&0SbhWV&{)?^Twu=sY1@CQG%M8Ujo>41w1(wbkeS;N|*osm1=wb4y%k zgkx(onqv|Gh|6wq5@G_0lMu5V#n9}{Hqr`7h)a)2IXf{cNy4&{vc!@w7KVA+HXM9D z7&kCxJI)G)(QxKsap!D{sgiM3C%OSpc}P4&!kt zcdOy?T6Cp|^mX@1g!_B?N#W%}#XAJYhWH;;yo|u{vC6H+&5)LyYL^(;1J&D5r_=4_ zt01|HWt#vic-pE0@TC}E$*zD$sulnM002ovPDHLkV1n^* B;sXEx literal 0 HcmV?d00001 diff --git a/resources/bitmaps_png/png/text_visibility_off_16.png b/resources/bitmaps_png/png/text_visibility_off_16.png new file mode 100644 index 0000000000000000000000000000000000000000..3089683131ba782ec50f0bf53c9717b866b3206d GIT binary patch literal 375 zcmV--0f_#IP)kdg0007wNkl z%WD%s9LM(`uswMati5@YX0~`P6g8y?2J;~Miu5AXG)53Sq}3h_gV zI9eDvsSE58V` z!jZcTbw~*+8oUo%u&mGifwWXekJ>-C9|}Q2+n{ literal 0 HcmV?d00001 diff --git a/resources/bitmaps_png/png/text_visibility_off_dark_16.png b/resources/bitmaps_png/png/text_visibility_off_dark_16.png new file mode 100644 index 0000000000000000000000000000000000000000..372e4826175a945a8d753d0ad8d2cd2fb0c952e4 GIT binary patch literal 581 zcmV-L0=oT)P)O`)z89WTlKcmTbW;x$<4(kI5wKi@9uy66s6d{b7-Hm+wDOY zU?15Vkw|197z|n@u#AU>1k5~|K`a(SE}O&q-FLtDw)d_(meaJq+5;|t6$*v6gt;Fu ztxuy`tz!MjI+R-qzkels?oT)zzDB{GFsIXLn1+evrDe=Mo<*%zL$k4pjFJ%rdVaru zSOTc}6u%%4N~ID^(?q#kMlzX%Ue#UmSYZsBrnxz%kctG*!$ve3MWs@4%`7%^+rnJ0 z*WEbhaBd(Fc<$}sg%`ld!aRO=T$;TAD*Ei)5sJm4oY`wO48t9dw)OuAd?0)<@pv4% zu48R=4TXFG3v&x-EHyBBe-f!wN^XeS|4aWv62PM1Ws}E-J`?SpHZK4Z#fe2RbHDgQ+F^(YbPw$Zj`ia+#ZLr)^ou^8FLeK>`T_p{tZa#V T$B^na00000NkvXXu0mjfU;GTk literal 0 HcmV?d00001 diff --git a/resources/bitmaps_png/png/text_visibility_off_dark_32.png b/resources/bitmaps_png/png/text_visibility_off_dark_32.png new file mode 100644 index 0000000000000000000000000000000000000000..31a75cebcf7666b5a7239ab1106c6af2dda6c0c9 GIT binary patch literal 994 zcmV<810DQ{P)%2VYoXx;4zMSox-}!w%=XrkTd48vW5K@5R z6C628ec4P8z%f>qFR#sMK0DwCf14j=WV_E<)`oFZa)CLKDGLq&4Kn8<@`_x?U zN%B)n04~Yh<#n92utf?GzOi70Ue-05I>9TIN~+V)N*Dlnh0NB=^Cz zPG|x^&;`(*mU&fG6`7uzCNmFa$YgX<5dIE_!ddf)u?dAa3Lfs4(P%uU3IK#bHDim# zLb|%TvL<4Ay2wma z*~|i1V*=e!g0s&G}QzHjB0I*{$fUDv_ ze8ONbs2FZMpNlya=BTTylR&`8T~+|V@ZY2X_4W1HWYsTZo|8dsP8o$2yP8B@J$9 zXpj~hEU!>2q^-40u@w8fK2lj(skw(>ZkYeGnwt>>M(GXoDdlVX?UpvhX4LL#CwiM0 zXjFGMggHM+yP!xgLS`S&D%SQx0&L@Is|!F|G1|$9_Va%M_yM}c@?rwe9u7L0eOAIe z0npsS@?ipq8%U&PHKlm~Y^yyv6F_WE&tV&dos9VH&;!WCj>J0>-y)@>ExD!OK^SAwm*c} zCD1nG(`%Pca?5;T>k+iw{gCe#x5=H+1;DQ%gis6MlUw$~eha1(T(cg)AN@gW{UW?2 QfdBvi07*qoM6N<$g86dNA^-pY literal 0 HcmV?d00001 diff --git a/resources/bitmaps_png/sources/dark/text_visibility.svg b/resources/bitmaps_png/sources/dark/text_visibility.svg new file mode 100644 index 0000000000..bd95e03055 --- /dev/null +++ b/resources/bitmaps_png/sources/dark/text_visibility.svg @@ -0,0 +1,133 @@ + + + + + + + + + + image/svg+xml + + text_sketch + + + + + + + + + + + + + + + text_sketch + + + T + + + + + diff --git a/resources/bitmaps_png/sources/dark/text_visibility_off.svg b/resources/bitmaps_png/sources/dark/text_visibility_off.svg new file mode 100644 index 0000000000..79681d0dee --- /dev/null +++ b/resources/bitmaps_png/sources/dark/text_visibility_off.svg @@ -0,0 +1,140 @@ + + + + + + + + + + image/svg+xml + + text_sketch + + + + + + + + + + + + + + + text_sketch + + + T + + + + + + diff --git a/resources/bitmaps_png/sources/light/text_visibility.svg b/resources/bitmaps_png/sources/light/text_visibility.svg new file mode 100644 index 0000000000..af95ff9f0b --- /dev/null +++ b/resources/bitmaps_png/sources/light/text_visibility.svg @@ -0,0 +1,134 @@ + + + + + + + + + + image/svg+xml + + text_sketch + + + + + + + + + + + + + + + text_sketch + + T + + + + + + diff --git a/resources/bitmaps_png/sources/light/text_visibility_off.svg b/resources/bitmaps_png/sources/light/text_visibility_off.svg new file mode 100644 index 0000000000..0f41a7df74 --- /dev/null +++ b/resources/bitmaps_png/sources/light/text_visibility_off.svg @@ -0,0 +1,142 @@ + + + + + + + + + + image/svg+xml + + text_sketch + + + + + + + + + + + + + + + text_sketch + + T + + + + + + +