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

Method SpectrumOverlayMenu

src/gui/SpectrumOverlayMenu.cpp:253–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251constexpr int kBandIdx2m = 17;
252
253SpectrumOverlayMenu::SpectrumOverlayMenu(QWidget* parent)
254 : QWidget(parent)
255{
256 setAttribute(Qt::WA_TransparentForMouseEvents, false);
257 setAttribute(Qt::WA_NoSystemBackground, true);
258 setAutoFillBackground(false);
259
260 // Toggle button (arrow)
261 m_toggleBtn = new QPushButton(this);
262 m_toggleBtn->setFixedSize(BTN_W, BTN_H);
263 AetherSDR::ThemeManager::instance().applyStyleSheet(m_toggleBtn, "QPushButton { background: rgba(20, 30, 45, 240); "
264 "border: 1px solid rgba(255, 255, 255, 40); border-radius: 2px; "
265 "color: {{color.text.primary}}; font-size: 13px; font-weight: bold; }"
266 "QPushButton:hover { background: rgba(0, 112, 192, 180); "
267 "border: 1px solid {{color.accent.dim}}; }");
268 connect(m_toggleBtn, &QPushButton::clicked, this, &SpectrumOverlayMenu::toggle);
269
270 // Menu buttons — Band, ANT, DSP handled specially (sub-panels)
271 struct BtnDef { QString text; int specialIdx; void (SpectrumOverlayMenu::*sig)(); };
272 const BtnDef defs[] = {
273 {"+RX", -1, nullptr}, // 0 — handled separately (signal has panId arg)
274 {"+TNF", -1, &SpectrumOverlayMenu::addTnfClicked}, // 1
275 {"Band", 0, nullptr}, // 2 — toggleBandPanel
276 {"ANT", 1, nullptr}, // 3 — toggleAntPanel
277 {"Display", 4, nullptr}, // 4 — toggleDisplayPanel
278 {"Memory", 5, nullptr}, // 6 — toggleMemoryPanel
279 // MEM+ moved into MemoryBrowsePanel (bottom button — doesn't scroll).
280 {"DAX", 3, nullptr}, // 6 — toggleDaxPanel
281 };
282
283 for (const auto& def : defs) {
284 auto* btn = makeMenuBtn(def.text, this);
285 if (def.specialIdx == 0)
286 connect(btn, &QPushButton::clicked, this, &SpectrumOverlayMenu::toggleBandPanel);
287 else if (def.specialIdx == 1)
288 connect(btn, &QPushButton::clicked, this, &SpectrumOverlayMenu::toggleAntPanel);
289 else if (def.specialIdx == 3)
290 connect(btn, &QPushButton::clicked, this, &SpectrumOverlayMenu::toggleDaxPanel);
291 else if (def.specialIdx == 4)
292 connect(btn, &QPushButton::clicked, this, &SpectrumOverlayMenu::toggleDisplayPanel);
293 else if (def.specialIdx == 5)
294 connect(btn, &QPushButton::clicked, this, &SpectrumOverlayMenu::toggleMemoryPanel);
295 else if (def.text == "+RX")
296 connect(btn, &QPushButton::clicked, this, [this]() { emit addRxClicked(m_panId); });
297 else if (def.sig)
298 connect(btn, &QPushButton::clicked, this, def.sig);
299 m_menuBtns.append(btn);
300 }
301
302 // Menu button tooltips
303 if (m_menuBtns.size() >= 7) {
304 m_menuBtns[kBtnAddRx]->setToolTip("Add a new receive slice on this panadapter.");
305 m_menuBtns[kBtnAddTnf]->setToolTip("Add a tracking notch filter at the current frequency.");
306 m_menuBtns[kBtnBand]->setToolTip("Open band selector.");
307 m_menuBtns[kBtnAnt]->setToolTip("Open antenna and RF gain controls.");
308 m_menuBtns[kBtnDisplay]->setToolTip("Open panadapter and waterfall display settings.");
309 m_menuBtns[kBtnMemoryBrowse]->setToolTip("Browse saved memories for quick recall.");
310 m_menuBtns[kBtnDax]->setToolTip("Open DAX audio routing channel selector.");

Callers

nothing calls this directly

Calls 4

makeMenuBtnFunction · 0.85
applyStyleSheetMethod · 0.80
declareWidgetTokensMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected