Bug 448760 - Minimum window size isn't kept when activating and deactivating constants
Summary: Minimum window size isn't kept when activating and deactivating constants
Status: RESOLVED FIXED
Alias: None
Product: kcalc
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Evan Teran
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-19 10:22 UTC by Niklas Freund
Modified: 2022-02-01 16:31 UTC (History)
0 users

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


Attachments
Video showing the issue (717.06 KB, video/mp4)
2022-01-19 10:22 UTC, Niklas Freund
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Niklas Freund 2022-01-19 10:22:57 UTC
Created attachment 145641 [details]
Video showing the issue

SUMMARY
When the window is at minimum size and you toggle constants on, then off, the window isn't automatically resized to its new minimum size (unlike in all other mode changes).

STEPS TO REPRODUCE
1. Open science (or statistics) mode
2. Make sure KCalc is at minimum size
3. Activate constants
4. Deactivate constants

OBSERVED RESULT
KCalc isn't at minimum size

EXPECTED RESULT
KCalc is at minimum size

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.2
Comment 1 Bug Janitor Service 2022-01-19 10:42:02 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kcalc/-/merge_requests/33
Comment 2 Albert Astals Cid 2022-02-01 16:31:38 UTC
Git commit 0bb46354590015f56ec8ea1d8fd13348d114bc91 by Albert Astals Cid, on behalf of Niklas Freund.
Committed on 01/02/2022 at 16:31.
Pushed by aacid into branch 'master'.

Workaround for minimum size not being kept when deactivating constants

In my previous resizing support merge request (https://invent.kde.org/utilities/kcalc/-/merge_requests/24), I made sure that any KCalc mode changes that happen at minimum window size result in the window resizing itself to the new minimum size. However, this turns out to not have worked in one specific case: Showing/Hiding the constants buttons.

Upon investigation of this issue, I noticed that `minimumSize()` isn't updating correctly after hiding of the buttons (and stays at the old minimumSize). Thus, the call to `resize(minimumSize())` doesn't work.

M  +3    -0    kcalc.cpp

https://invent.kde.org/utilities/kcalc/commit/0bb46354590015f56ec8ea1d8fd13348d114bc91