Commit Graph

3357 Commits

Author SHA1 Message Date
Roy-043
bd3e78691e Draft: Scale widget did not handle FEM unit system
The FEM UserSchema (8) was not handled by the code.
2024-01-26 13:09:07 +01:00
Roy-043
520b8babda Draft: Draft_Scale: make sure scale inputboxes show at least 6 decimals
Fixes #7386.
2024-01-23 18:07:03 +01:00
Roy-043
a14e0cbbbb Draft: ShapeString double escape backslash in string
Fixes 12058.
2024-01-22 14:35:34 -03:00
Roy-043
341f71ec5b Draft: Inform user that objects without a Shape cannot be cloned
Fixes #11923.
2024-01-22 12:31:02 -05:00
Roy-043
5b98a762d1 Draft: Improve layer functions
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`.
2024-01-22 11:29:13 -06:00
Roy-043
cb2fdeeeea Draft: DraftGui.py make type of self.facecolor consistent
Since V0.19 self.facecolor had two types: integer (initial value) or QColor. With this PR it is again always a QColor.
2024-01-19 18:31:11 +01:00
Roy-043
544bd1e7ea Arch: implement new get_param functions
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.
2024-01-18 15:43:15 +01:00
Roy-043
904bb57538 Draft: Task panel checkboxes were repositioned by accident
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.
2024-01-17 11:00:40 +01:00
Kevin Martin
d52cf81bce Move the "Treat ellipses and splines as polylines" to DXF *output* options
This option control DXF export but was confusingly in the Import options area. Fixes #11659
2024-01-11 15:58:26 +01:00
Roy-043
35f10ad5a5 Draft: remove reapply_diffuse_color workaround
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.
2024-01-10 16:46:49 +01:00
Roy-043
0b036ab58a Draft: gui_snapper: setTrackers can be called if there is no 3D view 2024-01-05 10:50:46 +01:00
Chris Hennes
1d2186b7d6 Update translations (#11886)
* 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>
2024-01-03 09:27:18 -06:00
Roy-043
1da2df1009 Draft: improve checkSpecialChars in DraftGui.py 2023-12-23 10:33:54 +01:00
Yorik van Havre
a679c8b818 merged crowdin translations 2023-12-20 09:27:37 +01:00
Yorik van Havre
f78959fab3 Updated ts files 2023-12-20 09:27:37 +01:00
Roy-043
5f07c7aacd Draft: intermediate fix for get_normal: check if 3D view exists
This avoids issues with TechDraw views of Arch models if there is no active 3D view.
2023-12-16 20:30:45 +01:00
Roy-043
1fa7eb76c6 Draft: implement new get_param functions (step 6)
See #11677

Added a parameter to the dictionary. The get_parameter and set_parameter functions now print a warning if a parameter is not found.
2023-12-15 14:59:59 +01:00
Roy-043
c2e16f2525 Draft: implement new get_param functions (step 5)
See #11677

Last bits...
2023-12-14 15:53:45 +01:00
Kevin Martin
5ac40155b0 Remove the "legacy only" from the import colors option 2023-12-14 10:15:17 +01:00
Kevin Martin
fd5b4076b8 Add hooks so Gui classes can be seen by DXF importer 2023-12-14 10:15:17 +01:00
Roy-043
d0a87b24d9 Draft: implement new get_param functions (step 4)
See #11677
2023-12-13 19:39:35 +01:00
Roy-043
17e5ef969c Moved another import 2023-12-13 16:32:15 +01:00
Roy-043
3e9b037c44 Moved an import to avoid circular import 2023-12-13 09:59:08 +01:00
Roy-043
12444a1d6b Draft: implement new get_param functions (step 3)
See #11677
2023-12-12 20:20:03 +01:00
Roy-043
3d9c520b0d Draft: implement new get_param functions (step 2)
See #11677
2023-12-12 14:48:09 +01:00
Roy-043
56d73f39ac Draft: implement new get_param functions (step 1)
See #11677
2023-12-11 19:31:34 +01:00
Roy-043
4ed43a2458 Draft: increase DXF Python library version to 1.42
See: https://github.com/yorikvanhavre/Draft-dxf-importer/pull/28
2023-12-11 12:40:47 +01:00
Roy-043
4262da5fc1 Draft: new get_param function with defaults
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
2023-12-11 10:18:50 +01:00
Roy-043
839bf41f1a Draft: minor improvement to prefs layouts 2023-12-10 15:22:43 +01:00
Roy-043
56b8f76cfb Draft: Introduce DefaultAnnoScaleMultiplier parameter
This parameter replaces DraftAnnotationScale.

The parameter can be changed in the preferences and with the Draft_SetStyle command.
2023-12-09 19:17:36 +01:00
Roy-043
a6cd89f746 Draft: use MarkerSize for snap and tracker markers 2023-12-08 21:17:34 +01:00
Roy-043
c0e774f15c Draft: remove maxSnap parameter
It is superfluous. The maxSnapEdges parameter can be set to zero.
2023-12-08 12:06:36 +01:00
Roy-043
640bd5cf26 Draft: remove the Draft_ToggleContinueMode command
Rarely used as Continue mode can also be checked in the task panel of Draft commands.
2023-12-05 22:31:44 +01:00
Roy-043
12211aacbb Draft: menu texts to sentence case 2023-12-04 10:44:59 +01:00
Roy-043
b4c3a0d963 Draft: update Draft_ApplyStyle
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.
2023-12-02 13:11:08 +01:00
Roy-043
92d69c9641 Draft: update Draft_SetStyle
* 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.
2023-11-30 21:19:48 +01:00
Roy-043
9b19b66d90 Draft: implement DefaultAnnoLineWidth and DefaultAnnoLineColor prefs
The format_object function in gui_utils.py still requires some work (in connection with the Draft_SetStyle command). This will be done later.
2023-11-30 09:45:19 +01:00
Roy-043
4755086911 Draft: Revised preference ui files
* 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.
2023-11-30 09:44:05 +01:00
Roy-043
6c015072eb Draft: implement DefaultAnnoLineWidth and DefaultAnnoLineColor prefs
The format_object function in gui_utils.py still requires some work (in connection with the Draft_SetStyle command). This will be done later.
2023-11-29 23:06:17 +01:00
Roy-043
08308ada8a Draft: Revised preference ui files
* 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.
2023-11-29 23:06:17 +01:00
Roy-043
b10e4ab809 Draft: Revised preference ui files
* 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.
2023-11-29 15:05:16 +01:00
Roy-043
096f77d28c Draft: use param observer to update tray 2023-11-27 23:56:00 +01:00
Yorik van Havre
3ade39ccf1 Translations (#11551)
* 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>
2023-11-27 11:29:38 -06:00
Roy-043
484bbf3807 Draft: improve handling of anno DisplayMode and LineSpacing
* 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.
2023-11-27 15:45:56 +01:00
Roy-043
b9d8f0a999 Draft: use clearer snap marker names 2023-11-25 19:29:12 +01:00
Roy-043
97e13c14d0 Draft: use consistent is-number string in DraftGui.py 2023-11-25 15:59:29 +01:00
Roy-043
c36979f156 Draft: improve Snap bar show-hide preference
This PR replaces the showSnapBar and hideSnapBar preferences with a single new preference: SnapBarShowOnlyDuringCommands.

Additonally:
Improved some param observer callbacks.
2023-11-24 13:30:03 +01:00
Roy-043
70d2731483 Merge pull request #11509 from Roy-043/Draft-getActiveObject-has-changed
Draft: Gui.ActiveDocument.ActiveView.getActiveObject has changed
2023-11-24 12:46:07 +01:00
Roy-043
b5d8e17341 Draft: gui_selectplane can rely on ParamObserver for grid changes 2023-11-24 12:18:57 +01:00
Roy-043
387d1d1fd9 Draft: Gui.ActiveDocument.ActiveView.getActiveObject has changed
See #10405.
2023-11-24 12:08:28 +01:00