Commit Graph

142 Commits

Author SHA1 Message Date
Alex c1ea90abc6 Handle view centering properly when drag-panning and zooming. 2023-01-02 14:20:43 +05:00
Seth Hillbrand 4f6b853756 Don't use modifiers when moving with keyboard
The modifier keys on the keyboard control the motion spacing (Ctrl) and
shouldn't be confused with the modifier key used to disable grid
snapping when moving with the mouse (also Ctrl)

Fixes https://gitlab.com/kicad/code/kicad/issues/13027
2022-11-28 11:05:12 -08:00
Alex c5c5a3fe91 Use a single-shot timer for auto-panning.
Fixes https://gitlab.com/kicad/code/kicad/issues/11425
2022-11-17 05:30:55 +05:00
Mike Williams 6c43ace018 common: fix build (missing return) 2022-10-31 10:29:50 -04:00
dsa-t 01572c0f7d ADDED: Focus follows mouse between SCH and PCB editors (option). 2022-09-30 18:32:06 +00:00
Marek Roszko 89310bc403 "Cleaner" pan fix and add internal setter on state 2022-09-07 07:19:39 -04:00
Marek Roszko 59e9225619 Remove accidental debug code 2022-09-06 23:09:07 -04:00
Marek Roszko 971a8489b3 Hackfix the autopan on Windows
Autopanning is kinda doesn't jive with how events work on Windows
This is a hackfix for testing

Kinda fix https://gitlab.com/kicad/code/kicad/-/issues/11425
2022-09-06 23:07:59 -04:00
Jeff Young 895a8a8dbc Work around focus issues for status popups.
Autoscroll wasn't working on Mac because the status popup's panel
has the focus.  This *may* also fix a problem on MSW of the auto-scroll
not being cancel-able.

Fixes https://gitlab.com/kicad/code/kicad/issues/11425
2022-09-04 21:08:01 +01:00
Seth Hillbrand a118f20464 Hide cursor while warping on Wayland
Based on https://gitlab.freedesktop.org/xorg/xserver/-/issues/734 we
hide the window cursor prior to warping, which allows XWayland to
reposition the cursor.  This is only performed when Wayland is detected;
all other configurations call the standard warp routine

Fixes https://gitlab.com/kicad/code/kicad/issues/9785
2022-06-24 09:56:43 -07:00
Jeff Young 23fb4c7433 Uniformly use a single facility for location-less prime events.
Also implements a uniform mechanism for avoiding auto-scroll after
a prime event or dialog which results in a mouse position at the
edge of the canvas.

Fixes https://gitlab.com/kicad/code/kicad/issues/11057
2022-05-16 23:43:00 +01:00
Seth Hillbrand 110728af48 Prevent focus stealing in some Linux WMs
OnEnter events will only raise the windows within KiCad rather than
between applications

Fixes https://gitlab.com/kicad/code/kicad/issues/10809
2022-05-12 11:06:30 -07:00
dsa-t 68655540eb Clamp cursor to limits of coordinates representation
Also improves large distance handling.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8846
2022-02-11 16:42:52 +00:00
markus-bonk 47603fbc76 Wx_view_controls: Allow two input devices to simultaneously pan & zoom
Instead of the mouse move and zoom algorithms calculating the new
position or scale values relative to a starting value, the new values
are calculated relative to the current values. This allows the user to
use a second input device to move or zoom the view at the same time
without its change being undone by the mouse.
2022-01-28 12:21:42 +00:00
Jon Evans 014bad7b28 Add profile counters for PCB mouse and paint events 2021-12-05 15:16:08 -05:00
Wayne Stambaugh bcd6bddfd4 Start expunging NULL.
Given that KiCad is a C++ project, we should really be using nullptr
instead of NULL.
2021-07-15 15:44:45 -04:00
Jeff Young 8f0104f921 Fix case of CLion getting a little carried away. 2021-07-04 16:23:57 +01:00
Jeff Young c11ee69499 Save 3D prefs after editing, and load some of them into FP Props.
Fixes https://gitlab.com/kicad/code/kicad/issues/8712
2021-07-04 13:20:55 +01:00
luz paz f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
Marek Roszko 69d7a23e1c Start cleaning out wx/wx.h in cpp files 2021-06-07 18:20:47 -04:00
jean-pierre charras 0427bda768 Remove useless wx/wx.h include, that create sometimes compil warnings on msys.
wx/wx.h includes all wxWidgets .h files, and sometimes creates collision
names in #define between kicad and windows headers
Moreover, blindly including a lot of useless files is compil time consuming
2021-05-01 19:32:15 +02:00
jean-pierre charras 1bfa3dc6a5 Fix an annoying issue (wxMSW specific) about X_VIEW_CONTROLS::CaptureCursor()
On MSW, CaptureMouse() was sometimes called event if the GAL panel has
captured the mouse (that was not accepted by wxMSW), although HasCapture()
returns false.
(Perhaps some race condition between events)
The fix add a flag to avoid calling twice CaptureMouse() after only one
wxEVT_MOUSE_CAPTURE_LOST event was received.
Fixes #8239
https://gitlab.com/kicad/code/kicad/issues/8239
2021-04-19 21:23:07 +02:00
Jon Evans cc8413c841 Tweak default zoom settings for Windows
Acceleration seems to be worse than constant on many
systems, so let's turn it off by default.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5434
2021-03-21 19:46:23 -04:00
mitxela 886cad43bd Cancel drag action when focus is lost 2021-01-27 03:33:22 +00:00
mitxela 16c7180ff5 Remove SetGrabMouse and revert some behaviours 2021-01-23 13:35:39 +00:00
mitxela 905fd63c9f Fix autopanning behaviour for left-click-drag 2021-01-23 13:35:39 +00:00
mitxela f7cd21c70d Move windows-specific mouse capture stuff into ifdefs 2021-01-23 13:35:39 +00:00
mitxela bfd7a9e956 Suppress assertions caused by closing the window while mouse is captured
Closing the window while dragging with unsaved changes causes a dialog box, triggering a capture-lost event. Closing the window while dragging without unsaved changes causes an assertion about destroying a window with mouse capture.
2021-01-23 13:35:39 +00:00
mitxela 39be962a69 Restructure mouse capture to avoid recapture asserts 2021-01-23 13:35:39 +00:00
jean-pierre charras fed56572f8 Refinements and fixes in auto-pan.
Add comments.
Fix incorrect comparison.
Fix a too fast auto-pan speed when auto-pan acceleration was not set to the minimal value.
2021-01-19 10:45:41 +01:00
mitxela 744d745ee5 Allow endless panning
Warp the cursor if it leaves the window while panning, to allow endless motion.
2021-01-18 22:07:59 +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
jean-pierre charras d3d26f2892 Update the zoom level as soon as it is modified by the mouse wheel
The zoom level displayed on the bottom of the canvas was not immediately
displayed, only after a mouse move.

