← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Gerbview: Zoom to selection tool duplication

 

I noticed that after deleting zoom-to-selection tool from left toolbar,
cursor (no tool) and separator becomes redundant in legacy view mode.
Updated patch in attachment.
It removes zoom-to-selection tool from left toolbar and hides cursor with
followed separator in legacy mode. When GAL canvas is active the cursor,
mesurement tool and separator is shows at the top of the toolbar.

2017-09-30 22:16 GMT+03:00 Константин Барановский <
baranovskiykonstantin@xxxxxxxxx>:

> Gerbview has "Zoom to selection" tool present on both toolbars (left and
> top).
> Attached patch removes it from left toolbar, so "Zoom to selection" stay
> present beside other zooming tools.
>
From cbafba6a80f8e71fc94e3d2ff1c1b7c353c8cd5e Mon Sep 17 00:00:00 2001
From: Baranovskiy Konstantin <baranovskiykonstantin@xxxxxxxxx>
Date: Sun, 1 Oct 2017 21:19:05 +0300
Subject: [PATCH] Gerbview: fix zoom to selection tool duplication.

---
 gerbview/toolbars_gerber.cpp | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/gerbview/toolbars_gerber.cpp b/gerbview/toolbars_gerber.cpp
index 40b5ed094..e0c6c8926 100644
--- a/gerbview/toolbars_gerber.cpp
+++ b/gerbview/toolbars_gerber.cpp
@@ -214,21 +214,18 @@ void GERBVIEW_FRAME::ReCreateOptToolbar( void )
     // TODO: these can be moved to the 'proper' vertical toolbar if and when there are
     // actual tools to put there. That, or I'll get around to implementing configurable
     // toolbars.
-    m_optionsToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
-                               wxEmptyString, wxITEM_CHECK );
-
-    m_optionsToolBar->AddTool( ID_ZOOM_SELECTION, wxEmptyString, KiBitmap( zoom_area_xpm ),
-                               _( "Zoom to selection" ), wxITEM_CHECK );
-
     if( IsGalCanvasActive() )
     {
+        m_optionsToolBar->AddTool( ID_NO_TOOL_SELECTED, wxEmptyString, KiBitmap( cursor_xpm ),
+                                   wxEmptyString, wxITEM_CHECK );
+
         m_optionsToolBar->AddTool( ID_TB_MEASUREMENT_TOOL, wxEmptyString,
                                    KiBitmap( measurement_xpm ),
                                    _( "Measure distance between two points" ),
                                    wxITEM_CHECK );
-    }
 
-    m_optionsToolBar->AddSeparator();
+        m_optionsToolBar->AddSeparator();
+    }
 
     m_optionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, KiBitmap( grid_xpm ),
                                _( "Turn grid off" ), wxITEM_CHECK );
-- 
2.14.1


Follow ups

References