Cosmetic enhancement: add a dismiss icon to clarification menu "title" (the "title" is also the close menu command)

This commit is contained in:
jean-pierre charras 2016-08-15 20:22:54 +02:00
parent 293849256e
commit 01d3c72dda
8 changed files with 163 additions and 28 deletions

View File

@ -216,6 +216,7 @@ set( BMAPS_MID
delete_track
delete
directory
dismiss
display_options
down
drag_module

View File

@ -0,0 +1,65 @@
/* Do not modify this file, it was automatically generated by the
* PNG2cpp CMake script, using a *.png file as input.
*/
#include <bitmaps.h>
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x02, 0xfc, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0x63, 0x60, 0x20, 0x15, 0x6c,
0x66, 0xe0, 0x62, 0xd8, 0xcf, 0xc0, 0xc1, 0x40, 0x75, 0xb0, 0x9f, 0x41, 0x83, 0xe1, 0x20, 0x43,
0x3c, 0x10, 0x4f, 0x64, 0x38, 0xc0, 0xb0, 0x98, 0xe1, 0x10, 0xc3, 0x32, 0x30, 0x3e, 0xc8, 0xb0,
0x00, 0x48, 0x77, 0x02, 0x71, 0x08, 0xc3, 0x5e, 0x06, 0x69, 0xca, 0x2c, 0xd8, 0xcf, 0xd0, 0x00,
0x37, 0x18, 0x1f, 0x3e, 0xc0, 0xb0, 0x14, 0x88, 0x73, 0x19, 0x4e, 0x30, 0x88, 0x13, 0x6f, 0xc1,
0x7f, 0x06, 0x46, 0x86, 0xc3, 0x0c, 0x71, 0x44, 0x59, 0x80, 0x8e, 0x0f, 0x32, 0x2c, 0x04, 0x5a,
0x68, 0x4b, 0x9c, 0x45, 0x07, 0x18, 0x52, 0xc9, 0xb2, 0x04, 0x61, 0xd9, 0x52, 0x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xd8, 0xd2, 0x1b, 0xe4, 0x20, 0xcd, 0xd3, 0x9a, 0x1b, 0xb0, 0xa7, 0x36, 0x74,
0xb0, 0x97, 0x41, 0x1e, 0xa8, 0x60, 0x3e, 0x45, 0xf5, 0x11, 0x24, 0xc8, 0xfa, 0x19, 0x76, 0x32,
0x70, 0xe3, 0xaf, 0x93, 0x0e, 0x33, 0x18, 0x53, 0x64, 0x19, 0xa8, 0x94, 0xd9, 0x09, 0xac, 0x72,
0x88, 0x02, 0x07, 0x19, 0x14, 0x81, 0x96, 0x4d, 0x24, 0xc3, 0xa2, 0x3a, 0x60, 0x21, 0x2a, 0x40,
0x5a, 0xe3, 0x64, 0x26, 0x03, 0x2b, 0xd0, 0x77, 0x1e, 0x40, 0x4b, 0xa7, 0x12, 0x61, 0x41, 0x27,
0xd0, 0x61, 0xa6, 0xe0, 0xf6, 0x06, 0xd9, 0x00, 0xa4, 0x19, 0xd2, 0xe4, 0x8a, 0x02, 0xe2, 0x6c,
0x20, 0xae, 0x00, 0x1a, 0x5c, 0x06, 0x34, 0x38, 0x13, 0xc8, 0x0e, 0x22, 0x3e, 0x98, 0xe8, 0x04,
0x00, 0xed, 0xfc, 0x4d, 0x6b, 0x01, 0x23, 0x3d, 0xb9, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
0x44, 0xae, 0x42, 0x60, 0x82,
};
const BITMAP_OPAQUE dismiss_xpm[1] = {{ png, sizeof( png ), "dismiss_xpm" }};
//EOF

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="26"
width="26"
version="1.1"
id="svg2"
inkscape:version="0.91 r13725"
sodipodi:docname="dismiss.svg">
<metadata
id="metadata40">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1033"
id="namedview38"
showgrid="true"
inkscape:snap-to-guides="false"
inkscape:snap-grids="true"
inkscape:zoom="27.416626"
inkscape:cx="0.1136198"
inkscape:cy="13.655007"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
inkscape:snap-nodes="true">
<inkscape:grid
type="xygrid"
id="grid3017"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
spacingx="0.5px"
spacingy="0.5px" />
</sodipodi:namedview>
<defs
id="defs4" />
<ellipse
style="opacity:0.65;fill:#00c100;fill-opacity:1;stroke:#7a2eff;stroke-width:3;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0"
id="path4144"
cx="12.900642"
cy="12.825385"
rx="11.911641"
ry="11.955193" />
<g
id="g4222"
transform="matrix(0.85839736,0,0,1.0136997,0.91403481,0.27180587)">
<path
inkscape:connector-curvature="0"
id="path4205"
d="M 7.0070598,6.4820568 20.847043,17.758067"
style="fill:none;fill-rule:evenodd;stroke:#f7f8f2;stroke-width:2.28078771;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path4205-6"
d="M 7.0025382,17.735282 20.842522,6.4592716"
style="fill:none;fill-rule:evenodd;stroke:#f7f8f2;stroke-width:2.28078771;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -161,9 +161,9 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF
wxT( "Select item clarification context menu size limit exceeded." ) );
wxMenu selectMenu;
wxMenuItem* title = new wxMenuItem( &selectMenu, wxID_NONE, _( "Clarify Selection" ) );
selectMenu.Append( title );
AddMenuItem( &selectMenu, wxID_NONE, _( "Clarify Selection" ),
KiBitmap( dismiss_xpm ) );
selectMenu.AppendSeparator();
for( int i = 0; i < m_collectedItems.GetCount() && i < MAX_SELECT_ITEM_IDS; i++ )
@ -173,7 +173,7 @@ SCH_ITEM* SCH_EDIT_FRAME::LocateItem( const wxPoint& aPosition, const KICAD_T aF
AddMenuItem( &selectMenu, ID_SELECT_ITEM_START + i, text, KiBitmap( xpm ) );
}
// Set to NULL in case user aborts the clarification context menu.
// Set to NULL in case the user aborts the clarification context menu.
GetScreen()->SetCurItem( NULL );
m_canvas->SetAbortRequest( true ); // Changed to false if an item is selected
PopupMenu( &selectMenu );

