Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore QTextEdit widget for RTL text in the Cell Editor #1929

Merged
merged 2 commits into from Jul 11, 2019

Conversation

mgrojo
Copy link
Member

@mgrojo mgrojo commented Jun 30, 2019

This restores the Qt text widget that was replaced by a QScintilla one in
45c1e2a

QScintilla does not support right-to-left scripts like Arabic, so QTextEdit
is still needed for these languages. Since the QScintilla editor has other
advantages already explained, it is preserved for general text edition.

RTL texts are detected when data is loaded and the Qt editor is
automatically selected. This is done both when loading data from the cell
and when interactively typing RTL characters in the Cell Editor.

All these changes can be undone if a new QScintilla editor supports RTL
texts.

See comments in issue #1793

This restores the Qt text widget that was replaced by a QScintilla one in
45c1e2a

QScintilla does not support right-to-left scripts like Arabic, so QTextEdit
is still needed for these languages. Since the QScintilla editor has other
advantages already explained, it is preserved for general text edition.

RTL texts are detected when data is loaded and the Qt editor is
automatically selected. This is done both when loading data from the cell
and when interactively typing RTL characters in the Cell Editor.

All these changes can be undone if a new QScintilla editor supports RTL
texts.

See comments in issue #1793
@justinclift
Copy link
Member

Yeah, sounds like this will be the way to go, until QScintilla supports RTL languages. Hopefully some day. 😄

Thanks for putting the time in for this @mgrojo. It can be a bit disappointing when a good idea doesn't work out. 😦

@mgrojo
Copy link
Member Author

mgrojo commented Jun 30, 2019

I make these pull request so users working with right-to-left languages can provide feedback before merging. @Johntaa can you compile from sources or would you need a build from this branch?

I'd like to know if the work flow displaying and entering RTL texts is correct.

@Johntaa
Copy link

Johntaa commented Jul 4, 2019

I make these pull request so users working with right-to-left languages can provide feedback before merging. @Johntaa can you compile from sources or would you need a build from this branch?

I'd like to know if the work flow displaying and entering RTL texts is correct.

Wow, Thank you for taking this step , it is greatly appreciated. I prefer a build from this branch.

@Z4us
Copy link

Z4us commented Jul 4, 2019 via email

1 similar comment
@Z4us
Copy link

Z4us commented Jul 4, 2019 via email

@mgrojo
Copy link
Member Author

mgrojo commented Jul 4, 2019

Wow, Thank you for taking this step , it is greatly appreciated. I prefer a build from this branch.

And what operating system are you using, @Johntaa? In any case I think we'd need help from @justinclift.

@Johntaa
Copy link

Johntaa commented Jul 5, 2019

Wow, Thank you for taking this step , it is greatly appreciated. I prefer a build from this branch.

And what operating system are you using, @Johntaa? In any case I think we'd need help from @justinclift.

Win64

@justinclift
Copy link
Member

justinclift commented Jul 6, 2019

@Johntaa
Copy link

Johntaa commented Jul 6, 2019

@justinclift , Thank you .
@mgrojo : great work, but still there is a small problems, sometimes the text field starts with a Latin character, that causes the program to select TEXT option for the content type , which requires change it back to RTLText option which produce a non-ordered arabic text (Randomized Arabic words not in the right direction), the second problem is that the widget cannot wrap lines within its borders and will show the horizontal scroll bar in the bottom , in RtlText option.

@mgrojo
Copy link
Member Author

mgrojo commented Jul 6, 2019

@mgrojo : great work, but still there is a small problems, sometimes the text field starts with a Latin character, that causes the program to select TEXT option for the content type , which requires change it back to RTLText option which produce a non-ordered arabic text (Randomized Arabic words not in the right direction),

Ok, I'll make a change in the RTL text detetion and I hope it will work better. The workaround for the current behaviour would be to change to the manual mode (button with the cog) and selecting RTL Text before writing the cell content.

the second problem is that the widget cannot wrap lines within its borders and will show the horizontal scroll bar in the bottom , in RtlText option.

This is configurable and it's the same for both widgets. There is button with a white page with text lines, which can be used to switch between scrolled lines or word wrapp.

Qt's isRightToLeft() returns true only for all left-to-right characters
in the string. That prevents the automatic switch to LTR Text mode, when
the text contains one or more left-to-right characters.

See #1793 and #1929
@mgrojo
Copy link
Member Author

mgrojo commented Jul 7, 2019

@Johntaa, mixed Latin and Arabic texts should work now. Could you test and confirm? @justinclift, we would need another build of this branch.

@Johntaa
Copy link

Johntaa commented Jul 10, 2019

@mgrojo : tested using sample database with both Latin and Arabic characters , working great. I don't see any problem. Thanks.
@justinclift Thank you.

@mgrojo
Copy link
Member Author

mgrojo commented Jul 10, 2019

Thanks, @Johntaa. Then I suppose this branch could be merged now, because the code is mostly recovered from previous versions with minor additions. I will wait till tomorrow, though, just in case someone would like to make a review.

@mgrojo mgrojo merged commit 592fa91 into master Jul 11, 2019
@mgrojo mgrojo deleted the qt_ltr_text_editor branch July 11, 2019 20:10
@justinclift justinclift added this to the 3.12.0 - Future release milestone Jul 11, 2019
@justinclift
Copy link
Member

Good stuff @mgrojo. 😄

@mgrojo mgrojo restored the qt_ltr_text_editor branch October 14, 2023 21:27
@mgrojo mgrojo deleted the qt_ltr_text_editor branch October 14, 2023 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants