Kaydet (Commit) 4073afa3 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#72007: on switching decks keep our left indent, don't assume 0

Change-Id: I878c999611e1294d5107f1cf2c000d9ed5f88cb1
üst 0776b33f
......@@ -324,62 +324,33 @@ void SidebarController::NotifyResize()
if (mpCurrentDeck)
{
SfxSplitWindow* pSplitWindow = GetSplitWindow();
if (pSplitWindow) //in sidebar mode
WindowAlign eAlign = pSplitWindow ? pSplitWindow->GetAlign() : WINDOWALIGN_LEFT;
long nDeckX, nTabX;
if (eAlign == WINDOWALIGN_LEFT) // attach the Sidebar towards the left-side of screen
{
// Find out that which side of the Window do we need to attach the Sidebar?
if ( pSplitWindow->GetAlign() == WINDOWALIGN_RIGHT ) // attach the Sidebar towards the right-side of screen
{
// Place the deck first.
{
if (bIsDeckVisible)
{
mpCurrentDeck->setPosSizePixel(0,0, nWidth-nTabBarDefaultWidth, nHeight);
mpCurrentDeck->Show();
mpCurrentDeck->RequestLayout();
}
else
mpCurrentDeck->Hide();
}
// Now place the tab bar.
mpTabBar->setPosSizePixel(nWidth-nTabBarDefaultWidth,0,nTabBarDefaultWidth,nHeight);
mpTabBar->Show();
}
else if ( pSplitWindow->GetAlign() == WINDOWALIGN_LEFT) // attach the Sidebar towards the left-side of screen
{
// Place the tab bar first.
mpTabBar->setPosSizePixel(0,0,nTabBarDefaultWidth,nHeight);
mpTabBar->Show();
// Now place the deck.
if (bIsDeckVisible)
{
mpCurrentDeck->setPosSizePixel(nTabBarDefaultWidth,0, nWidth-nTabBarDefaultWidth, nHeight);
mpCurrentDeck->Show();
mpCurrentDeck->RequestLayout();
}
else
mpCurrentDeck->Hide();
}
nDeckX = nTabBarDefaultWidth;
nTabX = 0;
}
else //floating window mode
else // attach the Sidebar towards the right-side of screen
{
// Place the deck first.
{
if (bIsDeckVisible)
{
mpCurrentDeck->setPosSizePixel(0,0, nWidth-nTabBarDefaultWidth, nHeight);
mpCurrentDeck->Show();
mpCurrentDeck->RequestLayout();
}
else
mpCurrentDeck->Hide();
}
nDeckX = 0;
nTabX = nWidth-nTabBarDefaultWidth;
}
// Now place the tab bar.
mpTabBar->setPosSizePixel(nWidth-nTabBarDefaultWidth,0,nTabBarDefaultWidth,nHeight);
mpTabBar->Show();
// Place the deck first.
if (bIsDeckVisible)
{
mpCurrentDeck->setPosSizePixel(nDeckX, 0, nWidth - nTabBarDefaultWidth, nHeight);
mpCurrentDeck->Show();
mpCurrentDeck->RequestLayout();
}
else
mpCurrentDeck->Hide();
// Now place the tab bar.
mpTabBar->setPosSizePixel(nTabX, 0, nTabBarDefaultWidth, nHeight);
mpTabBar->Show();
}
// Determine if the closer of the deck can be shown.
......@@ -658,11 +629,24 @@ void SidebarController::SwitchToDeck (
// mpCurrentPanels - may miss stuff (?)
aNewPanels.resize(nWriteIndex);
SfxSplitWindow* pSplitWindow = GetSplitWindow();
sal_Int32 nTabBarDefaultWidth = TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor();
WindowAlign eAlign = pSplitWindow ? pSplitWindow->GetAlign() : WINDOWALIGN_LEFT;
long nDeckX;
if (eAlign == WINDOWALIGN_LEFT) // attach the Sidebar towards the left-side of screen
{
nDeckX = nTabBarDefaultWidth;
}
else // attach the Sidebar towards the right-side of screen
{
nDeckX = 0;
}
// Activate the deck and the new set of panels.
mpCurrentDeck->setPosSizePixel(
nDeckX,
0,
0,
mpParentWindow->GetSizePixel().Width()-TabBar::GetDefaultWidth() * mpTabBar->GetDPIScaleFactor(),
mpParentWindow->GetSizePixel().Width() - nTabBarDefaultWidth,
mpParentWindow->GetSizePixel().Height());
mpCurrentDeck->ResetPanels(aNewPanels);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment