From 82f95ba2c7e3b975eb98fc84d5bc555801430b21 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 5 Nov 2024 21:44:32 +0100 Subject: [PATCH] PD: Fix default display mode of ViewProviderBoolean Make sure that by default display mode is set to 'Flat Lines' instead of 'Group' as otherwise it won't show the result object --- src/Mod/PartDesign/Gui/ViewProviderBoolean.cpp | 9 ++++++--- src/Mod/PartDesign/Gui/ViewProviderBoolean.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Mod/PartDesign/Gui/ViewProviderBoolean.cpp b/src/Mod/PartDesign/Gui/ViewProviderBoolean.cpp index b0dbb910cfee..b2fa6acbf5fe 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderBoolean.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderBoolean.cpp @@ -120,11 +120,14 @@ bool ViewProviderBoolean::onDelete(const std::vector &s) return ViewProvider::onDelete(s); } -void ViewProviderBoolean::attach(App::DocumentObject* obj) { +void ViewProviderBoolean::attach(App::DocumentObject* obj) +{ PartGui::ViewProviderPartExt::attach(obj); +} - //set default display mode to override the "Group" display mode - setDisplayMode("Flat Lines"); +const char* ViewProviderBoolean::getDefaultDisplayMode() const +{ + return "Flat Lines"; } void ViewProviderBoolean::onChanged(const App::Property* prop) { diff --git a/src/Mod/PartDesign/Gui/ViewProviderBoolean.h b/src/Mod/PartDesign/Gui/ViewProviderBoolean.h index 5cf6a7236188..1f8a114d0a71 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderBoolean.h +++ b/src/Mod/PartDesign/Gui/ViewProviderBoolean.h @@ -49,6 +49,7 @@ class PartDesignGuiExport ViewProviderBoolean : public ViewProvider, bool onDelete(const std::vector &) override; void attach(App::DocumentObject*) override; + const char* getDefaultDisplayMode() const override; void onChanged(const App::Property* prop) override; protected: