[Libreoffice-commits] core.git: sfx2/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Mar 31 19:07:26 UTC 2021
sfx2/source/sidebar/SidebarChildWindow.cxx | 6 +++---
sfx2/source/sidebar/SidebarController.cxx | 19 ++++++++-----------
2 files changed, 11 insertions(+), 14 deletions(-)
New commits:
commit 84b512ab3d8007293f2e8d338814db3ce7e4a63e
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Mar 30 11:14:12 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Mar 31 21:06:37 2021 +0200
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 at redhat.com>
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();
}
More information about the Libreoffice-commits
mailing list