Skip to content

Commit c98987d

Browse files
committed
src/qt/rpcconsole.cpp:mempooltxtables:stretch behaviour
1 parent 4119e5c commit c98987d

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/qt/rpcconsole.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,29 @@ void RPCConsole::onNumBlocksChanged(int count, const QDateTime& blockDate, doubl
984984

985985
// Hide mempool stats if in IBD mode
986986
if (clientModel) {
987-
ui->mempool_graph->setVisible(!clientModel->inInitialBlockDownload());
987+
bool in_ibd = clientModel->inInitialBlockDownload();
988+
ui->mempool_graph->setVisible(!in_ibd);
989+
990+
qDebug() << "Mempool graph parent:" << ui->mempool_graph->parentWidget()->metaObject()->className();
991+
if (ui->mempool_graph->parentWidget()->layout()) {
992+
qDebug() << "Mempool graph parent layout:" << ui->mempool_graph->parentWidget()->layout()->metaObject()->className();
993+
}
994+
995+
// Adjust layout based on visibility
996+
if (ui->mempool_graph->parentWidget()->layout()) {
997+
QLayout* parentLayout = ui->mempool_graph->parentWidget()->layout();
998+
if (QHBoxLayout* hLayout = qobject_cast<QHBoxLayout*>(parentLayout)) {
999+
if (in_ibd) {
1000+
// Mempool graph is hidden, make mempool_detail fill the space
1001+
hLayout->setStretchFactor(ui->mempool_graph, 0);
1002+
hLayout->setStretchFactor(ui->mempool_detail, 1);
1003+
} else {
1004+
// Mempool graph is visible, restore original stretch factors (e.g., equal)
1005+
hLayout->setStretchFactor(ui->mempool_graph, 1);
1006+
hLayout->setStretchFactor(ui->mempool_detail, 1);
1007+
}
1008+
}
1009+
}
9881010
}
9891011
}
9901012

0 commit comments

Comments
 (0)