Commit Graph

673 Commits

Author SHA1 Message Date
Marek Roszko fee3c41c40 Force string to utf8 before trying to pass it to url encoding
Fix #7878
2021-03-16 23:04:52 -04:00
Jon Evans 44f88f840c Bitmaps: a few improvements from review 2021-03-11 08:37:35 -05:00
Jon Evans 405fa183b2 Add icon theme selection behind advanced config flag 2021-03-11 08:37:35 -05:00
Jon Evans 18037e2f65 Rework bitmap system to load from archived PNGs
Bitmaps are now identified by an enum class instead of by pointers.
Bitmap loading and caching is now handled by a class in common, and
we no longer compile most bitmaps into the binary, so there is no
longer a bitmaps static library.

Instead, bitmaps are archived to a .tar.gz file which is installed
in ${KICAD_DATA}/resources/images.tar.gz

The source PNGs are checked in to Git as the original CPP files were,
so that people can build without the required dependencies to convert
SVGs to PNGs.

Initial support is also added for dark theme icons, although this
is not yet exposed in the GUI.

Stubs are present for multi-resolution image resources, but this is
not fully-baked yet and could use some refinement.
2021-03-11 08:37:35 -05:00
Dominik Wernberger e2aa7be4b3 Added a lot of consts and refactored a few lines 2021-03-08 12:49:48 -08:00
Jon Evans 720147d272 Remove transitive inclusion of bitmaps.h 2021-03-07 16:08:57 -05:00
Jon Evans 924accfdc8 Consolidate wxAui art providers 2021-03-01 23:10:03 -05:00
Jon Evans 17bcbdbf56 Disable AuiBar fix until dark icon support is ready 2021-03-01 21:59:19 -05:00
Jon Evans 93578517e4 Support dark mode in AuiBar buttons for wx 3.0 2021-03-01 21:24:29 -05:00
PJM 7ec46bc346 Pcbnew: Footprint warps to mouse if drag invoked from RMB menu
CHANGED: If the user selected a footprint and then invoked drag from the
RMB menu, the footprint would warp to the mouse center (if set in
preferences) instead of the mouse warping to the footprint center.

There was a call to 'WarpCursor' that was coming after the menu had been
closed and the mouse had already warped to the footprint center.  This made
the footprint jump instead to the old mouse position.

This MR removes the call to 'WarpMouse' and prevents the footprint
from warping to the mouse.

Fixes https://gitlab.com/kicad/code/kicad/issues/7680
2021-02-24 22:19:44 +00:00
Seth Hillbrand 0bab025832 Fixup toolchaining for immediate mode
The move tool can stack on others, so when we re-enter the previous tool
this caused another immediate action.  We flag re-entry in the tool
stack to check for this and avoid unexpected tool starts
2021-02-24 10:44:54 -08:00
Jeff Young 2d28ed8eda Move canvas backend selection to Preferences.
Fixes https://gitlab.com/kicad/code/kicad/issues/7630
2021-02-21 20:12:43 +00:00
Mikolaj Wielgus f9c42585fb Force immediate action for auto start wire feature
Fixes https://gitlab.com/kicad/code/kicad/issues/7503
2021-02-21 18:43:34 +00:00
Tokita, Hiroshi 9da55d961a Make the descriptions of pin/unpin library translatable 2021-02-19 20:24:49 +00:00
Seth Hillbrand 2566547377 Make mac-default delete happy
On mac, the backspace key is commonly used from removing items.  The
forward delete key doesn't really exist (it is hidden behind
fn-backspace), so this modifies our common use of delete.  The
context-dependent usage in router and polygon creation are unaffected as
CONTEXT overrides GLOBAL when processing
2021-02-15 15:04:44 -08:00
Mikolaj Wielgus 1dc0ef01b3 Fix automatic wire tool in gridless mode
The automatic wire tool was not working in the gridless mode because the
grid snapping on/off logic present in `EE_GRID_HELPER`, based on the
value of `m_enableGrid`, was not taking into account that another check,
but for the global KiCad setting, would be performed in the `Align()`
method, which is inherited from `GRID_HELPER`.

I've modified all tests of `m_enableGrid` value to also take the global
setting into account, and moved checks for it to `Align()` method, as
it's more consistent this way.

