1050 Commits

Author SHA1 Message Date
John Beard
d933ed964e Move LAYER_PRESENTATION to widgets/
Since this is code used by widgets for UI presentation purposes.

Also saves some unnexessary includes in headers.
2024-08-07 06:49:53 +08:00
John Beard
db457f52fa Move layer presentation logic to a separate class
The separates it from the LAYER_SELECTOR class - deciding
what color a layer is (say) is separate to managing the
actual selection of the layer. For example, sel_layer.cpp
only needs the presentation logic. This also makes it eaiser
to compose rather than inherit.

Additonally, break out the layer pair swatch function
to this class.

This will also be needed by the layer pair manager UI.

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/15227
2024-08-06 23:45:55 +08:00
John Beard
15924958d9 Add wxGrid autosizer helper
This moves a fiddly little bit of logic used by a few UI
classes into a central location.

Also means that the paths dialog learns to expand the
first cell when it needs to (like the text variable
panel).
2024-08-06 23:45:55 +08:00
James J
7ce00e511b Multi-netclass support 2024-07-26 20:49:29 +00:00
Jeff Young
9fcbd4e6d0 Slight reduction in asserts. 2024-07-18 18:01:05 +01:00
Seth Hillbrand
77797103f7 Add ability to embed files in various elements
Schematics, symbols, boards and footprints all get the ability to store
files inside their file structures.  File lookups now have a
kicad-embed:// URI to allow various parts of KiCad to refer to files
stored in this manner.

