Commit Graph

120 Commits

Author SHA1 Message Date
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
Seth Hillbrand aa064576a5 Fix symbol/footprint chooser tree rendering issue on GTK
Move showResults() inside the wxWindowUpdateLocker scope to ensure all
tree manipulation (including ExpandAncestors) happens while the window
is frozen. This prevents GTK from rendering stale cached cell data
during partial tree updates.

The issue manifested as text appearing offset by one row in the symbol
chooser tree after filtering, only correcting when the user moused over
items.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18407
2026-01-23 22:15:46 -08:00
Seth Hillbrand 95b29aba3f Simplify library adapter locking and reduce code duplication
The three library adapters (symbol, footprint, design block) each had
their own AsyncLoad() and GetLibraryStatus() implementations that were
nearly identical. This moves both to the base class.

The per-library mutex is removed. Each adapter now uses a single
shared_mutex for its library map. Read operations take shared locks,
write operations take unique locks. This simplifies the locking model
from two levels to one.

Derived classes override a new enumerateLibrary() method to perform
type-specific enumeration. The base class handles threading, status
tracking, and error handling.

Also adds a new WithFootprintsForLibrary() routine that takes a callback
but handles the locking internally so callers don't need to remember
2026-01-23 08:44:31 -08:00
Jeff Young f07e9234d9 Formatting. 2026-01-16 13:30:14 +00:00
Seth Hillbrand 6afeb6e09a Check existing column count against map
We are maintaining two structures in the lib_tree_model_adapter for
column widths.  m_columns (current available) and m_colNameMap.  If
there are more in the map than in reality, we get crashes

