Bug 472930

Summary: Result can exceed display area
Product: [Applications] kcalc Reporter: Andreas <eandmsz>
Component: generalAssignee: Gabriel Barrantes <gabriel.barrantes.dev>
Status: RESOLVED FIXED    
Severity: major CC: gabriel.barrantes.dev, p.r.worrall
Priority: NOR    
Version First Reported In: 23.04.3   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Andreas 2023-08-02 16:21:12 UTC
SUMMARY
The result on the display area that doesn't fit in the window is just cut off.
This can lead to false readings (if you are unlucky and don't see a half number at the edge, which would give you a clue that there are more numbers to the left), therefore I put major as severity.

STEPS TO REPRODUCE
1. Set Simple Mode and resize the KCalc window the narrowest possible
2. Set the display font to something large: e.g.: 32
3. Do any calculation that results in a large number

OBSERVED RESULT
The result on the display area that doesn't fit in the window is just cut off.

EXPECTED RESULT
This fault is due to the freedom, that the user has control over both the font size and the window size.
I suggest to implement an automatic font size reduction mechanism that kicks in when it detects that the result is not fully visible. This can be a bit complicated to implement if we want a robust solution that works with different fonts and different "Force font DPI" settings.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
- Windows, MacOS, iOS native calculators all have this implemented. They decrease the font size automatically when it wouldn't fit in the display area.
Comment 1 Andreas 2025-04-30 17:50:01 UTC
It seems this is fixed already on kUbuntu 25.04 with kCalc 24.12.3

KDE Fw: 6.12.0
Qt: 6.8.3