Gui: check dialog width after language change

This commit is contained in:
wmayer
2024-02-09 19:37:02 +01:00
committed by Chris Hennes
parent 4d6a5ee456
commit e3a5703c1f
2 changed files with 12 additions and 1 deletions

View File

@@ -759,6 +759,14 @@ void DlgPreferencesImp::showEvent(QShowEvent* ev)
move(x(), heightDifference / 2);
}
expandToMinimumDialogWidth();
}
void DlgPreferencesImp::expandToMinimumDialogWidth()
{
auto screen = windowHandle()->screen();
auto availableSize = screen->availableSize();
// if the expanded dialog occupies less than 50% of the screen
int mw = minimumDialogWidth(minimumPageWidth());
if (availableSize.width() > 2 * mw) {
@@ -878,8 +886,10 @@ void DlgPreferencesImp::changeEvent(QEvent *e)
}
}
expandToMinimumDialogWidth();
updatePageDependentWidgets();
} else {
}
else {
QWidget::changeEvent(e);
}
}

View File

@@ -185,6 +185,7 @@ private:
void addSizeHint(QWidget*);
int minimumPageWidth() const;
int minimumDialogWidth(int) const;
void expandToMinimumDialogWidth();
//@}
private: