[TD]fix camera/front buttons on Proj Group dialog

This commit is contained in:
wandererfan
2024-07-04 09:11:52 -04:00
committed by WandererFan
parent 05c0713418
commit efa9c46752
6 changed files with 88 additions and 24 deletions

View File

@@ -589,3 +589,7 @@ int Preferences::BreakType()
}
bool Preferences::useCameraDirection()
{
return getPreferenceGroup("General")->GetBool("UseCameraDirection", false);
}

View File

@@ -135,6 +135,8 @@ public:
static int BreakType();
static bool useExactMatchOnDims();
static bool useCameraDirection();
};

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>546</width>
<height>897</height>
<width>547</width>
<height>915</height>
</rect>
</property>
<property name="sizePolicy">
@@ -993,6 +993,52 @@ for ProjectionGroups</string>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gbViewDefaut">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>View Defaults</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="Gui::PrefCheckBox" name="cb_useCameraDirection">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>If checked, the 3d camera direction (or normal of a selected face) will be used as the view direction. If not checked, Views will be created as Front Views.</string>
</property>
<property name="text">
<string>Use 3d Camera Direction</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>UseCameraDirection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label_12">
<property name="font">
@@ -1009,19 +1055,6 @@ for ProjectionGroups</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>

View File

@@ -76,6 +76,8 @@ void DlgPrefsTechDrawGeneralImp::saveSettings()
ui->psb_GridSpacing->onSave();
ui->cbMultiSelection->onSave();
ui->cb_useCameraDirection->onSave();
}
void DlgPrefsTechDrawGeneralImp::loadSettings()
@@ -118,6 +120,8 @@ void DlgPrefsTechDrawGeneralImp::loadSettings()
bool multiSelectionDefault = PreferencesGui::multiSelection();
ui->cbMultiSelection->setChecked(multiSelectionDefault);
ui->cbMultiSelection->onRestore();
ui->cb_useCameraDirection->onRestore();
}
/**

View File

@@ -55,6 +55,7 @@
#include <Mod/TechDraw/App/DrawProjGroup.h>
#include <Mod/TechDraw/App/DrawProjGroupItem.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/Preferences.h>
#include "DrawGuiUtil.h"
#include "TaskProjGroup.h"
@@ -119,8 +120,8 @@ TaskProjGroup::TaskProjGroup(TechDraw::DrawView* featView, bool mode) :
connect(ui->butDownRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked);
connect(ui->butLeftRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked);
connect(ui->butCCWRotate, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked);
connect(ui->butFront, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked);
connect(ui->butCam, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked);
connect(ui->butFront, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked);
connect(ui->butCam, &QPushButton::clicked, this, &TaskProjGroup::rotateButtonClicked);
connect(ui->lePrimary, &QPushButton::clicked, this, &TaskProjGroup::customDirectionClicked);
@@ -155,6 +156,11 @@ TaskProjGroup::TaskProjGroup(TechDraw::DrawView* featView, bool mode) :
m_mdi = dvp->getMDIViewPage();
setUiPrimary();
if (Preferences::useCameraDirection()) {
ui->butCam->setChecked(true);
} else {
ui->butFront->setChecked(true);
}
saveGroupState();
}

View File

@@ -256,7 +256,7 @@
</property>
<property name="icon">
<iconset>
<normalon>:/icons/view-front.svg</normalon>
<normalon>:/icons/TechDraw_ProjFront.svg</normalon>
</iconset>
</property>
<property name="iconSize">
@@ -265,6 +265,15 @@
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
@@ -307,6 +316,12 @@
<height>24</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
@@ -608,7 +623,7 @@ using the given X/Y Spacing</string>
</spacer>
</item>
<item row="0" column="2">
<widget class="Gui::QuantitySpinBox" name="sbXSpacing" native="true">
<widget class="Gui::QuantitySpinBox" name="sbXSpacing">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -624,13 +639,13 @@ using the given X/Y Spacing</string>
<property name="toolTip">
<string>Horizontal space between border of projections</string>
</property>
<property name="keyboardTracking" stdset="0">
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
<property name="minimum" stdset="0">
<property name="minimum">
<double>0.000000000000000</double>
</property>
</widget>
@@ -655,7 +670,7 @@ using the given X/Y Spacing</string>
</widget>
</item>
<item row="1" column="2">
<widget class="Gui::QuantitySpinBox" name="sbYSpacing" native="true">
<widget class="Gui::QuantitySpinBox" name="sbYSpacing">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -671,13 +686,13 @@ using the given X/Y Spacing</string>
<property name="toolTip">
<string>Vertical space between border of projections</string>
</property>
<property name="keyboardTracking" stdset="0">
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
<property name="minimum" stdset="0">
<property name="minimum">
<double>0.000000000000000</double>
</property>
</widget>