[TD]fix line numbering in preferences

- resolve conflict between comboBox currentIndex [0,n] and
  line numbering [1, n]
This commit is contained in:
wandererfan
2023-12-02 09:44:58 -05:00
committed by WandererFan
parent cc12843e1d
commit ac6c3786b0
2 changed files with 18 additions and 8 deletions

View File

@@ -439,24 +439,31 @@ std::string Preferences::lineElementsLocation()
return prefDir;
}
// Note: line numbering starts at 1, but the saved parameter is the position of the
// line style in the list, starting at 0. We add 1 to the stored value to get the
// correct line number.
int Preferences::SectionLineStyle()
{
return getPreferenceGroup("Decorations")->GetInt("LineStyleSection", 4);
// default is line #4 long dash dotted, which is index 3
return getPreferenceGroup("Decorations")->GetInt("LineStyleSection", 3) + 1;
}
int Preferences::CenterLineStyle()
{
return getPreferenceGroup("Decorations")->GetInt("LineStyleCenter", 10);
// default is line #5 long dash double dotted, which is index 4
return getPreferenceGroup("Decorations")->GetInt("LineStyleCenter", 4) + 1;
}
int Preferences::HighlightLineStyle()
{
return getPreferenceGroup("Decorations")->GetInt("LineStyleHighLight", 10);
// default is line #2 dashed, which is index 1
return getPreferenceGroup("Decorations")->GetInt("LineStyleHighLight", 1) + 1;
}
int Preferences::HiddenLineStyle()
{
return getPreferenceGroup("Decorations")->GetInt("LineStyleHidden", 1);
// default is line #2 dashed, which is index 1
return getPreferenceGroup("Decorations")->GetInt("LineStyleHidden", 1) + 1;
}
int Preferences::LineSpacingISO()