kicad-embed://datasheet.pdf references the file named "datasheet.pdf"
embedded in the document.  Embeds are allowed in schematics, boards,
symbols and footprints.  Currently supported embeddings are Datasheets,
3D Models and drawingsheets

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

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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17827
2024-07-15 16:06:55 -07:00
Jeff Young
02a08bf9b1 ADDED: RMB > Copy item for HTML_WINDOW.
(Used at least in Footprint and Symbol Chooser details
panes.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17904
2024-07-08 20:55:08 +01:00
Jeff Young
f6031da58c ADDED: RMB-menu for Copy in inspectors.
Includes Inspect > Resolve Clearance, Inspect > Resolve
Constraints and everything else that uses WX_HTML_REPORT_BOX.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18321
2024-07-07 22:41:15 +01:00
Jeff Young
5c71d26b25 Regularise spacing with number badges. 2024-07-07 14:34:24 +01:00
Jeff Young
7f6ab7043b Clean up more exception processing in simulation GUI.
This allows us to more correctly report errors without
dialog issues, logs popping up, etc.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18259
2024-07-03 13:32:44 +01:00
Alex Shvartzkop
cec378b70d HiDPI: use logical icon size when changing indicator state. 2024-06-30 00:18:48 +03:00
jean-pierre charras
8737c6eb3c footprint selector in symbol properties: fix footprint selection issue.
When using the button to select a footprint using the footprint chooser
dialog, the new footprint was not always taken in account (perhaps MSW specific).
It was due to the code to update the footprint name was between Disable() and
Enable, thus creating a loss of some events in the complex grid edition stuff.
This is now replaced by a lock flag to protect this code to be executed when
it should not.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18270
2024-06-27 19:56:57 +02:00
Alex Shvartzkop
ece46223c9 Fix shadowed/conflicting enum values. 2024-06-21 16:16:29 +03:00
Seth Hillbrand
5c699e3c1e Handle not found fonts reliably
Check if the font isn't found when selecting (we seem to always have a
selection even if we fail on GTK) and properly set the index of the
final <not found> font name
2024-06-16 17:20:58 -07:00
jean-pierre charras
16e708a0e7 Fix minor compil and Coverity warnings. 2024-06-15 11:20:21 +02:00
Seth Hillbrand
9f4dfe77cb Freeze the adapter to avoid invalid deref
GTK tries to get the parent item of selected elements when unselecting.
If we don't freeze, we run the risk of crashing if a selected item is
removed before being unselected.  This causes a wx warning but a) this
is suppressed in release and b) warning message is better than crash.
See next commit for fix to avoid common case of the error
2024-06-14 16:49:56 -07:00
Alex Shvartzkop
cf7ad330e9 Fix some platform ifdef checks. 2024-06-01 06:49:11 +03:00
Jeff Young
7151f9a131 Formatting. 2024-05-31 10:36:51 +01:00
Alex Shvartzkop
7a0d75a5c4 Improve GRID_CELL_ICON_TEXT_RENDERER rendering on hidpi monitors. 2024-05-30 03:56:30 +03:00
Alex Shvartzkop
41b30e6ac6 Use logical size to center the bitmap in bitmap button. 2024-05-27 11:25:55 +03:00
Alex Shvartzkop
b6aa01a572 Accept bitmap bundles for menu items (but don't use it yet). 2024-05-27 01:02:12 +03:00
Alex Shvartzkop
c401e3d24b Prefer wxFB sizes in bitmap buttons. 2024-05-27 00:12:55 +03:00
Alex Shvartzkop
5e64bd6256 Center bitmaps in bitmap buttons by default. 2024-05-27 00:12:55 +03:00
Alex Shvartzkop
2a5903cd9b More universal way of scaling indicator icon bitmaps. 2024-05-26 22:14:52 +03:00
Jeff Young
30b5adde17 Fix spacing/scaling of indicators on MacOS.
Also pushes indicator scaling improvements to GerbView.
2024-05-26 14:37:05 +01:00
Alex Shvartzkop
b64a30f44b Fix color swatches and color picker dialog on GTK with window scaling. 2024-05-26 13:02:37 +03:00
Alex Shvartzkop
296630d484 Allow using higher resolution bitmaps in bitmap buttons on GTK. 2024-05-26 09:23:43 +03:00
Alex Shvartzkop
1afbcb04db Improve WX_GRID col label height to avoid clipping on hidpi. 2024-05-26 08:05:25 +03:00
Alex Shvartzkop
0b4ff7b859 Improve indicator icons in hidpi monitors. 2024-05-26 01:16:47 +03:00
dsa-t
9a1b3471fd Revert "Improve toolbar bitmap redraw performance on Windows."
This reverts commit 6170151cbc4d68958ee028bf4b0de1cebb6e6125
2024-05-25 20:32:48 +00:00
Alex Shvartzkop
6170151cbc Improve toolbar bitmap redraw performance on Windows.
Especially noticeable on high dpi.
2024-05-25 21:47:51 +03:00
Marek Roszko
808517dd74 Remove no longer needed hack on msw with wx 3.2.5
wxButton::GetDefaultSize was fixed and returns the correct size now
2024-05-25 10:45:27 -04:00
Jeff Young
ecb7cd6b84 Fix color-swatch sizing on MacOS.
Also fixes BITMAP_BUTTON sizing.
2024-05-24 18:27:15 +01:00
Jeff Young
edae328ca6 Push multi-sweep traces down into MathPlot.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17215
2024-05-23 12:24:56 +01:00
Alex Shvartzkop
e817f68f8e Remove unused header. 2024-05-23 08:30:55 +03:00
Alex Shvartzkop
ef148d372d Set current scale factor for generated bitmaps in color swatch.
Therefore, the bitmaps will be drawn as-is.
2024-05-23 08:30:55 +03:00
Alex Shvartzkop
492ce600a4 Improve message panel alignment on hidpi monitors. 2024-05-23 00:40:47 +03:00
Alex Shvartzkop
77b285c8ce Improve BITMAP_BUTTON behaviour when changing DPI. 2024-05-23 00:40:47 +03:00
Alex Shvartzkop
73e0498768 Improve hidpi color swatch sizes in layer selectors on MSW. 2024-05-21 03:46:09 +03:00
Alex Shvartzkop
4e306a7d76 Remove useless method (ResyncBitmapOnly) 2024-05-21 03:46:09 +03:00
Jeff Young
f7bef5e09b Generalize EnhanceAttr() function.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17735
2024-05-16 16:28:13 +01:00
Jeff Young
d9ff3c4485 Maintain selection when sorting.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17983
2024-05-11 16:20:34 +01:00
Jeff Young
a99377c1ec The user can cancel the opening of many editors.
Don't play dice with the devil.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17989
2024-05-08 18:21:42 +01:00
Alex Shvartzkop
dc8822b421 Don't hide symbol/footprint preview widgets on scroll. 2024-05-08 19:40:01 +03:00
Seth Hillbrand
ae610bbe85 ADDED: Reset option for Library tables
This re-shows the option to reset the global library table to its
default, empty or specified state

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2309
2024-05-02 21:31:59 +00:00
Alex Shvartzkop
6fdeca7c56 Fix build on Linux. 2024-04-28 02:06:12 +03:00
Alex Shvartzkop
16e3692e71 Build time optimizations. 2024-04-27 23:49:13 +03:00
Wayne Stambaugh
8a1347d2c8 Property grid navigation improvements.
* Do not handle tab key event when committing property changes so the
  property grid tab navigation works correctly.
* Do not call commit property changes on tab key when no changes are
  pending.
* Skip event handling in the base object value change and changing event
  handlers in case they do not get overloaded in derived objects.
* Do not force focus to canvas on property change so arrow and tab key
  grid navigation work properly.  Forcing the user to click the property
  grid control to edit a single property doesn't make sense.
* Pass properties panel show event up the event stack.
* Do not set focus to canvas in tool dispatcher if it already has the
  focus.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16957
2024-04-24 07:25:19 -04:00
Seth Hillbrand
3435c6ebee Prevent double-entry into footprint load
Avoids double-clicking on the footprint library symbol crashing due to
overwriting the global footprint table by multiple instances

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17040
2024-04-19 17:21:18 -07:00
aris-kimi
66bb49e2da Silence some GCC warnings 2024-04-16 11:11:50 +00:00