Fixes https://gitlab.com/kicad/code/kicad/issues/22663
2026-01-08 17:50:10 -08:00
Jeff Young b93d6d8ef1 Don't crash on un-shown columns.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22663
2026-01-07 11:06:36 +00:00
Jeff Young 4413cc75d8 Formatting. 2026-01-05 19:27:32 +00:00
Alex Shvartzkop ac281c79d2 Use LIB_TREE_RENDERER GTK workaround from wx 3.2.7
See https://github.com/wxWidgets/wxWidgets/issues/24227
2026-01-05 11:27:12 +03:00
Wayne Stambaugh a0ce13d1db A more complete fix for issue #22570.
The previous fix only prevented the crash when the design block panel
was hidden.  This fixes the same crash when the design block is visible.
It's possible this may cause refresh issues with the library tree model
adapter object.
2025-12-26 09:28:52 -05:00
Jeff Young 624f242da0 Formatting. 2025-11-25 12:06:58 +00:00
Jeff Young 0859aa4b75 Default to showing Value column in symbol library tree.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/22347
2025-11-25 12:06:58 +00:00
Jeff Young 3c2f6c5b8d Formatting. 2025-11-23 22:36:37 +00:00
Jon Evans 7527a1154a ADDED: background loading of footprints 2025-11-04 06:54:53 -05:00
Jon Evans 194091acae Switch schematic editor to using new library system
ADDED: lazy loading of symbol libraries in chooser
2025-10-15 22:18:50 -04:00
Jeff Young 87739c8ac7 wxStringTokenizer usage cleanup.
1) Always be explicit about what the delimiters are
2) If space is a delimiter, we probably want to skip
empty fields (wxTOKEN_STRTOK)
3) If space is not a delimiter, we often need to
trim the resultant tokens
4) Be more lenient about \t\r\n (and when they are
included, include them in the same order)
2025-09-16 13:03:02 +01:00
Seth Hillbrand dc7e0665c3 Prevent GTK from providing stale position
When the library name and symbol/footprint name both match the filter,
we try to display both but ensure visible can move things to the wrong
place.  We need to ensure the filtered list is up to date prior to
moving by ensureVisible

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18000
2025-09-03 16:58:38 -07:00
Jeff Young 34e075e112 Rework libtree SearchTerms to honour shownColumns.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21419
2025-08-03 20:32:19 +01:00
Jeff Young 01a8d44bce Further simplify scoring logic.
Do away with special cases for showing.
Do away with resetting the score separately.
All methods are subtractive (logical AND).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21220
2025-07-01 11:03:53 -06:00
Jeff Young 598d446a38 Simplify libTree scoring algorithm.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20610
2025-04-11 12:23:47 +01:00
Jeff Young e8e0b07223 Honour on-the-fly language changes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19773
2025-01-28 15:09:11 +00:00
Jon Evans 8903a82c50 Fix design block panel trampling symbol chooser settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19190
2025-01-26 18:32:00 -05:00
Jeff Young 577c1dd332 Also limit the number of search terms (as well as their length)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19464
2025-01-13 16:22:37 +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
Jeff Young f7f86174a0 Make sure symbol editor prefs go in symbol_editor file.
(And same for footprint editor.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18905
2024-10-13 20:14:14 +01:00
Mike Williams 2c99bc6c6d new feature: Schematic Design Blocks
Added to advanced config, default to off.
EnableDesignBlocks=1 in kicad_advanced to test

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/2263
2024-09-05 08:35:49 -04:00
Jeff Young 67a0253c66 m_filter is subtractive, and so must be run for each term
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18181
2024-08-14 21:22:39 -06:00
Alex Shvartzkop ece46223c9 Fix shadowed/conflicting enum values. 2024-06-21 16:16:29 +03:00
Jeff Young c828deee35 Sorting is not implemented on LIB_TREE columns.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18101
2024-05-29 18:49:11 +01:00
aris-kimi 66bb49e2da Silence some GCC warnings 2024-04-16 11:11:50 +00:00
Marek Roszko d8343a97dd explicit wx_str comparison 2024-04-12 19:59:43 -04:00
Jon Evans 0c2a084a47 Fix a few LIB_TREE search issues
Don't apply pruning to libraries that don't have
any children, since the point of the pruning is to
hide libraries that don't directly match a search
term if they don't have any children that match.

Fix searching for full LIB_IDs that got broken by
the implementation of "AND"

Fix searching for library names alone

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17205
2024-03-05 18:54:04 -05:00
Alex Shvartzkop 41ffadc987 Use correct text color in LIB_TREE selected items on non-OSX.
(cherry picked from commit 6feafedfbe)
2024-02-23 20:29:18 +03:00
Jeff Young 2cd9fbab9d Check known m_Desc field before m_Fields.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16971

(cherry picked from commit 25291d6e3a)
2024-02-23 16:53:34 +01:00
Alex Shvartzkop fba6aaf0e8 Only height should be increased for LIB_TREE_RENDERER. 2024-01-16 22:04:30 +03:00
Alex Shvartzkop ac59fae152 Fix cut-off library tree cell texts. 2024-01-16 21:59:08 +03:00
Seth Hillbrand 70a86c5caa Specify conversion for MSVC 2023-12-21 11:10:15 -08:00
Mike Williams 1700cad83b Symbol/Footprint Chooser: remember open libraries
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/16383
2023-12-21 09:57:54 -05:00
Mike Williams ecb7ac1da3 Lib Tree: don't always preselect in Already/Recently Placed 2023-12-21 09:57:54 -05:00
Jeff Young df161c9886 Support parital matches for libraries.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16400
2023-12-20 12:46:22 +00:00
Mike Williams c3d8fc4494 Symbol/Footprint Chooser: make columns resizable, sortable
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/16353
2023-12-13 09:46:17 -05:00
Jon Evans 2604854221 Make new lib tree highlighting dark-mode compatible 2023-11-21 17:31:23 -05:00
Jeff Young d382a11c2a Apply new on-canvas-item marking to footprint editor tree. 2023-11-20 19:46:03 +00:00
Jeff Young afb050a67f Header for non-MacOS builds. 2023-11-17 20:29:18 +00:00
Jeff Young 95dcf54d8d New is-canvas-item highlighting. 2023-11-17 20:29:18 +00:00
Jeff Young a4a946ab75 Clearer naming. 2023-11-17 18:36:33 +00:00
Jeff Young 752d2d5295 Filter must return true for libraries.
Also fixes a bug where a single symbol library wasn't expanded
due to the presence of the "-- already placed --" and
"-- recently used --" pseudo-libraries.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16074
2023-11-13 17:18:15 +00:00
Jeff Young 78e00ade7a Clearer naming. 2023-11-09 14:05:35 +00:00
Jeff Young 72c985bc07 Rewrite scoring algo again. (Third time's the charm?)
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16042
2023-11-08 12:33:09 +00:00
Jeff Young 64c692a42e Allow a:b to represent either lib:item_name or key:value.
Also changes the scoring algorithm to start at 0 and then increment
to 1 (the value that tells us to show, but not expand) only if the
search terms and lib filters are empty.
2023-10-31 23:20:59 +00:00
Alex Shvartzkop 9ed19192de Improve editing values with {return} in text fields; Add hyperlink detection. 2023-10-15 01:45:39 +03:00