[Gui] Add ability to change axis colors

This commit is contained in:
Benjamin Bræstrup Sayoc
2024-10-03 21:28:55 +02:00
parent 836ad91f3d
commit 2acd412f10
3 changed files with 122 additions and 0 deletions

View File

@@ -14,6 +14,9 @@
</FCParamGroup>
<FCParamGroup Name="View">
<FCInt Name="AntiAliasing" Value="0"/>
<FCUInt Name="AxisXColor" Value="3425907456"/>
<FCUInt Name="AxisYColor" Value="869020416"/>
<FCUInt Name="AxisZColor" Value="859032576"/>
<FCFloat Name="BoundingBoxFontSize" Value="10.0"/>
<FCBool Name="CornerCoordSystem" Value="1"/>
<FCInt Name="CornerCoordSystemSize" Value="10"/>

View File

@@ -122,6 +122,117 @@ in the corner -- in % of height/width of viewport</string>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="xAxisLabel">
<property name="text">
<string>X-axis color</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="xAxisColor">
<property name="text">
<string/>
</property>
<property name="prefEntry" stdset="0">
<cstring>AxisXColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
<property name="color" stdset="0">
<color>
<red>204</red>
<green>51</green>
<blue>51</blue>
</color>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="yAxisLabel">
<property name="text">
<string>Y-axis color</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="yAxisColor">
<property name="text">
<string/>
</property>
<property name="prefEntry" stdset="0">
<cstring>AxisYColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
<property name="color" stdset="0">
<color>
<red>51</red>
<green>204</green>
<blue>51</blue>
</color>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="zAxisLabel">
<property name="text">
<string>Z-axis color</string>
</property>
</widget>
</item>
<item>
<widget class="Gui::PrefColorButton" name="zAxisColor">
<property name="text">
<string/>
</property>
<property name="prefEntry" stdset="0">
<cstring>AxisZColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>View</cstring>
</property>
<property name="color" stdset="0">
<color>
<red>51</red>
<green>51</green>
<blue>204</blue>
</color>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Gui::PrefCheckBox" name="CheckBox_ShowAxisCross">
<property name="toolTip">

View File

@@ -35,6 +35,7 @@
#include <Base/Tools.h>
#include <Gui/Multisample.h>
#include <Gui/View3DInventorViewer.h>
#include <Gui/ViewParams.h>
#include "DlgSettings3DViewImp.h"
#include "ui_DlgSettings3DView.h"
@@ -74,6 +75,9 @@ void DlgSettings3DViewImp::saveSettings()
ui->sliderIntensity->onSave();
ui->radioPerspective->onSave();
ui->radioOrthographic->onSave();
ui->xAxisColor->onSave();
ui->yAxisColor->onSave();
ui->zAxisColor->onSave();
}
void DlgSettings3DViewImp::loadSettings()
@@ -92,6 +96,9 @@ void DlgSettings3DViewImp::loadSettings()
ui->radioPerspective->onRestore();
ui->radioOrthographic->onRestore();
ui->comboTransparentRender->onRestore();
ui->xAxisColor->onRestore();
ui->yAxisColor->onRestore();
ui->zAxisColor->onRestore();
loadAntiAliasing();
loadRenderCache();
@@ -240,3 +247,4 @@ void DlgSettings3DViewImp::onAliasingChanged(int index)
#include "moc_DlgSettings3DViewImp.cpp"