Bug 478577 - Cannot make window narrower than ~500 pixels
Summary: Cannot make window narrower than ~500 pixels
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 23.04.3
Platform: NixOS Linux
: NOR minor
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-15 19:46 UTC by chkno
Modified: 2023-12-17 21:39 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Allow the main window to be resized smaller (901 bytes, patch)
2023-12-15 19:46 UTC, chkno
Details

Note You need to log in before you can comment on or make changes to this bug.
Description chkno 2023-12-15 19:46:38 UTC
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.
Comment 1 Bug Janitor Service 2023-12-15 20:10:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/867
Comment 2 Albert Astals Cid 2023-12-17 21:39:51 UTC
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:
![Before and after screenshot](/uploads/71f685c89a7324444b89e1abd0592b80/image.png)

M  +16   -1    shell/shell.cpp

https://invent.kde.org/graphics/okular/-/commit/db2246f7771cfb96917bbc724dadf2c2e720c91b