Commit Graph

90 Commits

Author SHA1 Message Date
Jon Evans 816e3efbd5 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


(cherry picked from commit 0c2a084a47)
2024-03-14 21:01:13 +00:00
Alex Shvartzkop 6feafedfbe Use correct text color in LIB_TREE selected items on non-OSX. 2024-02-23 17:22:20 +00:00
Jeff Young 25291d6e3a Check known m_Desc field before m_Fields.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16971
2024-02-22 23:37:15 +00: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
Jeff Young fa11e9138d ADDED support for pin and fp filtering in FOOTPRINT_CHOOSER.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7176
2023-09-29 17:03:50 +01:00
Jeff Young 63c83b3aed Remove dead code, and some formatting cleanup. 2023-07-16 14:43:29 +01:00
Jeff Young 1528f4700c Treat canvas item as current when tree view contains no selection.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12702
2023-06-04 20:52:12 +01:00
Jeff Young df7d62fdd3 Added a sort-order dropdown to lib-tree filters.
Also simplifies the scoring algorithm so that it only
differentiates between exact-match, match-at-start and
any-match.  The rest of the position-based matching
stuff is gone, as is the knowledge of the name vs the
keywords vs the description.  All that is left to the
provider of the weighted search terms array.
2023-05-01 21:26:43 +01:00
Jeff Young bc754df30f Go back to winner-takes-all lib-tree scoring algorithm.
(Because we sort alphabetically there's no way to see
what the second-highest scored item was.)
2023-04-30 13:01:09 +01:00
Jeff Young d01c023d5a Retire the lib-tree scoring algorithm.
It appears to cause more confusion than help.

Fixes https://gitlab.com/kicad/code/kicad/issues/13905
2023-04-14 23:35:27 +01:00
Jeff Young 01564a254f Make sure "Item" and "Description" end up in the translation database. 2023-04-11 23:56:12 +01:00
Jeff Young eef3492fc0 Make symbol/footprint trees sensitive to language change. 2023-04-11 23:51:58 +01:00
Jon Evans 6cce99e0d0 Support showing Value field in symbol chooser
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13527
2023-01-19 22:14:10 -05:00
Jeff Young 054649fa38 Formatting. 2022-10-16 18:39:37 +01:00
Jon Evans 375b530dad ADDED: Column selection and reordering in symbol chooser 2022-09-25 22:49:49 -04:00
Jon Evans f37086e840 Remove size handler that messes up column sizes
Could not reproduce an issue on wxGTK.  If this causes problems
on other OS's, let's find a more appropriate fix
2022-09-23 22:08:33 -04:00
Jeff Young 8eb68ee472 Add pin/unpin context menu to Symbol Chooser and Footprint Chooser.
Also moves some more code down into common so it can be shared.

Fixes https://gitlab.com/kicad/code/kicad/issues/12384
2022-09-21 14:45:12 +01:00
Jon Evans 1520a1d372 Use cached untranslated header for looking up width 2022-09-06 09:18:34 -04:00
Jon Evans e294fe2074 ADDED: Dynamic field columns in symbol chooser
CHANGED: Symbol chooser search now considers custom symbol fields

Visible columns can be controlled in database libraries.
In standard KiCad libraries, we show columns for all custom fields for now.

Customizable column visibility will be added in the future.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11946
2022-09-05 16:38:14 -04:00
Seth Hillbrand 34a5a32a52 Prevent GTK from zero-ing out column size
Related to https://gitlab.com/kicad/code/kicad/-/issues/12180
2022-08-15 14:24:02 -07:00
Jeff Young 18ac169ac7 Add contexts to EDA_COMBINED_MATCHER. 2022-08-14 22:56:29 +01:00
jean-pierre charras 490875e222 Fix a missing call to aEvent.Skip() in commit 753f2f3.
Any wxSizeEvent handler must call Skip() to propagate the event.
2022-07-29 16:46:35 +02:00
Jeff Young 753f2f3e4c Display descriptions in second column of library trees.
Also fixes some bugs in how the columns are sized.

Fixes https://gitlab.com/kicad/code/kicad/issues/12090
2022-07-28 14:51:47 +01:00
Jeff Young def87c969e Redo the pinned-libraries storage architecture.
1) always use preferences directly
2) allow nicknames from either preferences or project
3) store-after-modify

Fixes https://gitlab.com/kicad/code/kicad/issues/12000

Fixes https://gitlab.com/kicad/code/kicad/issues/11892
2022-07-22 09:31:10 +01:00
Jeff Young 05219e4d9a Add pinned library support to Choose Symbol and Choose Footprint. 2022-07-09 20:06:31 -06:00
Jeff Young 120c5b9ac1 Reimplement pinning now that we're no longer sorting on score. 2022-07-09 12:26:44 -06:00
Seth Hillbrand 4790257616 Don't break alphabetical sorting on search
When using the "Filter" search for footprints/symbols, the least
surprising outcome is that the window filters the existing
(alphabetically sorted) list but does not change the display order based
on scoring.

This also needs to adjust the fix for
https://gitlab.com/kicad/code/kicad/-/issues/259 as that assumed the
selected element would be the first below the group (not the case if we
are sorting alphabetically)

Fixes https://gitlab.com/kicad/code/kicad/issues/11746
2022-06-10 11:48:47 -07:00
Jeff Young 724182abe4 Fix lib tree searches to handle searching on library names.
Fixes https://gitlab.com/kicad/code/kicad/issues/9981
2021-12-14 15:18:48 +00:00
Jeff Young 671e9f2dba A better algorithm for centering library items in the tree.
It still doesn't center as wxWidgets' API is poorly suited for that.
But it does now at least keep it off the very top or bottom.
2021-10-02 10:41:26 +01:00
Jeff Young b84d1456d5 KIFACE_I -> KIFACE_BASE. 2021-09-14 23:45:14 +01:00
Jeff Young 6aaf4413b3 Fix kicad_string.h / string.cpp mismatch.
They don't define a KiCad string class, so the header file name was
somewhat misleading. But the fact that they didn't match definitely
made coding more difficult.
2021-07-29 16:03:25 +01:00
Wayne Stambaugh 37b200cb3e Pass wxString objects by reference instead of on the stack. 2021-07-27 08:41:27 -04:00
Jeff Young b1b4caee6a Escape "naughty" characters in symbol names.
It's tempting to say that we don't need to exclude filename chars
from symbols, but we might regret that decision down the road.  Better
to just escape them.

Fixes https://gitlab.com/kicad/code/kicad/issues/8694
2021-06-30 13:12:57 +01:00
Wayne Stambaugh fbc135e69f Rename SCH_COMPONENT to SCH_SYMBOL. 2021-06-10 10:34:49 -04:00