Bug 400831 - The tooltip of message preview layout doesn't look right
Summary: The tooltip of message preview layout doesn't look right
Status: RESOLVED WORKSFORME
Alias: None
Product: kmail2
Classification: Applications
Component: message list (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-08 03:21 UTC by younker.dl@gmail.com
Modified: 2023-01-01 05:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
the wrong layout of the tooltip (211.86 KB, image/png)
2018-11-08 03:21 UTC, younker.dl@gmail.com
Details
This should be the right one (116.15 KB, image/png)
2018-11-08 03:22 UTC, younker.dl@gmail.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description younker.dl@gmail.com 2018-11-08 03:21:23 UTC
Created attachment 116174 [details]
the wrong layout of the tooltip

SUMMARY
The message preview tooltip's layout doesn't look right when using chinese on a 4K display. 

STEPS TO REPRODUCE
1. setting the language to Chinese. Maybe Japanese has the same issue. 
2. Launch kmail
3. hover to a item in the message list and check the preview tooltip of the message. 

OBSERVED RESULT
The layout is not right for From, Sender, etc. The text was wrapped. 

EXPECTED RESULT
the first column of the text should not be wrapped. 

SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: 5.14.x
KDE Frameworks Version: 5.51.x
Qt Version: 5.11.2

ADDITIONAL INFORMATION
I posted this to reddit https://www.reddit.com/r/kde/comments/9uxumy/where_is_the_source_code_for_the_kmail_message/?utm_content=full_comments&utm_medium=message&utm_source=reddit&utm_name=frontpage
and I followed the guidance provided KeyRice to change the code in messagelib/messagelist/src/core/view.cpp. changed the hard coded width setting from 45 to 85, and it now looks good on my display. 
But I think this not the solution for this problem, we need to have a method to determine the right width based on the display(dpi) and also the scale factor.
Comment 1 younker.dl@gmail.com 2018-11-08 03:22:04 UTC
Created attachment 116175 [details]
This should be the right one

Attach another screenshot for the right layout of the tooltip.
Comment 2 Laurent Montel 2018-11-08 07:16:05 UTC
For the moment I can't test it but indeed it's not a problem with right-to-left problem but a tooltip problem
Comment 3 Laurent Montel 2018-11-08 07:48:53 UTC
"messagelib/messagelist/src/core/view.cpp. changed the hard coded width setting from 45 to 85," did you test this patch ?
Comment 4 younker.dl@gmail.com 2018-11-08 09:07:46 UTC
(In reply to Laurent Montel from comment #3)
> "messagelib/messagelist/src/core/view.cpp. changed the hard coded width
> setting from 45 to 85," did you test this patch ?

Yes, as you can see from the screenshot, after change the width from 45 to 85, the text is not wrapped. But this is not the solution, I also tried to remove the width attribute, but this change makes the layout of the 2 columns moving to center of the tooltip. 

Another solution maybe just remove the width attribute and set the align attribute to left for the first column of the tooltip window. Though the alignment of the first column may be not good, but at least the behaviour is consistent.
Comment 5 Laurent Montel 2018-11-08 12:21:28 UTC
I will investigate it 
Thanks for all info
Comment 6 younker.dl@gmail.com 2018-11-09 00:21:27 UTC
Comment on attachment 116174 [details]
the wrong layout of the tooltip

Will attach it later
Comment 7 younker.dl@gmail.com 2018-11-10 01:34:12 UTC
(In reply to Laurent Montel from comment #5)
> I will investigate it 
> Thanks for all info

Tried to set the scale factor to 1.5 and found the value of 85 is bigger for the left column. Then I set it to 60 works find on 4K display with scale factor 1.5. So the hard code width is not the right solution. 

I also tried to set nowrap attribute of TD element, but it doesn't have effect, not sure is this caused by the comparability of qtwebkit or something else.
Comment 8 Justin Zobel 2022-12-02 01:23:09 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 9 Bug Janitor Service 2022-12-17 05:14:24 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 Bug Janitor Service 2023-01-01 05:20:58 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!