Commit Graph

125 Commits

Author SHA1 Message Date
PaddleStroke
98d64f9939 Sketcher: Element Task : clear selection when list selection is cleared 2025-10-09 14:06:10 -05:00
PaddleStroke
ca8bfc6180 Sketcher: Make ctrlA work with filter (#24541) 2025-10-09 12:37:54 -05:00
Markus Reitböck
ef670e7880 Sketcher: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
 should be considered an optimization, not a requirement. In particular, do not explicitly include a
 precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
 generated precompile header on the compiler command line instead. This is more portable across
 the major compilers and is likely to be easier to maintain. It will also avoid warnings being
 generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-23 00:51:00 +02:00
Roy-043
bac49e4659 Sketcher: context menu of Elements section in task panel to Title Case 2025-09-16 22:38:23 +02:00
Roy-043
9c4bafc28f Sketcher: Add 'Toggle' to 'Construction Geometry' menu texts (#23944)
* Sketcher: Add 'Toggle' to 'Construction Geometry' menu texts

* Sketcher: Add 'Toggle' to 'Construction Geometry' menu texts

* Update TaskSketcherElements.cpp

* Update CommandAlterGeometry.cpp
2025-09-15 19:38:13 +02:00
PaddleStroke
061e185e7f Sketcher: Fix ctrl A (#23866) 2025-09-12 15:40:24 -05:00
Max Wilfinger
cf082f7642 Sketcher: Update UI strings for consistency (#22167)
* Sketcher: Update UI strings for consistency

* Update src/Mod/Sketcher/App/Sketch.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/Gui/Command.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/App/SketchObject.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/Gui/Command.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/Gui/Command.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/Gui/Command.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review

---------

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 22:51:46 +00:00
Syres916
6eecd08f7c [Gui] C++ preparation for deprecation of QCheckBox…
…stateChanged -> checkStateChanged
2025-06-13 10:40:48 +02:00
Ajinkya Dahale
1cfb85a71f Sketcher: Incorporate comments from #20589
See https://github.com/FreeCAD/FreeCAD/pull/20589#pullrequestreview-2830404892.
2025-05-19 20:24:17 +02:00
Ajinkya Dahale
8fd9c19013 [Sketcher] Refactor TaskSketcherElements::onSelectionChanged() 2025-05-19 20:24:17 +02:00
tetektoza
e9f2e8fe92 Sketcher: Auto-scroll to selected geometry elements (#20866)
* Sketcher: Auto-scroll to selected geometry elements

Currently if user selects a geometry element on sketch, listview is not
scrolling to it.

So, this patch moves the previously added logic to constraints into a
separate helper function call and calls it for Geometry Elements as
well, resulting in scrolling in both lists - constraints and elements.

* Sketcher: Add QListWidget to enable QListWidget symbols for CI
2025-04-19 15:10:13 +02:00
Kacper Donat
db08735e10 Merge pull request #20559 from hyarion/refactor/add-limits
Add `#include <limits>` in all files where it is used
2025-04-01 17:11:50 +02:00
Benjamin Nauck
4b589088f6 Sketcher: Add #include <limits> where used 2025-03-31 23:52:38 +02:00
Rafael Pronto
1d4a09366c Sketcher: Prevent renaming interruption when hovering task elements. (#20458)
* Sketcher: Prevent renaming interruption when hovering task elements.

Fixes #11842.

* Sketcher: Refactored input focus check based on PR feedback (PR #20458)

* Update src/Mod/Sketcher/Gui/TaskSketcherElements.cpp

---------

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2025-03-31 17:45:33 +00:00
Benjamin Nauck
b4eb28e50e Sketcher: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:39 +01:00
Benjamin Nauck
65c6614081 Sketcher: Use constant for Type::BadType instead Type::badType() 2025-02-24 08:30:18 +01:00
Benjamin Bræstrup Sayoc
c0c6df10ec Sketcher: Use QStringLiteral 2025-02-10 18:32:45 +01:00
tritao
65466d580b Gui: Reorganize the selection files into a top Selection folder. 2025-02-03 17:56:57 +01:00
Kacper Donat
651cefde4d Gui: Use getObject<T>() helpers in classes
This commit is generated using regex based find and replace:

```
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*getObject\(\s*\)\)/getObject<$1>/
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*([^)]*)\s*->\s*getObject\(\s*\)\)/$2->getObject<$1>()/
```

To regenerate if needed.
2024-12-06 18:29:39 +01:00
CalligaroV
c3bad9da25 Do the same for the elements selected in the Task Panel
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-09-15 19:54:09 +02:00
Zheng, Lei
38c6d842f2 Sketcher/Toponaming: import code for SketchObject::checkSubName() from LS3
* import code
 * add modified_item assignment in TaskSketcherElements::onSelectionChanged() like for non ExternalEdge
2024-09-07 14:08:23 +02:00
Kacper Donat
b46ba096b2 Gui: Make sketcher element icons normally opaque 2024-09-03 20:53:47 +02:00
Max Wilfinger
7d21d9edb8 Fix source string typos mentioned on Crowdin (#15261) 2024-07-08 17:18:31 -05:00
Chris Hennes
4eb57fb50d Sketcher: Resolve unsafe combination of bool and int in | 2024-07-08 11:02:49 -05:00
CalligaroV
4a486b21ed Sketcher: fix external edges selection
* fix selection from Sketcher Task Panel
 * fix selection from 3D View
 * Synchronize selection between Task Panel and 3D View

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-06-24 10:35:54 -05:00
Emmanuel Obrien
a7e1760bfb Speedup sketcher item selection
Selecting lots of elements in the sketcher slows down quadratically because we were redrawing the entire element list widget for each element.
2024-06-10 10:35:32 -05:00
marcuspollio
0526257be5 Merge remote-tracking branch 'upstream/main' into UI-TaskPanels-cleanup-1 2024-05-15 13:45:43 +12:00
Johannes Wüller
0e24e121eb Fix backwards-compatible Qt6 warnings 2024-05-13 11:39:24 -05:00
marcuspollio
23537d97d7 Sketcher UI: Update Task panels icons 2024-05-12 15:57:26 +12:00
Roy-043
18f6abb3c0 Sketcher: correct position of ConstrainLock and ConstrainRadiam in GUI
Sketcher_ConstrainLock after Sketcher_ConstrainAngle.
Sketcher_ConstrainRadiam before Sketcher_ConstrainRadius.

This was not always correct.

See also #12667.
2024-03-11 12:28:28 -05:00
Roy-043
8145eed95f Sketcher: Sketcher_ConstrainHorizontal before Sketcher_ConstrainVertical in GUI
Changes to TaskSketcherElements.cpp are not required, but were done for consistency. The order in the file follows the GUI.
2024-03-04 11:12:38 -06:00
wmayer
53b512da1c MSVC: fix compiler warnings 2024-02-25 00:12:34 +01:00
Kacper Donat
34b6b36547 Sketcher: Disable visibility checkbox for external geometry 2024-01-21 20:33:49 +01:00
Kacper Donat
2fac012226 Sketcher: Fix checkbox behavior for Element checkboxes
This creates new method overload for changing layer of exact
ElementItem. This fixes strange behavior of the checkboxes for elements
that were dependent not on what user clicked but on what is selected.

Fixes: #8814
2024-01-21 20:33:37 +01:00
Kacper Donat
da6a4fe57b Sketcher: Make Elements UI style aware
This commit like previous one introduces ability to style list of
elements in the sketcher. It also completely refactors the rendering
delegate introducing dedicated method for calculating rects of each
element and method for rendering each sub control. Thanks to this
refactor we can be sure that areas drawn are the same as areas checked
for events in editorEvent.
2024-01-21 20:33:34 +01:00
Kacper Donat
122f163d0c Sketcher: Draw proper checkbox control in Elements UI
This ensures that checkboxes drawn in the Elements UI of the sketcher
can be styled using the correct style.

Three changes are introduced:
1. paint() method uses style provided by the widget, not application.
2. Indicator is drawn using PE_IndicatorCheckBox not CE_CheckBox - it
   allows to use ::indicator in qss to style it properly. This works the
   same as TreeView.
3. Fix for minor issues with text alignement and extension of selected items
   background to cover checkbox. This is how other controls of this kind
   work.
2024-01-20 21:59:01 +01:00
Abdullah Tahiri
882262bfa8 Sketcher Gui: clang-tidy diagnostic errors 2023-11-05 07:11:57 +01:00
wmayer
d150fa7164 modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
2023-08-08 21:10:16 +02:00
wmayer
68d22d864b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
wmayer
39e53e5eb0 Mods: modernize C++: redundant void arg 2023-08-05 16:50:31 +02:00
wmayer
5621a0089f Qt6 port:
Fix deprecation warnings with version 6.3 or 6.4
2023-08-04 21:23:14 -06:00
Abdullah Tahiri
ec899d75c6 SketcherGui: apply clang-format 2023-05-25 17:08:03 +02:00
Abdullah Tahiri
2338ae633e Sketcher: Make Command Constraints show the severity of warning for typical user mistakes 2023-05-23 14:24:45 +02:00
Chris Hennes
ff989512e5 Sketcher: Translate context menu 2023-05-17 14:43:57 +02:00
Roy-043
13cf9a9fdb Sketcher: improve context menu text for Sketcher_ToggleConstruction
In the Elements context menu (Sketcher task panel) the menu text for Sketcher_ToggleConstruction is "Toggle construction line", this should be "Toggle construction geometry". It is not just lines that can be toggled, and this is also the menu text in the main Sketcher menu.
2023-05-07 19:52:12 +02:00
Abdullah Tahiri
64eb85b1ea ElementWidget: remove unnecesary element pointer
================================================

This should fix this (I cannot reproduce it):
https://forum.freecad.org/viewtopic.php?p=667579#p667579

Lately I added the geometry pointer to the item. This has indeed
the potential for an already deleted pointer being accessed.

This PR removes the geometry pointer from the item and relies on the
ViewProvider to indirectly access an updated pointer.
2023-03-18 11:32:22 +01:00
Abdullah Tahiri
522679321c ElementWidget: reorganise implementation class declarations 2023-03-18 11:32:22 +01:00
Abdullah Tahiri
3f19bcbeef Sketcher: Elements Widget - Fix crash when moving external geometry to another layer
====================================================================================

As reported:
https://forum.freecad.org/viewtopic.php?p=667426#p667426

Support for moving external geometry to another layer will come in the future.
2023-03-18 07:45:04 +01:00
Abdullah Tahiri
5242f6d048 ElementsWidget: Move ElementFilterList to implementation
========================================================

Only moving code from header to implementation.
2023-03-18 07:45:04 +01:00
Abdullah Tahiri
7cc3fe480c ElementsWidget: Move Delegate to implementation
===============================================

Only moving code from header to implementation.
2023-03-18 07:45:04 +01:00