Commit Graph

90 Commits

Author SHA1 Message Date
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
Alex Shvartzkop 2f0f5dac94 Fix action toolbar DIP padding on MSW. 2026-01-31 20:15:11 +03: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
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
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
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
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
Jeff Young 6dd4e01f16 ADDED: custom body styles.
(Also moves editing of unit display names to the
Symbol Properties dialog and retires the Set Unit
Display Name dialog.)

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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14843
2025-08-27 18:11:56 +01:00
Jeff Young 60b4202766 CHANGED: Rework lock overrides architecture.
We now use a checkbox in the aux toolbar rather
than a query dialog (with "remember setting" checkbox).
2025-08-13 10:30:26 +01:00
Jeff Young 96c8d995dd Don't reset current tool in group when rebuilding toolbars.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21125
2025-06-17 23:01:24 +01:00
Jeff Young ca1db93013 Iterator safety. 2025-06-16 11:46:18 +01:00
jean-pierre charras 0755ab8ea9 Fix a few Coverity warnings (uninitialized vars) 2025-04-27 18:23:41 +02:00
jean-pierre charras 925f2f9bc1 class TOOLBAR_ITEM_TYPE: replace GROUP by TB_GROUP (collision with a Windows header) 2025-03-02 14:49:03 +01:00
Ian McInerney e202b00a74 Rework the toolbar settings storage and panel
This format is more extendable in the future, should separator and
spacer support be added to groups.

Also, this now has a working UI for modifying the toolbars.
2025-02-28 02:05:50 +00:00
Ian McInerney 85810510f4 Tweak toolbar settings a bit
* Manage the settings using the settings manager for better lifetimes
* Better architect the internals and JSON to make it easier to identify
  the various tool types
2025-02-28 01:57:37 +00:00
Ian McInerney 548334b4e2 Load toolbar configuration from settings 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
Ian McInerney df15db3236 Initial toolbar reconfigurability settings 2025-02-28 01:57:37 +00:00
Ian McInerney c24dbc17bf Move toolbar setup flags into the action definition
This makes them centrally defined, and removes the need to specify them
when creating the toolbar.
2025-02-28 01:57:37 +00:00
Marek Roszko 1ecf1d97ae Start all toolbar bitmapbundles at the selected size 2025-02-06 20:44:39 -05:00
Mark Roszko 50e2a12e17 Fix palette icon scaling on Windows, also extend KiBitmapBundle because we use bundles wrong
wxBitmapBundle assumes the smallest bitmap added is the intended "original" size for a particular use case.
And generally that is probably true. However, we re-use icons in some places where we intend for them to start at 16
or start at 24. This is problematic when GetPreferredBitmapSizeFor is called for calculations because it'll return the
16*scale number instead of 24*scale number. So let's just allow passing in a min height restriction to KiBitmapBundle
for when we reuse bitmaps.
2025-01-31 10:37:00 -05:00
Wayne Stambaugh e09b095533 Common folder housekeeping part 3. 2025-01-16 11:50:08 -05: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 81834a023e Don't duplicate tooltips and descriptions, but do use the description if there's no tooltip.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19155
2024-11-19 23:39:41 +00:00
Mark Roszko f389390c0c Disconnect events in ~ACTION_TOOLBAR 2024-08-16 11:11:20 +00:00
Alex Shvartzkop 85f5b8849e Invalidate control sizes in ACTION_TOOLBAR. 2024-05-23 00:40:47 +03:00
Jeff Young ca3cd706e5 Show friendly name in toolbar button tooltips.
(Don't require the same text to be put into the tooltip.
It's error-prone and also disallows us from having a separate
tooltip for toolbar buttons.)

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

(cherry picked from commit f4a085575a)
2024-02-23 16:53:33 +01:00
Alex Shvartzkop 13f8fd77ac wx 3.3 compatibility. 2024-01-24 19:58:12 +03:00
Jon Evans 96d203477e Fix launcher buttons on macOS 2023-10-23 08:56:02 -04:00
Jon Evans 9d455ca399 Fix rendering of ACTION_TOOLBAR_PALETTE buttons at non-normal sizes 2023-10-22 15:40:17 -04:00
Jon Evans 47e25d617e ADDED: Icon scaling for toolbars only
Unlike the old "icon scale" (that actually scaled all bitmaps)
this one actually changes the toolbar size while making use
of the new bitmap bundle functionality

Add more resolutions for all tool icon bitmaps

Wouldn't want Mark's eyes to bleed
2023-10-22 14:02:06 -04:00
Jon Evans 50fe585827 REMOVED: manual icon scale preference
This is now handled properly by wxWidgets on all platforms

See https://gitlab.com/kicad/code/kicad/-/issues/14119
2023-10-22 14:02:06 -04:00
Jon Evans e2cc678231 Add 2x scale icons
See https://gitlab.com/kicad/code/kicad/-/issues/14119
2023-10-22 14:02:06 -04:00
Jon Evans eb5b3db063 Add bitmap bundle support to BITMAP_SCALE
Change a bunch of buttons and toolbars to use it

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14119
2023-10-22 14:02:06 -04:00
Alex Shvartzkop 06463fd35a Fixes for Wayland cursor warping:
- Emulate the mouse position, since no motion events are sent after warp
- Do not call wl_surface_commit to prevent an assert
- Re-organize code a bit
2023-09-18 12:56:54 +00:00
Seth Hillbrand db8e15ce88 Require wxWidgets 3.2
Removes old defines and work arounds for earlier wx versions and adds a
CMake requirement to use at least 3.2 (or the minimum matching wxPython
version)
2023-08-23 22:02:56 +00:00
Ian McInerney e17cd5abc6 Allow action description to be different from tooltip
The tooltip should be short and easy to read, the description can be
longer and more detailed.
2023-06-30 00:06:03 +01:00
Marek Roszko 1edf84d756 More wxS ugh 2023-01-17 07:43:04 -05:00
Ian McInerney 3a297093e6 Fix lambda capture in ACTION_TOOLBAR 2022-09-25 15:41:39 +01:00
Marek Roszko ccf235a8c3 Suppress wx3.1.6 assert because it wants the window handle for dpi 2022-05-08 19:26:41 -04:00
Jeff Young 7a993c0211 Add support mode for dark mode to SCINTILLA_TRICKS.
Also removes the return value from the BITMAP_STORE's themeChanged
method as it will provide the wrong answer for the second frame it's
called on.

Also hooked up ACTION_TOOLBAR, the app launcher, and the project tree
to the wx event for system color changes so they change on the fly.

Fixes https://gitlab.com/kicad/code/kicad/issues/6026
2021-09-14 00:18:50 +01:00
david-beinder da833ad7dd Separate focus from hover state in BITMAP_BUTTON, trigger after mouse down+up
Fixes https://gitlab.com/kicad/code/kicad/-/issues/8556
Adds AcceptDragInAsClick() to maintain support for use in toolbar palettes
2021-06-13 17:00:41 +00:00
Jeff Young a64ac820db Refresh canvas after running event from toolbar.
Fixes https://gitlab.com/kicad/code/kicad/issues/8592
2021-06-12 22:31:25 +01:00