I've also removed an override of the `Align()` method in the
`PCB_GRID_HELPER` class, as it was made redundant by my changes.

Fixes https://gitlab.com/kicad/code/kicad/issues/7402
2021-02-10 22:07:49 +00:00
Jeff Young a30ae6a237 Pass un-pretty-printed bus names through menu help text.
Fixes https://gitlab.com/kicad/code/kicad/issues/7412
2021-02-10 15:03:06 +00:00
Wayne Stambaugh 5ecef204cd Coding policy fixes.
Using "this->" violates coding policy section 2.7.
2021-02-09 11:35:43 -05:00
Michael Kavanagh 404d18763d Icons: try a new version of the 'new' badge
and use it more consistently.
2021-02-06 22:51:56 +00:00
Jeff Young ac479a1c75 Fix regression in immediate actions.
Add some more comments to attempt to document our egregious series
of hacks over this.

Fixes https://gitlab.com/kicad/code/kicad/issues/7432
2021-02-05 16:18:28 +00:00
Seth Hillbrand 238aa2b5b0 Snap to eeschema lines
Allows easier snapping to lines when drawing in eeschema.

Fixes https://gitlab.com/kicad/code/kicad/issues/7378
2021-02-02 19:33:18 -08:00
Roberto Fernandez Bautista 9aedeae5c3 Don't log error messages when using the clipboard
wxClipboard::GetData()and wxClipboard::SetData() both log a "wxLogSysError" error-level message (see for example:  https://github.com/wxWidgets/wxWidgets/blob/v3.1.4/src/msw/clipbrd.cpp#L703 ). This logged message gets displayed as a messagebox to the user.

The logging can be disabled temporarily by creating a wxLogNull object. See https://docs.wxwidgets.org/3.0/classwx_log_null.html

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6956
2021-02-03 01:55:05 +00:00
Jeff Young 7688fdc94f Hack to prevent multiple simulation commands from stacking up.
Can happen if someone hammers away on the probe and/or tune tools
without ever mousing over the schematic in between.

*May* fix the below bug.

Fixes https://gitlab.com/kicad/code/kicad/issues/6876
2021-02-02 01:23:22 +00:00
Jon Evans eba98aa9f6 Change default Ctrl+H hotkey to 3-state layer view mode 2021-02-01 17:37:17 -05:00
Jon Evans abf0a46dce Refactor PICKER_TOOL and push up snapping disable functionality
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7348
2021-01-31 09:50:41 -05:00
Seth Hillbrand af3789571e Refresh screen after canvas switch
Fixes https://gitlab.com/kicad/code/kicad/issues/7335
2021-01-29 15:33:32 -08:00
Jeff Young 7d6a749285 Implement a more aggressive re-entrancy check for SCH drawing tools.
Fixes https://gitlab.com/kicad/code/kicad/issues/7259
2021-01-27 19:51:11 +00:00
Jeff Young b576ccef61 Don't double-up tools on tool stack.
Also make sure move tool gets cancelled by other tools being
activated.

Fixes https://gitlab.com/kicad/code/kicad/issues/7259
2021-01-26 10:56:19 +00:00
Wayne Stambaugh 6ab1144ea3 Fix broken Doxygen comment specifiers.
Please note, ///> is not a valid Doxygen comment specifier.  ///< is the
correct specifier to use for single line or short Doxygen comments.
2021-01-25 07:42:36 -05:00
Michael Kavanagh 1750faac4b Icons: make copy/paste a bit more standard
+ Paste special shouldn't share an icon with paste
2021-01-19 22:57:25 +00:00
Jeff Young 68efdb2fff Push shared parts of GRID_HELPERs into common. 2021-01-16 23:18:10 +00:00
Dominik Wernberger ac94d72d2d Add more const specifiers 2021-01-12 20:51:31 +00:00
Michael Kavanagh a00b9cc821 Icons: general tweaks and pixel alignment
+ minor rename
+ fix missing bitmap in DRC panel
2021-01-11 23:31:25 +00:00
Michael Kavanagh 32f7f30958 Icons: remove where they don't make sense
Also avoid icon reuse
2021-01-11 23:31:25 +00:00
Jeff Young 50889a9ed6 Promote mouse drag settings to full enums. 2021-01-11 22:09:36 +00:00
Jeff Young 6c648df4c6 Support 3 drag vs. select options, and unifiy with other drag prefs.
Fixes https://gitlab.com/kicad/code/kicad/issues/5493
2021-01-11 11:50:14 +00:00
Michael Kavanagh 5d9b2d3fea Icons: new filter icon
+ remove icons where they don't make sense.
2021-01-06 00:35:20 +00:00
Michael Kavanagh 154e19b6e7 Icons: use common prefix for small 16x16 2021-01-02 23:16:33 +00:00
Jeff Young 7a081b7c04 Naming consistency. 2020-12-25 16:59:41 +00:00
Seth Hillbrand 6641168cbc Update KiCad website links 2020-12-22 17:38:56 -08:00
Jeff Young 0ba43ca231 Use library icon for footprint browsing for more visual distinction. 2020-12-21 17:37:53 +00:00
Jeff Young c1a74b427a Translucent magnifying glass on footprint & library browser icons.
Also renamed.
2020-12-14 22:15:43 +00:00
Seth Hillbrand 500db27802 Icons: The return of the ladybug
Completely new ladybug icon for the Report Bug menu item.
2020-12-14 10:32:45 -08:00
Michael Kavanagh cc43b66daf Icons: use correct size for open action in toolbar
Previously 16x16 was used
2020-12-13 16:10:26 +00:00
Michael Kavanagh dce4d04113 Add 24x24 size refresh icon
Previously 16x16 was being used alongside 24x24
2020-12-12 18:51:55 +00:00
Michael Kavanagh cf6f0b9b92 Use trash icon where appropriate 2020-12-11 17:05:11 -08:00
Seth Hillbrand 17d0ad53b4 Update Show DCode icon 2020-12-08 15:14:24 -08:00
Ian McInerney 27fa3a422a Restore trace strings in the tool stack
This is a partial revert of d43eefbad5.
2020-12-07 22:03:43 +00:00
Jeff Young d43eefbad5 Formatting. 2020-12-05 19:44:01 +00:00
jean-pierre charras 64f555079a Code cleanup related to zoom:
- remove outdated code or comment coming from old drawing code using wxDC
- move zoom values lists to zoom_defines.h
- fix incorrect zoom max and min values (gal scaling factor limits).
2020-12-02 18:35:28 +01:00
jean-pierre charras 71ab42e60a Minor fixes and cleanup related to zoom definitions.
Mainly move 2 define relative to Zoom from convert_to_biu.h to zoom_defines.h.
Will make some changes/fixes in zoom code more easy.
2020-12-02 10:14:35 +01:00
Jeff Young df262eaa06 Make prev/next marker work reliably on all platforms.
Requires us to move from arrow-keys to our own commands (the only
way that the OSX wxWidgets impl doesn't eat the keys when the dataVIew
has focus).

While there we might as well add a command to exlucde markers.

ADDED Prev Marker, Next Marker, Exclude Marker

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

Fixes https://gitlab.com/kicad/code/kicad/issues/5501
2020-12-01 22:37:07 +00:00
jean-pierre charras 64636601b8 Eeschema: fix a Unicode/UTF8 management when pasting items from Clipboard.
Copy to clipboard save items (using S expr description) using wide strings
(not UTF8 encoding).
But Paste from clipboard was not converting the wide string to UTF8 string
when getting the stored data to send it as std::string to the S expr reader.

Fixes #6449
https://gitlab.com/kicad/code/kicad/issues/6449
2020-11-21 10:59:25 +01:00
Jeff Young 9e9946628a Go back to arrow cursor on a cancel (or finish).
Fixes https://gitlab.com/kicad/code/kicad/issues/6421
2020-11-19 20:09:28 +00:00
Marek Roszko 16e3e59495 Split out arrayDim and MIRROR templates from macros.h
These were not macros
2020-11-17 20:21:04 -05:00
Ian McInerney 05595da235 Cosmetic fixes to the toolbar palettes
* Align the top of the buttons in the palette with the toolbar button
* Don't check the button in the palette, since the toolbar button will
  show as checked.
2020-11-11 00:41:02 +00:00
Marek Roszko 05b5d2de00 Cleanup/downscope variable 2020-11-06 00:38:53 -05:00
Marek Roszko 9ed1ad06f7 The canvas should get the focus on clicks not the window
Fix #6308
2020-11-06 00:37:05 -05:00
Marek Roszko 08ca80a2d8 Smooth out redrawing of toolbars by not letting wx pointlessly calculate both orientations
Monkey patch

Fix #5705
2020-11-05 20:56:14 -05:00
Marek Roszko 262bb06d91 Avoid stealing focus from text controls when hovering over canvas
Fix #4879
Fix #4888
2020-11-04 22:22:45 -05:00
Jeff Young 1899209e9b Support unicode text on the clipboard.
Fixes https://gitlab.com/kicad/code/kicad/issues/6294

Fixes https://gitlab.com/kicad/code/kicad/issues/1802
2020-11-04 23:14:44 +00:00
Marek Roszko 8eaf9915c1 Check if the window is foreground before causing a focus war
Fix #6250
2020-11-04 07:51:36 -05:00
Ian McInerney 831d020544 Cleanup parent usage in the ACTION_TOOLBAR
When we look for icon scaling, we should be using the wxWidgets
parent as the scaling window not the tool manager's frame (even though
they are probably the same). (this also removes several dynamic_casts).
2020-11-04 01:42:18 +00:00
Ian McInerney 3d47eb0d49 Fix localization of the menu strings with accelerator strings
The accelerator strings really shouldn't be part of the translation,
and some translations have cause the accelerator keys to be incorrectly
handled. It is simpler to make it separate and just join them to the
translated string.

