thennequin / ImWindow

Window and GUI system based on Dear ImGui from OCornut
MIT License
828 stars 119 forks source link

Floating windows improvements. #23

Closed ChemistAion closed 6 years ago

ChemistAion commented 6 years ago

Two small things (too small IMO for pull-req.) within ImWindowDX11.

  1. When you are docking/undocking floating window to/from single external EasyWindow (with E_STYLE_NORMAL sytle): window loses height by 25 pixel every time it is undocked.

The oSize.y in ImwWindowManager::StartDragWindow should include c_fTabHeight: ImVec2 oSize = ImVec2(pWindow->GetLastSize().x, pWindow->GetLastSize().y + ImwContainer::c_fTabHeight);

  1. When you are docking/undocking floating window to/from single external EasyWindow (with E_STYLE_NORMAL sytle): the position is not aligned with Window ClientArea.

The pPlatformWindow->SetPosition(...) from ImwWindowManager::InternalFloat should adjust client rect pos based on EasyWindow style, in ImwPlatformWindowDX11::SetPosition: DWORD style = GetWindowLong(m_pWindow->GetHandle(), GWL_STYLE); AdjustWindowRect(&rect, style, FALSE);

thennequin commented 6 years ago

Hi, thanks for your bug report and for your fixes. For the second bug, I applied changes directly on the EasyWindow library for set client position.

ChemistAion commented 6 years ago

Works like a charm.