+ hide(); // Only become visible when we have space info to show. @see StatusBarSpaceInfo::setShown().
+
+ m_capacityBar = new KCapacityBar(KCapacityBar::DrawTextInline, this);
+ m_textInfoButton = new QToolButton(this);
+ m_textInfoButton->setAutoRaise(true);
+ m_textInfoButton->setPopupMode(QToolButton::InstantPopup);
+ auto menu = new DiskSpaceUsageMenu{this};
+ connect(menu, &DiskSpaceUsageMenu::showMessage, this, &StatusBarSpaceInfo::showMessage);
+ connect(menu, &DiskSpaceUsageMenu::showInstallationProgress, this, &StatusBarSpaceInfo::showInstallationProgress);
+ m_textInfoButton->setMenu(menu);
+
+ auto layout = new QHBoxLayout(this);
+ // We reduce the outside margin of the flat button so it visually has the same margin as the status bar text label on the other end of the bar.
+ layout->setContentsMargins(2, -1, 0, -1); // "-1" makes it so the fixed height won't be ignored.
+ layout->addWidget(m_capacityBar);
+ layout->addWidget(m_textInfoButton);