Gui: move pre/-selection prefs to General/Selection + clarify behavior

This commit is contained in:
0penBrain
2023-06-24 19:34:39 +02:00
committed by Chris Hennes
parent 5a7824b646
commit 601c1f9437
4 changed files with 163 additions and 206 deletions

View File

@@ -45,6 +45,10 @@ DlgSettingsSelection::~DlgSettingsSelection()
void DlgSettingsSelection::saveSettings()
{
ui->checkBoxPreselection->onSave();
ui->checkBoxSelection->onSave();
ui->HighlightColor->onSave();
ui->SelectionColor->onSave();
ui->spinPickRadius->onSave();
auto handle = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/TreeView");
handle->SetBool("SyncView", ui->checkBoxAutoSwitch->isChecked());
@@ -56,6 +60,10 @@ void DlgSettingsSelection::saveSettings()
void DlgSettingsSelection::loadSettings()
{
ui->checkBoxPreselection->onRestore();
ui->checkBoxSelection->onRestore();
ui->HighlightColor->onRestore();
ui->SelectionColor->onRestore();
ui->spinPickRadius->onRestore();
auto handle = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/TreeView");
ui->checkBoxAutoSwitch->setChecked(handle->GetBool("SyncView", true));

View File

@@ -13,15 +13,131 @@
<property name="windowTitle">
<string>Selection</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<layout class="QGridLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="spinPickRadiusLabel">
<widget class="Gui::PrefCheckBox" name="checkBoxPreselection">
<property name="minimumSize">
<size>
<width>240</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Enable preselection, highlighted with specified color</string>
</property>
<property name="text">
<string>Pick radius (px):</string>
<string>Enable preselection</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>EnablePreselection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::PrefColorButton" name="HighlightColor">
<property name="text">
<string/>
</property>
<property name="color">
<color>
<red>225</red>
<green>225</green>
<blue>20</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>HighlightColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxSelection">
<property name="toolTip">
<string>Enable selection, highlighted with specified color</string>
</property>
<property name="text">
<string>Enable selection</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>EnableSelection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefColorButton" name="SelectionColor">
<property name="text">
<string/>
</property>
<property name="color">
<color>
<red>28</red>
<green>173</green>
<blue>28</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>SelectionColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_1">
<item>
<widget class="QLabel" name="spinPickRadiusLabel">
<property name="text">
<string>Pick radius (px):</string>
</property>
</widget>
</item>
<item>
<spacer name="horizSpacer_1">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>250</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="2" column="1">
<widget class="Gui::PrefDoubleSpinBox" name="spinPickRadius">
<property name="minimumSize">
<size>
@@ -57,42 +173,42 @@ Larger value eases to pick things, but can make small features impossible to sel
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxAutoSwitch">
<property name="text">
<string>Auto switch to the 3D view containing the selected item</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxAutoExpand">
<property name="text">
<string>Auto expand tree item when the corresponding object is selected in 3D view</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxPreselect">
<property name="text">
<string>Preselect the object in 3D view when mouse over the tree item</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxRecord">
<property name="text">
<string>Record selection in tree view in order to go back/forward using navigation button</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<item row="7" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxSelectionCheckBoxes">
<property name="text">
<string>Add checkboxes for selection in document tree</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<item row="8" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -113,7 +229,35 @@ Larger value eases to pick things, but can make small features impossible to sel
<extends>QDoubleSpinBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::ColorButton</class>
<extends>QPushButton</extends>
<header>Gui/Widgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefColorButton</class>
<extends>Gui::ColorButton</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefCheckBox</class>
<extends>QCheckBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
<connections>
<connection>
<sender>checkBoxPreselection</sender>
<signal>toggled(bool)</signal>
<receiver>HighlightColor</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>checkBoxSelection</sender>
<signal>toggled(bool)</signal>
<receiver>SelectionColor</receiver>
<slot>setEnabled(bool)</slot>
</connection>
</connections>
</ui>

View File

@@ -42,8 +42,6 @@ DlgSettingsViewColor::DlgSettingsViewColor(QWidget* parent)
, ui(new Ui_DlgSettingsViewColor)
{
ui->setupUi(this);
ui->HighlightColor->setEnabled(ui->checkBoxPreselection->isChecked());
ui->SelectionColor->setEnabled(ui->checkBoxSelection->isChecked());
connect(ui->SwitchGradientColors, &QPushButton::pressed, this,
&DlgSettingsViewColor::onSwitchGradientColorsPressed);
@@ -78,10 +76,6 @@ void DlgSettingsViewColor::saveSettings()
ui->radioButtonGradient->onSave();
ui->rbRadialGradient->onSave();
ui->checkMidColor->onSave();
ui->checkBoxPreselection->onSave();
ui->checkBoxSelection->onSave();
ui->HighlightColor->onSave();
ui->SelectionColor->onSave();
ui->TreeEditColor->onSave();
ui->TreeActiveColor->onSave();
}
@@ -96,10 +90,6 @@ void DlgSettingsViewColor::loadSettings()
ui->radioButtonGradient->onRestore();
ui->rbRadialGradient->onRestore();
ui->checkMidColor->onRestore();
ui->checkBoxPreselection->onRestore();
ui->checkBoxSelection->onRestore();
ui->HighlightColor->onRestore();
ui->SelectionColor->onRestore();
ui->TreeEditColor->onRestore();
ui->TreeActiveColor->onRestore();

View File

@@ -14,158 +14,6 @@
<string>Colors</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBoxSelection">
<property name="title">
<string>Selection</string>
</property>
<layout class="QGridLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout" name="_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxPreselection">
<property name="minimumSize">
<size>
<width>240</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Enable preselection and highlight by specified color</string>
</property>
<property name="text">
<string>Enable preselection highlighting</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>EnablePreselection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::PrefColorButton" name="HighlightColor">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="color">
<color>
<red>225</red>
<green>225</green>
<blue>20</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>HighlightColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="checkBoxSelection">
<property name="toolTip">
<string>Enable selection highlighting and use specified color</string>
</property>
<property name="text">
<string>Enable selection highlighting</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>EnableSelection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefColorButton" name="SelectionColor">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string/>
</property>
<property name="color">
<color>
<red>28</red>
<green>173</green>
<blue>28</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>SelectionColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<spacer name="spacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>183</width>
<height>23</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxColor">
<property name="toolTip">
@@ -607,38 +455,5 @@
<tabstop>backgroundColorMid</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>checkBoxPreselection</sender>
<signal>toggled(bool)</signal>
<receiver>HighlightColor</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>70</x>
<y>45</y>
</hint>
<hint type="destinationlabel">
<x>310</x>
<y>54</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkBoxSelection</sender>
<signal>toggled(bool)</signal>
<receiver>SelectionColor</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>158</x>
<y>76</y>
</hint>
<hint type="destinationlabel">
<x>291</x>
<y>75</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>