Bug 472671

Summary: Calculator applet minimum width and height values
Product: [Unmaintained] kdeplasma-addons Reporter: Sadi <sadiyumusak>
Component: calculatorAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: nate
Priority: NOR    
Version First Reported In: 5.27.5   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.0
Sentry Crash Report:

Description Sadi 2023-07-26 15:08:58 UTC
SUMMARY
***
This handy widget works as expected from anywhere on the desktop, but it seems there's a problem with display and scaling.
When added to desktop, it's displayed initially as an icon, although one would expect it to appear at least in its minimum size, which can only be attained by resizing it.
My problem is with its use in the right panel (sidebar) where I have also analog clock, media player etc. I couldn't reduce the width of that panel below 226 px because the calculator widget would immediately switch to an icon below that width.
After replacing the "Layout.minimumWidth/Height" values in "/usr/share/plasma/plasmoids/org.kde.plasma.calculator/contents/ui/calculator.qml" with 200 and 210, respectively, I could reduce panel width down to 215 px.
I think it should be possible to have a full display of this applet in a much smaller scale, which would be very useful in some cases.
***
SOFTWARE/OS VERSIONS
Operating System: Debian Testing
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.8
Comment 1 Nate Graham 2023-09-07 21:10:21 UTC
The bad default size should be fixed in Plasma 6, but making it much smaller is probably less feasible as it would start to be too small to use. But maybe it's possible.
Comment 2 Nate Graham 2023-09-07 21:17:21 UTC
Git commit 877cb682a2997b174dae7ef0cb80a31d3f36e4dc by Nate Graham.
Committed on 07/09/2023 at 23:10.
Pushed by ngraham into branch 'master'.

applets/calculator: use multiples of gridUnit for minimum size

This way it adjusts with the font size. We do this everywhere else too.

M  +2    -2    applets/calculator/package/contents/ui/calculator.qml

https://invent.kde.org/plasma/kdeplasma-addons/-/commit/877cb682a2997b174dae7ef0cb80a31d3f36e4dc
Comment 3 Nate Graham 2023-09-07 21:17:22 UTC
Git commit 4e1b311d1326b03a57255d6542b2554d03a19e1d by Nate Graham.
Committed on 07/09/2023 at 23:15.
Pushed by ngraham into branch 'master'.

applets/calculator: reduce min size to only what's needed to fit buttons

This makes it usable for people who want to put it on thick vertical
panels of 126px wide or wider--down from the previous value of 144px.

Any smaller than this, and button text starts to get elided with the
current design.
FIXED-IN: 6.0

M  +2    -2    applets/calculator/package/contents/ui/calculator.qml

https://invent.kde.org/plasma/kdeplasma-addons/-/commit/4e1b311d1326b03a57255d6542b2554d03a19e1d