Bug 460952 - Ledger lens improvement
Summary: Ledger lens improvement
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: git (master)
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks: 426400
  Show dependency treegraph
 
Reported: 2022-10-24 16:54 UTC by adi.sav
Modified: 2024-08-19 06:48 UTC (History)
1 user (show)

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


Attachments
Screen to show the problem (401 bytes, image/png)
2022-10-24 16:54 UTC, adi.sav
Details
Proper screenshot (368.47 KB, image/jpeg)
2022-10-24 17:30 UTC, adi.sav
Details
KMyMoney Fonts (76.00 KB, image/jpeg)
2022-10-24 18:01 UTC, adi.sav
Details
Patch: Apply font settings to ledger view (1.93 KB, patch)
2022-11-01 22:34 UTC, Ralf Habacker
Details
Screenshot showing the issue on linux with attachment 153385 applied (172.41 KB, image/png)
2022-11-01 22:36 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description adi.sav 2022-10-24 16:54:13 UTC
Created attachment 153172 [details]
Screen to show the problem

When selecting the option "Use legder lens", the row is too narrow and the text is clipped.

Using Windows 11 and KMyMoney 5.1.80, nightly build.
Comment 1 Jack 2022-10-24 17:04:31 UTC
Your screen shot is not helpful - I don't know if it's too large/too small/wrong resolution, but I only see a blur.  On Linux, the ledger lens works fine for me.  Have you tried adjusting the column widths in the ledger?
Comment 2 adi.sav 2022-10-24 17:30:58 UTC
Created attachment 153173 [details]
Proper screenshot
Comment 3 adi.sav 2022-10-24 17:31:57 UTC
OMG, I am sorry, I just attached the fixed screenshot.
Comment 4 adi.sav 2022-10-24 17:39:21 UTC
I just noticed the same problem in Tags.
Comment 5 Jack 2022-10-24 17:51:10 UTC
The row is too short, not too narrow, just to clarify the terminology.
I am not able to replicate this on Linux, so we need to determine if it is a configuration issue, or something Windows specific.
What exact version are you running - from Help/About KMyMoney?
Do you have the same problem if you select a transaction other than the last one shown?
What are your Font settings (Configure KMyMoney, select Fonts on the left)?
I don't know if any of these matter, but I'm trying to find any possible cause.
(When you reply, you can set the status back to REPORTED)
Comment 6 adi.sav 2022-10-24 18:01:28 UTC
> The row is too short, not too narrow, just to clarify the terminology.
Got it, sorry. English is a foreign language to me.

> I am not able to replicate this on Linux, so we need to determine if it is a configuration issue, or something Windows specific.
It may be a Windows specific issue, since I deleted KMyMoney the config file and nothing changed.

> What exact version are you running - from Help/About KMyMoney?
Version 5.1.80-3aed8676c

> Do you have the same problem if you select a transaction other than the last one shown?
Yes, on every transaction in Ledger and in Tags. I did not check other areas.