Make all accelerator modifiers use lowercased Ctrl instead of CTRL
to be the same as the other modifiers.

Fixes https://gitlab.com/kicad/code/kicad/issues/5992
2020-11-04 01:31:52 +00:00
Mark Roszko 98ece9df72 Remove infinitely recursive loop on Windows (in special cases)
This looks like it was always intended for macOS but was accidentally changed for Windows as well.
If this is a requirement on windows, I'm sure theres better ways to fix it....
2020-10-31 13:44:50 +00:00
Jeff Young bddc97df30 LibEdit -> SymbolEditor 2020-10-31 10:28:21 +00:00
Jeff Young 5a644aa3fb QuasiModal needs to be used for any dialog hosting a help window.
Fixes https://gitlab.com/kicad/code/kicad/issues/5897
2020-10-28 23:07:15 +00:00
Jeff Young 89f8078381 Bi-directional tooltips for Update PCB from Schematic and viceversa.
Fixes https://gitlab.com/kicad/code/kicad/issues/6186
2020-10-27 22:54:22 +00:00
Werni a7d5d1f091 Add more consts all over the place 2020-10-27 11:03:35 +00:00
Marek Roszko 91e5611341 Move dialog_configure_paths.h and dialog_edit_library_tables.h to dialogs folder 2020-10-25 20:01:12 -04:00
Jon Evans 09ade9fe51 Inhibit point editor while drag-selecting
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6155
2020-10-25 12:13:25 -04:00
jean-pierre charras 34179cd039 Add missing icon in menu, and fix them in other menus 2020-10-25 14:51:08 +01:00
Marek Roszko e928b2d8fd Split EDA_UNITS out from common. 2020-10-25 00:02:52 -04:00
Marek Roszko 81a7afc76e Use kicad_algo directly rather than common.h 2020-10-24 08:53:11 -04:00
Jon Evans 35c7ba0a8a Fix hover/highlight of line edit points
Fixes https://gitlab.com/kicad/code/kicad/-/issues/6104
2020-10-21 20:37:15 -04:00
Marek Roszko f1e2bdc2d0 Prevent zoom to fit from going to crazy zooms on blank canvas
Fix #6062
2020-10-19 18:51:32 -04:00
Marek Roszko f38676fc46 Move the timer fix to the dispatcher to just always run 2020-10-15 00:38:32 -04:00
Jon Evans 858718b949 CHANGED: High-contrast mode is now called single layer view mode
This makes it more obvious what the tool is for, and also clarifies
the difference between the 2-state and 3-state actions in the
hotkey dialog
2020-10-14 20:16:49 -04:00
Marek Roszko f59551d6ad Remove painter.h from eda_text.h 2020-10-14 19:18:38 -04:00
Marek Roszko 511bdb64e1 Fix the delete tool not immediately setting cursor
Fix #5939
2020-10-09 18:51:10 -04:00
Marek Roszko 8fa42a74bd Add zoom cursors 2020-10-08 20:52:58 -04:00
Mark Roszko d9485129c8 Implement more context specific cursors using both stock and custom cursors. 2020-10-08 00:50:28 +00:00
Jeff Young ee95d8fe2e Improve SNR in status bar (and use common code). 2020-10-06 12:08:31 +01:00
Ian McInerney 43c14face0 Switch to showing metric/imperial units in comboboxes and menus
This will always show 1 unit from each system, with the primary unit
being the current frame unit and the secondary unit being the
most recent unit used from the other system. These are saved in
the settings, so they are saved between runs.
2020-10-05 20:26:33 +01:00
Ian McInerney 3a570c27f0 Update unit handling in the preview ruler
* Make the ruler able to switch to mils after creation
* Cleanup an unused flag in Pcbnew dimensions
* Move unit changed notification into EDA_DRAW_FRAME so more
  frames to use it.