Fixes #6542
https://gitlab.com/kicad/code/kicad/issues/6542
2020-11-29 17:46:24 +01:00
Mark Roszko e7bf2b6256 Update comment 2020-11-11 13:45:46 +00:00
Marek Roszko 2a3e6ee1b5 Nix another easily triggered infinite event loop on Windows
This infinite loop was triggered on any dynamic scaling change with KiCad open.
Either local display scale change OR Remote Desktop.
2020-11-10 19:59:29 -05:00
Jeff Young 812b714ccd More Module -> Footprint and a bit of formatting cleanup. 2020-11-10 20:53:12 +00: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
Marek Roszko c372a77d6c Fix focus theft, Windows sends mouse events to windows regardless of focus.
We need to check if the window is foreground before fight over focus which will make the window foreground if it wasn't.

Fixes #4099
Fixes #5958
2020-10-16 23:25:01 -04:00
Seth Hillbrand f493e270ea ADDED: Menu option to enable/disable snap to grid
You can now enable and disable snap to grid when drawing/editing across
all apps.  You can also tie snap to grid to the visibility of the grid
to allow rapid enable/disable via grid display.
2020-09-10 20:09:30 -07:00
Jon Evans 711fc999f2 Coverity fixes 2020-05-25 19:29:41 -04:00
Jon Evans a52435bbb0 ADDED: New mouse settings panel, expanded mouse settings
You can now choose the behavior of dragging with the
middle and right mouse buttons.

You can also choose which modifier keys to use for
panning and zooming with the scroll wheel or trackpad.

You can also customize the zoom speed, which makes
it possible to have a good zoom experience on a wider
range of input devices.

You can also now zoom by dragging with the right or
middle button if desired.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/3885
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4348
2020-05-24 14:38:28 -04:00
Jon Evans 92ce7caf9a Remove extra write to common view control settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/4458
2020-05-15 21:37:17 -04:00
Jon Evans e59a3d981e Implement a new settings framework across all of KiCad
CHANGED: Settings are now stored in versioned sub-directories
ADDED: First-run dialog for migrating settings from a previous version
CHANGED: Settings are now stored as JSON files instead of wxConfig-style INI files
CHANGED: Color settings are now all stored in a separate settings file
CHANGED: The symbol editor and footprint editor now have their own settings files
CHANGED: Color settings are no longer exposed through BOARD object
CHANGED: Page layout editor now uses Eeschema's color scheme

Settings are now managed through a central SETTINGS_MANAGER held by PGM_BASE.
Existing settings will be migrated from the wxConfig format on first run of each application.
Per-application settings are now stored in one class for each application.
2020-02-19 23:44:56 -05:00
Jeff Young c27e278e58 Fix uninitialized variable (from Coverity scan). 2020-01-10 22:32:50 +00:00
Jeff Young 65c88ba2c3 Reduce the auto-panning margin and implement acceleration. 2020-01-10 22:32:49 +00:00
Ian McInerney 13b6028e1b Refactor all math into a new kimath library
* Split up the thirdparty code into the thirdparty folder (#3637)
* Create a new kimath static library containing all the math functions

This is part of cleaning the build system for #1906.
2020-01-07 17:12:59 +00:00
Jeff Young 1f07505b27 Fix long-standing issue with arrow keys moving in both axes. 2019-12-15 14:29:47 +00:00
Ian McInerney a37d8f2859 Remove unneeded wxWidgets version checks in the code
Now that the minimum version is 3.0.0, we don't need to actually
check if the version is greater than 3.0.0 inside the code.
2019-09-18 10:03:53 -04:00
Jeff Young de8f97be6b Don't apply GTK fix to OSX as it causes a hang.
Fixes: lp:1841379
* https://bugs.launchpad.net/kicad/+bug/1841379
2019-08-25 20:48:47 +01:00