305 Commits

Author SHA1 Message Date
Damjan Prerad 8b2cb94cb1 pcbnew: fix Flip Board View from custom toolbars
Flip Board View did not work correctly when it was added to a
custom toolbar. The board flip worked from the view menu or
appearance panel.

This change stores the board flip state in PCB_DISPLAY_OPTIONS
and applies it through SetDisplayOptions(), the same way other
display toggles are handled. The toolbar, menu, and appearance
panel now use the same state, so Flip Board View works correctly
from custom toolbars.
2026-03-18 12:41:51 +01:00
John Beard c4c19018c3 Pcbnew: Restrict includes of pad.h/footprint.h
There are some headers which don't need to include pad.h (which brings
padstack.h) - they just need forward defines.

While pad.h is not an especially heavy include on the scale of things,
footprint is quite heavy. And both reduce inclusion load and
reduce the number of files needlessly sensitive to changes in headers.
2026-03-05 02:18:34 +08:00
John Beard 113746dc81 Pcbnew: move PCB_TRACK types to a lightweight header
This lightens the load when including forwards for PCB_TRACK and
friends as we don't need all the transitive includes. Sometimes
you just need the enums - many users just wanted VIATYPE, or
just needed a forward.

And reduces transitive code churn when something is changed in the
header - this reduces the files affected by a change in
pcb_track.h from nearly 400 to under 200.
2026-03-04 23:28:31 +08:00
Alex Shvartzkop e14ed92353 Remove stale comment. 2026-02-26 00:08:47 +03:00
Christoph Moench-Tegeder 129995acbd Handle libspnav login on FreeBSD just like on Linux
FreeBSD uses libspnav, just like a Linux does, so all the
conditional code addressing the spnav APIs should be used
on FreeBSD, too.
Unfortunately, the logic was not consistent in all places:
sometimes we had "#ifdef", sometimes "#if defined" and
sometimes it was negated as "#ifndef". To make the intention
clearer across both Linux and FreeBSD, I unified all places
to a "#if defined(__linux__) || defined(__FreeBSD__)".
If we get another OS latching onto the same logic, we should
introduce a simple flag for this, but for only two OSes I
decided against adding central logic for this.
2026-02-16 22:56:27 +00: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
Mark Roszko be93ccad87 Make IO_ERROR inherit from std::exception for giggles 2026-01-12 22:21:37 -05:00
dsa-t a9f9671683 Clear tool manager model to avoid crash when closing PCB editor.
(cherry picked from commit 5e4633545b)

Co-authored-by: Alex Shvartzkop <dudesuchamazing@gmail.com>
2025-12-12 21:29:50 +03:00
Jon Evans baa29c1a58 Port footprint library table to new system 2025-11-04 06:54:53 -05:00
Seth Hillbrand e257912b04 Move a bunch of strings to trace_helpers
Actually forgot about this file for a while until being reminded
2025-10-14 18:23:48 -07:00
Jeff Young 507b22bbaf Fill in more missing barcode code. 2025-10-02 21:52:43 +01:00
Jeff Young e6fd3826c3 Make sure listeners get updated when schematic changes.
Also be safer about pulling pointers out from under
search results.

Also remove old frame-based board listeners (they're
now hosted directly on the board).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21817
2025-09-26 17:41:50 +01:00
jean-pierre charras 8f8edf8d69 FRAME_FOOTPRINT_CHOOSER and FRAME_FOOTPRINT_VIEWER: fix incorrect save settings
They were saved in cvpcb.json instead of pcbnew.json, and especially for
FRAME_FOOTPRINT_CHOOSER, some settings were incorrectly retrieved because
not actually updated.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21818
2025-09-26 11:52:49 +02:00
Jeff Young 6e316d9faa ADDED: menu items to control cross-probing from ERC
dialog.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17916
2025-09-10 17:52:09 +01:00
Jeff Young 3c5fb9d90d CHANGED: progressive disclosure in DRC dialog.
CHANGED: moved Report All Track Errors to config menu.

ADDED: menu items to control cross-probing from DRC
dialog.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17916
2025-09-10 17:52:09 +01:00
Seth Hillbrand 0a5de5010f ADDED: Spacemouse support for Linux
Uses libspnav to handle spacemouse data.  Overlays on existing
spacemouse framework to handle view activation

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16133
2025-08-12 07:04:54 -07:00
Jeff Young beb83e87ea Must use addParamsForWindow to init WINDOW_SETTINGs structs. 2025-07-17 16:26:50 +01:00
Wayne Stambaugh fdb8e0d079 Do not refresh PCB canvas when clearing every selected item.
It only needs to be done once after all of the items are updated.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21332

(cherry picked from commit 63ec5af8a1)
2025-07-16 18:29:32 -04:00
Jeff Young 6541202d42 Repair COMMON_TOOLS to know about frame-specific WINDOW_SETTINGS
Remove the older architectures for ensuring non-empty
grids and zooms

Move new architecture to PARAM_LIST::Load,
and add zoom support

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21318
2025-07-15 15:24:11 +01:00
Jeff Young 273ca3de77 Re-entrancy guard for sym/fp change timers.
(Potentially KICAD-XJN.)
2025-07-13 16:39:50 +01:00
Jeff Young 4a653c548b Put all focused items through ID lookup when un-brightening them. (Potentially KICAD-RN1) 2025-07-08 11:24:20 +01:00
Jeff Young b077b32c43 Clear arcs before boolean ops (KICAD-CFQ). 2025-07-03 22:40:28 -06:00
Alex Shvartzkop 4a5039c2cf Remove some unused variables. 2025-07-02 16:48:26 +03:00
Jeff Young f58fc0b952 Rewrite GROUP undo based on uuids.
This also removes the GROUP/UNGROUP-specific undo actions.

