Commit Graph

2530 Commits

Author SHA1 Message Date
Yorik van Havre
f9c0455385 Merge pull request #4816 from luzpaz/typos
Fix misc. typos
2021-06-04 13:16:21 +02:00
Yorik van Havre
3352ebf9a0 Merge pull request #4811 from carlopav/DraftEdit_Improvements
Draft: Edit improvements to context menu and code organization
2021-06-04 13:15:18 +02:00
luz paz
097bb0769c Arch: fix typo in translate() 2021-06-03 14:36:21 -04:00
Yorik van Havre
d0d637b2c6 merged crowdin translations 2021-06-03 15:43:34 +02:00
Yorik van Havre
4361893f24 updated ts files 2021-06-03 15:37:33 +02:00
carlopav
267291567f Draft: Edit, cleanup of new GuiTools.addPoint methods
In new splitted addPoint methods, getObjectsInfo and the consequent checks have been removed and moved to main DraftEdit module in a new get_specific_object_info method.
This method returns the info for the selected object at a given position and the 3d Vector of the point clicked on the object.
2021-06-01 23:21:12 +02:00
carlopav
5841b737e1 Draft: Edit, moved resetTrackers for context menu actions to main module
The wrapper allows to call resetTrackers in the main module after the callback to the GuiTools is executed.

This is the last commit, many thanks to @matthijskooijman for having menthored me :)

I think it's helpful to have @matthijskooijman explanation on this use of the wrapper:

This defines a new wrapper function, that calls the original callback and then calls resetTrackers. Note that this creates a new function for every loop iteration, so each of these wrapper functions captures potentially different callback, self and obj values so things work as expected. Note I did something weird with the callback value there: Since functions like these capture a variable, not its value at the time of function definition, and loop variables like label and callback are a single variable shared between all loop iterations, capturing callback directly ends up with all wrappers calling the last callback (i.e. they all capture the same variable and by the time the wrappers are called, that variable will contain the last of the callbacks). This is commonly solved by using a default value in the function definition, since such a default value uses the value of the (in this case) callback variable, not capturing the variable.
2021-06-01 23:20:41 +02:00
carlopav
0ea4c5d2fe Draft: Edit, Added reverse wire option to context menu
Now Draft Edit can reverse the order of the points of a Draft_Wire
2021-06-01 22:53:24 +02:00
carlopav
28ced10d50 Draft: Edit, rewriting context menu system
get_edit_point_context_menu(self, edit_command, obj, node_idx)
get_edit_obj_context_menu(self, edit_command, obj, position)
that are called depending if the user is over an editpoint or over another part of the object.
2021-06-01 22:53:01 +02:00
carlopav
cc87ab4913 Draft: Edit, Split out addPoint in multiple methods in the GuiTools
Now Draft_Wire, Draft_BSpline, Draft_Bezcurve have their own methods to add points.
2021-06-01 21:57:38 +02:00
carlopav
bd02136f9d Draft: Edit, change startEditing method to accept (obj, node_idx)
This enable to start editing also without an user click event, by just calling the method and specifying the object and the edit point index.
It is used for alternative edit mode (alt_edit_mode) by arc context menu
2021-06-01 21:47:37 +02:00
carlopav
b108f66780 Draft: Edit, Remove all the empty pass functions
Remove unused functions. Since GuiTools objects inherit from the GuiTools class, they do not need those placeholders.
2021-06-01 21:47:37 +02:00
Yorik van Havre
f7cdb4cc04 Merge pull request #4822 from marioalexis84/draft-fillet
Draft: Add shortcut to fillet command
2021-06-01 17:01:53 +02:00
Yorik van Havre
9332e52d94 Draft: Added ExclusionPoints property to shape2dview object 2021-06-01 11:30:04 +02:00
marioalexis
d363f10edf Draft: Add shortcut to fillet command 2021-05-31 16:18:36 -03:00
Yorik van Havre
43a2e2e640 Merge pull request #4820 from Roy-043/Draft_Fix_make_text
Draft: make_text fixed 3 small issues
2021-05-31 19:44:13 +02:00
Roy-043
cd31a4f026 Draft: make_text fixed 3 small issues
Fixed 3 small issues in make_text that came up while working on make_label (pull request #4801).
2021-05-30 19:53:02 +02:00
Yorik van Havre
f94f4257cf Merge branch 'master' of github.com:FreeCAD/FreeCAD 2021-05-28 14:11:51 +02:00
Yorik van Havre
cc1140489e Merge pull request #4801 from Roy-043/draft_make_label_text_input
Draft: Fixed make_label to accept list of strings for custom_text
2021-05-28 13:46:10 +02:00
Yorik van Havre
b1d9a5607f Merged crowdin translations 2021-05-27 14:51:33 +02:00
Yorik van Havre
c6771853ae Updated translation files 2021-05-27 14:44:40 +02:00
Roy-043
c0105690f4 Merge branch 'master' into draft_make_label_text_input 2021-05-26 16:23:22 +02:00
Yorik van Havre
e6af8032e2 Merge pull request #4804 from luzpaz/Crowdin-Draft
Crowdin: fix Draft mirror code typo
2021-05-25 15:07:28 +02:00
Yorik van Havre
601d6ca466 Merge pull request #4808 from matthijskooijman/movewithhost-link-exception
Draft: Do not move children of App::Link objects
2021-05-25 15:06:55 +02:00
Yorik van Havre
5d57496f25 Merge pull request #4809 from matthijskooijman/draft-arch-simplifications
Draft & Arch: Python code simplifications
2021-05-25 15:05:46 +02:00
Roy-043
57de4681ec Update make_label.py
Brought back name=_name. Added type(custom_text) is list check.
2021-05-24 18:42:27 +02:00
Matthijs Kooijman
738bcbe357 Draft: Fix "Show groups in layer list drop-down button" preference
The code that was intended to handle this preference looked inside
Mod/BIM instad of Mod/Draft for the preference. This seems to have been
broken since the preference was first introduced in commit 507c40669d
(Draft: Turned autogroup button into layers selector (added pref option
to restore old groups-based system)).

This also removes a stray "-" that was probably a leftover from a merge
conflict, introduced in commit 68119de02f (Draft: move Draft_AutoGroup to
gui_groups module). Since -True is still true and -False is still false,
this did not actually break the code, though.

See https://forum.freecadweb.org/viewtopic.php?t=42018 for related
discussion.
2021-05-22 18:33:15 +02:00
Matthijs Kooijman
ecc05545c1 Draft: Simplify code using getattr default value
This uses the default value that can be passed to getattr to simplify
code that uses it. By choosing an appropriate default value, a separate
call to hasattr can be avoided and in some cases duplicate code can be
avoided.

This applies this trick where possible in wire.py and circle.py.

This commit does not change behavior.
2021-05-22 17:44:04 +02:00
Matthijs Kooijman
19ada8fd1f Draft: Do not move children of App::Link objects
This caused the original object to be moved when using the Draft move
tool to move a link object, when the original object has MoveWithHost
set (e.g. a Window). There was already a similar exception for clones,
so it makes sense to extend this for links too.

Note that there seem to be more problems with the "MoveWithHost"
mechanism and fixing them might completely refactor this code, but until
then, this is a simple and targeted fix that at least makes moving
links to windows work as expected.

See https://forum.freecadweb.org/viewtopic.php?f=23&t=57223 for
discussion of this bug, its fix and the additional problems mentioned.
2021-05-22 16:51:04 +02:00
Roy-043
98e563c3d9 Update make_label.py
If custom_text is a string there is no need to put it in a list.
2021-05-22 16:33:12 +02:00
Yorik van Havre
089b2ae478 Draft: Fixed use of double quotes in Draft Texts 2021-05-21 15:35:29 +02:00
luz paz
5394c27683 Crowdin: fix Draft mirror code typo
ref: https://crowdin.com/translate/freecad/548/en-en?filter=basic&value=2#6587132
2021-05-20 16:02:34 -04:00
Roy-043
9b2ebec35d Draft: Fixed make_label to accept list of strings for custom_text
The make_label function should accept a list of strings for custom_text. Compare the make_text function. The new code was mostly taken from there.
2021-05-18 21:08:02 +02:00
Yorik van Havre
5161d99b48 Merge pull request #4795 from luzpaz/Crowdin-Draft-whitespace
Crowdin: remove superfluous whitespace from translation
2021-05-18 16:24:42 +02:00
luz paz
71faff2a0a Crowdin: remove superfluous whitespace from translation
ref: https://crowdin.com/translate/freecad/548/en-en?filter=basic&value=2#6587168
2021-05-17 10:51:05 -04:00
luz paz
7f4ac1d4f8 Crowdin: fix mistake in Draft Preferences text [skip ci]
ref: https://crowdin.com/translate/freecad/548/en-en?filter=basic&value=13#6577122
2021-05-17 10:28:43 -04:00
Yorik van Havre
7b0a6358b1 Merged crwodin translations 2021-05-12 16:36:31 +02:00
Yorik van Havre
7132d7cc87 Merge pull request #4784 from UR-0/origin/Draft_harmonize_digits_of_dxfScaling
[Draft] harmonize no of digits of dxfScaling between Edit->Preference…
2021-05-12 15:36:47 +02:00
Yorik van Havre
2f3bb4050e Draft: Added 'apply to texts/dims' button to SetStyle dialog 2021-05-11 16:24:06 +02:00
UR-0
61c67cf3b8 [Draft] harmonize no of digits of dxfScaling between Edit->Preferences and Tools->Edit Parameters 2021-05-11 16:14:18 +02:00
Yorik van Havre
28c51d4a43 Draft: Allow to use dimension tool with predefined direction 2021-05-11 13:27:41 +02:00
Yorik van Havre
81a44fcccb Updated ts files 2021-05-11 13:05:20 +02:00
Yorik van Havre
3a4621bda9 Merge pull request #4780 from matthijskooijman/fix-flat-groups-section-view
Arch: Fix section view duplicate rendering of items in groups with only flat objects
2021-05-11 12:13:09 +02:00
Matthijs Kooijman
82d0d3007d Draft: Improve docs for get_group_contents spaces parameter
The documentation suggested subtly different semantics from what the
code implements.
2021-05-09 17:33:46 +02:00
Yorik van Havre
72e249a106 Draft: Fixed last commit (stroke endcap -> stroke-linecap) 2021-05-06 18:49:55 +02:00
Yorik van Havre
d8c74c06fd Draft: Using square endcaps for lines in SVG output 2021-05-06 18:38:32 +02:00
Yorik van Havre
8c4f4e6895 Draft: Added load/save functionality to SetStyle dialog 2021-05-06 18:36:41 +02:00
Yorik van Havre
131cdd1e4e Merge pull request #4557 from luzpaz/crowdin/whitespaces-substituted-into-code
Crowdin: represent whitespace in code instead of in string
2021-05-05 17:18:35 +02:00
Yorik van Havre
665e8bd32e Draft: Changed shapestring FillLetters property to MakeFace 2021-05-05 15:41:28 +02:00
Yorik van Havre
191cfb2365 Merge pull request #4769 from Roy-043/Draft_make_ellipse
Draft: Fixed make_ellipse.py: the face argument was not used
2021-05-05 15:31:13 +02:00