Created attachment 164210 [details] Allow the main window to be resized smaller SUMMARY The minimum width of the main Okular window is about 505 pixels. It declines to be resized narrower than this, even when the document displayed is much smaller, for example 70 pixels when zoomed all the way out at 12%. STEPS TO REPRODUCE 1. Open a document 2. Zoom all the way out (12%) 3. Try to shrink the window OBSERVED RESULT The window never gets narrower than ~505 pixels. 85% of horizontal screen space is wasted on the gray background. EXPECTED RESULT I can make the window as narrow as I please. SOFTWARE/OS VERSIONS KDE Frameworks Version: 5.106.0 Qt Version: Version 5.15.10 (built against 5.15.10) ADDITIONAL INFORMATION The cause appears to be that the window refuses to be smaller than the minimum size of the *welcome screen*, even when the welcome screen is not visible, and even when the welcome screen was never displayed, such as when okular is invoked with a command line argument. The welcome screen is still present in the UI in a `QStackedWidget` underneath the document view. This appears to be easy to fix: Just have the `m_centralStackedWidget` report its size as the currently-visible widget, instead of taking the welcome screen into account even when it is not displayed. A patch to fix the problem is attached.
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/867
Git commit db2246f7771cfb96917bbc724dadf2c2e720c91b by Albert Astals Cid, on behalf of Scott Worley. Committed on 17/12/2023 at 22:39. Pushed by aacid into branch 'master'. Allow shrinking the main window The welcome screen's minimum size is quite large. This change allows the window to be smaller than the welcome screen when the welcome screen is not visible. Before and after screenshot:  M +16 -1 shell/shell.cpp https://invent.kde.org/graphics/okular/-/commit/db2246f7771cfb96917bbc724dadf2c2e720c91b