Commit c55b4f8e authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Never shrink the window when adjusting its size

This happened when switching in the Advanced Settings dialog from the
first tab to the second tab.

GnuPG-bug-id: 5969
parent f6e31bab
Pipeline #177938 passed with stage
in 2 minutes and 25 seconds
......@@ -74,10 +74,13 @@ QSize ScrollArea::sizeHint() const
void ScrollArea::adjustSizeOfWindowBy(const QSize &extent)
{
if (auto w = window()) {
const auto currentSize = w->size();
// we limit the automatic size adjustment to 2/3 of the screen's size
const auto maxWindowSize = screen()->geometry().size() * 2 / 3;
const auto newWindowSize = (w->size() + extent).boundedTo(maxWindowSize);
w->resize(newWindowSize);
const auto newWindowSize = currentSize.expandedTo((currentSize + extent).boundedTo(maxWindowSize));
if (newWindowSize != currentSize) {
w->resize(newWindowSize);
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment