From 1ef62a1de82af3a89d5441d0e4e41130644787f8 Mon Sep 17 00:00:00 2001 From: wandererfan Date: Tue, 19 Nov 2024 17:52:34 -0500 Subject: [PATCH] [TD]add preference for auto workbench switch --- src/Mod/TechDraw/App/Preferences.cpp | 5 + src/Mod/TechDraw/App/Preferences.h | 2 + .../TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui | 469 +++++++++--------- .../Gui/DlgPrefsTechDrawAdvancedImp.cpp | 4 + 4 files changed, 255 insertions(+), 225 deletions(-) diff --git a/src/Mod/TechDraw/App/Preferences.cpp b/src/Mod/TechDraw/App/Preferences.cpp index 56cf903583..8db68f852b 100644 --- a/src/Mod/TechDraw/App/Preferences.cpp +++ b/src/Mod/TechDraw/App/Preferences.cpp @@ -651,3 +651,8 @@ void Preferences::setBalloonDragModifiers(Qt::KeyboardModifiers newModifiers) } +//! if true, automatically switch to TD workbench when a Page is set in edit (double click) +bool Preferences::switchOnClick() +{ + return getPreferenceGroup("General")->GetBool("SwitchToWB", true); +} diff --git a/src/Mod/TechDraw/App/Preferences.h b/src/Mod/TechDraw/App/Preferences.h index 0d694bfd2c..03558f0522 100644 --- a/src/Mod/TechDraw/App/Preferences.h +++ b/src/Mod/TechDraw/App/Preferences.h @@ -150,6 +150,8 @@ public: static Qt::KeyboardModifiers balloonDragModifiers(); static void setBalloonDragModifiers(Qt::KeyboardModifiers newModifiers); + + static bool switchOnClick(); }; diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui index c5b74fc300..2594f96f31 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui @@ -28,27 +28,99 @@ - - + + + + + true + + + + Overlap Edges Scrub Passes + + + + + 0 0 - - - true - - - Perform a fuse operation on input shape(s) before Section view processing + Include edges with unexpected geometry (zero length etc.) in results - Fuse Before Section + Allow Crazy Edges - SectionFuseFirst + allowCrazyEdge + + + Mod/TechDraw/debug + + + + + + + Limit of 64x64 pixel SVG tiles used to hatch a single face. +For large scalings you might get an error about too many SVG tiles. +Then you need to increase the tile limit. + + + Qt::AlignmentFlag::AlignRight + + + 1 + + + 1000000 + + + 100 + + + 10000 + + + MaxSVGTile + + + Mod/TechDraw/Decorations + + + + + + + + 0 + 0 + + + + + 174 + 0 + + + + Selection area around center marks +Each unit is approx. 0.1 mm wide + + + + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + 5.000000000000000 + + + MarkFuzz Mod/TechDraw/General @@ -77,110 +149,29 @@ - - - - - 0 - 0 - - - - - 174 - 0 - - + + - Size of selection area around edges -Each unit is approx. 0.1 mm wide + If checked, FreeCAD will use the new face finder algorithm. If not checked, FreeCAD will use the original face finder. - - + + Use New Face Finder Algorithm - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 10.000000000000000 + + true - EdgeFuzz + NewFaceFinder Mod/TechDraw/General - - - - Edge Fuzz - - - - - - - - 0 - 0 - - - - Include edges with unexpected geometry (zero length etc.) in results - - - Allow Crazy Edges - - - allowCrazyEdge - - - Mod/TechDraw/debug - - - - - - - Maximum hatch line segments to use -when hatching a face with a PAT pattern - - - Qt::AlignRight - - - 1 - - - 1000000 - - - 100 - - - 10000 - - - MaxSeg - - - Mod/TechDraw/PAT - - - - - - - Mark Fuzz - - - - + - Qt::Horizontal + Qt::Orientation::Horizontal @@ -190,97 +181,40 @@ when hatching a face with a PAT pattern - - - - - 0 - 0 - - - - - 174 - 0 - - - - Selection area around center marks -Each unit is approx. 0.1 mm wide - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 5.000000000000000 - - - MarkFuzz - - - Mod/TechDraw/General - - - - + Max SVG Hatch Tiles - - + + - Limit of 64x64 pixel SVG tiles used to hatch a single face. -For large scalings you might get an error about too many SVG tiles. -Then you need to increase the tile limit. + Issue progress messages while building View geometry - - Qt::AlignRight - - - 1 - - - 1000000 - - - 100 - - - 10000 + + Report Progress - MaxSVGTile + ReportProgress - Mod/TechDraw/Decorations + /Mod/TechDraw/General - - - - - 0 - 0 - - - - Dump intermediate results during Detail view processing - + + - Debug Detail + Edge Fuzz - - debugDetail - - - Mod/TechDraw/debug + + + + + + Mark Fuzz @@ -309,38 +243,32 @@ Then you need to increase the tile limit. - - + + - Issue progress messages while building View geometry + Maximum hatch line segments to use +when hatching a face with a PAT pattern - - Report Progress + + Qt::AlignmentFlag::AlignRight + + + 1 + + + 1000000 + + + 100 + + + 10000 - ReportProgress + MaxSeg - /Mod/TechDraw/General - - - - - - - If checked, FreeCAD will use the new face finder algorithm. If not checked, FreeCAD will use the original face finder. - - - Use New Face Finder Algorithm - - - true - - - NewFaceFinder - - - Mod/TechDraw/General + Mod/TechDraw/PAT @@ -366,6 +294,93 @@ Then you need to increase the tile limit. + + + + + 0 + 0 + + + + + 174 + 0 + + + + Size of selection area around edges +Each unit is approx. 0.1 mm wide + + + + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + 10.000000000000000 + + + EdgeFuzz + + + Mod/TechDraw/General + + + + + + + + 0 + 0 + + + + + true + + + + Perform a fuse operation on input shape(s) before Section view processing + + + Fuse Before Section + + + SectionFuseFirst + + + Mod/TechDraw/General + + + + + + + The number of times FreeCAD should try to remove overlapping edges returned by the Hidden Line Removal algorithm. A value of 0 indicates no scrubbing, 1 indicates a single pass and 2 indicates a second pass should be performed. Values above 2 are generally not productive. Each pass adds to the time required to produce the drawing. + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + + + + + 1 + + + ScrubCount + + + Mod/TechDraw/General + + + @@ -394,44 +409,48 @@ can be a performance penalty in complex models. - - - - - true - + + + + + 0 + 0 + + + + Dump intermediate results during Detail view processing - Overlap Edges Scrub Passes + Debug Detail + + + debugDetail + + + Mod/TechDraw/debug - + Max PAT Hatch Segments - - + + - The number of times FreeCAD should try to remove overlapping edges returned by the Hidden Line Removal algorithm. A value of 0 indicates no scrubbing, 1 indicates a single pass and 2 indicates a second pass should be performed. Values above 2 are generally not productive. Each pass adds to the time required to produce the drawing. + If this box is checked, double clicking on a page in the tree will automatically switch to TechDraw and the page will be made visible. - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + Switch Workbench on Click - - - - - - - - 1 + + true - ScrubCount + SwitchToWB Mod/TechDraw/General @@ -538,7 +557,7 @@ can be a performance penalty in complex models. <html><head/><body><p><span style=" font-weight:600;">Note:</span> Items in <span style=" font-style:italic;">italics</span> are default values for new objects. They have no effect on existing objects.</p></body></html> - Qt::RichText + Qt::TextFormat::RichText true @@ -548,7 +567,7 @@ can be a performance penalty in complex models. - Qt::Vertical + Qt::Orientation::Vertical diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvancedImp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvancedImp.cpp index b686b14aca..ef987f8e8f 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvancedImp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvancedImp.cpp @@ -64,6 +64,8 @@ void DlgPrefsTechDrawAdvancedImp::saveSettings() ui->sbScrubCount->onSave(); saveBalloonOverride(); + + ui->cbSwitchWB->onSave(); } @@ -114,6 +116,8 @@ void DlgPrefsTechDrawAdvancedImp::loadSettings() ui->sbScrubCount->onRestore(); loadBalloonOverride(); + + ui->cbSwitchWB->onRestore(); } void DlgPrefsTechDrawAdvancedImp::loadBalloonOverride()