* Allow switching units when GerbView ruler tool is active
2020-10-04 17:53:55 +01:00
Ian McInerney b1bd1f2a97 Introduce new action to switch to mils as a unit 2020-10-04 17:53:55 +01:00
Seth Hillbrand 8e515d0069 Standardize default hotkey refresh 2020-10-04 05:48:26 -07:00
Mikolaj Wielgus 400c15b8eb Add mils to units, remove useMils variables 2020-10-03 20:06:56 +00:00
Ian McInerney b69d396afc Turn the toolbar context menus into unique_ptr for easier management 2020-10-03 19:09:18 +01:00
Jon Evans 3b252c696d Make tool init order dependent on registration order
Previously, init order depended on the ordering of the
tool state map, which is opaque from the point of view of
registration.  This makes it challenging to make one tool's
init depend on another.  With this change, registration
order defines init order.
2020-10-02 18:42:41 -04:00
Seth Hillbrand 394b3b3a36 Use standard refresh icon in toolbar
Fixes https://gitlab.com/kicad/code/kicad/issues/5852
2020-10-02 12:01:33 -07:00
jean-pierre charras 8285110c2a more cleanup about removing useless include 2020-10-02 08:58:19 +02:00
Ian McInerney 8e7e1ffaaa Fix the mouse handling in the toolbar palettes
There were issues on OSX where the mouse being captured
by the parent toolbar would lead to seg faults, so release
the mouse on opening the palette.

