MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / buildDisplayPanel

Method buildDisplayPanel

src/gui/SpectrumOverlayMenu.cpp:1216–1919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1214// ── Display sub-panel ─────────────────────────────────────────────────────────
1215
1216void SpectrumOverlayMenu::buildDisplayPanel()
1217{
1218 m_displayPanel = new QWidget(parentWidget());
1219 AetherSDR::ThemeManager::instance().applyStyleSheet(m_displayPanel, "QWidget { background: rgba(15, 15, 26, 220); "
1220 "border: 1px solid {{color.background.2}}; border-radius: 3px; }");
1221 m_displayPanel->hide();
1222
1223 auto* grid = new QGridLayout(m_displayPanel);
1224 grid->setContentsMargins(8, 6, 8, 6);
1225 grid->setSpacing(4);
1226 grid->setColumnStretch(1, 1);
1227
1228 auto labelStyle = QStringLiteral("QLabel { color: #8090a0; font-size: 10px; border: none; }");
1229 auto valStyle = QStringLiteral("QLabel { color: #c8d8e8; font-size: 10px; border: none;"
1230 " min-width: 24px; }");
1231 auto btnStyle = QStringLiteral(
1232 "QPushButton { background: #1a2a3a; color: #c8d8e8; border: 1px solid #205070;"
1233 " border-radius: 3px; font-size: 10px; font-weight: bold; padding: 2px 6px; }"
1234 "QPushButton:hover { background: #204060; }"
1235 "QPushButton:checked { background: #006040; color: #00ff88; border-color: #00a060; }");
1236
1237 int row = 0;
1238 // Grid columns: 0=label, 1=button (optional), 2=slider, 3=value
1239
1240 // Helper: label col 0, slider col 1-2, value col 3
1241 auto makeRow = [&](const QString& text, int lo, int hi, int def,
1242 QSlider*& slider, QLabel*& valLbl) {
1243 auto* lbl = new QLabel(text);
1244 lbl->setStyleSheet(labelStyle);
1245 grid->addWidget(lbl, row, 0);
1246
1247 slider = new GuardedSlider(Qt::Horizontal);
1248 slider->setRange(lo, hi);
1249 slider->setValue(def);
1250 applyPrimarySliderStyle(slider);
1251 grid->addWidget(slider, row, 1, 1, 2);
1252
1253 valLbl = new QLabel(QString::number(def));
1254 valLbl->setStyleSheet(valStyle);
1255 valLbl->setFixedWidth(28);
1256 valLbl->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
1257 grid->addWidget(valLbl, row, 3);
1258 ++row;
1259 };
1260
1261 // Helper: label col 0, button col 1, slider col 2, value col 3
1262 auto makeRowWithBtn = [&](const QString& text, int lo, int hi, int def,
1263 QSlider*& slider, QLabel*& valLbl,
1264 QPushButton*& btn, const QString& btnText) {
1265 auto* lbl = new QLabel(text);
1266 lbl->setStyleSheet(labelStyle);
1267 grid->addWidget(lbl, row, 0);
1268
1269 btn = new QPushButton(btnText);
1270 btn->setCheckable(true);
1271 btn->setFixedSize(36, 18);
1272 btn->setStyleSheet(btnStyle);
1273 grid->addWidget(btn, row, 1);

Callers

nothing calls this directly

Calls 15

applyPrimarySliderStyleFunction · 0.85
makeToggleFunction · 0.85
kiwiWaterfallDbTextFunction · 0.85
rateSliderLabelTextFunction · 0.85
kiwiWaterfallRateTextFunction · 0.85
applyComboStyleFunction · 0.85
wfSchemeNameFunction · 0.85
applyStyleSheetMethod · 0.80
capturedMethod · 0.80
countMethod · 0.80

Tested by

no test coverage detected