Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jun 28, 2018

No description provided.

@chcg chcg added this to the v1.3 milestone Jun 28, 2018
@chcg chcg merged commit 86ed1a0 into bruderstein:master Jun 28, 2018
@Yaron10
Copy link

Yaron10 commented Jun 28, 2018

That was fast!

👍
Perfect.
Thank you very much. Highly appreciated.

Allow me one question (please don't mind that :) ):

Is adding

LONG_PTR exstyles = GetWindowLongPtr(m_scintilla, GWL_EXSTYLE);
	if ((exstyles & WS_EX_LAYOUTRTL) == WS_EX_LAYOUTRTL)
	{
		SetWindowLongPtr(m_scintilla, GWL_EXSTYLE, exstyles & (~WS_EX_LAYOUTRTL));
        }

the only way to force LTR?

Can't it be achieved by removing makeRTLResource or passing false instead of isRTL?
(I looked at the code some months ago; makeRTLResource may not be the exact name).

@ghost
Copy link
Author

ghost commented Jun 28, 2018

Not sure I understand - afaik python script code does not have any isRTL call.
If you want to prevent npp from doing rtl in the first place then yes, forcing isRTL to be always false
should prevent it from decorating a window with WS_EX_LAYOUTRTL style but from PS ...
I don't know makeRTLResource - need to search the web maybe this is a MFC way of doing it.

@ghost
Copy link
Author

ghost commented Jun 28, 2018

Ok, makeRTLResource is also a function from npp which, again, uses WS_EX_LAYOUTRTL to decorate
the dialog.

@ghost
Copy link
Author

ghost commented Jun 28, 2018

ooppsss - function exists in NppPlugin as well

@Yaron10
Copy link

Yaron10 commented Jun 28, 2018

ooppsss - function exists in NppPlugin as well

👍

I've been searching the code. :)
Could you please look into it? - It might be better to remove or modify some code.

Thank you.

@ghost
Copy link
Author

ghost commented Jun 28, 2018

The current solution seems to be the one which affects the layout of the console scintilla window.
Changing isRTL to be always false in StaticDialog doesn't have any effect on console scintilla window.

@Yaron10
Copy link

Yaron10 commented Jun 28, 2018

Thank you for looking into it. And thanks again for fixing this issue.
Much appreciated.

Allow me another question:

Do we gain anything by if ((exstyles & WS_EX_LAYOUTRTL) == WS_EX_LAYOUTRTL)?
Is not calling SetWindowLongPtr(m_scintilla, GWL_EXSTYLE, exstyles & (~WS_EX_LAYOUTRTL)); if NPP layout is LTR worth the extra if?

IOW: wouldn't SetWindowLongPtr(m_scintilla, GWL_EXSTYLE, exstyles & (~WS_EX_LAYOUTRTL)); be enough or better?

I don't know. What do you think?

@ghost
Copy link
Author

ghost commented Jun 29, 2018

Imho - taking care that only WS_EX_LAYOUTRTL is removed if set is worth it

@Yaron10
Copy link

Yaron10 commented Jun 29, 2018

👍
Thank you.

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.

2 participants