From 01de3d143dc2fa05323b93f4a30ef392a78755e7 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Sat, 3 Jun 2023 10:54:49 +0200 Subject: [PATCH] Draft: Add TextSpacing to Draft_AnnotationStyleEditor (#9702) Also reordered the dialog a little. --- .../ui/dialog_AnnotationStyleEditor.ui | 233 ++++++++++-------- src/Mod/Draft/draftutils/utils.py | 25 +- 2 files changed, 144 insertions(+), 114 deletions(-) diff --git a/src/Mod/Draft/Resources/ui/dialog_AnnotationStyleEditor.ui b/src/Mod/Draft/Resources/ui/dialog_AnnotationStyleEditor.ui index 1dcade1544..6f44b5f3ca 100644 --- a/src/Mod/Draft/Resources/ui/dialog_AnnotationStyleEditor.ui +++ b/src/Mod/Draft/Resources/ui/dialog_AnnotationStyleEditor.ui @@ -157,9 +157,9 @@ 589 - + - + Text @@ -216,7 +216,7 @@ - The line spacing (relative to the font size) + The line spacing for multi-line texts and labels (relative to the font size) Line spacing @@ -226,12 +226,12 @@ - The line spacing (relative to the font size) + The line spacing for multi-line texts and labels (relative to the font size) - + The color of texts, dimension texts and label texts @@ -251,96 +251,13 @@ - - - Units - - - - - - A multiplier factor that affects the size of texts and markers - - - Scale multiplier - - - - - - - A multiplier factor that affects the size of texts and markers - - - - - - - If it is checked it will show the unit next to the dimension value - - - Show unit - - - - - - - If it is checked it will show the unit next to the dimension value - - - Qt::LeftToRight - - - - - - - - - - Specify a valid length unit like mm, m, in, ft, to force displaying the dimension value in this unit - - - Unit override - - - - - - - Specify a valid length unit like mm, m, in, ft, to force displaying the dimension value in this unit - - - - - - - The number of decimals to show for dimension values - - - Decimals - - - - - - - The number of decimals to show for dimension values - - - - - - - - + Lines and arrows - + - + If it is checked it will display the dimension line @@ -366,7 +283,7 @@ - + The width of the lines @@ -386,7 +303,7 @@ - + The type of arrows or markers to use for dimensions and labels @@ -460,7 +377,7 @@ - + The color of lines and arrows @@ -476,8 +393,100 @@ - + + + + + + + Units + + + + + A multiplier factor that affects the size of texts and markers + + + Scale multiplier + + + + + + + A multiplier factor that affects the size of texts and markers + + + + + + + If it is checked it will show the unit next to the dimension value + + + Show unit + + + + + + + If it is checked it will show the unit next to the dimension value + + + Qt::LeftToRight + + + + + + + + + + Specify a valid length unit like mm, m, in, ft, to force displaying the dimension value in this unit + + + Unit override + + + + + + + Specify a valid length unit like mm, m, in, ft, to force displaying the dimension value in this unit + + + + + + + The number of decimals to show for dimension values + + + Decimals + + + + + + + The number of decimals to show for dimension values + + + + + + + + + + Dimension details + + + + The distance the dimension line is additionally extended @@ -486,7 +495,7 @@ - + The distance the dimension line is additionally extended @@ -496,8 +505,8 @@ - - + + The length of the extension lines @@ -506,7 +515,7 @@ - + The length of the extension lines @@ -516,8 +525,8 @@ - - + + The distance the extension lines are additionally extended beyond the dimension line @@ -526,7 +535,7 @@ - + The distance the extension lines are additionally extended beyond the dimension line @@ -536,6 +545,26 @@ + + + + The distance between the dimension text and the dimension line + + + Text spacing + + + + + + + The distance between the dimension text and the dimension line + + + + + + diff --git a/src/Mod/Draft/draftutils/utils.py b/src/Mod/Draft/draftutils/utils.py index 46865956a7..c13d10091f 100644 --- a/src/Mod/Draft/draftutils/utils.py +++ b/src/Mod/Draft/draftutils/utils.py @@ -60,22 +60,23 @@ param_draft = App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft") param_view = App.ParamGet("User parameter:BaseApp/Preferences/View") ANNOTATION_STYLE = { - "FontName": ("font", param_draft.GetString("textfont", "Sans")), - "FontSize": ("float", param_draft.GetFloat("textheight", 100)), - "LineSpacing": ("float", param_draft.GetFloat("LineSpacing", 1)), - "TextColor": ("color", param_draft.GetUnsigned("DefaultTextColor", 255)), - "ScaleMultiplier": ("float", 1), - "ShowUnit": ("bool", param_draft.GetBool("showUnit", True)), - "UnitOverride": ("str", param_draft.GetString("overrideUnit", "")), - "Decimals": ("int", param_draft.GetInt("dimPrecision", 2)), - "ShowLine": ("bool", True), - "LineWidth": ("int", param_view.GetInt("DefaultShapeLineWidth", 1)), - "ArrowType": ("index", param_draft.GetInt("dimsymbol", 0)), "ArrowSize": ("float", param_draft.GetFloat("arrowsize", 20)), - "LineColor": ("color", param_view.GetUnsigned("DefaultShapeLineColor", 255)), + "ArrowType": ("index", param_draft.GetInt("dimsymbol", 0)), + "Decimals": ("int", param_draft.GetInt("dimPrecision", 2)), "DimOvershoot": ("float", param_draft.GetFloat("dimovershoot", 20)), "ExtLines": ("float", param_draft.GetFloat("extlines", 300)), "ExtOvershoot": ("float", param_draft.GetFloat("extovershoot", 20)), + "FontName": ("font", param_draft.GetString("textfont", "Sans")), + "FontSize": ("float", param_draft.GetFloat("textheight", 100)), + "LineColor": ("color", param_view.GetUnsigned("DefaultShapeLineColor", 255)), + "LineSpacing": ("float", param_draft.GetFloat("LineSpacing", 1)), + "LineWidth": ("int", param_view.GetInt("DefaultShapeLineWidth", 1)), + "ScaleMultiplier": ("float", 1), + "ShowLine": ("bool", True), + "ShowUnit": ("bool", param_draft.GetBool("showUnit", True)), + "TextColor": ("color", param_draft.GetUnsigned("DefaultTextColor", 255)), + "TextSpacing": ("float", param_draft.GetFloat("dimspacing", 20)), + "UnitOverride": ("str", param_draft.GetString("overrideUnit", "")), }