-
Notifications
You must be signed in to change notification settings - Fork 63
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
[Bug] KryptonForms do not know how to do RTL setting correctly #343
Comments
Help needed with RTL Language Developers to check if Normal font in an RTL is revered like the Bug indicates above, or is "Normal" and only RTL languages are reversed, or it's the RTL font that does the standard reversing. |
Posting a pinned comment to Discord |
I'm not sure if I understand you correctly. Does my screenshot posted to the linked issue not help with this? If not, please try to elaborate and I'll be happy to help if it's still needed. |
@Ahmed-Abdelhameed Help needed is for a developer who has RTL set as the OS, would be needed to work out why the internals of Krypton do not work, and then to apply the fix across all components and related dll's (Navigator / Ribbon / Extended / etc.) But, you have also added that the Title elements should also be swapped around as well. 👍 |
@Smurf-IV Okay, here's my progress so far... First of all, I don't think the OS language or RTL plays a role here since the So, after a lot of investigating, I figured out the cause of the text (and buttons) being flipped/mirrored. I'm not submitting a PR though because I don't have a complete solution yet. I'm just posting what I found so far and maybe you or @Wagnerp can pick up from where I left as you both obviously have more experience with the internals of Krypton than me. The problem begins in the
Here's the complete code for context:
As you can see, it's using the screen's device context and only when that fails does it fall back to using the window's device context (i.e., Now, I'm not entirely sure whether using the screen device context is necessary or how the caching mentioned in the code comment above works. If it's not necessary, then we can just get rid of the
Using either of the fixes described above causes the RTL layout to work correctly (icon and text on the right, displayed correctly/unmirrored, and the buttons are on the left): However, there are two things I still didn't figure out.
|
As per comment in #786, button specs including help should be flipped along with the hit areas. |
@Smurf-IV & @Ahmed-Abdelhameed These may help adjust the 'hit' targets, but they're not used in KForm |
Hi @Smurf-IV, Is this still being worked on? |
Hi @Smurf-IV Do we know where the bug is on this one, or is it a case of creating a 'special' KForm? |
@Ahmed-Abdelhameed: created a demo (As in the gif above), but did not supply it. |
I wonder if there's something in the WinForms repo that can be used? |
Hi @Smurf-IV Created a demo, the behaviour is even more unusual... |
I think I've found something... look at https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms/src/System/Windows/Forms/Form.cs, specifically lines 867 - 873... |
Superseded by #1570 |
As seen with the fix for #313
Both Set:
RightAlign only:
RTL Only:
Originally posted by @Smurf-IV in #313 (comment)
And an old reference to an active Component Krypton Bug:
ComponentFactory/Krypton#94
The text was updated successfully, but these errors were encountered: