From b2930647b92271e4717e97b169bc73a5ce99116e Mon Sep 17 00:00:00 2001 From: jriegel Date: Thu, 20 Dec 2012 19:10:29 +0100 Subject: [PATCH 1/4] fix of #917 --- src/Gui/TaskView/TaskWatcher.cpp | 25 +++++++++++++++++++++++++ src/Gui/TaskView/TaskWatcher.h | 17 +++++++++++++++++ src/Mod/PartDesign/Gui/Workbench.cpp | 2 +- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/Gui/TaskView/TaskWatcher.cpp b/src/Gui/TaskView/TaskWatcher.cpp index d32809ed22..e3143ddfe9 100644 --- a/src/Gui/TaskView/TaskWatcher.cpp +++ b/src/Gui/TaskView/TaskWatcher.cpp @@ -143,5 +143,30 @@ bool TaskWatcherCommandsEmptyDoc::shouldShow() return doc && doc->countObjects() == 0; } +//************************************************************************** +//************************************************************************** +// TaskWatcherCommandsEmptySelection +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +TaskWatcherCommandsEmptySelection::TaskWatcherCommandsEmptySelection(const char* commands[], + const char* name, + const char* pixmap ) + : TaskWatcherCommands(0,commands,name,pixmap) +{ +} + +TaskWatcherCommandsEmptySelection::~TaskWatcherCommandsEmptySelection() +{ +} + +//==== implementer =========================================================================== + + +//==== calls from the TaskView =============================================================== + +bool TaskWatcherCommandsEmptySelection::shouldShow() +{ + return (App::GetApplication().getActiveDocument() && Gui::Selection().size() == 0); +} #include "moc_TaskWatcher.cpp" diff --git a/src/Gui/TaskView/TaskWatcher.h b/src/Gui/TaskView/TaskWatcher.h index c5e1cdd169..df7bdbf7f2 100644 --- a/src/Gui/TaskView/TaskWatcher.h +++ b/src/Gui/TaskView/TaskWatcher.h @@ -97,6 +97,23 @@ public: }; +// -------------------------------------------------------------------------- + +/// Special watcher class for showing commands when there is nothing selected +class GuiExport TaskWatcherCommandsEmptySelection : public TaskWatcherCommands +{ + Q_OBJECT + +public: + TaskWatcherCommandsEmptySelection(const char* commands[], const char* name, const char* pixmap); + ~TaskWatcherCommandsEmptySelection(); + +public: + /// is called wenn the document or the Selection changes. + virtual bool shouldShow(void); + +}; + } //namespace TaskView diff --git a/src/Mod/PartDesign/Gui/Workbench.cpp b/src/Mod/PartDesign/Gui/Workbench.cpp index 5a11069c16..1cdb6c3ca1 100644 --- a/src/Mod/PartDesign/Gui/Workbench.cpp +++ b/src/Mod/PartDesign/Gui/Workbench.cpp @@ -140,7 +140,7 @@ void Workbench::activated() "Part_Box", "Part_Cylinder", 0}; - Watcher.push_back(new Gui::TaskView::TaskWatcherCommandsEmptyDoc( + Watcher.push_back(new Gui::TaskView::TaskWatcherCommandsEmptySelection( Empty, "Create Geometry", "Part_Box" From 6e8828fc434e970911e6a4955c3ff1a30876c9db Mon Sep 17 00:00:00 2001 From: jriegel Date: Thu, 20 Dec 2012 19:49:17 +0100 Subject: [PATCH 2/4] setting defaults for zoom invert and zoom step for Werners fix of #894 - inverse is now default - 0.2 is zoom step default expecting lots of flaming :) --- src/Gui/CADNavigationStyle.cpp | 2 +- src/Gui/DlgSettings3DView.ui | 7 +++++-- src/Gui/NavigationStyle.cpp | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Gui/CADNavigationStyle.cpp b/src/Gui/CADNavigationStyle.cpp index b6e49d6321..f2a8e0cc8e 100644 --- a/src/Gui/CADNavigationStyle.cpp +++ b/src/Gui/CADNavigationStyle.cpp @@ -71,7 +71,7 @@ const char* CADNavigationStyle::mouseButtons(ViewerMode mode) case NavigationStyle::DRAGGING: return QT_TR_NOOP("Press left and middle mouse button"); case NavigationStyle::ZOOMING: - return QT_TR_NOOP("Scroll middle mouse button"); + return QT_TR_NOOP("Scroll middle mouse button or middle and cklicking left"); default: return "No description"; } diff --git a/src/Gui/DlgSettings3DView.ui b/src/Gui/DlgSettings3DView.ui index cd289df1ed..6c1fbaa266 100644 --- a/src/Gui/DlgSettings3DView.ui +++ b/src/Gui/DlgSettings3DView.ui @@ -176,7 +176,7 @@ 0.050000000000000 - 0.050000000000000 + 0.200000000000000 ZoomStep @@ -190,7 +190,10 @@ - + + true + + Invert zoom diff --git a/src/Gui/NavigationStyle.cpp b/src/Gui/NavigationStyle.cpp index e801e1490b..836b6f7bf1 100644 --- a/src/Gui/NavigationStyle.cpp +++ b/src/Gui/NavigationStyle.cpp @@ -226,11 +226,11 @@ void NavigationStyle::initialize() this->shiftdown = FALSE; this->altdown = FALSE; this->invertZoom = App::GetApplication().GetParameterGroupByPath - ("User parameter:BaseApp/Preferences/View")->GetBool("InvertZoom",false); + ("User parameter:BaseApp/Preferences/View")->GetBool("InvertZoom",true); this->zoomAtCursor = App::GetApplication().GetParameterGroupByPath ("User parameter:BaseApp/Preferences/View")->GetBool("ZoomAtCursor",false); this->zoomStep = App::GetApplication().GetParameterGroupByPath - ("User parameter:BaseApp/Preferences/View")->GetFloat("ZoomStep",0.05f); + ("User parameter:BaseApp/Preferences/View")->GetFloat("ZoomStep",0.2f); } void NavigationStyle::finalize() From adada37807a4a92891e469bd25f09b7a851fc3f5 Mon Sep 17 00:00:00 2001 From: jriegel Date: Thu, 20 Dec 2012 22:23:08 +0100 Subject: [PATCH 3/4] remove some loging for release --- src/Mod/Part/Gui/ViewProviderExt.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Mod/Part/Gui/ViewProviderExt.cpp b/src/Mod/Part/Gui/ViewProviderExt.cpp index 10260b9be7..7dc155b080 100644 --- a/src/Mod/Part/Gui/ViewProviderExt.cpp +++ b/src/Mod/Part/Gui/ViewProviderExt.cpp @@ -860,9 +860,10 @@ void ViewProviderPartExt::updateVisual(const TopoDS_Shape& inputShape) Base::Console().Error("Cannot compute Inventor representation for the shape of %s.\n",pcObject->getNameInDocument()); } - // printing some informations - Base::Console().Log("ViewProvider update time: %f s\n",Base::TimeInfo::diffTimeF(start_time,Base::TimeInfo())); - Base::Console().Log("Shape tria info: Faces:%d Edges:%d Nodes:%d Triangles:%d IdxVec:%d\n",nbrFaces,nbrEdges,nbrNodes,nbrTriangles,nbrLines); - +# ifdef FC_DEBUG + // printing some informations + Base::Console().Log("ViewProvider update time: %f s\n",Base::TimeInfo::diffTimeF(start_time,Base::TimeInfo())); + Base::Console().Log("Shape tria info: Faces:%d Edges:%d Nodes:%d Triangles:%d IdxVec:%d\n",nbrFaces,nbrEdges,nbrNodes,nbrTriangles,nbrLines); +# endif VisualTouched = false; } From a0c573ce93484fc0e466d698f1d73a7ffb1b8c50 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 20 Dec 2012 23:25:15 +0100 Subject: [PATCH 4/4] Fox typo --- src/Gui/CADNavigationStyle.cpp | 2 +- src/Gui/DlgSettingsViewColor.ui | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Gui/CADNavigationStyle.cpp b/src/Gui/CADNavigationStyle.cpp index f2a8e0cc8e..b7aae8f488 100644 --- a/src/Gui/CADNavigationStyle.cpp +++ b/src/Gui/CADNavigationStyle.cpp @@ -71,7 +71,7 @@ const char* CADNavigationStyle::mouseButtons(ViewerMode mode) case NavigationStyle::DRAGGING: return QT_TR_NOOP("Press left and middle mouse button"); case NavigationStyle::ZOOMING: - return QT_TR_NOOP("Scroll middle mouse button or middle and cklicking left"); + return QT_TR_NOOP("Scroll middle mouse button or middle and left click"); default: return "No description"; } diff --git a/src/Gui/DlgSettingsViewColor.ui b/src/Gui/DlgSettingsViewColor.ui index bcd5cd44f8..6acaaeaf98 100644 --- a/src/Gui/DlgSettingsViewColor.ui +++ b/src/Gui/DlgSettingsViewColor.ui @@ -7,7 +7,7 @@ 0 0 601 - 445 + 565 @@ -652,17 +652,20 @@ checkBoxSelection HighlightColor SelectionColor + DefaultShapeColor + DefaultShapeLineWidth + DefaultShapeLineColor CursorTextColor EditedEdgeColor EditedVertexColor ConstructionColor FullyConstrainedColor radioButtonSimple - radioButtonGradient - checkMidColor SelectionColor_Background + radioButtonGradient backgroundColorFrom backgroundColorTo + checkMidColor backgroundColorMid