diff --git a/src/Gui/DlgSettingsUnits.ui b/src/Gui/DlgSettingsUnits.ui
index 4d74ec8bf2..62183c6ae8 100644
--- a/src/Gui/DlgSettingsUnits.ui
+++ b/src/Gui/DlgSettingsUnits.ui
@@ -20,6 +20,40 @@
Units settings
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 79
+
+
+
+
+ -
+
+
-
+
+
+ Number of decimals:
+
+
+
+ -
+
+
+ 1
+
+
+ 12
+
+
+
+
+
-
-
@@ -70,28 +104,7 @@
- -
-
-
-
-
-
- Number of decimals:
-
-
-
- -
-
-
- 1
-
-
- 12
-
-
-
-
-
- -
+
-
@@ -114,18 +127,58 @@
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 79
-
-
-
+
-
+
+
-
+
+
+ Minimum fractional inch:
+
+
+
+ -
+
+
+ <html><head/><body><p>Minimum fractional inch to display.</p></body></html>
+
+
-
+
+ 1/2"
+
+
+ -
+
+ 1/4"
+
+
+ -
+
+ 1/8"
+
+
+ -
+
+ 1/16"
+
+
+ -
+
+ 1/32"
+
+
+ -
+
+ 1/64"
+
+
+ -
+
+ 1/128"
+
+
+
+
+
diff --git a/src/Gui/DlgSettingsUnitsImp.cpp b/src/Gui/DlgSettingsUnitsImp.cpp
index 5022bfb5f5..7b735f7886 100644
--- a/src/Gui/DlgSettingsUnitsImp.cpp
+++ b/src/Gui/DlgSettingsUnitsImp.cpp
@@ -80,7 +80,16 @@ void DlgSettingsUnitsImp::saveSettings()
("User parameter:BaseApp/Preferences/Units");
hGrp->SetInt("UserSchema", ui->comboBox_ViewSystem->currentIndex());
hGrp->SetInt("Decimals", ui->spinBoxDecimals->value());
+ hGrp->SetInt("FracInchIndex", ui->comboBox_FracInch->currentIndex());
+
+ // Set actual value
Base::UnitsApi::setDecimals(ui->spinBoxDecimals->value());
+
+ // Convert the combobox index to the its integer denominator. Currently
+ // with 1/2, 1/4, through 1/128, this little equation directly computes the
+ // denominator given the combobox integer.
+ int minFracInch = std::pow(2, ui->comboBox_FracInch->currentIndex() + 1);
+ hGrp->SetInt("minFracInch", minFracInch);
}
void DlgSettingsUnitsImp::loadSettings()
@@ -89,6 +98,7 @@ void DlgSettingsUnitsImp::loadSettings()
("User parameter:BaseApp/Preferences/Units");
ui->comboBox_ViewSystem->setCurrentIndex(hGrp->GetInt("UserSchema",0));
ui->spinBoxDecimals->setValue(hGrp->GetInt("Decimals",Base::UnitsApi::getDecimals()));
+ ui->comboBox_FracInch->setCurrentIndex(hGrp->GetInt("FracInchIndex",2)); // 2==1/8"
}
/**