| 31 | } |
| 32 | |
| 33 | void PanFloatingWindow::adoptApplet(PanadapterApplet* applet) |
| 34 | { |
| 35 | if (!applet) return; |
| 36 | m_applet = applet; |
| 37 | |
| 38 | // Use the user-facing slice title (e.g. "Slice A") instead of raw hex pan ID |
| 39 | QString title = applet->sliceTitle(); |
| 40 | if (title.isEmpty()) |
| 41 | title = QString("Pan %1").arg(applet->panId()); |
| 42 | setWindowTitle(QString("AetherSDR — %1").arg(title)); |
| 43 | |
| 44 | // Reparent directly into this window — addWidget() calls setParent() |
| 45 | // internally, so the widget goes straight from the splitter to the |
| 46 | // floating window without an intermediate nullptr/top-level state. |
| 47 | // This avoids corrupting the main window's NSResponder chain on macOS. |
| 48 | m_layout->addWidget(m_applet, 1); |
| 49 | |
| 50 | // Show dock icon in the applet's title bar |
| 51 | m_applet->setFloatingState(true); |
| 52 | connect(m_applet, &PanadapterApplet::dockClicked, this, [this]() { |
| 53 | emit dockRequested(panId()); |
| 54 | }); |
| 55 | } |
| 56 | |
| 57 | QString PanFloatingWindow::panId() const |
| 58 | { |
no test coverage detected