* Tweak resetElementMap tp default to empty defined element map
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
The current make_layer function has a `None` default for the shape color and the line color. With that value the current preference is used. This, and how the function is called, results in some confusing behaviors:
* Newly created layers will only use 2 values from the preferences when they might use 5. The latter makes more sense for the end-user IMO.
* Layers created during DXF import (for example) will have a different shape color depending on the current preferences.
* The make_layer function may reapply colors that have already been set by the view provider.
To solve this all view property related function parameter have been changed to a not None value. If a None value is supplied the view property as set by the view provider is not changed. The Layer Manager has been updated accordingly.
I realize that calling a function with 6 None values is not very convenient, but think it is the solution that is least likely to break other exiting code.
Additionally:
* Removed the makeLayer function. Layers were introduced in V0.19 when the naming scheme was changed to "make_*". Maybe it was created by mistake, or before the actual renaming operation started, but it is safe to remove it now.
* Removed overly verbose messages.
* gui_layers.py had a missing import (result of a previous V0.22 PR): `from draftutils import utils`.
* Preferences: modernize for loop in DlgSettingsEditor.cpp
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
* Preferences: modernize for loop in DlgSettingsEditor.cpp
added textType and textColor variables to unpack range-for loops iterators
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
* Update src/Gui/PreferencePages/DlgSettingsEditor.cpp
Minor linter updates, as suggested
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
* Update src/Gui/PreferencePages/DlgSettingsEditor.cpp
Minor linter updates, as suggested
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
---------
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
In order to make getNameInDocument() always return a valid string,
we implement a getDagKey() method that shall be used instead of getNameInDocument()
when we want to use the pointer value as a "key" to identify the DocumentObject.
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
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.