diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-30 11:14:12 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-31 21:06:37 +0200 |
commit | 84b512ab3d8007293f2e8d338814db3ce7e4a63e (patch) | |
tree | e5c96f8b3c46ee55fbd52d209bc7c782fa7589b1 /sfx2/source/sidebar | |
parent | 741c72e00ed3d647121ce385c0f9442ecebb6216 (diff) |
tabbar is now too wide under windows hidpi
probably since:
commit 75b9109a2da35cf0f0914504145d84cf918c6af2
Date: Thu Nov 12 20:48:50 2020 +0000
weld TabBar
Change-Id: I8024d3479f766a065a24f7c82ceeadf01e7b9729
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113344
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source/sidebar')
-rw-r--r-- | sfx2/source/sidebar/SidebarChildWindow.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 19 |
2 files changed, 11 insertions, 14 deletions
diff --git a/sfx2/source/sidebar/SidebarChildWindow.cxx b/sfx2/source/sidebar/SidebarChildWindow.cxx index e8054b445325..04d1f1037f4b 100644 --- a/sfx2/source/sidebar/SidebarChildWindow.cxx +++ b/sfx2/source/sidebar/SidebarChildWindow.cxx @@ -54,7 +54,7 @@ SidebarChildWindow::SidebarChildWindow(vcl::Window* pParentWindow, sal_uInt16 nI if (!comphelper::LibreOfficeKit::isActive()) { pDockWin->SetSizePixel( - Size(TabBar::GetDefaultWidth() * GetWindow()->GetDPIScaleFactor(), + Size(TabBar::GetDefaultWidth(), pDockWin->GetSizePixel().Height())); } } @@ -66,7 +66,7 @@ SidebarChildWindow::SidebarChildWindow(vcl::Window* pParentWindow, sal_uInt16 nI // Undock sidebar in LOK to allow for resizing freely // (i.e. when the client window is resized) and collapse // it so the client can open it on demand. - pDockWin->SetFloatingSize(Size(pDockWin->GetSizePixel().Width() * GetWindow()->GetDPIScaleFactor(), + pDockWin->SetFloatingSize(Size(pDockWin->GetSizePixel().Width(), pDockWin->GetSizePixel().Height())); pDockWin->SetFloatingMode(true); } @@ -84,7 +84,7 @@ sal_Int32 SidebarChildWindow::GetDefaultWidth(vcl::Window const* pWindow) const static sal_Int32 nMaxPropertyPageWidth(146); return pWindow->LogicToPixel(Point(nMaxPropertyPageWidth,1), MapMode(MapUnit::MapAppFont)).X() - + TabBar::GetDefaultWidth() * pWindow->GetDPIScaleFactor(); + + TabBar::GetDefaultWidth(); } else return 0; diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 56622cbb2691..e278ded14849 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -420,7 +420,7 @@ void SidebarController::NotifyResize() return; } - const sal_Int32 nTabBarDefaultWidth = TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor(); + const sal_Int32 nTabBarDefaultWidth = TabBar::GetDefaultWidth(); const sal_Int32 nWidth(mpParentWindow->GetSizePixel().Width()); const sal_Int32 nHeight(mpParentWindow->GetSizePixel().Height()); @@ -524,7 +524,7 @@ void SidebarController::ProcessNewWidth (const sal_Int32 nNewWidth) mbIsDeckOpen = true; RequestCloseDeck(); - if (mnWidthOnSplitterButtonDown > TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor()) + if (mnWidthOnSplitterButtonDown > TabBar::GetDefaultWidth()) mnSavedSidebarWidth = mnWidthOnSplitterButtonDown; } } @@ -659,8 +659,7 @@ void SidebarController::OpenThenToggleDeck ( // Make sure the sidebar is wide enough to fit the requested content if (mpCurrentDeck && mpTabBar) { - sal_Int32 nRequestedWidth = (mpCurrentDeck->GetMinimalWidth() + TabBar::GetDefaultWidth()) - * mpTabBar->GetDPIScaleFactor(); + sal_Int32 nRequestedWidth = mpCurrentDeck->GetMinimalWidth() + TabBar::GetDefaultWidth(); if (mnSavedSidebarWidth < nRequestedWidth) SetChildWindowWidth(nRequestedWidth); } @@ -885,7 +884,7 @@ void SidebarController::SwitchToDeck ( #endif SfxSplitWindow* pSplitWindow = GetSplitWindow(); - sal_Int32 nTabBarDefaultWidth = TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor(); + sal_Int32 nTabBarDefaultWidth = TabBar::GetDefaultWidth(); WindowAlign eAlign = pSplitWindow ? pSplitWindow->GetAlign() : WindowAlign::Right; tools::Long nDeckX; if (eAlign == WindowAlign::Left) // attach the Sidebar towards the left-side of screen @@ -1289,7 +1288,7 @@ void SidebarController::UpdateDeckOpenState() // No state requested. return; - const sal_Int32 nTabBarDefaultWidth = TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor(); + const sal_Int32 nTabBarDefaultWidth = TabBar::GetDefaultWidth(); // Update (change) the open state when it either has not yet been initialized // or when its value differs from the requested state. @@ -1429,13 +1428,11 @@ void SidebarController::RestrictWidth (sal_Int32 nWidth) { const sal_uInt16 nId (pSplitWindow->GetItemId(mpParentWindow.get())); const sal_uInt16 nSetId (pSplitWindow->GetSet(nId)); - const sal_Int32 nRequestedWidth - = (TabBar::GetDefaultWidth() + nWidth) * mpTabBar->GetDPIScaleFactor(); + const sal_Int32 nRequestedWidth = TabBar::GetDefaultWidth() + nWidth; pSplitWindow->SetItemSizeRange( nSetId, - Range(nRequestedWidth, - getMaximumWidth() * mpTabBar->GetDPIScaleFactor())); + Range(nRequestedWidth, getMaximumWidth())); } } @@ -1476,7 +1473,7 @@ void SidebarController::UpdateCloseIndicator (const bool bCloseAfterDrag) const Size aImageSize (mpCloseIndicator->GetSizePixel()); mpCloseIndicator->SetPosPixel( Point( - aWindowSize.Width() - TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor() - aImageSize.Width(), + aWindowSize.Width() - TabBar::GetDefaultWidth() - aImageSize.Width(), (aWindowSize.Height() - aImageSize.Height())/2)); mpCloseIndicator->Show(); } |