diff --git a/Plugins/SpikeDetector/PopupConfigurationWindow.cpp b/Plugins/SpikeDetector/PopupConfigurationWindow.cpp index 0a5a534f6..09f014893 100644 --- a/Plugins/SpikeDetector/PopupConfigurationWindow.cpp +++ b/Plugins/SpikeDetector/PopupConfigurationWindow.cpp @@ -1054,6 +1054,9 @@ PopupConfigurationWindow::PopupConfigurationWindow (SpikeDetectorEditor* editor_ addAndMakeVisible (viewport.get()); update (spikeChannels); + + auto stream = editor->getProcessor()->getDataStream (editor->getCurrentStream()); + popupTitle = String(stream->getSourceNodeId()) + " " + stream->getSourceNodeName() + " - " + stream->getName(); } void PopupConfigurationWindow::scrollBarMoved (ScrollBar* scrollBar, double newRangeStart) @@ -1088,8 +1091,8 @@ void PopupConfigurationWindow::update (Array spikeChannels) viewport->getVerticalScrollBar().setVisible (false); } - setSize (540 + scrollBarWidth, (numRowsVisible + 1) * 30 + 10 + 40); - viewport->setBounds (5, 5, 530 + scrollBarWidth, (numRowsVisible + 1) * 30); + setSize (540 + scrollBarWidth, (numRowsVisible + 1) * 30 + 70); + viewport->setBounds (5, 25, 530 + scrollBarWidth, (numRowsVisible + 1) * 30); electrodeTable->setBounds (0, 0, 530 + scrollBarWidth, (spikeChannels.size() + 1) * 30); viewport->setViewPosition (0, scrollDistance); @@ -1104,8 +1107,8 @@ void PopupConfigurationWindow::update (Array spikeChannels) { tableModel->update (spikeChannels); electrodeTable->setVisible (false); - setSize (530, 45); - spikeChannelGenerator->setBounds (60, 8, 420, 30); + setSize (440, 65); + spikeChannelGenerator->setBounds (10, 28, 420, 30); } } @@ -1115,6 +1118,13 @@ void PopupConfigurationWindow::updatePopup() update (spikeDetector->getSpikeChannelsForStream (editor->getCurrentStream())); } +void PopupConfigurationWindow::paint (Graphics& g) +{ + g.setColour (findColour (ThemeColours::controlPanelText)); + g.setFont (FontOptions ("Inter", "Regular", 15.0f)); + g.drawFittedText (popupTitle, 10, 0, getWidth() - 20, 20, Justification::centredLeft, 1); +} + bool PopupConfigurationWindow::keyPressed (const KeyPress& key) { // Popup component handles globally reserved undo/redo keys diff --git a/Plugins/SpikeDetector/PopupConfigurationWindow.h b/Plugins/SpikeDetector/PopupConfigurationWindow.h index 04a47fe2b..7086632e1 100644 --- a/Plugins/SpikeDetector/PopupConfigurationWindow.h +++ b/Plugins/SpikeDetector/PopupConfigurationWindow.h @@ -456,6 +456,8 @@ class PopupConfigurationWindow : public PopupComponent, /** Callback to update the popup */ void updatePopup() override; + void paint (Graphics& g) override; + /** Custom table header component (not currently used)*/ //std::unique_ptr tableHeader; @@ -475,6 +477,8 @@ class PopupConfigurationWindow : public PopupComponent, std::unique_ptr viewport; + String popupTitle; + int scrollDistance = 0; bool updating = false;