This also fixes a bunch of undo bugs when duplicating
group members, creating pins, etc.

This also fixes some undo bugs when dividing wires etc.

This also fixes some bugs with new sch items not
being created within an entered group.
2025-05-21 14:24:59 +01:00
Jeff Young 7232a98b65 Remove redundant performance changes.
(Alex had already moved these to const char, which
avoids wxString's c'tor.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20506
2025-04-10 11:40:37 +01:00
Jeff Young 1d45de0d1d Performance.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20506
2025-04-09 18:21:15 +01:00
Jeff Young 0659290417 Simplify hatch damage/rebuild and move it out of view.
There should be far fewer hatched objects than other
objects, so we're spending too much effort finding
all the possible damage when we probably should
just be auto-regenerating all the hatching.

This also moves it out of being done during redraw,
which was proving problematic.  Plus the refill
zones architecture does it during commit, and has
a lot more miles behind it.
2025-04-07 11:46:02 +01:00
Mike Williams 40058ebe80 actions: move all basic selection operations to common actions 2025-04-02 12:02:01 -04:00
Mike Williams 5fd294cad2 eda frame: hoist FocusItem calls up a layer
Prep for SCH_GROUPs
2025-04-01 14:34:20 -04:00
Mike Williams a90b8ec57a pcb: merge RunOnChildren/Descendants into one function with a mode 2025-03-27 13:16:09 -04:00
Jeff Young 9c375581ff Don't assert (or crash) on shutdown.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20433
2025-03-24 12:36:44 +00:00
Ian McInerney 04ab369a49 Make the PCB layerbox not needed in pcbcommon 2025-02-28 01:57:37 +00:00
Ian McInerney fc6f3f2332 Formatting tweak 2025-02-28 01:57:37 +00:00
Ian McInerney f0a76f62b6 Cleanup PCB/fpeditor layer box handling 2025-02-28 01:57:37 +00:00
Ian McInerney 7ad1103f55 Move toolbars to a serializable storage format 2025-02-28 01:57:37 +00:00
Jeff Young 8874f137fa Read hotkeys from disk after they change.
(Otherwise we'll write the old versions back out
when closing one app.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19612
2025-02-01 20:01:13 +00:00
Ian McInerney 4cf8274b2b Silence errors from file watchers when adding files
The file watcher can throw errors on Linux that are very cryptic and
actually not very useful to users, so let's hide them since there isn't
really any problem that comes from this.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15717
2025-01-29 19:34:00 +00:00
Jeff Young 0d6a2f1c47 SynchronizeProperties after (potentially) changing text vars.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19658
2025-01-16 18:37:10 +00:00
Seth Hillbrand 229507ee43 Cleanup a couple routines in the last MR
Simplify and clean the functions
2025-01-09 15:42:58 -08:00
Dhinesh e02b6be4c9 Fix error-marker highlighting for multiple markers at the same location
Previously, if multiple error markers were placed at the same location,
the selected marker was not visually differentiated from the unselected
ones, even if one was at the top of the stack. To fix this, Need to pass
overlapping markers to the FocusOnItems() function instead of calling
FocusOnItem() with only the selected marker.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9778
2025-01-09 23:41:02 +00:00
Seth Hillbrand 0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Seth Hillbrand fbbb642c0c Move all nlnav to unique_ptrs
7daded7c60 moved them to bare pointers but
this was not required to allow forward declarations.  We only need to
place the CTOR/DTOR fully in the cpp file where the nlnav headers are
included
2024-12-30 15:43:15 -08:00
Seth Hillbrand e9bc8cfe9d Give Clipper1 a Viking funeral
Clears out the last spot where we were only using Clipper1 (how'd I
miss that?) and remove all calls to the Clipper1 structures
2024-12-23 17:12:09 -08:00
Jon Evans 71a0a638a0 Remove unused pad layers and simplify pad colors 2024-11-16 11:27:20 -05:00
jean-pierre charras b193249d1c BOARD: add helper function GetCopperLayerStackMaxId() and remove dead code
GetCopperLayerStackMaxId() replaces GetCopperLayerCount()*2 and is more
understandable in code where the max allowed PCB_LAYER_ID value is needed.
Removed also a dead code related to GetCopperLayerCount() < 2, broken and not
allowed in Kicad.
2024-10-06 09:37:04 +02:00
jean-pierre charras ef3193fe97 Pcbnew: fix some switch copper layers issues:
- fix PCB_CONTROL::LayerNext() and PCB_CONTROL::LayerPrev() (hotkeys + and -)
- fix PCB_EDIT_FRAME::SwitchLayer( PCB_LAYER_ID layer )
- fix PCB_BASE_FRAME::SwitchLayer( PCB_LAYER_ID layer )

-PNS router SwitchLayer is still broken and can crash.
2024-10-03 18:28:09 +02:00
John Beard 215533f31a Unify flip direction handling
There was a gentle mish-mash of booleans, some with
true being left/right and some up/down, and some functions that
can flip in both axes (which is never actually done, and doesn't
really make geometric sense).

Replace all this with the FLIP_DIRECTION enum class, which makes
the intention completely unambiguous.

This also then allows a small scattering of simplifications,
because everything takes the same type and you don't have to
fiddle booleans to fit.
2024-09-27 17:13:13 +01:00
Mike Williams 867cb58175 feature removal: remove Show Hidden Text
Does not work properly since 8.0 introduction of footprint fields.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18656
2024-09-19 15:41:44 -04:00
Jeff Young 94f995c49e Reduce dependency on dynamic_cast.
(Especially where it is no-worky on MacOS.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17245
2024-09-04 17:24:49 +01:00
Jeff Young cbfd6ec9ea CHANGED: remove single layer restriction for uvias.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18501
2024-08-15 16:42:57 -06:00