From 97264b534c024ee289be0ac4cb28cd8b1c86d1f5 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Fri, 9 Apr 2021 12:52:15 -0600 Subject: [PATCH] Improve default window size Okular's current default window size is very small, due to a bug which will be fixed by https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/53. Once that is fixed, its default window size will become huge due to the current sizeHint value, which basically says "take up 75% of the screen space". This may be somewhat excessive. This commit reduces the sizeHint to a saner default size while still being big enough to show all toolbar buttons. --- shell/shell.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shell/shell.cpp b/shell/shell.cpp index ba7ea6e9c..bd8bc8359 100644 --- a/shell/shell.cpp +++ b/shell/shell.cpp @@ -599,7 +599,11 @@ void Shell::slotShowMenubar() QSize Shell::sizeHint() const { - return QApplication::primaryScreen()->availableSize() * 0.75; + const QSize baseSize = QApplication::primaryScreen()->availableSize() * 0.6; + // Set an arbitrary yet sensible sane minimum size for very small screens; + // for example we don't want people using 1366x768 screens to get a tiny + // default window size of 820 x 460 which will elide most of the toolbar buttons. + return baseSize.expandedTo(QSize(1000, 700)); } bool Shell::queryClose()