Commit Graph

227 Commits

Author SHA1 Message Date
vocx-fc
3c6fdca582 Draft: move units functions outside DraftGui.py
The functions `getDefaultUnit`, `makeFormatSpec`, `displayExternal`
are used to get the default unit schema for lengths and angles,
and display a string with a particular format.

They aren't used in `DraftGui.py`, but are used by the
viewprovider of the Dimension objects. Therefore, they are moved
into a separate module, so that they can be imported without
using the entire `DraftGui` module.
2020-07-10 12:29:30 +02:00
carlopav
78a5036048 [Draft] Improved Snapper Toolbar Behaviour
Changed snap toolbar behaviour:
- create a list of available snaps (Gui.Snapper.snaps)
- make it consistent with Snap Gui Commands (in gui_snaps module)
- create a list of active snaps (Gui.Snapper.active_snaps)
- refactor the isEnabled() method to allow it to check if the given snap is in Gui.Snapper.active_snaps and not if the snap toolbar button isChecked()
- updated and reordered the new list of gui snap commands in draftutils.init_tools and used it as a base to refactor the creation of draft toolbar
- updated all the draft snap gui tools to make them control the toolbar buttons directly
.


.


.
2020-04-20 12:38:06 +02:00
vocx-fc
9d9102bc7e Draft: Draft_Text split lines by newline characters 2020-04-06 13:01:32 +02:00
vocx-fc
2a340bcfd3 Draft: move ScaleTaskPanel to a module
We remove it from `DraftGui.py` to reduce the size of this file.
Then we import it and tie it to its command defined
in `DraftTools.py`.
2020-04-02 16:53:49 +02:00
vocx-fc
46216d6032 Draft: move ShapeStringTaskPanel to a module
We remove it from `DraftGui.py` to reduce the size of this file.
Then we import it and tie it to its command defined
in `DraftTools.py`.
2020-04-01 13:22:04 +02:00
vocx-fc
580270ce4a Draft: move DraftSnap to another module
And do not load the `Snapper` in `DraftGui`.
The Snapper should be initialized by the module
that imports `DraftGui`, most probably `DraftTools`
or even by the `InitGui` of the workbench.
2020-03-20 08:11:04 -03:00
carlopav
6d2c8b5df3 [Draft] Uniform length and xyz inputfield behaviour
Single returnPressed to accept point if cursor is parallel to xyz axis for bot setfocus on x and on length inputfields.
[Draft] Edit_updated tooltip


[Draft] DraftGui Further cleanup and bugfix
2020-03-12 09:11:34 -03:00
carlopav
4396b40fec [Draft] DraftGui and DraftEdit Cleanup to remove AddPoint & DelPoint
Lines to be deleted in DraftGui in the future, are now commented.
2020-03-12 09:11:34 -03:00
carlopav
786eac8c01 [Draft] DraftGui Bugfix on selecting inputfields
https://forum.freecadweb.org/viewtopic.php?f=23&t=43145&p=367517#p367517
2020-03-12 09:11:34 -03:00
Syres916
b90d181188 [Draft] Bugfix for new users opening Shapestring
See Discussion : https://forum.freecadweb.org/viewtopic.php?f=23&t=42808
2020-02-05 10:51:12 +01:00
carlopav
2e4ce2f220 [Draft] Toolbar, remove option from preferences 2020-02-05 10:50:03 +01:00
vocx-fc
f86980e0b1 Draft: disable the Toolbar mode of Gui commands
The `Taskview` mode (value 1) is set fixed in `DraftGui.py`
even if the widget shows the other value `Toolbar` (value 0),
as this mode is unmaintained and obsolete.
At the same time, clarify the behavior with a new tooltip.
2020-02-05 10:50:03 +01:00
triplus
ac3d5b1633 Draft - Toolbar mode input size issue
https://forum.freecadweb.org/viewtopic.php?f=34&t=42782
2020-02-05 10:48:27 +01:00
Yorik van Havre
ee10405140 Draft: Use proper multi-line text editor for Draft Text tool 2020-01-29 14:27:01 +01:00
UR-0
7b511d49cb Draft: ShapeStringTaskPanel add parameter DontUseNativeFontDialog 2020-01-22 10:25:13 +01:00
vocx-fc
d8fd4b2f9c Draft: move translate function to translate module
The translate mechanism in Draft depends on the `QtCore`
`translate` function. This is defined in its own module
so that `DraftGui.py` is not as big and hard to manage.

Other modules in Draft can import the translate function
without needing to import the entire interface, which
often causes errors and circular dependencies.

We can import `QtCore.QT_TRANSLATE_NOOP` at the top level
in `Draft.py` because it does not depend on the graphical
interface.
2020-01-15 10:05:52 +01:00
vocx-fc
abd31f0b2b Draft: move todo static class to the todo module
The todo class in `DraftGui.py` can be placed in its
own module so that `DraftGui.py` isn't as big
and hard to maintain.
2020-01-14 12:49:29 +01:00
vocx-fc
7721ca0157 Draft: new module for utility functions
Many auxiliary tools used by `Draft.py` can be defined
in another module. Many functions are moved to this module
so that `Draft.py` isn't as big and hard to maintain.

The following is a list of functions and attributes that were moved:
`stringencodecoin`, `arrowtypes`, `typecheck`,
`getParamType`, `getParam`, `setParam`, `precision`,
`tolerance`, `epsilon`, `getRealName`, `getType`,
`getObjectsOfType`, `isClone`, `getGroupNames`,
`ungroup`, `shapify`, `getGroupContents`,
`printShape`, `compareObjects`, `loadSvgPatterns`,
`svgpatterns`, `getMovableChildren`, `getWindows`,
`utf8_decode`.