> What are your Font settings (Configure KMyMoney, select Fonts on the left)?
Attached screenshot, all settings are default.
Comment 7 adi.sav 2022-10-24 18:01:48 UTC
Created attachment 153174 [details]
KMyMoney Fonts
Comment 8 Ralf Habacker 2022-10-24 21:29:49 UTC
You may try a binary from the stable branch, see https://binary-factory.kde.org/view/Windows%2064-bit/job/KMyMoney_Release_win64/. If the issue is also shown, then it is probably a kmymoney issue. If that does not help, try a binary release from https://download.kde.org/stable/kmymoney/5.1.3/.
Comment 9 adi.sav 2022-10-25 03:24:01 UTC
(In reply to Ralf Habacker from comment #8)
> You may try a binary from the stable branch, see
> https://binary-factory.kde.org/view/Windows%2064-bit/job/
> KMyMoney_Release_win64/.
When I tried a version from the stable branch, version 5.1.3-261c598d3, I noticed the row to be correctly sized for the text.

> If the issue is also shown, then it is probably a
> kmymoney issue.
But this difference between the branches also means it is an issue of KMyMoney (that respective branch), doesn't it?
Comment 10 Ralf Habacker 2022-10-25 07:54:22 UTC
(In reply to adi.sav from comment #9)
> > If the issue is also shown, then it is probably a
> > kmymoney issue.
> But this difference between the branches also means it is an issue of
> KMyMoney (that respective branch), doesn't it?

Does it make a difference if you 1. change the font size and 2. use the system fonts? 
If no, it is a lack of support or a problem with the display of transaction in the general ledger display that has been rebuilt in the master branch.
Comment 11 adi.sav 2022-10-25 10:01:58 UTC
1. Increasing font size of Ms Shell Dlg 2 for both cell and header from 8.3 to 12 does not have any effect on the program. Even if KMyMoney is restarted, the font is still small, probably the initial 8.3.
Changing Ms Shell Dlg 2 with another font does not produce any noticeable results, and it should, since I choose Noto Mono, a monospace font. The difference should be easily seen.

2. Checking "Use system fonts" does not do anything. Even if KMyMoney is restarted.
Comment 12 adi.sav 2022-10-25 10:09:31 UTC
This all happens in nightly builds of the master branch.

However, just tested "KMyMoney Version 5.1.3-261c598d3" out of curiosity. And I have a monospace font in it. Which I set in a nightly build.
So both versions share the same config file. Nightly build writes them to the file, but does not respect Configure > Font settings at all.
Comment 13 Ralf Habacker 2022-10-25 14:48:00 UTC
(In reply to adi.sav from comment #12)
>  Nightly build writes them to the file, but does not respect Configure > Font settings at all.

In builds from 5.1 branch the font for the ledger is set set at https://invent.kde.org/office/kmymoney/-/blob/5.1/kmymoney/views/kgloballedgerview_p.h#L476

(In reply to Ralf Habacker from comment #10)
> ... the display of transaction in the general ledger display that has been rebuilt in the master branch.

It now uses a custom QPainter-based implementation to draw the content inside the ledger. The font used by QPainter is initialized via the widget font setting (see https://doc.qt.io/qt-5/qwidget.html#font-prop), which seems to be missing when compared to the 5.1 branch.
Comment 14 Thomas Baumgart 2022-10-25 15:40:11 UTC
I believe the problem is within the calculation of JournalDelegate::sizeHint() which is used to setup the height of the line. The result returned seem too narrow under Windows but is OK on Linux. The actual drawing of the text in JournalDelegate::paint() looks OK in both environments. Can someone try to figure out if adjusting the calc in JournalDelegate::sizeHint()  on Windows resolves the problem? 

The settings in fact are shared between the 5.1 and master versions. That is by design. The font settings are not used in master's ledger view, though. So it does not make sense to play with it. That may change in the future, but it does not resolve the problem, as the surrounding box is the problem that clips the text. And the size of the box is calculated based on the font size. Shrinking the font will also shrink the box.

BTW: The cell font setting is used in the summary labels in the accounts, categories, institutions and budget views. So those should change. The header font setting is used in the header of the schedules view. An general area of improvement, but of minor importance right now.
Comment 15 Ralf Habacker 2022-11-01 22:34:14 UTC
Created attachment 153385 [details]
Patch:  Apply font settings to ledger view

With the appended patch the issue can be reproduced also on linux by unchecking "use system fonts" and increasing the cell font size in the font settings page.
Comment 16 Ralf Habacker 2022-11-01 22:36:03 UTC
Created attachment 153387 [details]
Screenshot showing the issue on linux with attachment 153385 [details] applied
Comment 17 Thomas Baumgart 2022-11-02 13:42:02 UTC
Git commit e3810b0be2e4bf09e32db76e2f9935b09fb5e348 by Thomas Baumgart.
Committed on 02/11/2022 at 13:41.
Pushed by tbaumgart into branch 'master'.

Improve font handling in ledger views

M  +5    -0    kmymoney/views/journaldelegate.cpp
M  +7    -0    kmymoney/views/journaldelegate.h
M  +27   -2    kmymoney/views/ledgerview.cpp

https://invent.kde.org/office/kmymoney/commit/e3810b0be2e4bf09e32db76e2f9935b09fb5e348
Comment 18 adi.sav 2022-11-03 17:22:31 UTC
Just tried build 1697 from Nov 03.
I confirm it working in Ledger section.
The Tags section is still not affected by the change of fonts in Configure > Fonts.

If the settings in Configure > Fonts refer only to the ledger, they are misplaced in the current location.
They should be found in Configure > Ledger in a tab named Fonts.

Should I make a new bug report for this?
Comment 19 Ralf Habacker 2022-11-07 07:38:26 UTC
(In reply to adi.sav from comment #18)
> Just tried build 1697 from Nov 03.
> I confirm it working in Ledger section.
nice to hear 

> The Tags section is still not affected by the change of fonts in Configure > Fonts.
...
> Should I make a new bug report for this?
Yes, please 

Even better would be patches that add the missing feature.
Comment 20 adi.sav 2022-11-07 18:59:30 UTC
@Ralf Habacker: Thank you for fixing this bug.

>Even better would be patches that add the missing feature.
I would, if I could, but unfortunately I do not have any programming experience :(
Comment 21 Ralf Habacker 2022-11-07 23:17:05 UTC
(In reply to adi.sav from comment #20)
> @Ralf Habacker: Thank you for fixing this bug.

I'll pass this on to Thomas Baumgart, since he really fixed the problem :-)
Comment 22 adi.sav 2022-11-08 16:28:11 UTC
(In reply to Ralf Habacker from comment #21)
> (In reply to adi.sav from comment #20)
> > @Ralf Habacker: Thank you for fixing this bug.
> 
> I'll pass this on to Thomas Baumgart, since he really fixed the problem :-)

Aaah... Thank you Thomas Baumgart for the fix!
Comment 23 Thomas Baumgart 2022-11-09 13:44:17 UTC
Git commit c192ade2e4908c0ce3314df9745c8cee7093d8ed by Thomas Baumgart.
Committed on 09/11/2022 at 13:43.
Pushed by tbaumgart into branch 'master'.

Update font settings in tags and payees view

This amends commit e3810b0b and adds the necessary logic to switch the
font in the tags and payees view.

M  +8    -0    kmymoney/views/kpayeesview.cpp
M  +1    -0    kmymoney/views/kpayeesview.h
M  +8    -0    kmymoney/views/ktagsview.cpp
M  +1    -0    kmymoney/views/ktagsview.h

https://invent.kde.org/office/kmymoney/commit/c192ade2e4908c0ce3314df9745c8cee7093d8ed
Comment 24 adi.sav 2024-08-18 07:58:19 UTC
Thanks. I would test the latest build, but the link I have saved does not work anymore: https://binary-factory.kde.org/job/KMyMoney_Nightly_win64/.
Where can I find it?
Comment 25 Thomas Baumgart 2024-08-19 06:48:18 UTC
See https://kmymoney.org/windows.html