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

Method DvkPanel

src/gui/DvkPanel.cpp:37–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35 "QPushButton:checked { background: #00b4d8; color: #000; }";
36
37DvkPanel::DvkPanel(DvkModel* model, QWidget* parent)
38 : QWidget(parent), m_model(model)
39{
40 theme::setContainer(this, QStringLiteral("panel/dvk"));
41 auto* outerVbox = new QVBoxLayout(this);
42 outerVbox->setContentsMargins(4, 4, 4, 4);
43 outerVbox->setSpacing(4);
44
45 // Title
46 auto* title = new QLabel("Digital Voice Keyer");
47 AetherSDR::ThemeManager::instance().applyStyleSheet(title, "QLabel { color: {{color.accent}}; font-weight: bold; font-size: 12px; }");
48 outerVbox->addWidget(title);
49
50 // Grid of slots — each row gets equal stretch
51 auto* grid = new QGridLayout;
52 grid->setContentsMargins(0, 0, 0, 0);
53 grid->setSpacing(2);
54
55 for (int i = 0; i < 12; ++i) {
56 int id = i + 1;
57 grid->setRowStretch(i, 1);
58
59 // Inset container per row: VBox with content row + progress bar
60 auto* rowFrame = new QFrame;
61 AetherSDR::ThemeManager::instance().applyStyleSheet(rowFrame, "QFrame { background: #0f1520; border: 1px solid {{color.background.1}}; border-radius: 3px; }");
62 rowFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
63 auto* rowVbox = new QVBoxLayout(rowFrame);
64 rowVbox->setContentsMargins(3, 2, 3, 1);
65 rowVbox->setSpacing(0);
66
67 auto* rowLayout = new QHBoxLayout;
68 rowLayout->setContentsMargins(0, 0, 0, 0);
69 rowLayout->setSpacing(4);
70
71 auto* fkeyBtn = new QPushButton(QString("F%1").arg(id));
72 fkeyBtn->setStyleSheet(kFKeyStyle);
73 fkeyBtn->setFixedWidth(34);
74 fkeyBtn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
75 fkeyBtn->setToolTip(QString("Play recording %1 on-air (F%1)").arg(id));
76 rowLayout->addWidget(fkeyBtn);
77
78 auto* nameLabel = new QLabel(QString("Recording %1").arg(id));
79 nameLabel->setStyleSheet("QLabel { color: #505060; font-size: 10px; }");
80 rowLayout->addWidget(nameLabel, 1);
81
82 auto* durLabel = new QLabel("Empty");
83 durLabel->setStyleSheet(kDurStyle);
84 durLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
85 durLabel->setFixedWidth(40);
86 rowLayout->addWidget(durLabel);
87
88 rowVbox->addLayout(rowLayout, 1);
89
90 auto* progressBar = new QProgressBar;
91 progressBar->setFixedHeight(3);
92 progressBar->setTextVisible(false);
93 progressBar->setRange(0, 100);
94 progressBar->setValue(0);

Callers

nothing calls this directly

Calls 13

setContainerFunction · 0.85
applyStyleSheetMethod · 0.80
activeIdMethod · 0.80
playbackStopMethod · 0.80
playbackStartMethod · 0.80
recStartMethod · 0.80
recStopMethod · 0.80
previewStopMethod · 0.80
previewStartMethod · 0.80
setRangeMethod · 0.45
setValueMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected