Browse Source

Enable Copy Embedded File Reference context menu on macOS

Using wxID_COPY checks under the hood whether the item
should be enabled or not; we need to use a custom ID
to avoid this behavior.
pcb_db
JamesJCode 12 months ago
parent
commit
6a9e195d19
  1. 9
      common/dialogs/panel_embedded_files.cpp

9
common/dialogs/panel_embedded_files.cpp

@ -84,9 +84,11 @@ void PANEL_EMBEDDED_FILES::resizeGrid()
void PANEL_EMBEDDED_FILES::onGridRightClick( wxGridEvent& event )
{
wxMenu menu;
menu.Append( wxID_COPY, _( "Copy Embedded Reference" ) );
const wxWindowID id = NewControlId();
menu.Append( id, _( "Copy Embedded Reference" ) );
menu.Bind( wxEVT_COMMAND_MENU_SELECTED,
menu.Bind(
wxEVT_COMMAND_MENU_SELECTED,
[&]( wxCommandEvent& )
{
int row = event.GetRow();
@ -100,7 +102,8 @@ void PANEL_EMBEDDED_FILES::onGridRightClick( wxGridEvent& event )
wxTheClipboard->Close();
}
}
}, wxID_COPY );
},
id );
PopupMenu( &menu );
}

Loading…
Cancel
Save