Commit Graph

224 Commits

Author SHA1 Message Date
Roy-043
432befd79a Merge pull request #17379 from yorikvanhavre/draft-fix-annotation
Draft: better check for Gui object
2024-12-06 18:05:41 +01:00
luzpaz
2d40efd555 Fix various typos
Found with codespell
2024-12-04 23:18:00 -05:00
Roy-043
2b2a80ac3c Pattern name Diamant -> Diamond 2024-12-02 11:40:01 +01:00
Roy-043
3c21ff425e Draft: Display default file and pattern in hatch task panel
Fixes #18197.
2024-12-02 11:40:01 +01:00
Roy-043
83a5eaeef4 Draft: avoid listing status bar widgets in toolbar area context menu
Fixes #16832.

In V1.0 the two Draft status bar widgets appear as checkboxes without label in the toolbar area context menu. They should not be listed in that menu, as was the case in V0.21. Their visibility is controlled via preferences.

Additionally, in case the Draft WB is only preloaded, the widgets would display in another workbench. This is prevented by using a delay.
2024-11-25 11:40:55 +01:00
Chris Mayo
cea8d25c11 Draft: Make startup and tests independent of BIM (#17390) 2024-11-16 17:43:46 +01:00
Roy-043
2df0f770dd Draft: Fix _param_observer_callback_scalemultiplier error
Fixes #17741.
2024-11-09 10:27:12 -05:00
Roy-043
0c77ff85b7 Draft: avoid race condition in todo code
The doTasks function is called multiple times when using Draft tools. In some cases the ToDo.commitlist belonging to a previous call was not fuly processed, resulting in the same list being processed twice. To avoid this the list is stored as a local variable and then immediately reset.

Forum topic:
https://forum.freecad.org/viewtopic.php?t=91832
2024-11-07 11:13:29 +01:00
Roy-043
0fac810797 Restore ViewObject implementation for all Draft objects
In my tests the code works fine. Using @AIRCAP's instructions,  I have created a 'broken' file from draft_test_objects.FCStd.
2024-10-24 15:24:13 +02:00
bgbsww
7d9e955190 Disallow end_all_events in Gesture Nav Style 2024-10-07 15:03:17 +02:00
Syres916
5fd27dbd03 [Draft] Improve the color activation and ability to change… (#16603)
* [Draft] Improve the color activation and ability to change size of the snap text

* [Draft] Correct dimension text size calculation
2024-09-19 09:03:33 +02:00
Furgo
1c865c0f95 Draft toggle grid as a toggle button to indicate grid visibility (#14452)
Makes the button for the Draft_ToggleGrid command act as a real toggle button to provide visual feedback of the grid visibility state.

---------

Co-authored-by: Syres916 <46537884+Syres916@users.noreply.github.com>
2024-06-13 15:31:29 +02:00
Roy-043
df49763d3f Draft: improved IsActive behavior (#14103)
Related issue: #14061.
2024-05-18 11:38:38 +02:00
Roy-043
81436e833a get_appearance_material -> get_view_material
Also removed the ret_default argument.
2024-05-11 10:11:16 +02:00
Roy-043
1b2ef7831f Draft: Draft_SetStyle new Material handling
Discussion: #13657.
2024-05-09 10:49:19 +02:00
Roy-043
4d2e124f11 Merge pull request #13633 from Roy-043/Draft-revert-Draft-WB-changes-from-13294
Draft: revert Draft WB changes from #13294
2024-04-26 10:46:05 +02:00
Roy-043
152d642b60 Draft: revert Draft WB changes from #13294
Revert the Draft WB related changes of #13294.
2024-04-24 21:27:04 +02:00
Chris Mayo
170f8baa29 Draft: Fix QImage object has no attribute 'byteCount'
'PySide6.QtGui.QImage' object has no attribute 'byteCount'
load_texture: unable to load texture
2024-04-23 19:35:54 +01:00
David Carter
ba20441935 Material: Material appearance
Uses new material system for appearance

Each feature object now has a property called ShapeMaterial that
describes its physical properties. If it has a shape, it has a
material.

The ShapeColor attribute is replaced by a ShapeAppearance attribute.
This is a material list that describes all appearance properties, not
just diffuse color. As a list in can be used for all elements of a
shape, such as edges and faces.

A new widget is provided to allow the user to select materials in a
consistent fashion. It can also launch the material editor with its
more advanced capabilities.
2024-04-04 07:39:58 -05:00
Yorik van Havre
d77f958112 Draft: Made get_type aware of IFC objects 2024-03-18 18:50:56 +01:00
Chris Hennes
7b07447cce Draft: Remove trailing spaces from translations 2024-03-12 22:42:20 -05:00
Roy-043
6df52808f2 Draft: applyConstructionStyle was missing in params.py 2024-03-04 11:33:10 +01:00
Roy-043
4016d53f17 Draft: update DefaultShapeColor in params.py to match new default 2024-02-19 10:11:48 +01:00
Roy-043
2bd0a06991 Draft: fix wrong selection after commands
Fixes #10469

The code of the `end_all_events()` function is by Chris Hennes (chennes).
See https://forum.freecadweb.org/viewtopic.php?p=656362#p656362.
2024-02-12 11:32:58 -06:00
Kevin Martin
2b9fa18b68 Eliminate many "doing what you told me to" messages
These messages were perhaps originally intended as a debuggin aid but now add clutter to the output panes. Remaining messges are mostly the result of methods to display attributes of an object (which one could call from the Python console) or actually provide some information which would not be obvious from the circumstances
2024-02-02 08:58:45 -05:00
Roy-043
51035731e7 Draft: Avoid draftToolBar.getDefaultColor outside DraftGui.py
The draftToolBar.getDefaultColor() function is an indirect way of retreiving a parameter. It is better to avoid it where possible.
2024-02-01 18:02:10 +01:00
Roy-043
47f6c756e3 Merge pull request #12111 from 3x380V/draft_wb_qt6
Draft: Qt6 fixes
2024-01-31 11:31:38 +01:00
Roy-043
b1b0c48742 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
Ladislav Michl
839fb17649 Draft: Use widgets from QtWidgets 2024-01-25 14:27:38 +01:00
Roy-043
be03a9cebf 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
0845671608 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
20f32c4bf1 Draft: implement new get_param functions (step 5)
See #11677

Last bits...
2023-12-14 15:53:45 +01:00
Roy-043
16e5835aa6 Draft: implement new get_param functions (step 4)
See #11677
2023-12-13 19:39:35 +01:00
Roy-043
14482b1f8e Moved another import 2023-12-13 16:32:15 +01:00
Roy-043
bd19d331f5 Moved an import to avoid circular import 2023-12-13 09:59:08 +01:00
Roy-043
822f2111e3 Draft: implement new get_param functions (step 3)
See #11677
2023-12-12 20:20:03 +01:00
Roy-043
b0aa33f92a Draft: implement new get_param functions (step 2)
See #11677
2023-12-12 14:48:09 +01:00
Roy-043
59753260c9 Draft: implement new get_param functions (step 1)
See #11677
2023-12-11 19:31:34 +01:00
Roy-043
4d00c0f43c 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
79eaa01032 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
770eb5e64a 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
26adc417a9 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
6db658255f 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
e64bb9f499 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
35993c79ca 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
904b37b47d 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
4bcdb7cb1c Draft: use param observer to update tray 2023-11-27 23:56:00 +01:00
Roy-043
a462e8e616 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
a3f285cb46 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
9bcb7cbc7e Draft: Gui.ActiveDocument.ActiveView.getActiveObject has changed
See #10405.
2023-11-24 12:08:28 +01:00