Kaydet (Commit) 8965bfda authored tarafından Prashant Pandey's avatar Prashant Pandey Kaydeden (comit) Caolán McNamara

Fixing the problem with Sidebar-alignment

Currently, when the sidebar is taken from right side of
the screen to left side of the screen, the vertical tab
-bar is still attached towards the right side of deck.
Ideally, when the sidebar is attched towards the left
side of the screen, the tab-bar should automatically set
towards the left side of deck.

Change-Id: I1f56e5f0b7dfef37760e6563e7d757f7901cf2cd
Reviewed-on: https://gerrit.libreoffice.org/5979Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 76227410
......@@ -361,22 +361,45 @@ void SidebarController::NotifyResize (void)
else
bIsDeckVisible = false;
// Place the deck.
if (mpCurrentDeck)
SfxSplitWindow* pSplitWindow = GetSplitWindow();
if ( mpCurrentDeck && pSplitWindow )
{
if (bIsDeckVisible)
// 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
{
mpCurrentDeck->setPosSizePixel(0,0, nWidth-TabBar::GetDefaultWidth(), nHeight);
mpCurrentDeck->Show();
mpCurrentDeck->RequestLayout();
// Place the deck first.
{
if (bIsDeckVisible)
{
mpCurrentDeck->setPosSizePixel(0,0, nWidth-TabBar::GetDefaultWidth(), nHeight);
mpCurrentDeck->Show();
mpCurrentDeck->RequestLayout();
}
else
mpCurrentDeck->Hide();
}
// Now place the tab bar.
mpTabBar->setPosSizePixel(nWidth-TabBar::GetDefaultWidth(),0,TabBar::GetDefaultWidth(),nHeight);
mpTabBar->Show();
}
else
mpCurrentDeck->Hide();
}
else if ( pSplitWindow->GetAlign() == WINDOWALIGN_LEFT) // attach the Sidebar towards the left-side of screen
{
// Place the tab bar first.
mpTabBar->setPosSizePixel(0,0,TabBar::GetDefaultWidth(),nHeight);
mpTabBar->Show();
// Place the tab bar.
mpTabBar->setPosSizePixel(nWidth-TabBar::GetDefaultWidth(),0,TabBar::GetDefaultWidth(),nHeight);
mpTabBar->Show();
// Now place the deck.
if (bIsDeckVisible)
{
mpCurrentDeck->setPosSizePixel(TabBar::GetDefaultWidth(),0, nWidth-TabBar::GetDefaultWidth(), nHeight);
mpCurrentDeck->Show();
mpCurrentDeck->RequestLayout();
}
else
mpCurrentDeck->Hide();
}
}
// Determine if the closer of the deck can be shown.
sal_Int32 nMinimalWidth = 0;
......@@ -667,6 +690,7 @@ void SidebarController::SwitchToDeck (
0,
mpParentWindow->GetSizePixel().Width()-TabBar::GetDefaultWidth(),
mpParentWindow->GetSizePixel().Height());
mpCurrentDeck->SetPanels(aNewPanels);
mpCurrentDeck->Show();
......
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