qandak / sumcalc

SUM - crossplatform one-line calculator with History
GNU General Public License v3.0
9 stars 3 forks source link

Command Line too small #2

Open ziomau10 opened 4 years ago

ziomau10 commented 4 years ago

Dear Levon, I really appreciate this tool. I am using a notepad with 4K display and I have a problem. The command line, where one types the expressions is a little small (or the font is too big) and clips the top and bottom of the text. Clipboard-1 Using resolution double is slightly worse: Clipboard-2

Can you please add some more room around the text line, or make the division draggable (whichever is easier for you)

Thank you very much. I am using this tool daily ... Regards. Mau.

qandak commented 4 years ago

Thank you for your report, Mau! I could not reproduce this issue, unfortunately, but I think it's somehow related to high-DPI display and virtual resolution (resolution scale) providing by OS.

Could you please confirm that OS is Windows 10, and, if so, provide some additional information by following points:

  1. check if scale percentage under "Scale and Layout" (Settings -> Display) is higher that 100%,
  2. temporary set the scale percentage to 100% (only if it's higher, of course) and check if it's fixing the issue,
  3. check if changing resolution to Native of the application (Preferences -> User Interface -> Resolution) is fixing the issue.

Thanks!

ziomau10 commented 4 years ago

Thank you for your answer, and here are the results of my tests: Yes os is Windows 10 Pro.

  1. My display scale is indeed set to 200%
  2. Setting to 100% fixes the issue but the icons, text, and everything else is so tiny to be barely usable
  3. I've done this already and as I shoewd in my revious post the two images there, were one native and one double resolution. In both cases lines are clipped (with display scale set to 200%).

Anyway, don't worry ... I've seen software from branded names (even from Micr***t) fail miserably with high DPI displays. It seems than nobody is getting it right. Hope this helps, and let me know if you need more tests or beta test or something. Regrads.

qandak commented 4 years ago

Thank you for the info!

You are right. Unfortunately, virtual resolution support is an open issue for GUI frameworks and libraries.

I will try to update Qt (GUI framework). If it doesn't help I'll keep track of new releases. You can leave this issue open, so that I can update it and be in touch.

ziomau10 commented 4 years ago

Thank you very much. Should you need me to test something or whatever feel free to ask. Good job.

ziomau10 commented 3 years ago

Looking for something else I stumbled upon this: https://stackoverflow.com/questions/39247342/pyqt-gui-size-on-high-resolution-screens

Maybe it can be useful to fix the edit box issue. I'd test it myself, but I believe it will take me ages to install the PyQT development chain in order to do this simple test.

Additionally I have seen in the code, the following fragment:

        if platform == 'win':
            self.layout.setContentsMargins(0, 0, 2, 0)
            self.setFixedHeight(self.widget.buttonsSize - 2)
        else:
            self.layout.setContentsMargins(0, 0, 3, 0)
            self.setFixedHeight(self.widget.buttonsSize)

which seems to reduce the edit height on windows platform. Can you have a look? Best regards. Mau.

qandak commented 3 years ago

Mau, check the latest release, please.

I looked at the fragment you quoted. Here I've fixed the difference between calculation field height and inline buttons height, because buttons size in Windows were being calculated 2px bigger (1px each side) than rendered. So, if I don't reduce that height in Windows by buttonsSize - 2, assigning self.widget.buttonsSize parameter to selfFixedHeight of calculation field makes the latter's height visually bigger.

I looked also at the stackoverflow reference. I upgraded both Python and PyQt versions (see About in app), but I intentionally avoided setting that AA_EnableHighDpiScaling and AA_UseHighDpiPixmaps attributes, because I cannot reproduce high-dpi environment and test on side-effects.

I still cannot reproduce the main issue neither before nor after PyQt upgrade. I believe the problem is not the height, but the system default font size, which was increased (as a correction) for Windows before this release. So, added a font-size change setting (near the resolution selector) and removed that increasing correction for Windows. Try to manually set suitable font size. Hope it will help.

ziomau10 commented 3 years ago

Thank you for your immediate response. The possibility to change the font size is great: image Even the default size 8 was ok, but setting it to 7 results in the above picture which is perfecly ok.

Regarding the HighDpi test, I have one! ;) I understand you should not commit any change without testing ... but I can test it for you in high dpi screen. I cannot promise as quick response as yours, but I can promise to make the tests if you send me some test binary ...

Keep the good work. Thanks. Mau.

qandak commented 3 years ago

Thanks for the support, Mau! I’ll prepare it for the next release, but I'm afraid it won't be soon (too much refactoring is needed).

I’m glad it helped you. Kind regards.

ziomau10 commented 3 years ago

Great, when you have something to test, let me know Regards. Mau.