Fix docked window sizing direction problem in RTL mode

Fix #10536, close #10576
pull/10600/head
Ashfaaq18 2021-09-21 22:04:27 +05:30 committed by Don Ho
parent 19cf5c9037
commit 531bef28d8
2 changed files with 6 additions and 1 deletions

View File

@ -31,6 +31,8 @@ void DockingSplitter::init(HINSTANCE hInst, HWND hWnd, HWND hMessage, UINT flags
_flags = flags;
WNDCLASS wc;
DWORD hwndExStyle = (DWORD)GetWindowLongPtr(hWnd, GWL_EXSTYLE);
isRTL = hwndExStyle & WS_EX_LAYOUTRTL;
if (flags & DMS_HORIZONTAL)
{
@ -137,7 +139,7 @@ LRESULT DockingSplitter::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
}
else if (_ptOldPos.x != pt.x)
{
::SendMessage(_hMessage, DMM_MOVE_SPLITTER, _ptOldPos.x - pt.x, reinterpret_cast<LPARAM>(_hSelf));
::SendMessage(_hMessage, DMM_MOVE_SPLITTER, isRTL ? pt.x - _ptOldPos.x : _ptOldPos.x - pt.x, reinterpret_cast<LPARAM>(_hSelf));
}
_ptOldPos = pt;
}

View File

@ -49,5 +49,8 @@ private:
static BOOL _isVertReg;
static BOOL _isHoriReg;
// get layout direction
bool isRTL;
};