1132 Commits

Author SHA1 Message Date
Seth Hillbrand 42928c8b2f Fix Move command grabbing from grid point instead of anchor
The Move command grabbed footprints from the nearest grid point rather
than the footprint anchor. This was caused by the reference point being
grid-aligned at drag start (commit 89be3fd390), which was a workaround
for fractional-nanometer positioning errors with non-page display origin.

Fix the root cause instead: AlignGrid(VECTOR2I, VECTOR2D, VECTOR2D)
relied on implicit VECTOR2D->VECTOR2I truncation to pass grid parameters
to computeNearest. For grid sizes that aren't exact in IEEE 754 double
(e.g., 0.254mm = 10 mil becomes 253999.999... instead of 254000), the
truncation produces incorrect grid sizes. Use KiROUND for the conversion
so all grid operations produce exact grid multiples.

With AlignGrid returning correct positions, the move tool no longer needs
to grid-align its reference point. Restore the anchor-based grab and the
GetMoveWarpsCursor() preference that 89be3fd390 removed.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23308
2026-03-10 11:07:39 -07:00
Seth Hillbrand a5445df107 Cycle through options on single-click for non-tool flyout groups
Setting flyout groups (units, crosshair, line modes) now cycle to the
next option on single-click instead of requiring a long-press to open
the palette. Tool flyout groups (route track, tune, dimensions, origins)
continue to activate the displayed tool on click.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23349
2026-03-09 15:06:25 -07:00
Seth Hillbrand 17d53bd77f Cycle through options on single-click for toggle flyout groups
When clicking flyout buttons for non-tool groups (crosshair style,
units, line modes), advance to the next option in the group instead
of re-dispatching the already-active action. Tool-type flyout groups
retain existing behavior of selecting the displayed tool.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23349
2026-03-06 11:28:28 -08:00
Ian McInerney 96d5de482a Don't gate toolbar tool action processing by ID anymore
We have some actions that use wx IDs now (e.g., wxID_PASTE), so we can't
just process things in our custom ID region anymore.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/23239
2026-03-02 01:41:14 +00:00
Jeff Young d7761d08c2 Better reporting when multiple footprints share the same RefDes.
Also guards access to fields in variant m_fields map.
2026-02-22 20:05:47 +00:00
Seth Hillbrand fb58cc4187 Prevent single-element groups
Groups with fewer than two items serve no purpose. All
user-facing group creation paths now require at least two
items before creating a group. The Group menu action is
greyed out when fewer than two items are selected.

When items are removed from a group via RemoveFromGroup,
pruneExistingGroups, or the netlist updater, the group is
dissolved if it drops below two members. Importers are left
unchanged since they reflect external file structure.
2026-02-19 09:43:01 -08:00
Damjan Prerad 3be5046f0f Fix uppercase 'X' in text controls when menu accelerator steals key event
On macOS, menu accelerators intercept key events before they reach focused text controls. The existing workaround in ACTION_MENU::OnMenuEvent re-creates the key event but uses the raw key code (always uppercase for letters) when converting.
Fix by checking the actual Shift/CapsLock keyboard state and converting the key code to the correct case before forwarding the synthetic wxEVT_CHAR event.

Row 53
2026-02-15 14:01:19 -08:00
Seth Hillbrand c52ab91c84 Reduce compile times by extracting headers
Break the most expensive header include chains that contaminate the
largest number of translation units

New lightweight headers for extractdded types:
font_metrics.h, mouse_drag_action.h, board_project_settings_params.h,
common_settings_internals.h, wx_infobar_message_type.h,
zone_layer_properties_grid.h
2026-02-13 17:10:45 -08:00
Alex Shvartzkop 2f0f5dac94 Fix action toolbar DIP padding on MSW. 2026-01-31 20:15:11 +03:00
Seth Hillbrand 3bfcac9e36 Prevent context menus from opening during progress dialog yielding
When a progress dialog calls YieldFor to process events, timer events
can fire and trigger disambiguation menus. Opening a popup menu during
YieldFor creates a nested modal event loop that leaves the menu stuck
and unresponsive, potentially locking up the entire UI on platforms
where the context menu captures all input (like Xfwm).

This fix adds a guard in DispatchContextMenu to check if the event loop
is currently yielding, and if so, skip opening the context menu.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14489
2026-01-29 20:56:53 -08:00
Alex Shvartzkop 84303bb94e Delay toolbar overflow status update.
Otherwise it may not work correctly when using small icons.
2026-01-30 01:47:11 +03:00
Alex Shvartzkop 98db8031a8 Fix negative padding in toolbar palette when using window scaling.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22582
2026-01-27 23:05:41 +03:00
Seth Hillbrand b9327dbe7e Fix incorrect ordering of mouse click and escape key events
When pressing escape soon after left clicking (within ~60ms), KiCad
was processing the escape key before the mouse button release event
due to wxWidgets event queue ordering. This caused operations to be
canceled instead of completed.

The fix adds flushPendingClicks() which checks button state via polling
when an escape key event arrives. If a button was logically pressed but
has been physically released, the click event is generated before the
escape event is processed, maintaining proper ordering.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20527
2026-01-26 22:22:35 -08:00
Mark Roszko 314735e2fc Move message dialogs to KICAD_MESSAGE_DIALOG define
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22830
2026-01-25 12:42:13 -05:00
Jeff Young d40dced428 Use the correct preferences.
The fooptrint viewer has its own WIDNOW_SETTINGS.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22709
2026-01-13 18:26:02 +00:00
Alex Shvartzkop 9a4694644d Show overflow button in toolbars when items don't fit.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8935
2026-01-08 05:16:47 +05:00
Alex Shvartzkop 3e255a2d48 More improvements in toolbar icon handling.
Also makes WX_AUI_TOOLBAR_ART more in-line with wx implementation.
2026-01-07 15:31:40 +05:00
Jeff Young 8c36e2f992 Allow control.ZoomSelector in 3D viewer. 2026-01-06 17:07:38 +00:00
Jeff Young 1f2caa041d Handle quit uniformly in COMMON_CONTROL.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22659

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22660
2026-01-06 17:07:38 +00:00
Seth Hillbrand 829c34532d Fix line constraints in polygon editor
Dragging a line should only ever maintain either the line itself or the
adjacent angles.  The direction of motion should always be orthogonal to
the line.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22563
2026-01-04 22:34:35 -08:00
Wayne Stambaugh d8f0eec099 Fix Linux build error. 2026-01-02 14:57:22 -05:00
Seth Hillbrand 3a89a5a9f5 ADDED toolbar context menus
Provides a global registry for context menu factories keyed by
action or group name. This allows JSON-loaded toolbar configurations
to get the same context menus as code-defined defaults.

API syntax:
  config.AppendAction( ACTION ).WithContextMenu( factory );

The WithContextMenu() method registers the factory in the
global registry keyed by action name.

Context menus can also be associated with toolbar groups:
  TOOLBAR_GROUP_CONFIG( name )
      .AddAction( A )
      .AddAction( B )
      .AddContextMenu( factory )

The factory is registered globally by group name.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20713
2026-01-02 10:09:45 -08:00
Jeff Young e2b83ca813 Formatting. 2026-01-02 13:29:25 +00:00
Jeff Young 7a67b142c9 Parameter is a FRAME_T, not a string.
Though we don't use it anyway....

Fixes https://gitlab.com/kicad/code/kicad/-/issues/22618
2026-01-02 13:10:08 +00:00
Alex Shvartzkop 75efbb7ce5 Modernize layer pair swatch icon drawing. 2026-01-02 08:53:05 +03:00
Jeff Young ba3e35b13e Protect toolbar controls from improper contexts. 2025-12-30 13:26:20 +00:00
Jeff Young 1f9965bd60 Add control handling to toolbar customisation. 2025-12-29 20:30:35 +00:00
Mike Williams f3fb46436d design blocks: always allow creating new library
Without this, a selected design block would prevent the New Library
option even when right clicking in blank space in the tree browser.
2025-12-17 10:24:18 -05:00
Jeff Young c4b72c386a Formatting. 2025-12-15 16:38:43 +00:00
Seth Hillbrand 897b1655d1 Clear construction manager with grid helper
Construction manager and snap manager keep raw pointers to board items,
so we need to clear them when switching canvases

(cherry picked from commit 3003c0c509)
2025-12-10 10:24:46 -08:00
Magnus Lundmark cdc1c417ff added table export, try to fix escaped expression uuid bug 2025-12-04 13:12:24 +00:00
Jeff Young 8bef63e802 Organise symbol tree menu to correspond with File & Edit menus.
Also minor improvements to all the
fields tables menu item names.
2025-12-01 16:58:11 +00:00
jean-pierre charras 5c5c5a4f11 Kicad manager: Fix for commit 30bfd045: ensure Kicad binaries are found 2025-11-24 09:42:32 +01:00
Mark Roszko 30bfd0459b Dont look for kicad binaries when trying to open text editor
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/22384
2025-11-23 08:54:06 -05:00
Jeff Young 161697d81c Cleanup. 2025-11-14 15:17:35 +00:00
Jeff Young 16ca38ed4a Improve signal-to-noise in the code. 2025-11-14 15:17:35 +00:00
jean-pierre charras e79e889599 Fix a few typos in comments and tool tips.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22187
2025-11-01 09:19:33 +01:00
Seth Hillbrand ce305990e8 Snap construction lines to grid if enabled
Nearest grid line intersection is a snap point on construction lines

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21984
2025-10-15 16:40:06 -07:00
Seth Hillbrand cbf469d5db Make MSVC happy 2025-10-15 15:07:45 -07:00
Seth Hillbrand ce49e9d69c Prioritize anchor snapping over snapline/grid
We have a number of potential snap points and we would prefer to snap to
identified snap points on objects in the view over ethereal points
created by intersections
2025-10-15 13:42:13 -07:00
Seth Hillbrand 3a67dceab2 Fix polygon point editor behavior to avoid hard limits
When dragging a vertex, use the 45/90 limits as guides and display the
full guidelines.  When dragging a midpoint, do not use these limits.
Keep the standard converging limit
2025-10-10 13:31:49 -07:00
Seth Hillbrand 7b26c57e07 Update movement constrainer
When moving an object in pcbnew, instead of using the constrainer to
restrict motion, we use it to build snapping guidelines that are visible
to the designer and make keeping movement on the various axes easier but
not required
2025-10-09 14:47:19 -07:00
Jeff Young aa72a7a257 Handle rotation of rounded corner rectangles.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21634
2025-10-08 15:16:10 +01:00
Jeff Young c12cc19ef4 Rename "Expand Selection" menu item in selection tool.
(We have a different "Expand Selection" command now,
and this was never a great name for showing
more choices anyway.)

Also treat tablecells as opaque when guessing
selection candidates.  It's unlikely there's anything
under them and keeping to their text bounds feels
counter-intuitive.
2025-10-06 21:16:36 +01:00
Seth Hillbrand f33fd675d2 Protect polygon build
If we don't have corners, then we cannot add any points or lines
2025-10-05 05:57:07 -07:00
Seth Hillbrand 0785e7525b Auto-update flyout icons when changed
Provides an update action to refresh the icon display when the user
changes the angle mode using a hotkey.  Also unifies the angle modes
between schematic, pcb and library editors
2025-09-22 12:19:20 -07:00
jean-pierre charras 11cc86e586 Hotkey handling: disable usage of keyboard modifier flag wxMOD_ALTGR.
The flag wxMOD_ALTGR is defined in wxWidgets as wxMOD_CONTROL|wxMOD_ALT
So AltGr key cannot used as modifier key because it is the same as
Alt key + Ctrl key that is already handled.
So the previous code did not work with modifiers Alt key, Ctrl key and Altgr key

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21696
2025-09-10 18:10:43 +02:00
Seth Hillbrand a1f816e8be Add additional modifies to hotkeys
Allows (depending on system) AltGr, Meta, Win, Super in combination with
other keys

Fixes https://gitlab.com/kicad/code/kicad/issues/1908
2025-09-09 13:30:01 -07:00
Jeff Young 93b0004175 Go back to checking points from the front.
We want to prefer a primary point (ie: a rectangle
corner) to a secondary point (ie: a rounded-rect
radius adjuster).
2025-09-08 18:37:47 +01:00
Jeff Young 702f774a1f Bring DIALOG_LIB_FIELDS into line with DIALOG_SYMBOL_FIELDS_TABLE. 2025-09-06 15:10:30 +01:00