Releasing the mouse then means that the mouse states become
confused, so we need to manually clear all the mouse states
when we open the popup.

Fixes https://gitlab.com/kicad/code/kicad/issues/5803
2020-09-28 00:42:47 +01:00
Ian McInerney 4ec46dabf8 Make the toolbar palettes open at a right angle to the toolbar
This opening is easier when using the drag-to-open system.
2020-09-27 23:20:17 +01:00
Ian McInerney 6dfe7b6eb0 Switch toolbar palettes to use AUI drag event
This isn't as much a hack as trying to detect it ourselves and
hope we don't clobber the internal toolbar workings.
2020-09-27 23:20:17 +01:00
Ian McInerney d5f781c7ca Allow dragging on the toolbar item to open a group 2020-09-27 02:22:22 +01:00
Ian McInerney df3018832b Fix toolbar palette location
This better aligns the first button in the palette with the
group button on the toolbar.
2020-09-27 01:58:41 +01:00
Ian McInerney fc565edb33 Add a palette to the toolbars to display groups of actions
This adds a palette to toolbar items that displays groups
of actions when long-pressed on a button.
2020-09-27 01:00:44 +01:00
Jeff Young f8875bc5a6 Move std::contains to alg::contains. 2020-09-26 14:42:40 +01:00
Jeff Young d7e80f8008 Add std::contains() to simplify a lot of code. 2020-09-26 12:40:32 +01:00