| 981 | } // namespace |
| 982 | |
| 983 | FlexControlDialog::FlexControlDialog(QWidget* parent) |
| 984 | : PersistentDialog(QStringLiteral("AetherControl"), |
| 985 | QStringLiteral("FlexControlDialogGeometry"), |
| 986 | parent) |
| 987 | { |
| 988 | theme::setContainer(this, QStringLiteral("dialog/flexControl")); |
| 989 | setModal(false); |
| 990 | setWindowModality(Qt::NonModal); |
| 991 | setMinimumSize(430, 610); |
| 992 | |
| 993 | // applyStyleSheet (not raw setStyleSheet) so the {{color.slider.*}} + |
| 994 | // {{color.accent.success}} tokens in the slider rules resolve at apply |
| 995 | // time, AND the body widget is registered for free live re-theme when |
| 996 | // the user switches Default Dark ↔ Default Light without restarting. |
| 997 | // Other (non-slider) hardcoded colours in the template remain as-is — |
| 998 | // out of scope for the slider-sweep PR; a follow-up could tokenize |
| 999 | // the rest of the FlexControl dialog stylesheet. |
| 1000 | AetherSDR::ThemeManager::instance().applyStyleSheet( |
| 1001 | bodyWidget(), QString::fromLatin1(kFlexControlStyle)); |
| 1002 | auto* root = new QVBoxLayout(bodyWidget()); |
| 1003 | root->setSizeConstraint(QLayout::SetMinimumSize); |
| 1004 | root->setContentsMargins(14, 14, 14, 14); |
| 1005 | root->setSpacing(10); |
| 1006 | |
| 1007 | auto* header = new QFrame; |
| 1008 | header->setObjectName(QStringLiteral("StatusFrame")); |
| 1009 | header->setMinimumHeight(70); |
| 1010 | header->setMaximumHeight(70); |
| 1011 | header->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
| 1012 | auto* headerLayout = new QHBoxLayout(header); |
| 1013 | headerLayout->setContentsMargins(16, 12, 16, 12); |
| 1014 | headerLayout->setSpacing(12); |
| 1015 | |
| 1016 | auto* titleColumn = new QVBoxLayout; |
| 1017 | titleColumn->setSpacing(0); |
| 1018 | auto* title = new QLabel(QStringLiteral("AetherControl")); |
| 1019 | title->setObjectName(QStringLiteral("FlexMark")); |
| 1020 | auto* subtitle = new QLabel(QStringLiteral("Virtual Tuning Controller")); |
| 1021 | subtitle->setObjectName(QStringLiteral("SubMark")); |
| 1022 | titleColumn->addWidget(title); |
| 1023 | titleColumn->addWidget(subtitle); |
| 1024 | headerLayout->addLayout(titleColumn, 1); |
| 1025 | |
| 1026 | m_physicalButton = new QPushButton(header); |
| 1027 | m_physicalButton->setObjectName(QStringLiteral("PhysicalButton")); |
| 1028 | m_physicalButton->setMinimumWidth(96); |
| 1029 | m_physicalButton->setCursor(Qt::PointingHandCursor); |
| 1030 | connect(m_physicalButton, &QPushButton::clicked, this, [this] { |
| 1031 | if (m_physicalButton->property("connected").toBool()) |
| 1032 | emit physicalDisconnectRequested(); |
| 1033 | else |
| 1034 | emit physicalDetectRequested(); |
| 1035 | }); |
| 1036 | headerLayout->addWidget(m_physicalButton, 0, Qt::AlignVCenter); |
| 1037 | |
| 1038 | m_compactButton = new QPushButton(QStringLiteral("Compact"), header); |
| 1039 | m_compactButton->setObjectName(QStringLiteral("OptionButton")); |
| 1040 | m_compactButton->setCheckable(true); |
nothing calls this directly
no test coverage detected