Bug 284072

Summary: clear text icon "X>" is hiding Hebrew text in RTL mode
Product: [Frameworks and Libraries] kdelibs Reporter: Nadav Kavalerchik <nadavkav>
Component: kdeuiAssignee: kdelibs bugs <kdelibs-bugs>
Status: REOPENED ---    
Severity: normal CC: afief.h, cfeck, josh+tech, kde-2011.08, med.medin.2014, omeritzicschwartz, sh.yaron
Priority: NOR Keywords: rtl
Version: 4.7   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 4.11
Attachments: Hebrew text is covered with "Clear Text" icon
RTL and clear icon
Okular automatic RTL and LTR

Description Nadav Kavalerchik 2011-10-15 11:01:58 UTC
Version:           4.7 (using KDE 4.7.1) 
OS:                Linux

When typing Hebrew text (RTL Mode), the "Clear Text" icon ("X>") is covering the beginning of the text (See attached screen capture)

Please display the "Clear Text" icon justified to the left of the Input Text Box when in RTL mode. Where the text is typed from right to left. so the icon will not cover the text.

Reproducible: Didn't try

Steps to Reproduce:
1. Press Alt-F2 to open the krunner
2. Switch keyboard layout to Hebrew (Or Arabic) 
3. Type some text
4. You will now see this issue. (Icon covers text)

Actual Results:  
Text is not covered by "Clear text icon"

Expected Results:  
Text should not covered by "Clear text icon"
and if possible, justify the icon to the left side of the text input box
Comment 1 Nadav Kavalerchik 2011-10-15 11:04:14 UTC
Created attachment 64537 [details]
Hebrew text is covered with "Clear Text" icon

Screen capture of this issue
Comment 2 Afief Halumi 2013-06-01 15:44:03 UTC
Affects Arabic text too. From reading the code of KLineEdit it seems that when the text alignment is automatically changed(by entering RTL text such as Hebrew or Arabic) the function updateClearButton is not called.

I'm running KDE 4.10.2, the bug is especially annoying when searching for non-latin contacts in a contact list.
Comment 3 Christoph Feck 2013-06-16 01:19:49 UTC
Ah, you mean KDE is not set to RTL mode by default, but the widget only temporarily switches when RTL characters are entered?
Comment 4 Nadav Kavalerchik 2013-06-16 05:31:52 UTC
Yes
Comment 5 Christoph Feck 2013-07-17 11:47:03 UTC
*** Bug 322456 has been marked as a duplicate of this bug. ***
Comment 6 Christoph Feck 2013-07-23 11:32:49 UTC
Git commit 7e663c8d11c306dffbf7e9ba32744a94f1e4bed9 by Christoph Feck.
Committed on 23/07/2013 at 11:30.
Pushed by cfeck into branch 'KDE/4.11'.

Update clear button position on layout direction changes
FIXED-IN: 4.11

M  +4    -0    kdeui/widgets/klineedit.cpp

http://commits.kde.org/kdelibs/7e663c8d11c306dffbf7e9ba32744a94f1e4bed9
Comment 7 Christoph Feck 2013-12-16 22:05:33 UTC
*** Bug 280567 has been marked as a duplicate of this bug. ***
Comment 8 Christoph Feck 2013-12-29 22:05:48 UTC
*** Bug 279052 has been marked as a duplicate of this bug. ***
Comment 9 Dotan Cohen 2013-12-30 12:39:17 UTC
Thank you for the fix, Chris!
Comment 10 medin 2020-11-16 12:13:30 UTC
The problem is still persistent on Plasma 5.20.2
Comment 11 medin 2020-11-16 12:14:29 UTC
Created attachment 133377 [details]
RTL and clear icon

Operating System: Manjaro Linux
KDE Plasma Version: 5.20.2
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Kernel Version: 5.4.74-1-MANJARO
OS Type: 64-bit
Comment 12 Omeritzics 2021-05-25 13:10:27 UTC
This problem seems to be fixed on Plasms 5.21.
Comment 13 medin 2021-05-25 14:42:04 UTC
(In reply to Omeritzics from comment #12)
> This problem seems to be fixed on Plasms 5.21.

Not completely resolved, it's just temporary (wrong) solution, the correct way RTL languages should be treated is to show clear icon at left and typing start from right, but now RTL are treated as LTR languages. The correct way to address this problem is to have the ability to change automatically the layout of textbox when focus is catched and according to current selected keyboard layout the layout of focused textbox will change to match RTL or LTR.
It seems Okular (search) is the only that is implementing the correct solution, see attached video for more info.
Comment 14 medin 2021-05-25 14:42:53 UTC
Created attachment 138775 [details]
Okular automatic RTL and LTR