Summary: | RTL text shuffled when ellided in calendar cells | ||
---|---|---|---|
Product: | [Applications] korganizer | Reporter: | Shai <shai> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | lemma, winter |
Priority: | NOR | Keywords: | triaged |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
The cell when it is wide enough for the todo title
The cell when it is not wide enough for the todo title Full vs. elided text in KDE4 Korganizer week view The same picture, with marks showing which letter went where Eliding always to the left still doesn't quite work partial fix for month view Fix KWordwrap, which mostly fixes week view |
Description
Shai
2008-04-23 02:55:36 UTC
Created attachment 24483 [details]
The cell when it is wide enough for the todo title
Created attachment 24484 [details]
The cell when it is not wide enough for the todo title
In the couple of screen caps you can see (if you look carefully at the Hebrew
characters) how the title becomes distorted when it is ellided -- compare it to
the english example given in the bug description.
SVN commit 831596 by winterz: Fix "RTL text shuffled when ellided in calendar cells" I hope. Shai and Dotan, please test. BUG: 161181 CCMAIL: kde-2@dotancohen.com M +11 -2 monthgraphicsitems.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=831596 Hi Allen, Thanks for trying, but no, this doesn't quite fix it. At least as far as I see, the bug has moved from the month view to the week view. The month view now uses eliding with an ellipsis, not dimming of late characters; in this mode, there's only a question of positioning the ellipsis w.r.t what's left of the text. Currently, in a LTR locale the ellipsis is before the text, but it is the beginning of the text that is cut out, so it looks ok (it is a little funny that it's the beginning that's removed, but we've seen much worse :-)). When there's a RTL (Hebrew) cell but the locale is LTR, the ellipsis now appears on the wrong side of the text (it probably has always appeared this way). Between the beginning of text with ellipsis on its wrong side, and the end of text with ellipsis on its right side, I'm not sure which I prefer; I think they're both non-comfortably acceptable, at least to an experienced computer user. However, the problem, exactly as I described it, now lives in the Week view, where eliding is done by dimming the last characters. Make a longish title, and play with the event duration to make it elide; if the title is LTR, you can see the weird dance of letters as exemplified by the attachments I am now adding -- where the titles of the event and the todo are actually the same, but the event is elided. My conclusion from the above is that the problem is in the QPainter, not in the use of elidedText. If I find the time, I'll look more deeply into it. Either way, the new KOrganizer (like the rest of KDE4) is a lot prettier than the old one. Thanks again, Shai. Created attachment 26091 [details]
Full vs. elided text in KDE4 Korganizer week view
Created attachment 26092 [details]
The same picture, with marks showing which letter went where
(sorry, forgot to reopen with earlier post) ... and again sorry for the spam, but I've just noticed what a mess I've made above between LTR and RTL. So here is the above again, hopefully corrected: The month view now uses eliding with an ellipsis, not dimming of late characters; in this mode, there's only a question of positioning the ellipsis w.r.t what's left of the text. Currently, in a *RTL* locale the ellipsis is before the text, but it is the beginning of the text that is cut out, so it looks ok (it is a little funny that it's the beginning that's removed, but we've seen much worse :-)). When there's a RTL (Hebrew) cell but the locale is LTR, the ellipsis now appears on the wrong side of the text (it probably has always appeared this way). Between the beginning of text with ellipsis on its wrong side, and the end of text with ellipsis on its right side, I'm not sure which I prefer; I think they're both non-comfortably acceptable, at least to an experienced computer user. However, the problem, exactly as I described it, now lives in the Week view, where eliding is done by dimming the last characters. Make a longish title, and play with the event duration to make it elide; if the title is *RTL*, you can see the weird dance of letters as exemplified by the attachments I am now adding -- where the titles of the event and the todo are actually the same, but the event is elided. My conclusion from *examining the code changes* is that the problem is in the QPainter, not in the use of elidedText. I hope this is now right and clear, Shai. I really want to fix this. We have a couple problems: 1) be consistent between month and week views (either dimming or ellipsis) 2) make sure the dimming (or ellipsis) is in the correct place It seems that KWordWrap class (which does the dimming) does not properly support RtoL, probably due to QPainter. So let's try to use ellipsis in both views.. at least for now. If we can get the monthview correct, then I can make the similar fix in week view. Please try this: in korganizer/views/monthgraphicsitem.cpp, change the Qt::ElideLeft in both places to QT::ElideRight. Let me know if that works. Created attachment 26132 [details]
Eliding always to the left still doesn't quite work
No, not quite. The problem is that the presentation relies on the global
ReverseLayout property, instead of the direction of the text in the cell. This
means that in a LTR (English) layout, RTL (Hebrew) text will come out wrong,
and vice versa; it's not an issue of the elide mode, but of presentation of
text.
The attached image was taken in RTL (Hebrew), to make it easier for non-Hebrew
users to see what's wrong. The full (English) event title is shown on the
right. The Hebrew event's eliding here is perfect. If I use a LTR layout, then
it's the other way around.
Just to be perfectly clear: The eliding of the English title is elideLeft. If I used elideRight, it would show something like "...Event". Shai, What do you recommend for the 4.1 release? Leave it at the current state? Or put back the changes I made for RTL? There seem to be Qt problems underlying that won't be fixed before 4.1 is tagged in 1 week. Either way is fine in terms of UI; but I guess it is better to remove the elideRight references (and the KGlobals::reverseLayout references), in terms of hints for future people looking at this code. PS: But if you can get the Week view to elide by ellipsis, that will be an improvement. SVN commit 834757 by winterz: revert SVN commit 831596 by winterz: Fix "RTL text shuffled when ellided in calendar cells" I hope. ==> Shai says it doesn't help to do this. The real problem is in QPainter CCBUGS: 161181 M +2 -11 monthgraphicsitems.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=834757 Created attachment 27581 [details]
partial fix for month view
The attached 2-line patch fixes the worst effects of the bug for the month view; it causes the ellipsis to be printed on the correct side of the text, whether the text is Hebrew or English.
The Week view still does things differently (I don't see dimming anymore, just cropping of characters, but the cropping is still done as described in the bug, so that characters are shuffled around). I suppose one can put a similar fix there.
Once we get over the really-bad, we can start worrying about when icons should appear on the right side of the cell instead of the left.
Thanks Shai. I committed the 2-line patch. Keep them coming! What's the status of this bug? Was it finally resolved back then? Technically speaking this bug has been fixed. However, as Shai mentions, there are other RTL issues in the cells (like icon placement) So, let's leave the decision to Shai. We can close and open other bugs, or just leave this one open. (In reply to comment #19) > Technically speaking this bug has been fixed. > However, as Shai mentions, there are other RTL issues in the cells (like icon > placement) > > So, let's leave the decision to Shai. We can close and open other bugs, or > just leave this one open. > I think the icon placement should be dealt with in its own bug -- that really is a minor issue. However, I'd like to keep this one open until the week view situation is improved. Created attachment 27839 [details]
Fix KWordwrap, which mostly fixes week view
The attached patch fixes (the worst of) the problems in week view. It makes the dimmed characters paint in the correct place, and stops character shuffling. This leaves minor display problems, like alignment and icon placement, which are of much lower priority.
Notice that the patch is not to kdepim, but to kdelibs; it should solve similar problems all around KDE, though I personally haven't run into them.
SVN commit 870851 by iastrubni: This fixes (the worst of) the problems in week view in KOrganizer (and probably other places). It makes the dimmed characters paint in the correct place, and stops character shuffling. This leaves minor display problems, like alignment and icon placement, which are of much lower priority. Patch by Shai berger. BUG: 161181 CCMAIL: Shai Berger <shai@platonix.com> M +24 -9 kwordwrap.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=870851 SVN commit 871006 by iastrubni: This fixes (the worst of) the problems in week view in KOrganizer (and probably other places). It makes the dimmed characters paint in the correct place, and stops character shuffling. This leaves minor display problems, like alignment and icon placement, which are of much lower priority. Patch by Shai berger. Backport for 4.1. BUG: 161181 CCMAIL: Shai Berger <shai@platonix.com> M +24 -9 kwordwrap.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=871006 |