View File

@ -1275,9 +1275,9 @@ LIB_ITEM* LIB_EDIT_FRAME::locateItem( const wxPoint& aPosition, const KICAD_T aF
wxT( "Select item clarification context menu size limit exceeded." ) );
wxMenu selectMenu;
wxMenuItem* title = new wxMenuItem( &selectMenu, wxID_NONE, _( "Clarify Selection" ) );
AddMenuItem( &selectMenu, wxID_NONE, _( "Clarify Selection" ),
KiBitmap( dismiss_xpm ) );
selectMenu.Append( title );
selectMenu.AppendSeparator();
for( int i = 0; i < m_collectedItems.GetCount() && i < MAX_SELECT_ITEM_IDS; i++ )

View File

@ -172,6 +172,7 @@ EXTERN_BITMAP( delete_track_xpm )
EXTERN_BITMAP( delete_xpm )
EXTERN_BITMAP( dialog_warning_xpm )
EXTERN_BITMAP( directory_xpm )
EXTERN_BITMAP( dismiss_xpm )
EXTERN_BITMAP( display_options_xpm )
EXTERN_BITMAP( down_xpm )
EXTERN_BITMAP( ortho_xpm )

View File

@ -228,16 +228,8 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode )
wxMenu itemMenu;
// Give a title to the selection menu. This is also a cancel menu item
wxMenuItem * item_title = new wxMenuItem( &itemMenu, -1, _( "Selection Clarification" ) );
#ifdef __WINDOWS__
wxFont bold_font( *wxNORMAL_FONT );
bold_font.SetWeight( wxFONTWEIGHT_BOLD );
bold_font.SetStyle( wxFONTSTYLE_ITALIC );
item_title->SetFont( bold_font );
#endif
itemMenu.Append( item_title );
AddMenuItem( &itemMenu, wxID_NONE, _( "Clarify Selection" ),
KiBitmap( dismiss_xpm ) );
itemMenu.AppendSeparator();
int limit = std::min( MAX_ITEMS_IN_PICKER, m_Collector->GetCount() );

View File

@ -128,16 +128,8 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode )
wxMenu itemMenu;
// Give a title to the selection menu. It also allow to close the popup menu without any action
wxMenuItem* item_title = new wxMenuItem( &itemMenu, wxID_NONE, _( "Selection Clarification" ) );
#ifdef __WINDOWS__
wxFont bold_font( *wxNORMAL_FONT );
bold_font.SetWeight( wxFONTWEIGHT_BOLD );
bold_font.SetStyle( wxFONTSTYLE_ITALIC );
item_title->SetFont( bold_font );
#endif
itemMenu.Append( item_title );
AddMenuItem( &itemMenu, wxID_NONE, _( "Clarify Selection" ),
KiBitmap( dismiss_xpm ) );
itemMenu.AppendSeparator();
int limit = std::min( MAX_ITEMS_IN_PICKER, m_Collector->GetCount() );
@ -159,7 +151,7 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode )
// PCB_BASE_FRAME::ProcessItemSelection()
// and it calls SetCurItem() which in turn calls DisplayInfo() on the
// item.
m_canvas->SetAbortRequest( true ); // changed in false if an item
m_canvas->SetAbortRequest( true ); // changed in false if an item is selected
PopupMenu( &itemMenu ); // m_AbortRequest = false if an item is selected
m_canvas->MoveCursorToCrossHair();
@ -464,7 +456,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
if( pcbframe->IsGalCanvasActive() )
{
KIGFX::VIEW* view = pcbframe->GetGalCanvas()->GetView();
source_module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view,
source_module->RunOnChildren( std::bind( &KIGFX::VIEW::Remove, view,
std::placeholders::_1 ) );
view->Remove( source_module );
}
@ -499,7 +491,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
ratsnest->Recalculate();
KIGFX::VIEW* view = pcbframe->GetGalCanvas()->GetView();
newmodule->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view,
newmodule->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view,
std::placeholders::_1 ) );
view->Add( newmodule );
pcbframe->GetGalCanvas()->ForceRefresh();