Moreover, many of these functions were renamed
to comply better with PEP8 guidelines, particularly
the use of `snake_case`. For example, `getGroupNames`
is now `get_group_names`; `getMovableChildren`
is now `get_movable_children`.

Aliases are provided for the old names so that
other functions and classes that depend on these
won't break. The new names should be the official
programming interface, while the old names
should be deprecated at some point in the future.
2020-01-08 15:16:55 +01:00
luz.paz
8cfa85cf18 Draft: [skip ci] Fix header uniformity
This PR fixes header uniformity across all Draft files
2019-12-27 00:16:12 +01:00
vocx-fc
1987ecabdd Draft: PySide should be available already 2019-11-21 16:35:29 +01:00
luz.paz
e804698edc Draft: use string operator instead of numeric LGTM fix 2019-10-25 10:25:31 -03:00
vocx-fc
ac0e74b220 Draft: DraftGui, use boolean values to set up an option instead of numeric values 1 and 0 2019-10-14 16:45:33 -03:00
Syres916
15c6b01237 [Draft] ShapeString Task Panel Allow Windows...
....Users to view Font Files without the need to modify permissions on the Fonts folder. Also keeping the rest of FreeCAD file dialog boxes as standard.
2019-10-11 19:11:12 -04:00
Yorik van Havre
91ca523f54 Draft: Moved SelectPlane stuff from DraftGui to its own ui file 2019-09-02 22:15:58 -03:00
Dion Moult
bfae0408ac Fix UI labels and unit type to be angle instead of length when doing draft rotate 2019-09-02 16:05:36 -03:00
Yorik van Havre
6666a33433 Draft: Added shortcut to toggle near snap during drawing 2019-09-01 13:00:57 -03:00
Yorik van Havre
f16f58c040 Draft: Fixed tooltips 2019-08-26 14:16:19 -03:00
Yorik van Havre
d45a4a347e Draft: fixed color buttons dialogs not starting with the right color 2019-08-24 19:41:26 -03:00
Zheng, Lei
0a4f1abf00 Draft: fix Link(Path)Array 2019-08-17 15:32:51 +02:00
vocx-fc
dc6b02917e Draft: DraftGui.py, the docstrings need triple quotes and be next to the method or class in order to be picked up by Doxygen or Sphinx; this complies with PEP 257 2019-08-14 14:30:46 -03:00
Yorik van Havre
cef27c7a72 Draft: Added button to working plane task panel to orient the view to the WP 2019-07-09 12:29:32 -03:00
Yorik van Havre
afe0d6fad8 Draft: Remember Offset copy mode separately from Move copy mode 2019-07-06 16:52:58 -03:00
Yorik van Havre
631204ef6f Draft: Set global copy mode to False by default 2019-07-06 14:05:31 -03:00
Yorik van Havre
94c2617362 Arch: Misc bugfixes 2019-07-05 20:58:44 -03:00
Yorik van Havre
6fa859ab89 Draft: Better positioned layers button popup + new layer entry 2019-06-30 13:32:42 -03:00
Yorik van Havre
f717d540c8 Draft: Turned autogroup button into layers selector (added pref option to restore old groups-based system) 2019-06-30 01:00:50 -03:00
wmayer
d2bf707e7a Draft: QPixmap.fill expects a QColor, not an int or long 2019-06-14 11:30:43 +02:00
Yorik van Havre
2c918366e4 Draft: Introduced Layers system (former VisGroup) 2019-06-05 18:47:01 -03:00
Yorik van Havre
7957e065db Draft: Fixed regressions in Scale tool + reimplemented Clone mode 2019-06-03 19:06:27 -03:00
Yorik van Havre
4e9eb995df Draft: Now uses general FreeCAD shape colors instead of defining its own 2019-06-03 17:47:39 -03:00
Dion Moult
1b362fd82b Fix draft missing line tracker when snapper detects an object without any snap targets 2019-06-03 16:36:07 -03:00
Dion Moult
514fa9d4fc Add customisable in-command shortcut keys rather than hardcoding them 2019-06-03 16:31:25 -03:00
Derek V. Schmalenberger
297c7f2ec6 increased default snapRange from 5 to 8
Grid snapping will fail with a snapRange of 5 if a line or arc passes through the grid point.
2019-05-20 11:08:48 -03:00
luz.paz
92bf2228d9 Misc. typo fixes
Found via `codespell -q 3 -I ../fc-word-whitelist.txt -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller -L pard,wallthickness,commen,byteorder,alocation`
2019-05-17 13:19:36 +02:00
Yorik van Havre
601b09bb83 Draft: Removed annoying an unuseful verbose command line output 2019-05-16 15:31:57 -03:00
Yorik van Havre
8a432cc830 Draft: Fixed regression bug in Rotate 2019-05-16 14:38:46 -03:00
Yorik van Havre
3a2aac4fe0 Draft: Enhancements to Working Plane selection UI 2019-05-15 19:48:58 -03:00
Yorik van Havre
8119077feb Draft: Fixed Part primitives mode of Draft tools 2019-05-13 14:55:58 -03:00
Yorik van Havre
d72d5a5b21 Draft: allow to use different snapping task dialogs 2019-05-10 22:27:08 -03:00
Yorik van Havre
eb47cf84a0 Draft: General cleanup of the Draft UI 2019-05-10 21:03:35 -03:00