[Gui] add UI to change the NaviCube button size

- it was frequently requested and people now even published videos since I documented this hidden feature in the Wiki.
However, for a user it is a nightmare without a UI and users who like a bright background need to change the button color to keep the buttons visible.
This commit is contained in:
Uwe
2023-02-25 08:05:25 +01:00
parent 37fcd2da26
commit 4adf98e369
6 changed files with 69 additions and 14 deletions

View File

@@ -292,6 +292,11 @@ void NaviCube::setFontSize(int size)
m_NaviCubeImplementation->m_CubeTextSize = size;
}
void NaviCube::setButtonColor(QColor ButtonColor)
{
m_NaviCubeImplementation->m_ButtonColor = ButtonColor;
}
QString NaviCube::getDefaultSansserifFont()
{
// Windows versions since 2017 have the 'Bahnschrift' font (a condensed
@@ -379,7 +384,12 @@ void NaviCubeImplementation::OnChange(ParameterGrp::SubjectType& rCaller,
m_HiliteColor.setRgba(rGrp.GetUnsigned(reason, QColor(170, 226, 255, 255).rgba()));
}
else if (strcmp(reason, "ButtonColor") == 0) {
m_ButtonColor.setRgba(rGrp.GetUnsigned(reason, QColor(226, 233, 239, 128).rgba()));
// the color is stored in the form ARRGGBB thus we cannot read in using .rgba()
unsigned long col = rGrp.GetUnsigned("ButtonColor", 3806916480);
// 3806916480 is AAA,RRR,GGG,BBB: 128,226,233,239
QColor buttonColor(
(col >> 24) & 0xff, (col >> 16) & 0xff, (col >> 8) & 0xff, col & 0xff);
m_ButtonColor = buttonColor;
}
else if (strcmp(reason, "CornerNaviCube") == 0) {
m_Corner = static_cast<NaviCube::Corner>(rGrp.GetInt(reason, 1));