Commit Graph

97 Commits

Author SHA1 Message Date
marcuspollio
22336540b6 Sketcher UI: Update Task panels icons 2024-05-12 15:57:26 +12:00
Roy-043
ad667811a5 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
94120db2a9 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
64a91968a3 MSVC: fix compiler warnings 2024-02-25 00:12:34 +01:00
Kacper Donat
993248b4db Sketcher: Disable visibility checkbox for external geometry 2024-01-21 20:33:49 +01:00
Kacper Donat
8c2310eaf3 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
f52c0d12f0 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
8777b809cd 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
533250bc34 Sketcher Gui: clang-tidy diagnostic errors 2023-11-05 07:11:57 +01:00
wmayer
948cbfccd9 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
52e1c7c33b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
wmayer
2b3d48176c Mods: modernize C++: redundant void arg 2023-08-05 16:50:31 +02:00
wmayer
7d0926d0b3 Qt6 port:
Fix deprecation warnings with version 6.3 or 6.4
2023-08-04 21:23:14 -06:00
Abdullah Tahiri
78ae9c1d7d SketcherGui: apply clang-format 2023-05-25 17:08:03 +02:00
Abdullah Tahiri
17f65d8746 Sketcher: Make Command Constraints show the severity of warning for typical user mistakes 2023-05-23 14:24:45 +02:00
Chris Hennes
e951756611 Sketcher: Translate context menu 2023-05-17 14:43:57 +02:00
Roy-043
2107270847 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
a7853a088c 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
4e815584c3 ElementWidget: reorganise implementation class declarations 2023-03-18 11:32:22 +01:00
Abdullah Tahiri
adf6d81ebb 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
6c77d5ae44 ElementsWidget: Move ElementFilterList to implementation
========================================================

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

Only moving code from header to implementation.
2023-03-18 07:45:04 +01:00
Abdullah Tahiri
d86686029c Sketcher: TaskSketcherElements - Very Basic Layer Management
============================================================

This class needs quite some rework, as it is mixing model-view model and item model.

Eventually, the whole needs to be moved to a QTreeWidget for layers' implementation.

This commit:
1. Moves back implementation only class item to the cpp file.
2. Adds a contextual submenu to change the selection from one layer to another in the
naive fixed 3 layer implementation.
3. Adds checkboxes to hide geometry.

It is the minimal modification to enable a user work with the 3 layer implementation.
2023-03-02 20:42:48 +01:00
Abdullah Tahiri
dbdd04e05b Sketcher: Elements Widget - Add Visual Layer metadata 2023-03-02 20:42:48 +01:00
wmayer
d25e171ef3 Sketcher: replace slots with member function pointers 2023-02-03 00:21:38 +01:00
wmayer
7a8f48d4e0 Sketcher: move to new style connect() 2023-01-13 20:17:53 +01:00
wmayer
91613cc24c Mod: fix some compiler warnings:
* QString::indexOf() is now marked as [[nodiscard]]
* QApplication::fontMetrics() is deprecated, use the constructor of QFontMetricsF
* fix -Wunused-result
* fix -Wunused-but-set-variable
2022-12-31 21:54:45 +01:00
Uwe
4e55c4b46d [Sketch] Gui:Task*: remove unused headers
- also some sorting
2022-12-14 03:48:40 +01:00
luz paz
f17b73a7bf Cleanup: move return statement to new line + trailing
Follow-up to #6497
2022-12-12 11:38:06 +01:00
wmayer
a21c454387 Sketcher: [skip ci] don't mix QCheckBox::setChecked() with tristate API 2022-11-29 11:03:29 +01:00
Paddle
8284f6bae8 Sketcher: Element widget: - FilterBox and filter state is now registered as preference to be cross-session. 2022-11-24 01:14:43 +01:00
0penBrain
34bfb9bbc2 Sketcher: fix warning about QStringLiteral used without argument 2022-11-21 09:57:54 +01:00
0penBrain
283ee6f1a3 Sketcher: filter list strings are updated at language change (include fix commits) 2022-11-20 15:14:19 +01:00
Paddle
1ab352040a Sketcher: Element widget: Improve filter widget. 2022-11-20 15:14:19 +01:00
wmayer
3335f03f3b Sketcher: fix clazy warnings:
* Wclazy-connect-by-name
* Wclazy-unused-non-trivial-variable
* Wclazy-detaching-temporary
2022-11-13 15:39:27 +01:00
Paddle
cf383d709d Sketcher: Fix element widget repaint delay bug
Related to https://github.com/FreeCAD/FreeCAD/pull/7567#issuecomment-1304724547
2022-11-13 07:13:06 +01:00
Paddle
cd3b7e26c6 Fix issues raised by OpenBrain. 2022-10-29 20:25:34 +02:00
Paddle
3f87aa90b1 ElementWidget: Fix extended naming settings not initializing. Adds 'Collapse filter' option. 2022-10-29 20:25:34 +02:00
Abdullah Tahiri
d8b89b2253 Sketcher: ElementWidget - Rename ElementType to SubElementType - make SubElementType nested to ElementItem 2022-10-29 20:25:34 +02:00
Abdullah Tahiri
098a154ad3 Sketcher: ElementItem - do not select/preselect invalid 2022-10-29 20:25:34 +02:00
Paddle
fef871320b SKETCHER: Element widget rework see https://forum.freecadweb.org/viewtopic.php?f=8&t=72239&sid=b7787fadb4c2a7e9682d28f31ede5eb8 2022-10-29 20:25:34 +02:00
wmayer
840fc70106 Mod: replace QRegExp with QRegularExpression 2022-10-07 14:03:53 +02:00
0penBrain
b02d549c98 Sketcher : optimize code that was present for Qt4 compatibility
Was introduced by a2b53be76, new code only supported by Qt5
2022-10-03 11:12:35 -07:00
berniev
71dc5ead2f Mod: Use override etc 2 2022-08-09 12:52:26 +02:00
wmayer
50ef527ded Sketcher: [skip ci] Fix several clazy issues:
* Missing reference in range-for with non trivial type [-Wclazy-range-loop-reference]
* Unused QString [-Wclazy-unused-non-trivial-variable]
* Missing emit keyword on signal call [-Wclazy-incorrect-emit]
* Don't call QList::operator[]() on temporary [-Wclazy-detaching-temporary]
* Use multi-arg instead [-Wclazy-qstring-arg]
* Maybe you meant to call ViewProvider2DObjectGrid::onChanged() instead [-Wclazy-skipped-base-method]
2022-07-25 12:56:09 +02:00
Uwe
763a575b23 Mod: remove some unnecessary nullptr checks 2022-07-18 12:58:12 +02:00
Abdullah Tahiri
276020c313 Sketcher: Bug fix
https://forum.freecadweb.org/viewtopic.php?p=606581&sid=70cfe557d7d1985e45ea1b298282c759#p606581
2022-07-01 13:56:16 +02:00
mosfet80
c48a569696 Boost version <=1.60 is never used in freecad 0.20 (#7038)
* Boost version 1.60 is never used in freecad 0.20
2022-06-24 02:20:26 +02:00
Uwe
61be686687 [Sketch] remove unnecessary Boolean comparisons 2022-06-19 18:35:52 +02:00
Zheng, Lei
8bec44934b Fix mixed line endings 2022-04-26 12:52:55 -05:00