diff --git a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp index 429d95e0..3c149b40 100644 --- a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp @@ -168,6 +168,32 @@ namespace Bloom &InsightWindow::refresh ); + // Panel connections + QObject::connect( + this->leftPanel, + &PanelWidget::opened, + this, + &InsightWindow::adjustMinimumSize + ); + QObject::connect( + this->leftPanel, + &PanelWidget::closed, + this, + &InsightWindow::adjustMinimumSize + ); + QObject::connect( + this->bottomPanel, + &PanelWidget::opened, + this, + &InsightWindow::adjustMinimumSize + ); + QObject::connect( + this->bottomPanel, + &PanelWidget::closed, + this, + &InsightWindow::adjustMinimumSize + ); + // Panel button connections QObject::connect( this->targetRegistersButton, @@ -946,7 +972,6 @@ namespace Bloom void InsightWindow::onRegistersPaneStateChanged() { this->targetRegistersButton->setChecked(this->targetRegistersSidePane->activated); - this->adjustMinimumSize(); } void InsightWindow::onRamInspectionPaneStateChanged() { @@ -962,8 +987,6 @@ namespace Bloom // Both panes cannot be attached and activated at the same time. this->eepromInspectionPane->deactivate(); } - - this->adjustMinimumSize(); } void InsightWindow::onEepromInspectionPaneStateChanged() { @@ -979,8 +1002,6 @@ namespace Bloom // Both panes cannot be attached and activated at the same time. this->ramInspectionPane->deactivate(); } - - this->adjustMinimumSize(); } void InsightWindow::onProgrammingModeEnabled() { diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp index 5b069ee1..b8ec952e 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.cpp @@ -84,6 +84,13 @@ namespace Bloom::Widgets } } + if (event->type() == QEvent::Type::Close || event->type() == QEvent::Type::Hide) { + emit this->closed(); + + } else if (event->type() == QEvent::Type::Show) { + emit this->opened(); + } + return QFrame::event(event); } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.hpp index 8deb288f..2cde460e 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/PanelWidget.hpp @@ -73,6 +73,10 @@ namespace Bloom::Widgets */ void updateVisibility(); + signals: + void closed(); + void opened(); + protected: int handleSize = 10; int minimumResize = 10;