1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-05-14 13:22:16 -04:00

Update naming convention.

This commit is contained in:
Jon Beniston 2026-04-20 09:35:04 +01:00
parent 1d4a936f86
commit afde6d50b4
2 changed files with 23 additions and 23 deletions

View File

@ -170,7 +170,7 @@ FreqDisplayGUI::FreqDisplayGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet,
FeatureGUI(parent),
ui(new Ui::FreqDisplayGUI),
m_freqDisplay(reinterpret_cast<FreqDisplay*>(feature)),
m_availableChannelOrFeatureHandler(QStringList(), rxTxChannelKinds),
m_availableChannelOrFeatureHandler(QStringList(), m_rxTxChannelKinds),
m_doApplySettings(true),
m_overlay(nullptr)
{
@ -212,7 +212,7 @@ FreqDisplayGUI::FreqDisplayGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet,
connect(ui->dropShadow, &ButtonSwitch::toggled, this, &FreqDisplayGUI::on_dropShadow_toggled);
connect(ui->dropShadowColor, &QPushButton::clicked, this, &FreqDisplayGUI::on_dropShadowColor_clicked);
connect(&m_pollTimer, &QTimer::timeout, this, &FreqDisplayGUI::pollSelectedChannel);
m_pollTimer.start(pollIntervalMs);
m_pollTimer.start(m_pollIntervalMs);
#ifndef QT_TEXTTOSPEECH_FOUND
ui->speech->setVisible(false);
@ -524,7 +524,7 @@ void FreqDisplayGUI::updateFrequencyFont()
// Probe at a large reference size to get accurate text dimensions, then
// scale linearly to find the largest point size that fits in both directions.
font.setPointSize(fontProbePointSize);
font.setPointSize(m_fontProbePointSize);
const QFontMetrics fm(font);
// For multi-line text (Both mode) find the widest line; divide available
@ -543,17 +543,17 @@ void FreqDisplayGUI::updateFrequencyFont()
maxLineWidth += 5; // Add some space for a border
const int maxFromWidth = fontProbePointSize * availableWidth / maxLineWidth;
const int maxFromHeight = fontProbePointSize * availableHeight / (lineHeight * numLines);
int pointSize = qMax(minimumFrequencyFontPointSize, qMin(maxFromWidth, maxFromHeight));
const int maxFromWidth = m_fontProbePointSize * availableWidth / maxLineWidth;
const int maxFromHeight = m_fontProbePointSize * availableHeight / (lineHeight * numLines);
int pointSize = qMax(m_minimumFrequencyFontPointSize, qMin(maxFromWidth, maxFromHeight));
font.setPointSize(pointSize);
// Verify the text actually fits at the calculated point size. The linear
// interpolation from fontProbePointSize can be slightly inaccurate due to
// interpolation from m_fontProbePointSize can be slightly inaccurate due to
// font hinting or non-linear glyph metrics at the target size; if the text
// would overflow either horizontally or vertically, reduce by one point at a
// time until it fits.
while (pointSize > minimumFrequencyFontPointSize)
while (pointSize > m_minimumFrequencyFontPointSize)
{
const QFontMetrics verifyFm(font);
bool overflow = false;
@ -679,8 +679,8 @@ void FreqDisplayGUI::applyDropShadow()
{
auto* effect = new QGraphicsDropShadowEffect(target);
effect->setColor(m_settings.m_dropShadowColor);
effect->setBlurRadius(dropShadowBlurRadius);
effect->setOffset(dropShadowOffsetX, dropShadowOffsetY);
effect->setBlurRadius(m_dropShadowBlurRadius);
effect->setOffset(m_dropShadowOffsetX, m_dropShadowOffsetY);
target->setGraphicsEffect(effect);
}
else
@ -815,15 +815,15 @@ QString FreqDisplayGUI::formatFrequency(qint64 frequencyHz) const
switch (m_settings.m_frequencyUnits)
{
case FreqDisplaySettings::kHz: {
const QString s = locale.toString(frequencyHz / kHzDivisor, 'f', dp);
const QString s = locale.toString(frequencyHz / m_kHzDivisor, 'f', dp);
return showUnits ? s + tr(" kHz") : s;
}
case FreqDisplaySettings::MHz: {
const QString s = locale.toString(frequencyHz / MHzDivisor, 'f', dp);
const QString s = locale.toString(frequencyHz / m_MHzDivisor, 'f', dp);
return showUnits ? s + tr(" MHz") : s;
}
case FreqDisplaySettings::GHz: {
const QString s = locale.toString(frequencyHz / GHzDivisor, 'f', dp);
const QString s = locale.toString(frequencyHz / m_GHzDivisor, 'f', dp);
return showUnits ? s + tr(" GHz") : s;
}
case FreqDisplaySettings::Hz:

View File

@ -126,18 +126,18 @@ private:
static QString textForSpeech(const QString& displayText);
#endif
static constexpr const char* rxTxChannelKinds = "RT";
static constexpr int pollIntervalMs = 1000;
static constexpr int minimumFrequencyFontPointSize = 10;
static constexpr const char* m_rxTxChannelKinds = "RT";
static constexpr int m_pollIntervalMs = 1000;
static constexpr int m_minimumFrequencyFontPointSize = 10;
/// Reference point size used when probing text metrics in updateFrequencyFont().
/// Large enough that integer rounding in QFontMetrics is negligible.
static constexpr int fontProbePointSize = 200;
static constexpr double kHzDivisor = 1e3;
static constexpr double MHzDivisor = 1e6;
static constexpr double GHzDivisor = 1e9;
static constexpr double dropShadowBlurRadius = 10.0;
static constexpr double dropShadowOffsetX = 2.0;
static constexpr double dropShadowOffsetY = 2.0;
static constexpr int m_fontProbePointSize = 200;
static constexpr double m_kHzDivisor = 1e3;
static constexpr double m_MHzDivisor = 1e6;
static constexpr double m_GHzDivisor = 1e9;
static constexpr double m_dropShadowBlurRadius = 10.0;
static constexpr double m_dropShadowOffsetX = 2.0;
static constexpr double m_dropShadowOffsetY = 2.0;
explicit FreqDisplayGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature, QWidget* parent = nullptr);
~FreqDisplayGUI() override;