diff --git a/common/bitmap_info.cpp b/common/bitmap_info.cpp index bc50e6d73d..85aafb1f1c 100644 --- a/common/bitmap_info.cpp +++ b/common/bitmap_info.cpp @@ -80,6 +80,7 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::pintype_openemit].emplace_back( BITMAPS::pintype_openemit, wxT( "pintype_openemit_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::pintype_nic].emplace_back( BITMAPS::pintype_nic, wxT( "pintype_nic_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::pintype_noconnect].emplace_back( BITMAPS::pintype_noconnect, wxT( "pintype_noconnect_16.png" ), 16, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::small_bottom].emplace_back( BITMAPS::small_bottom, wxT( "small_bottom_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_down].emplace_back( BITMAPS::small_down, wxT( "small_down_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_edit].emplace_back( BITMAPS::small_edit, wxT( "small_edit_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_folder].emplace_back( BITMAPS::small_folder, wxT( "small_folder_16.png" ), 16, wxT( "light" ) ); @@ -88,6 +89,7 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::small_plus].emplace_back( BITMAPS::small_plus, wxT( "small_plus_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_refresh].emplace_back( BITMAPS::small_refresh, wxT( "small_refresh_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_sort_desc].emplace_back( BITMAPS::small_sort_desc, wxT( "small_sort_desc_16.png" ), 16, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::small_top].emplace_back( BITMAPS::small_top, wxT( "small_top_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_trash].emplace_back( BITMAPS::small_trash, wxT( "small_trash_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_up].emplace_back( BITMAPS::small_up, wxT( "small_up_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_warning].emplace_back( BITMAPS::small_warning, wxT( "small_warning_16.png" ), 16, wxT( "light" ) ); @@ -165,6 +167,7 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::pintype_openemit].emplace_back( BITMAPS::pintype_openemit, wxT( "pintype_openemit_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::pintype_nic].emplace_back( BITMAPS::pintype_nic, wxT( "pintype_nic_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::pintype_noconnect].emplace_back( BITMAPS::pintype_noconnect, wxT( "pintype_noconnect_dark_16.png" ), 16, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::small_bottom].emplace_back( BITMAPS::small_bottom, wxT( "small_bottom_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_down].emplace_back( BITMAPS::small_down, wxT( "small_down_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_edit].emplace_back( BITMAPS::small_edit, wxT( "small_edit_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_folder].emplace_back( BITMAPS::small_folder, wxT( "small_folder_dark_16.png" ), 16, wxT( "dark" ) ); @@ -173,6 +176,7 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::small_plus].emplace_back( BITMAPS::small_plus, wxT( "small_plus_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_refresh].emplace_back( BITMAPS::small_refresh, wxT( "small_refresh_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_sort_desc].emplace_back( BITMAPS::small_sort_desc, wxT( "small_sort_desc_dark_16.png" ), 16, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::small_top].emplace_back( BITMAPS::small_top, wxT( "small_top_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_trash].emplace_back( BITMAPS::small_trash, wxT( "small_trash_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_up].emplace_back( BITMAPS::small_up, wxT( "small_up_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_warning].emplace_back( BITMAPS::small_warning, wxT( "small_warning_dark_16.png" ), 16, wxT( "dark" ) ); @@ -250,6 +254,7 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::pintype_openemit].emplace_back( BITMAPS::pintype_openemit, wxT( "pintype_openemit_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::pintype_nic].emplace_back( BITMAPS::pintype_nic, wxT( "pintype_nic_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::pintype_noconnect].emplace_back( BITMAPS::pintype_noconnect, wxT( "pintype_noconnect_32.png" ), 32, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::small_bottom].emplace_back( BITMAPS::small_bottom, wxT( "small_bottom_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_down].emplace_back( BITMAPS::small_down, wxT( "small_down_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_edit].emplace_back( BITMAPS::small_edit, wxT( "small_edit_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_folder].emplace_back( BITMAPS::small_folder, wxT( "small_folder_32.png" ), 32, wxT( "light" ) ); @@ -258,6 +263,7 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::small_plus].emplace_back( BITMAPS::small_plus, wxT( "small_plus_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_refresh].emplace_back( BITMAPS::small_refresh, wxT( "small_refresh_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_sort_desc].emplace_back( BITMAPS::small_sort_desc, wxT( "small_sort_desc_32.png" ), 32, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::small_top].emplace_back( BITMAPS::small_top, wxT( "small_top_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_trash].emplace_back( BITMAPS::small_trash, wxT( "small_trash_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_up].emplace_back( BITMAPS::small_up, wxT( "small_up_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::small_warning].emplace_back( BITMAPS::small_warning, wxT( "small_warning_32.png" ), 32, wxT( "light" ) ); @@ -335,6 +341,7 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::pintype_openemit].emplace_back( BITMAPS::pintype_openemit, wxT( "pintype_openemit_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::pintype_nic].emplace_back( BITMAPS::pintype_nic, wxT( "pintype_nic_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::pintype_noconnect].emplace_back( BITMAPS::pintype_noconnect, wxT( "pintype_noconnect_dark_32.png" ), 32, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::small_bottom].emplace_back( BITMAPS::small_bottom, wxT( "small_bottom_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_down].emplace_back( BITMAPS::small_down, wxT( "small_down_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_edit].emplace_back( BITMAPS::small_edit, wxT( "small_edit_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_folder].emplace_back( BITMAPS::small_folder, wxT( "small_folder_dark_32.png" ), 32, wxT( "dark" ) ); @@ -343,6 +350,7 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::small_plus].emplace_back( BITMAPS::small_plus, wxT( "small_plus_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_refresh].emplace_back( BITMAPS::small_refresh, wxT( "small_refresh_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_sort_desc].emplace_back( BITMAPS::small_sort_desc, wxT( "small_sort_desc_dark_32.png" ), 32, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::small_top].emplace_back( BITMAPS::small_top, wxT( "small_top_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_trash].emplace_back( BITMAPS::small_trash, wxT( "small_trash_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_up].emplace_back( BITMAPS::small_up, wxT( "small_up_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::small_warning].emplace_back( BITMAPS::small_warning, wxT( "small_warning_dark_32.png" ), 32, wxT( "dark" ) ); diff --git a/include/bitmaps/bitmaps_list.h b/include/bitmaps/bitmaps_list.h index e27ba43522..8375804182 100644 --- a/include/bitmaps/bitmaps_list.h +++ b/include/bitmaps/bitmaps_list.h @@ -573,6 +573,7 @@ enum class BITMAPS : unsigned int sim_tune, simulator, slice_line, + small_bottom, small_down, small_edit, small_folder, @@ -581,6 +582,7 @@ enum class BITMAPS : unsigned int small_plus, small_refresh, small_sort_desc, + small_top, small_trash, small_up, small_warning, diff --git a/pcbnew/zone_manager/dialog_zone_manager.cpp b/pcbnew/zone_manager/dialog_zone_manager.cpp index f135258506..db616355b1 100644 --- a/pcbnew/zone_manager/dialog_zone_manager.cpp +++ b/pcbnew/zone_manager/dialog_zone_manager.cpp @@ -59,8 +59,10 @@ DIALOG_ZONE_MANAGER::DIALOG_ZONE_MANAGER( PCB_BASE_FRAME* aParent ) : m_sizerZoneOP->InsertSpacer( m_sizerZoneOP->GetItemCount(), 5 ); #endif + m_btnMoveTop->SetBitmap( KiBitmapBundle( BITMAPS::small_top ) ); m_btnMoveUp->SetBitmap( KiBitmapBundle( BITMAPS::small_up ) ); m_btnMoveDown->SetBitmap( KiBitmapBundle( BITMAPS::small_down ) ); + m_btnMoveBottom->SetBitmap( KiBitmapBundle( BITMAPS::small_bottom ) ); m_panelZoneProperties = new PANEL_ZONE_PROPERTIES( m_zonePanel, aParent, m_zoneSettingsBag ); m_sizerProperties->Add( m_panelZoneProperties, 0, wxEXPAND, 5 ); @@ -95,6 +97,7 @@ DIALOG_ZONE_MANAGER::DIALOG_ZONE_MANAGER( PCB_BASE_FRAME* aParent ) : Bind( EVT_ZONES_OVERVIEW_COUNT_CHANGE, &DIALOG_ZONE_MANAGER::OnZonesTableRowCountChange, this ); Bind( wxEVT_CHECKBOX, &DIALOG_ZONE_MANAGER::OnCheckBoxClicked, this ); Bind( wxEVT_IDLE, &DIALOG_ZONE_MANAGER::OnIdle, this ); + Bind( wxEVT_CHAR_HOOK, &DIALOG_ZONE_MANAGER::OnDialogCharHook, this ); Bind( wxEVT_BOOKCTRL_PAGE_CHANGED, [this]( wxNotebookEvent& aEvent ) { @@ -113,6 +116,24 @@ DIALOG_ZONE_MANAGER::~DIALOG_ZONE_MANAGER() = default; bool DIALOG_ZONE_MANAGER::TransferDataToWindow() { + m_layerFilter->Clear(); + m_layerFilter->Append( _( "All Layers" ) ); + + LSET usedLayers; + BOARD* board = m_pcbFrame->GetBoard(); + + for( ZONE* zone : m_zoneSettingsBag.GetClonedZoneList() ) + usedLayers |= zone->GetLayerSet(); + + for( PCB_LAYER_ID layer : usedLayers.Seq() ) + { + m_layerFilter->Append( board->GetLayerName( layer ), + reinterpret_cast( static_cast( layer ) ) ); + } + + m_modelZonesOverview->SetLayerFilter( UNDEFINED_LAYER ); + m_layerFilter->SetSelection( 0 ); + m_modelZonesOverview->ApplyFilter( m_filterCtrl->GetValue(), m_viewZonesOverview->GetSelection() ); if( m_modelZonesOverview->GetCount() ) @@ -131,6 +152,7 @@ void DIALOG_ZONE_MANAGER::PostProcessZoneViewSelChange( wxDataViewItem const& aI { m_viewZonesOverview->Select( aItem ); m_viewZonesOverview->EnsureVisible( aItem ); + SelectZoneTableItem( aItem ); } else { @@ -158,9 +180,44 @@ void DIALOG_ZONE_MANAGER::PostProcessZoneViewSelChange( wxDataViewItem const& aI void DIALOG_ZONE_MANAGER::GenericProcessChar( wxKeyEvent& aEvent ) { aEvent.Skip(); +} - if( aEvent.GetKeyCode() == WXK_DOWN || aEvent.GetKeyCode() == WXK_UP ) - Bind( wxEVT_IDLE, &DIALOG_ZONE_MANAGER::OnIdle, this ); + +void DIALOG_ZONE_MANAGER::OnDialogCharHook( wxKeyEvent& aEvent ) +{ + if( aEvent.GetKeyCode() == WXK_UP ) + { + NavigateZoneSelection( -1 ); + } + else if( aEvent.GetKeyCode() == WXK_DOWN ) + { + NavigateZoneSelection( 1 ); + } + else + { + aEvent.Skip(); + } +} + + +void DIALOG_ZONE_MANAGER::NavigateZoneSelection( int aDirection ) +{ + unsigned count = m_modelZonesOverview->GetCount(); + + if( count == 0 ) + return; + + wxDataViewItem current = m_viewZonesOverview->GetSelection(); + unsigned currentRow = 0; + + if( current.IsOk() ) + currentRow = m_modelZonesOverview->GetRow( current ); + + int newRow = (int) currentRow + aDirection; + newRow = std::max( 0, std::min( newRow, (int) count - 1 ) ); + + if( !current.IsOk() || (unsigned) newRow != currentRow ) + PostProcessZoneViewSelChange( m_modelZonesOverview->GetItem( (unsigned) newRow ) ); } @@ -309,6 +366,12 @@ void DIALOG_ZONE_MANAGER::OnDrop( wxDataViewEvent& aEvent ) #endif // wxUSE_DRAG_AND_DROP +void DIALOG_ZONE_MANAGER::OnMoveTopClick( wxCommandEvent& aEvent ) +{ + MoveSelectedZonePriority( ZONE_INDEX_MOVEMENT::MOVE_TO_TOP ); +} + + void DIALOG_ZONE_MANAGER::OnMoveUpClick( wxCommandEvent& aEvent ) { MoveSelectedZonePriority( ZONE_INDEX_MOVEMENT::MOVE_UP ); @@ -321,6 +384,12 @@ void DIALOG_ZONE_MANAGER::OnMoveDownClick( wxCommandEvent& aEvent ) } +void DIALOG_ZONE_MANAGER::OnMoveBottomClick( wxCommandEvent& aEvent ) +{ + MoveSelectedZonePriority( ZONE_INDEX_MOVEMENT::MOVE_TO_BOTTOM ); +} + + void DIALOG_ZONE_MANAGER::OnFilterCtrlCancel( wxCommandEvent& aEvent ) { PostProcessZoneViewSelChange( m_modelZonesOverview->ClearFilter( m_viewZonesOverview->GetSelection() ) ); @@ -352,6 +421,27 @@ void DIALOG_ZONE_MANAGER::OnFilterCtrlEnter( wxCommandEvent& aEvent ) } +void DIALOG_ZONE_MANAGER::OnLayerFilterChanged( wxCommandEvent& aEvent ) +{ + int sel = m_layerFilter->GetSelection(); + + if( sel <= 0 ) + { + m_modelZonesOverview->SetLayerFilter( UNDEFINED_LAYER ); + } + else + { + void* data = m_layerFilter->GetClientData( sel ); + PCB_LAYER_ID layer = static_cast( reinterpret_cast( data ) ); + m_modelZonesOverview->SetLayerFilter( layer ); + } + + PostProcessZoneViewSelChange( + m_modelZonesOverview->ApplyFilter( m_filterCtrl->GetValue(), + m_viewZonesOverview->GetSelection() ) ); +} + + void DIALOG_ZONE_MANAGER::OnUpdateDisplayedZonesClick( wxCommandEvent& aEvent ) { if( m_isFillingZones ) @@ -418,8 +508,8 @@ void DIALOG_ZONE_MANAGER::OnZonesTableRowCountChange( wxCommandEvent& aEvent ) { unsigned count = aEvent.GetInt(); - for( STD_BITMAP_BUTTON* btn : { m_btnMoveDown, m_btnMoveUp } ) - btn->Enable( count == m_zoneSettingsBag.GetClonedZoneList().size() ); + for( STD_BITMAP_BUTTON* btn : { m_btnMoveTop, m_btnMoveUp, m_btnMoveDown, m_btnMoveBottom } ) + btn->Enable( count > 1 ); } diff --git a/pcbnew/zone_manager/dialog_zone_manager.h b/pcbnew/zone_manager/dialog_zone_manager.h index 4e955e8909..bbd4458c80 100644 --- a/pcbnew/zone_manager/dialog_zone_manager.h +++ b/pcbnew/zone_manager/dialog_zone_manager.h @@ -85,12 +85,15 @@ protected: void MoveSelectedZonePriority( ZONE_INDEX_MOVEMENT aMove ); + void OnMoveTopClick( wxCommandEvent& aEvent ) override; void OnMoveUpClick( wxCommandEvent& aEvent ) override; void OnMoveDownClick( wxCommandEvent& aEvent ) override; + void OnMoveBottomClick( wxCommandEvent& aEvent ) override; void OnFilterCtrlCancel( wxCommandEvent& aEvent ) override; void OnFilterCtrlSearch( wxCommandEvent& aEvent ) override; void OnFilterCtrlTextChange( wxCommandEvent& aEvent ) override; void OnFilterCtrlEnter( wxCommandEvent& aEvent ) override; + void OnLayerFilterChanged( wxCommandEvent& aEvent ) override; void OnUpdateDisplayedZonesClick( wxCommandEvent& aEvent ) override; void PostProcessZoneViewSelChange( wxDataViewItem const& aItem ); @@ -102,6 +105,8 @@ private: void GenericProcessChar( wxKeyEvent& event ); void OnIdle( wxIdleEvent& aEvent ); + void NavigateZoneSelection( int aDirection ); + void OnDialogCharHook( wxKeyEvent& aEvent ); private: PCB_BASE_FRAME* m_pcbFrame; diff --git a/pcbnew/zone_manager/dialog_zone_manager_base.cpp b/pcbnew/zone_manager/dialog_zone_manager_base.cpp index ad93940727..6d6cb301cb 100644 --- a/pcbnew/zone_manager/dialog_zone_manager_base.cpp +++ b/pcbnew/zone_manager/dialog_zone_manager_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -54,6 +54,21 @@ DIALOG_ZONE_MANAGER_BASE::DIALOG_ZONE_MANAGER_BASE( wxWindow* parent, wxWindowID m_leftColumn->Add( searchSizer, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 ); + wxBoxSizer* layerFilterSizer; + layerFilterSizer = new wxBoxSizer( wxHORIZONTAL ); + + m_layerFilterLabel = new wxStaticText( m_listPanel, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_layerFilterLabel->Wrap( -1 ); + layerFilterSizer->Add( m_layerFilterLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + wxArrayString m_layerFilterChoices; + m_layerFilter = new wxChoice( m_listPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_layerFilterChoices, 0 ); + m_layerFilter->SetSelection( 0 ); + layerFilterSizer->Add( m_layerFilter, 1, wxALIGN_CENTER_VERTICAL, 0 ); + + + m_leftColumn->Add( layerFilterSizer, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 ); + m_viewZonesOverview = new wxDataViewCtrl( m_listPanel, wxID_ANY, wxDefaultPosition, wxSize( -1,240 ), wxDV_HORIZ_RULES|wxDV_SINGLE|wxDV_VERT_RULES ); m_viewZonesOverview->SetMinSize( wxSize( -1,240 ) ); @@ -61,6 +76,11 @@ DIALOG_ZONE_MANAGER_BASE::DIALOG_ZONE_MANAGER_BASE( wxWindow* parent, wxWindowID m_sizerZoneOP = new wxBoxSizer( wxHORIZONTAL ); + m_btnMoveTop = new STD_BITMAP_BUTTON( m_listPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); + m_btnMoveTop->SetToolTip( _("Top zone has the highest priority. When a zone is inside another zone, if its priority is higher, its outlines are removed from the other zone.") ); + + m_sizerZoneOP->Add( m_btnMoveTop, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + m_btnMoveUp = new STD_BITMAP_BUTTON( m_listPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); m_btnMoveUp->SetToolTip( _("Top zone has the highest priority. When a zone is inside another zone, if its priority is higher, its outlines are removed from the other zone.") ); @@ -71,6 +91,11 @@ DIALOG_ZONE_MANAGER_BASE::DIALOG_ZONE_MANAGER_BASE( wxWindow* parent, wxWindowID m_sizerZoneOP->Add( m_btnMoveDown, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + m_btnMoveBottom = new STD_BITMAP_BUTTON( m_listPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 ); + m_btnMoveBottom->SetToolTip( _("Top zone has the highest priority. When a zone is inside another zone, if its priority is higher, its outlines are removed from the other zone.") ); + + m_sizerZoneOP->Add( m_btnMoveBottom, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + m_leftColumn->Add( m_sizerZoneOP, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); @@ -151,12 +176,15 @@ DIALOG_ZONE_MANAGER_BASE::DIALOG_ZONE_MANAGER_BASE( wxWindow* parent, wxWindowID m_filterCtrl->Connect( wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnFilterCtrlSearch ), NULL, this ); m_filterCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnFilterCtrlTextChange ), NULL, this ); m_filterCtrl->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnFilterCtrlEnter ), NULL, this ); + m_layerFilter->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnLayerFilterChanged ), NULL, this ); m_viewZonesOverview->Connect( wxEVT_CHAR, wxKeyEventHandler( DIALOG_ZONE_MANAGER_BASE::OnTableChar ), NULL, this ); m_viewZonesOverview->Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_ZONE_MANAGER_BASE::OnTableCharHook ), NULL, this ); m_viewZonesOverview->Connect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_ZONE_MANAGER_BASE::OnDataViewCtrlSelectionChanged ), NULL, this ); m_viewZonesOverview->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_ZONE_MANAGER_BASE::OnViewZonesOverviewOnLeftUp ), NULL, this ); + m_btnMoveTop->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnMoveTopClick ), NULL, this ); m_btnMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnMoveUpClick ), NULL, this ); m_btnMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnMoveDownClick ), NULL, this ); + m_btnMoveBottom->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnMoveBottomClick ), NULL, this ); m_updateDisplayedZones->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnUpdateDisplayedZonesClick ), NULL, this ); m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnOk ), NULL, this ); } @@ -169,12 +197,15 @@ DIALOG_ZONE_MANAGER_BASE::~DIALOG_ZONE_MANAGER_BASE() m_filterCtrl->Disconnect( wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnFilterCtrlSearch ), NULL, this ); m_filterCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnFilterCtrlTextChange ), NULL, this ); m_filterCtrl->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnFilterCtrlEnter ), NULL, this ); + m_layerFilter->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnLayerFilterChanged ), NULL, this ); m_viewZonesOverview->Disconnect( wxEVT_CHAR, wxKeyEventHandler( DIALOG_ZONE_MANAGER_BASE::OnTableChar ), NULL, this ); m_viewZonesOverview->Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( DIALOG_ZONE_MANAGER_BASE::OnTableCharHook ), NULL, this ); m_viewZonesOverview->Disconnect( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_ZONE_MANAGER_BASE::OnDataViewCtrlSelectionChanged ), NULL, this ); m_viewZonesOverview->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( DIALOG_ZONE_MANAGER_BASE::OnViewZonesOverviewOnLeftUp ), NULL, this ); + m_btnMoveTop->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnMoveTopClick ), NULL, this ); m_btnMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnMoveUpClick ), NULL, this ); m_btnMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnMoveDownClick ), NULL, this ); + m_btnMoveBottom->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnMoveBottomClick ), NULL, this ); m_updateDisplayedZones->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnUpdateDisplayedZonesClick ), NULL, this ); m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ZONE_MANAGER_BASE::OnOk ), NULL, this ); diff --git a/pcbnew/zone_manager/dialog_zone_manager_base.fbp b/pcbnew/zone_manager/dialog_zone_manager_base.fbp index 699793f64f..1733add17a 100644 --- a/pcbnew/zone_manager/dialog_zone_manager_base.fbp +++ b/pcbnew/zone_manager/dialog_zone_manager_base.fbp @@ -424,6 +424,148 @@ + + 5 + wxBOTTOM|wxEXPAND|wxTOP + 0 + + + layerFilterSizer + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + Layer: + + 0 + + + 0 + + 1 + m_layerFilterLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + 0 + wxALIGN_CENTER_VERTICAL + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_layerFilter + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnLayerFilterChanged + + + + 5 wxEXPAND @@ -465,6 +607,81 @@ m_sizerZoneOP wxHORIZONTAL protected + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Move Top + + 0 + + 0 + + + 0 + + 1 + m_btnMoveTop + 1 + + + protected + 1 + + + + Resizable + 1 + + + STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare + 0 + Top zone has the highest priority. When a zone is inside another zone, if its priority is higher, its outlines are removed from the other zone. + + wxFILTER_NONE + wxDefaultValidator + + + + + OnMoveTopClick + + 5 wxALIGN_CENTER_VERTICAL|wxRIGHT @@ -615,6 +832,81 @@ OnMoveDownClick + + 5 + wxALIGN_CENTER_VERTICAL|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + + 0 + 0 + + Dock + 0 + Left + 0 + 1 + + 1 + + + 0 + 0 + wxID_ANY + Move Bottom + + 0 + + 0 + + + 0 + + 1 + m_btnMoveBottom + 1 + + + protected + 1 + + + + Resizable + 1 + + + STD_BITMAP_BUTTON; widgets/std_bitmap_button.h; forward_declare + 0 + Top zone has the highest priority. When a zone is inside another zone, if its priority is higher, its outlines are removed from the other zone. + + wxFILTER_NONE + wxDefaultValidator + + + + + OnMoveBottomClick + + diff --git a/pcbnew/zone_manager/dialog_zone_manager_base.h b/pcbnew/zone_manager/dialog_zone_manager_base.h index ee0119549c..8064ce1b79 100644 --- a/pcbnew/zone_manager/dialog_zone_manager_base.h +++ b/pcbnew/zone_manager/dialog_zone_manager_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -21,6 +21,8 @@ class STD_BITMAP_BUTTON; #include #include #include +#include +#include #include #include #include @@ -49,10 +51,14 @@ class DIALOG_ZONE_MANAGER_BASE : public DIALOG_SHIM wxSearchCtrl* m_filterCtrl; wxCheckBox* m_checkName; wxCheckBox* m_checkNet; + wxStaticText* m_layerFilterLabel; + wxChoice* m_layerFilter; wxDataViewCtrl* m_viewZonesOverview; wxBoxSizer* m_sizerZoneOP; + STD_BITMAP_BUTTON* m_btnMoveTop; STD_BITMAP_BUTTON* m_btnMoveUp; STD_BITMAP_BUTTON* m_btnMoveDown; + STD_BITMAP_BUTTON* m_btnMoveBottom; wxPanel* m_zonePanel; wxBoxSizer* m_rightColumn; wxBoxSizer* m_sizerProperties; @@ -71,12 +77,15 @@ class DIALOG_ZONE_MANAGER_BASE : public DIALOG_SHIM virtual void OnFilterCtrlSearch( wxCommandEvent& event ) { event.Skip(); } virtual void OnFilterCtrlTextChange( wxCommandEvent& event ) { event.Skip(); } virtual void OnFilterCtrlEnter( wxCommandEvent& event ) { event.Skip(); } + virtual void OnLayerFilterChanged( wxCommandEvent& event ) { event.Skip(); } virtual void OnTableChar( wxKeyEvent& event ) { event.Skip(); } virtual void OnTableCharHook( wxKeyEvent& event ) { event.Skip(); } virtual void OnDataViewCtrlSelectionChanged( wxDataViewEvent& event ) { event.Skip(); } virtual void OnViewZonesOverviewOnLeftUp( wxMouseEvent& event ) { event.Skip(); } + virtual void OnMoveTopClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnMoveUpClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnMoveDownClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnMoveBottomClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnUpdateDisplayedZonesClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnOk( wxCommandEvent& event ) { event.Skip(); } diff --git a/pcbnew/zone_manager/model_zones_overview.cpp b/pcbnew/zone_manager/model_zones_overview.cpp index f71491eec7..549c65ce94 100644 --- a/pcbnew/zone_manager/model_zones_overview.cpp +++ b/pcbnew/zone_manager/model_zones_overview.cpp @@ -98,7 +98,8 @@ MODEL_ZONES_OVERVIEW::MODEL_ZONES_OVERVIEW( wxWindow* aParent, PCB_BASE_FRAME* a m_frame( aFrame ), m_zoneSettingsBag( aZoneSettingsBag ), m_sortByName( true ), - m_sortByNet( true ) + m_sortByNet( true ), + m_layerFilter( UNDEFINED_LAYER ) { m_filteredZones = m_zoneSettingsBag.GetClonedZoneList(); Reset( m_filteredZones.size() ); @@ -153,6 +154,12 @@ void MODEL_ZONES_OVERVIEW::EnableFitterByNet( bool aEnable ) } +void MODEL_ZONES_OVERVIEW::SetLayerFilter( PCB_LAYER_ID aLayer ) +{ + m_layerFilter = aLayer; +} + + bool MODEL_ZONES_OVERVIEW::SetValueByRow( const wxVariant& aVariant, unsigned aRow, unsigned aCol ) { return {}; @@ -209,6 +216,39 @@ std::optional MODEL_ZONES_OVERVIEW::MoveZoneIndex( unsigned aIndex, ZO return SwapZonePriority( aIndex, aIndex + 1 ); break; + + case ZONE_INDEX_MOVEMENT::MOVE_TO_TOP: + if( aIndex >= 1 && GetCount() > 1 ) + { + unsigned cur = aIndex; + + while( cur > 0 ) + { + SwapZonePriority( cur, cur - 1 ); + --cur; + } + + return 0u; + } + + break; + + case ZONE_INDEX_MOVEMENT::MOVE_TO_BOTTOM: + if( aIndex + 1 < GetCount() ) + { + unsigned cur = aIndex; + const unsigned last = GetCount() - 1; + + while( cur < last ) + { + SwapZonePriority( cur, cur + 1 ); + ++cur; + } + + return last; + } + + break; } return std::optional{}; @@ -251,6 +291,9 @@ wxDataViewItem MODEL_ZONES_OVERVIEW::ApplyFilter( wxString const& aFilterText, w for( ZONE* zone : m_zoneSettingsBag.GetClonedZoneList() ) { + if( m_layerFilter != UNDEFINED_LAYER && !zone->GetLayerSet().Contains( m_layerFilter ) ) + continue; + if( ( m_sortByName && zone->GetZoneName().Lower().Contains( lowerFilterText ) ) || ( m_sortByNet && zone->GetNetname().Lower().Contains( lowerFilterText ) ) ) { @@ -271,7 +314,14 @@ wxDataViewItem MODEL_ZONES_OVERVIEW::ClearFilter( wxDataViewItem aSelection ) return {}; ZONE* zone = GetZone( aSelection ); - m_filteredZones = m_zoneSettingsBag.GetClonedZoneList(); + m_filteredZones.clear(); + + for( ZONE* z : m_zoneSettingsBag.GetClonedZoneList() ) + { + if( m_layerFilter == UNDEFINED_LAYER || z->GetLayerSet().Contains( m_layerFilter ) ) + m_filteredZones.push_back( z ); + } + SortFilteredZones(); Reset( GetCount() ); OnRowCountChange(); diff --git a/pcbnew/zone_manager/model_zones_overview.h b/pcbnew/zone_manager/model_zones_overview.h index 16201a7fbb..38a90cd535 100644 --- a/pcbnew/zone_manager/model_zones_overview.h +++ b/pcbnew/zone_manager/model_zones_overview.h @@ -48,7 +48,9 @@ wxDECLARE_EVENT( EVT_ZONES_OVERVIEW_COUNT_CHANGE, wxCommandEvent ); enum class ZONE_INDEX_MOVEMENT { MOVE_UP, - MOVE_DOWN + MOVE_DOWN, + MOVE_TO_TOP, + MOVE_TO_BOTTOM }; @@ -83,6 +85,8 @@ public: void EnableFitterByNet( bool aEnable ); + void SetLayerFilter( PCB_LAYER_ID aLayer ); + void GetValueByRow( wxVariant& aVariant, unsigned aRow, unsigned aCol ) const override; bool SetValueByRow( const wxVariant& aVariant, unsigned aRow, unsigned aCol ) override; @@ -137,4 +141,5 @@ private: std::vector m_filteredZones; bool m_sortByName; bool m_sortByNet; + PCB_LAYER_ID m_layerFilter; }; diff --git a/pcbnew/zone_manager/zone_preview_canvas.cpp b/pcbnew/zone_manager/zone_preview_canvas.cpp index 1b0fae3d84..4fdf800d20 100644 --- a/pcbnew/zone_manager/zone_preview_canvas.cpp +++ b/pcbnew/zone_manager/zone_preview_canvas.cpp @@ -24,6 +24,8 @@ #include "zone_preview_canvas.h" #include +#include +#include #include #include @@ -104,7 +106,9 @@ ZONE_PREVIEW_CANVAS::ZONE_PREVIEW_CANVAS( BOARD* aPcb, ZONE* aZone, PCB_LAYER_ID const wxPoint& aPosition, const wxSize& aSize, GAL_TYPE aGalType ) : PCB_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, wxDefaultSize, aOptions, aGalType ), m_pcb( aPcb ), - m_pcb_bounding_box( std::make_unique( aPcb->GetBoardEdgesBoundingBox() ) ) + m_layer( aLayer ), + m_pcb_bounding_box( std::make_unique( aPcb->GetBoardEdgesBoundingBox() ) ), + m_zoomLocked( false ) { m_view->UseDrawPriority( true ); m_painter = std::make_unique( m_gal, FRAME_FOOTPRINT_PREVIEW ); @@ -126,10 +130,28 @@ ZONE_PREVIEW_CANVAS::ZONE_PREVIEW_CANVAS( BOARD* aPcb, ZONE* aZone, PCB_LAYER_ID Bind( wxEVT_SIZE, [this]( wxSizeEvent& aEvent ) { - ZoomFitScreen(); + if( !m_zoomLocked ) + ZoomFitScreen(); + aEvent.Skip(); } ); + Bind( wxEVT_RIGHT_UP, + [this]( wxMouseEvent& aEvent ) + { + wxMenu menu; + menu.Append( wxID_ANY, _( "Zoom to Fit" ) ); + + menu.Bind( wxEVT_COMMAND_MENU_SELECTED, + [this]( wxCommandEvent& ) + { + UnlockZoom(); + ZoomFitScreen(); + } ); + + PopupMenu( &menu ); + } ); + StartDrawing(); RequestRefresh(); } @@ -192,3 +214,18 @@ void ZONE_PREVIEW_CANVAS::ZoomFitScreen() m_view->SetCenter( bBox.Centre() ); RequestRefresh(); } + + +void ZONE_PREVIEW_CANVAS::LockZoom( double aScale, const VECTOR2D& aCenter ) +{ + m_zoomLocked = true; + m_view->SetScale( aScale ); + m_view->SetCenter( aCenter ); + RequestRefresh(); +} + + +void ZONE_PREVIEW_CANVAS::UnlockZoom() +{ + m_zoomLocked = false; +} diff --git a/pcbnew/zone_manager/zone_preview_canvas.h b/pcbnew/zone_manager/zone_preview_canvas.h index 5a6ce56434..fa158046df 100644 --- a/pcbnew/zone_manager/zone_preview_canvas.h +++ b/pcbnew/zone_manager/zone_preview_canvas.h @@ -26,6 +26,7 @@ #pragma once #include +#include #include #include #include @@ -50,8 +51,12 @@ public: const BOX2I GetDocumentExtents( bool aIncludeAllVisible = true ) const; + void LockZoom( double aScale, const VECTOR2D& aCenter ); + void UnlockZoom(); + private: BOARD* m_pcb; int m_layer; std::unique_ptr m_pcb_bounding_box; + bool m_zoomLocked; }; diff --git a/pcbnew/zone_manager/zone_preview_notebook.cpp b/pcbnew/zone_manager/zone_preview_notebook.cpp index 3b12705969..13ee961728 100644 --- a/pcbnew/zone_manager/zone_preview_notebook.cpp +++ b/pcbnew/zone_manager/zone_preview_notebook.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -75,7 +76,10 @@ private: ZONE_PREVIEW_NOTEBOOK::ZONE_PREVIEW_NOTEBOOK( wxWindow* aParent, PCB_BASE_FRAME* aPcbFrame ) : wxNotebook( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize ), - m_pcbFrame( aPcbFrame ) + m_pcbFrame( aPcbFrame ), + m_hasSavedZoom( false ), + m_savedScale( 1.0 ), + m_savedCenter( 0, 0 ) { Bind( wxEVT_BOOKCTRL_PAGE_CHANGED, &ZONE_PREVIEW_NOTEBOOK::OnPageChanged, this ); @@ -108,7 +112,20 @@ void ZONE_PREVIEW_NOTEBOOK::OnZoneSelectionChanged( ZONE* aZone ) int preferredLayer = UNDEFINED_LAYER; if( GetSelection() >= 0 && GetSelection() < (int) GetPageCount() ) - preferredLayer = static_cast( GetCurrentPage() )->GetLayer(); + { + ZONE_PREVIEW_NOTEBOOK_PAGE* curPage = + static_cast( GetCurrentPage() ); + preferredLayer = curPage->GetLayer(); + + KIGFX::VIEW* view = curPage->GetCanvas()->GetView(); + + if( view ) + { + m_savedScale = view->GetScale(); + m_savedCenter = view->GetCenter(); + m_hasSavedZoom = true; + } + } while( GetPageCount() ) RemovePage( 0 ); @@ -122,13 +139,18 @@ void ZONE_PREVIEW_NOTEBOOK::OnZoneSelectionChanged( ZONE* aZone ) { BOARD* board = m_pcbFrame->GetBoard(); wxString layerName = board->GetLayerName( layer ); - ZONE_PREVIEW_NOTEBOOK_PAGE* page = new ZONE_PREVIEW_NOTEBOOK_PAGE( this, board, aZone, layer, - m_pcbFrame->GetGalDisplayOptions(), - m_pcbFrame->GetCanvas()->GetBackend() ); + ZONE_PREVIEW_NOTEBOOK_PAGE* page = + new ZONE_PREVIEW_NOTEBOOK_PAGE( this, board, aZone, layer, + m_pcbFrame->GetGalDisplayOptions(), + m_pcbFrame->GetCanvas()->GetBackend() ); AddPage( page, layerName, false, layer ); page->Layout(); - page->GetCanvas()->ZoomFitScreen(); + + if( m_hasSavedZoom ) + page->GetCanvas()->LockZoom( m_savedScale, m_savedCenter ); + else + page->GetCanvas()->ZoomFitScreen(); if( layer == preferredLayer ) preferredPage = page; diff --git a/pcbnew/zone_manager/zone_preview_notebook.h b/pcbnew/zone_manager/zone_preview_notebook.h index 66b7876caf..d4c1b8303f 100644 --- a/pcbnew/zone_manager/zone_preview_notebook.h +++ b/pcbnew/zone_manager/zone_preview_notebook.h @@ -24,7 +24,7 @@ #pragma once -#include +#include #include #include #include @@ -47,4 +47,7 @@ public: private: PCB_BASE_FRAME* m_pcbFrame; + bool m_hasSavedZoom; + double m_savedScale; + VECTOR2D m_savedCenter; }; diff --git a/resources/bitmaps_png/CMakeLists.txt b/resources/bitmaps_png/CMakeLists.txt index a73ffe0a70..1384739066 100644 --- a/resources/bitmaps_png/CMakeLists.txt +++ b/resources/bitmaps_png/CMakeLists.txt @@ -121,6 +121,7 @@ set( BMAPS_SMALL pintype_openemit pintype_nic pintype_noconnect + small_bottom small_down small_edit small_folder @@ -129,6 +130,7 @@ set( BMAPS_SMALL small_plus small_refresh small_sort_desc + small_top small_trash small_up small_warning diff --git a/resources/bitmaps_png/png/small_bottom_16.png b/resources/bitmaps_png/png/small_bottom_16.png new file mode 100644 index 0000000000..40d837e310 Binary files /dev/null and b/resources/bitmaps_png/png/small_bottom_16.png differ diff --git a/resources/bitmaps_png/png/small_bottom_32.png b/resources/bitmaps_png/png/small_bottom_32.png new file mode 100644 index 0000000000..1e14bbc3c6 Binary files /dev/null and b/resources/bitmaps_png/png/small_bottom_32.png differ diff --git a/resources/bitmaps_png/png/small_bottom_dark_16.png b/resources/bitmaps_png/png/small_bottom_dark_16.png new file mode 100644 index 0000000000..860c59606b Binary files /dev/null and b/resources/bitmaps_png/png/small_bottom_dark_16.png differ diff --git a/resources/bitmaps_png/png/small_bottom_dark_32.png b/resources/bitmaps_png/png/small_bottom_dark_32.png new file mode 100644 index 0000000000..f52836f03f Binary files /dev/null and b/resources/bitmaps_png/png/small_bottom_dark_32.png differ diff --git a/resources/bitmaps_png/png/small_top_16.png b/resources/bitmaps_png/png/small_top_16.png new file mode 100644 index 0000000000..795876be60 Binary files /dev/null and b/resources/bitmaps_png/png/small_top_16.png differ diff --git a/resources/bitmaps_png/png/small_top_32.png b/resources/bitmaps_png/png/small_top_32.png new file mode 100644 index 0000000000..52c621ce9d Binary files /dev/null and b/resources/bitmaps_png/png/small_top_32.png differ diff --git a/resources/bitmaps_png/png/small_top_dark_16.png b/resources/bitmaps_png/png/small_top_dark_16.png new file mode 100644 index 0000000000..761cf2bb94 Binary files /dev/null and b/resources/bitmaps_png/png/small_top_dark_16.png differ diff --git a/resources/bitmaps_png/png/small_top_dark_32.png b/resources/bitmaps_png/png/small_top_dark_32.png new file mode 100644 index 0000000000..587ddaa4a6 Binary files /dev/null and b/resources/bitmaps_png/png/small_top_dark_32.png differ diff --git a/resources/bitmaps_png/sources/dark/small_bottom.svg b/resources/bitmaps_png/sources/dark/small_bottom.svg new file mode 100644 index 0000000000..a8bd9485f7 --- /dev/null +++ b/resources/bitmaps_png/sources/dark/small_bottom.svg @@ -0,0 +1,104 @@ + + + + + + + + + + image/svg+xml + + small_bottom + + + + + + + + + + + + + + + small_bottom + + + + diff --git a/resources/bitmaps_png/sources/dark/small_top.svg b/resources/bitmaps_png/sources/dark/small_top.svg new file mode 100644 index 0000000000..da84d5f090 --- /dev/null +++ b/resources/bitmaps_png/sources/dark/small_top.svg @@ -0,0 +1,88 @@ + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/resources/bitmaps_png/sources/light/small_bottom.svg b/resources/bitmaps_png/sources/light/small_bottom.svg new file mode 100644 index 0000000000..867ffda1c7 --- /dev/null +++ b/resources/bitmaps_png/sources/light/small_bottom.svg @@ -0,0 +1,104 @@ + + + + + + + + + + image/svg+xml + + small_bottom + + + + + + + + + + + + + + + small_bottom + + + + diff --git a/resources/bitmaps_png/sources/light/small_top.svg b/resources/bitmaps_png/sources/light/small_top.svg new file mode 100644 index 0000000000..ddcca8725e --- /dev/null +++ b/resources/bitmaps_png/sources/light/small_top.svg @@ -0,0 +1,88 @@ + + + + + + + + image/svg+xml + + + + + + + + + +