Skip to content

Allow resizing of KCalc

Niklas Freund requested to merge nalquas/kcalc:master into master

Summary

KCalc currently uses a fixed window size. I would like KCalc to be resizable, which seems especially important on touch systems (like 2-in-1 laptops) where the current buttons are often too small to reliably hit. Additionally, KCalc is the only application on my entire desktop that can't scale.

It is already possible to increase the button size by changing the font size in KCalc's settings, which is nice for accessibility. Nevertheless, being able to dynamically resize the window and all of its content would make for easier use / more flexibility. The font settings can instead be interpreted as minimum size settings.

This is my first attempt to contribute to KDE. I also only have little experience with QT. I'd appreciate any feedback or advice on how to do this properly.

I also posted a request for KCalc resizing on Bugzilla: 441986

Some progress/issue lists that were only relevant when I first posted this merge request

Progress

My current progress on this is as follows:

  • I have enabled window resizing. As KCalc was written to be a fixed size application, this is not enough.
  • I've reworked the layouting settings using QtDesigner as well as changing a few key points of code for better and more uniform scaling.
  • The current font settings (from the settings dialog) are now interpreted as minimum font size.

Issues that I think have to be fixed before I'd consider this ready:

  • The calc display's text doesn't scale. Intended behaviour. Display size can be changed in settings. Implemented.
  • The bit editor doesn't scale. Implemented.
  • Some buttons in the left pad seem to expand faster than others. Fixed.
  • When switching from simple mode to science mode and then back, the window keeps the size of the science mode. Could be considered intended behaviour? Need feedback. Fixed.
  • The button texts should probably scale, too. Intended behaviour. Button font size can be changed in settings. Implemented.

Screenshots

Here are some screenshots:

Before After (at minimum size)
Screenshot_20211121_110553 Screenshot_20211121_110616

Here are some screenshots on how resized windows look:

After (scaled, science) After (scaled, numeral)
Screenshot_20211121_110640 Screenshot_20211121_110651
Edited by Niklas Freund

Merge request reports