diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-04-24 13:47:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-04-24 20:23:20 +0200 |
commit | 3b5e0316f755b9981ed4f4032c2c362407b808f6 (patch) | |
tree | 3e967b00f2984ae4acc9acac671342fc8ec46b56 /svx | |
parent | 5838b62e7ba2312f41a4c8a43d53036476bfce1d (diff) |
all PanelLayout are layout aware
Change-Id: I11609c3b4e0783bc7dfc64467ba675761886859b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92859
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/PanelLayout.cxx | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx index fe0ffbee12f7..39659687d218 100644 --- a/svx/source/sidebar/PanelLayout.cxx +++ b/svx/source/sidebar/PanelLayout.cxx @@ -50,24 +50,19 @@ void PanelLayout::dispose() Size PanelLayout::GetOptimalSize() const { - if (isLayoutEnabled(this)) + Size aSize = m_xContainer->get_preferred_size(); + + if (mxFrame) { - Size aSize = m_xContainer ? m_xContainer->get_preferred_size() - : VclContainer::getLayoutRequisition(*GetWindow(GetWindowType::FirstChild)); - if (mxFrame) - { - SidebarController* pController - = SidebarController::GetSidebarControllerForFrame(mxFrame); - if (pController) - aSize.setWidth(std::min<long>( - aSize.Width(), (pController->getMaximumWidth() - TabBar::GetDefaultWidth()) - * GetDPIScaleFactor())); - } - - return aSize; + SidebarController* pController + = SidebarController::GetSidebarControllerForFrame(mxFrame); + if (pController) + aSize.setWidth(std::min<long>( + aSize.Width(), (pController->getMaximumWidth() - TabBar::GetDefaultWidth()) + * GetDPIScaleFactor())); } - return Control::GetOptimalSize(); + return aSize; } void PanelLayout::queue_resize(StateChangedType /*eReason*/) @@ -76,8 +71,6 @@ void PanelLayout::queue_resize(StateChangedType /*eReason*/) return; if (m_aPanelLayoutIdle.IsActive()) return; - if (!isLayoutEnabled(this)) - return; InvalidateSizeCache(); m_aPanelLayoutIdle.Start(); } @@ -94,10 +87,9 @@ void PanelLayout::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, P bool bCanHandleSmallerWidth = false; bool bCanHandleSmallerHeight = false; - bool bIsLayoutEnabled = isLayoutEnabled(this); vcl::Window *pChild = GetWindow(GetWindowType::FirstChild); - if (bIsLayoutEnabled && pChild->GetType() == WindowType::SCROLLWINDOW) + if (pChild->GetType() == WindowType::SCROLLWINDOW) { WinBits nStyle = pChild->GetStyle(); if (nStyle & (WB_AUTOHSCROLL | WB_HSCROLL)) @@ -114,7 +106,7 @@ void PanelLayout::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, P Control::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags); - if (bIsLayoutEnabled && (nFlags & PosSizeFlags::Size)) + if (nFlags & PosSizeFlags::Size) VclContainer::setLayoutAllocation(*pChild, Point(0, 0), Size(nWidth, nHeight)); } |