1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-15 16:03:42 -04:00

Polish freqdisplay GUI iteration and font scaling constant

Agent-Logs-Url: https://github.com/srcejon/sdrangel/sessions/3b53c052-7f2b-4597-b509-d7cc17f3b0b0

Co-authored-by: srcejon <57259258+srcejon@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-18 15:15:43 +00:00
committed by GitHub
parent 55a127da3f
commit f1388ca571
@@ -10,6 +10,10 @@
#include "freqdisplay.h"
#include "freqdisplaygui.h"
namespace {
constexpr double kFrequencyFontScale = 0.22;
}
FreqDisplayGUI* FreqDisplayGUI::create(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature)
{
return new FreqDisplayGUI(pluginAPI, featureUISet, feature);
@@ -125,17 +129,14 @@ void FreqDisplayGUI::updateChannelList()
int selectedIndex = -1;
int i = 0;
for (const auto& availableChannel : m_availableChannels)
for (int i = 0; i < m_availableChannels.size(); ++i)
{
const QString longId = availableChannel.getLongId();
const QString longId = m_availableChannels.at(i).getLongId();
ui->channels->addItem(longId);
if (longId == m_settings.m_selectedChannel) {
selectedIndex = i;
}
++i;
}
if ((selectedIndex < 0) && (m_availableChannels.size() > 0)) {
@@ -227,7 +228,7 @@ void FreqDisplayGUI::updateFrequencyText()
void FreqDisplayGUI::updateFrequencyFont()
{
const int minDimension = qMin(ui->frequencyValue->width(), ui->frequencyValue->height());
const int pointSize = qMax(10, static_cast<int>(minDimension * 0.22));
const int pointSize = qMax(10, static_cast<int>(minDimension * kFrequencyFontScale));
QFont font = ui->frequencyValue->font();
font.setPointSize(pointSize);