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.
* 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.
Additionally:
* Added the DimShowLine preference. Layout of the tab will be updated later.
* Improved handling of DraftAnnotationScale preference: catch division by zero and use it for the default anno style.
With this PR the following 5 command modes are automatically stored in the preferences:
* "ContinueMode"
* "RelativeMode"
* "GlobalMode"
* "fillmode" (existing preference, removed from the Preferences Editor)
* "SubelementMode"
Additionally:
Three commands (Draft_Ellipse, Draft_Rectangle and Draft_Stretch) call `setRelative` after the 1st point has been specified and would permanently switch on relativeMode. After this PR this switch is temporary.
This PR improves the behavior of the Draft grid:
* Options in the preferences: "Always show the grid" and "Show the grid during commands".
* The parameters are used for new views. In existing views the grid can be toggled either during a command or when no command is active.
* When switching to a different workbench all grids are hidden unless GridHideInOtherWorkbenches is set to `False`. This can be a Fine-tuning parameter IMO.
Notes:
* The defaultCameraHeight parameter becomes obsolete. It was only used in very specific circumstances.
* The code of PR #8818 becomes obsolete. It makes more sense to use `App.activeDraftCommand` instead of adding a `tool` argument to some functions. Will do some related cleanup later.
* Improved alignment for the related preference ui. The checkbox interaction has been fixed as well.
Related issue:
#5603.
For gui_snapper.py and gui_trackers.py an intermediate solution has been adopted. They still rely on App.DraftWorkingPlane, but now use a small function to retreive it.
Simply switching to the PlaneGui class is problematic for the trackers as this results in an endless recursion (wp->grid->wp->...). Using the old App.DraftWorkingPlane (which is kept up-to-date by PlaneGui) solves this for now. I will try to return to this later (which may be after the next release though).
* Draft: added the new Draft_Hyperlink command
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
* Draft: added the new Draft_Hyperlink command
* Updated regex condition for more Windows file paths and network resources
* Added check for file existence
* Modified syntax for Win32/CygWin case
* Declared ret variable outside if statement
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
* Draft: added the new Draft_Hyperlink command
* Replaced os.startfile and subprocess.call with QDesktopServices.openUrl
* Removed unused Python dependencies
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
---------
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
Forum topic:
https://forum.freecad.org/viewtopic.php?t=81997
Additionally:
* Fixed offset and extrusion for non-planar faces.
* Improved the addSubobjects function,
* Cleaned up the code a little bit.
Related issue:
#5603
Previous PR:
#11010
* This PR implements the new PlaneGui class for the Draft_SelectPlane command.
* As mentioned in the previous PR, almost all working plane related code has been removed from gui_selectplane.py.
* The task panel has a new button "Next" to switch to the next working plane in the history.
* Both the "Previous" and "Next" buttons are only enabled if there is a corresponding step in the history.
* PlaneGui stores a working plane per 3D view, but the other commands have to be updated before that system is fully functional.
* Code to update the toolbar when switching to a different view will be added later.
Forum topic:
https://forum.freecad.org/viewtopic.php?t=81956
This PR basically reverts PR #10556.
The angular offset required for the Draft_Arc command is handled in the gui_arc.py file instead. Also removed the unused `urotated` variable from that file.
Steps to verify the issue:
1. Open FreeCAD.
2. Switch to Std_ViewTop.
3. Click one of the curved arrows of the Navigation Cube.
4. Switch to the Draft WB.
5. Make sure Draft_SelectPlane is set to "Auto".
6. Start Draft_Arc and click 2 points (for the radius and the start angle).
7. Result: The displayed arc does not match the start angle or the current point.
Additonally:
* Removed the normal argument from `__init__`. The tracker does not work properly with just a normal. AFAICT there is no code that specifies this normal.
* Minor improvement to `getAngle`: Switched the vectors.