Fix RTL alignment bug in preferences dialog when dark mode enabled

Fixed "Dark Mode->Customize tone" color pickers RTL alignment

Fix #11343, close #11354
This commit is contained in:
Ashfaaq18 2022-03-07 19:51:01 +05:30 committed by Don Ho
parent c3daf4448d
commit f6ea35d521
1 changed files with 7 additions and 1 deletions

View File

@ -903,7 +903,13 @@ void DarkModeSubDlg::move2CtrlLeft(int ctrlID, HWND handle2Move, int handle2Move
RECT rc;
::GetWindowRect(::GetDlgItem(_hSelf, ctrlID), &rc);
p.x = rc.left - NppParameters::getInstance()._dpiManager.scaleX(5) - handle2MoveWidth;
NppParameters& nppParam = NppParameters::getInstance();
if(nppParam.getNativeLangSpeaker()->isRTL())
p.x = rc.right + nppParam._dpiManager.scaleX(5) + handle2MoveWidth;
else
p.x = rc.left - nppParam._dpiManager.scaleX(5) - handle2MoveWidth;
p.y = rc.top + ((rc.bottom - rc.top) / 2) - handle2MoveHeight / 2;
::ScreenToClient(_hSelf, &p);