From b125054afe3a72b1adc50f937806364d68c1abc2 Mon Sep 17 00:00:00 2001 From: Simon Wells Date: Sat, 16 Jan 2016 10:31:10 -0500 Subject: [PATCH] Pcbnew: Allow changing layer color with left mouse button Many users, particularly those on laptops, have no middle mouse button, and thus have no way at all to set the layer colors. --- pcbnew/layer_widget.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pcbnew/layer_widget.cpp b/pcbnew/layer_widget.cpp index 15798f1137..feee0b5845 100644 --- a/pcbnew/layer_widget.cpp +++ b/pcbnew/layer_widget.cpp @@ -422,9 +422,9 @@ void LAYER_WIDGET::insertLayerRow( int aRow, const ROW& aSpec ) // column 1 (COLUMN_COLORBM) col = COLUMN_COLORBM; wxBitmapButton* bmb = makeColorButton( m_LayerScrolledWindow, aSpec.color, encodeId( col, aSpec.id ) ); - bmb->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( LAYER_WIDGET::OnLeftDownLayers ), NULL, this ); + bmb->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( LAYER_WIDGET::OnMiddleDownLayerColor ), NULL, this ); bmb->Connect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( LAYER_WIDGET::OnMiddleDownLayerColor ), NULL, this ); - bmb->SetToolTip( _("Left click to select, middle click for color change, right click for menu" ) ); + bmb->SetToolTip( _("Left click for color change, right click for menu" ) ); m_LayersFlexGridSizer->wxSizer::Insert( index+col, bmb, 0, flags ); // column 2 (COLUMN_COLOR_LYR_CB) @@ -458,8 +458,9 @@ void LAYER_WIDGET::insertRenderRow( int aRow, const ROW& aSpec ) if( aSpec.color != -1 ) { wxBitmapButton* bmb = makeColorButton( m_RenderScrolledWindow, aSpec.color, encodeId( col, aSpec.id ) ); + bmb->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( LAYER_WIDGET::OnMiddleDownRenderColor ), NULL, this ); bmb->Connect( wxEVT_MIDDLE_DOWN, wxMouseEventHandler( LAYER_WIDGET::OnMiddleDownRenderColor ), NULL, this ); - bmb->SetToolTip( _( "Middle click for color change" ) ); + bmb->SetToolTip( _( "Left click for color change" ) ); m_RenderFlexGridSizer->wxSizer::Insert( index+col, bmb, 0, flags ); // could add a left click handler on the color button that toggles checkbox.