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>
Related issue:
#5603.
The view observer starts/stops when the Draft workbench is activated/deactivated.
Additionally:
* Minor improvements to _update_grid and _update_gui.
* 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>
Remove call to get_draft_line_commands.
Update the ContextMenu function. The items are based on the utilities menu now. And the context menu is the same for the Tree view and the 3D view.
Previously they were imported directly in `InitGui.py`,
now they are collected in `DraftTools.py`, so that they
are imported at the same time as other modules.
Also provide an icon so this icon appears in the menu.
These commands are useful but are "hiden"
inside the "Utilities" menu, so not many poeple know about them.
By placing them in a toolbar, they will be more discoverable.
The `ContextMenu` method defines commands that will be listed
when right clicking and opening the context menu in the 3D view
or the tree view.
This sets up the line GUI commands when either a line, wire,
polyline, spline, or bezier curve is active.
However, this currently doesn't work at all for unknown reasons.
Maybe some other functionality in the internal C++ code
needs to be changed first.
still have to split viewprovider from object.
[Draft] Dimension Style code cleanup
thx @vocx-fc for reviewing
further cleanup
[Draft] Dimension Style improvements
Added a property to the dimension object to link the dimension style.
Improved the update of dimensions when style changes. This can be done in 2 different ways: by setting AutoUpdate property to True or by activating Update function from the viewprovider context menu.
Those unit tests that are registered in `Init.py` will always run,
while those that are registerd in `InitGui.py` will only run
when the graphical interface is available.
This allows us to more clearly distinguish functions that
should be able to run always, from those that may run only
when the interfce is available.
This means that now the unit tests will run from
the console mode when using
```
FreeCADCmd -t 0
FreeCAD --console -t 0
```
This will allow us to catch errors more easily,
as we separate better the behavior of non-GUI
and GUI-required modules.
Also small spacing fixes and position of the license.
Previously it was placed in the `annotation` category
but since it creates a group of shapes, it is better
in the `creation` category.
Also small fixes in the menu text and tooltip.
It replaces the older `Draft_Array` command, and provides
a task panel to select the properties, similar to the
`Draft_PolarArray` and `Draft_CircularArray` commands.
It can also create `App::Links` directly from this task
panel, so it also replaces the `Draft_LinkArray`
introduced by the LinkMerge.
Also other small fixes: cleanup for getting the icon
of the workbench; we don't need to test for PySide because
it should already exist as part of the system
for the entire interface to work; cleanup of the printing
functions.
* Add Draft_LinkArray and Draft_PathLinkArray that uses link for both
data and visualization, which supports linking external objects
* Add link group support for draft snap
* Fix ArchWindows expression ambiguity
* It allows you to select multiple objects to edit instead of just one.
* It highlights the object lines and the points in red.
* It stays in the mode and allows you to run other modifiers.
* A very hackish hook into the move modifier is added as a proof of concept.
With this commit 2 commands are created, one for current bezier curve tool behaviour, the other for cubic bezier in inkscape style...
grouped in a dropdown button in the toolbar.