[TD]fix default for KeepLabel

This commit is contained in:
wandererfan
2024-07-05 09:40:19 -04:00
committed by WandererFan
parent 335bf96188
commit 94940f950b
5 changed files with 34 additions and 1 deletions

View File

@@ -593,3 +593,9 @@ bool Preferences::useCameraDirection()
{
return getPreferenceGroup("General")->GetBool("UseCameraDirection", false);
}
bool Preferences::alwaysShowLabel()
{
return getPreferenceGroup("General")->GetBool("AlwaysShowLabel", false);
}

View File

@@ -137,6 +137,7 @@ public:
static bool useExactMatchOnDims();
static bool useCameraDirection();
static bool alwaysShowLabel();
};

View File

@@ -1034,6 +1034,27 @@ for ProjectionGroups</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="cb_alwaysShowLabel">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>If checked, view labels will be displayed even when frames are suppressed.</string>
</property>
<property name="text">
<string>Always Show Label</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>AlwaysShowLabel</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>

View File

@@ -78,6 +78,7 @@ void DlgPrefsTechDrawGeneralImp::saveSettings()
ui->cbMultiSelection->onSave();
ui->cb_useCameraDirection->onSave();
ui->cb_alwaysShowLabel->onSave();
}
void DlgPrefsTechDrawGeneralImp::loadSettings()
@@ -122,6 +123,7 @@ void DlgPrefsTechDrawGeneralImp::loadSettings()
ui->cbMultiSelection->onRestore();
ui->cb_useCameraDirection->onRestore();
ui->cb_alwaysShowLabel->onRestore();
}
/**

View File

@@ -40,6 +40,7 @@
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/Preferences.h>
#include "ViewProviderDrawingView.h"
#include "ViewProviderDrawingViewExtension.h"
@@ -49,6 +50,7 @@
#include "ViewProviderPage.h"
using namespace TechDrawGui;
using namespace TechDraw;
namespace sp = std::placeholders;
PROPERTY_SOURCE(TechDrawGui::ViewProviderDrawingView, Gui::ViewProviderDocumentObject)
@@ -62,7 +64,8 @@ ViewProviderDrawingView::ViewProviderDrawingView() :
sPixmap = "TechDraw_TreeView";
static const char *group = "Base";
ADD_PROPERTY_TYPE(KeepLabel ,(false), group, App::Prop_None, "Keep Label on Page even if toggled off");
auto showLabel = Preferences::alwaysShowLabel();
ADD_PROPERTY_TYPE(KeepLabel ,(showLabel), group, App::Prop_None, "Keep Label on Page even if toggled off");
ADD_PROPERTY_TYPE(StackOrder,(0),group,App::Prop_None,"Over or under lap relative to other views");
// Do not show in property editor why? wf WF: because DisplayMode applies only to coin and we