Added opened/closed signals to PanelWidget

This commit is contained in:
Nav
2022-07-20 19:13:16 +01:00
parent 97d7690682
commit 22b51f5129
3 changed files with 37 additions and 5 deletions

View File

@@ -168,6 +168,32 @@ namespace Bloom
&InsightWindow::refresh &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 // Panel button connections
QObject::connect( QObject::connect(
this->targetRegistersButton, this->targetRegistersButton,
@@ -946,7 +972,6 @@ namespace Bloom
void InsightWindow::onRegistersPaneStateChanged() { void InsightWindow::onRegistersPaneStateChanged() {
this->targetRegistersButton->setChecked(this->targetRegistersSidePane->activated); this->targetRegistersButton->setChecked(this->targetRegistersSidePane->activated);
this->adjustMinimumSize();
} }
void InsightWindow::onRamInspectionPaneStateChanged() { void InsightWindow::onRamInspectionPaneStateChanged() {
@@ -962,8 +987,6 @@ namespace Bloom
// Both panes cannot be attached and activated at the same time. // Both panes cannot be attached and activated at the same time.
this->eepromInspectionPane->deactivate(); this->eepromInspectionPane->deactivate();
} }
this->adjustMinimumSize();
} }
void InsightWindow::onEepromInspectionPaneStateChanged() { void InsightWindow::onEepromInspectionPaneStateChanged() {
@@ -979,8 +1002,6 @@ namespace Bloom
// Both panes cannot be attached and activated at the same time. // Both panes cannot be attached and activated at the same time.
this->ramInspectionPane->deactivate(); this->ramInspectionPane->deactivate();
} }
this->adjustMinimumSize();
} }
void InsightWindow::onProgrammingModeEnabled() { void InsightWindow::onProgrammingModeEnabled() {

View File

@@ -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); return QFrame::event(event);
} }

View File

@@ -73,6 +73,10 @@ namespace Bloom::Widgets
*/ */
void updateVisibility(); void updateVisibility();
signals:
void closed();
void opened();
protected: protected:
int handleSize = 10; int handleSize = 10;
int minimumResize = 10; int minimumResize = 10;