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`.
Additionally 2 Arch_Window bugs were fixed:
* If the W1 value was changed the box tracker was not repositioned relative to the cursor.
* The WindowColor was not applied because of a typo in the code. De current default color is quite dark BTW.
Note that all dimensional values that were not really defaults, but just the last entered values, have been removed from preferences-archdefaults.ui. As a result the layout looks a bit strange. That will be improved in a next PR.
In a previous PR of mine I have reorganized some lines of code in DraftGui.py without realizing that this would reposition checkboxes. This PR fixes that.
The function would trigger the creation of duplicate Draft Polar Arrays (only on Linux and only if the Fuse option is selected and the Link Array option deselected).
Forum topic:
https://forum.freecad.org/viewtopic.php?t=84090
The reapply_diffuse_color function is no longer required anyway as Issue #8340 has been fixed.
* Update translations
* [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>
This PR introduces a new get_param function. For its default values it checks a dictionary largely filled by reading the preferences UI files. The goal is to have all defaults in one place to avoid inconsistencies. The dictionary is created once and then stored in a global variable.
Once merged this function will be implemented in Draft and Arch. The get_param function in utils.py will become obsolete.
Related issue: #10176
The command now applies all style properties from `utils.get_default_annotation_style()` and `utils.get_default_shape_style()`.
Additionally: minor improvements to gui_setstyle.py.
* Added handling of DefaultShapeVertexColor, DefaultShapePointSize, DefaultAnnoLineColor and DefaultAnnoLineWidth preferences.
* Rearranged the task panel.
Additionally the DefaultDrawStyle and DefaultDisplayMode preferences are now applied by format_object in gui_utils.py.
* Removed DefaultAnnoDisplayMode. This will become a fine-tuning preference.
* Removed HatchPatternResolution as it was not used.
* Added DefaultAnnoLineColor and DefaultAnnoLineWidth. These will be implemented in other parts of the Draft code in later PRs.
* Removed DefaultAnnoDisplayMode. This will become a fine-tuning preference.
* Removed HatchPatternResolution as it was not used.
* Added DefaultAnnoLineColor and DefaultAnnoLineWidth. These will be implemented in other parts of the Draft code in later PRs.
* Removed DefaultAnnoDisplayMode. This will become a fine-tuning preference.
* Removed HatchPatternResolution as it was not used.
* Added DefaultAnnoLineColor and DefaultAnnoLineWidth. These will be implemented in other parts of the Draft code in later PRs.
* Updated ts files
* merged crowdin translations
* [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>
* DisplayMode controlled by new pref DefaultAnnoDisplayMode. This replaces the old dimstyle pref.
* LineSpacing pref is now used when creating annotations. Will be added to prefs ui later.
* format_object no longer changes FontSize as this conflicted with the height parameter in the make_text function.
* make_text function updated.
This PR replaces the showSnapBar and hideSnapBar preferences with a single new preference: SnapBarShowOnlyDuringCommands.
Additonally:
Improved some param observer callbacks.