core: qt layout ui: ux/ui: fixes #26048 keep workbench selector visible
This commit is contained in:
@@ -440,4 +440,22 @@ void WorkbenchTabWidget::adjustSize()
|
||||
parentWidget()->adjustSize();
|
||||
}
|
||||
|
||||
void WorkbenchComboBox::setVisible(bool visible)
|
||||
{
|
||||
if (!visible && parentWidget() && parentWidget()->isVisible()) {
|
||||
// ignore attempts to hide while parent is visible
|
||||
// this works around a layout bug when toolbar grip is attached
|
||||
// in the menu bar area
|
||||
QTimer::singleShot(0, this, [this]() {
|
||||
if (auto toolbar = parentWidget()) {
|
||||
if (auto areaWidget = toolbar->parentWidget()) {
|
||||
areaWidget->adjustSize();
|
||||
}
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
QComboBox::setVisible(visible);
|
||||
}
|
||||
|
||||
#include "moc_WorkbenchSelector.cpp"
|
||||
|
||||
@@ -53,6 +53,7 @@ Q_OBJECT // NOLINT
|
||||
~WorkbenchComboBox() override = default;
|
||||
WorkbenchComboBox(WorkbenchComboBox&& rhs) = delete;
|
||||
void showPopup() override;
|
||||
void setVisible(bool visible) override;
|
||||
|
||||
WorkbenchComboBox operator=(WorkbenchComboBox&& rhs) = delete;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user