diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-27 15:52:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-27 15:54:16 +0100 |
commit | 7aeef829fdc25a60530c776c8f4958b7415384ce (patch) | |
tree | 0503c91a3e0e3a19546b508404ee6da6363b332d | |
parent | 86b7f932487c0372180f8ea111fcc045c52a49cf (diff) |
Related: fdo#65634 make sidebar react to resizes when floating
the parent isn't a SfxSplitWindow in this case, but it should
still react to the resize
Change-Id: Ia298d45b33fc272d6169df12cf2c58a881255163
(cherry picked from commit df630b8f8c2c92ec2cd1e4be6a3f54a4e4960e92)
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 70 |
1 files changed, 41 insertions, 29 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 7701879683d0..2d6c56edbfcd 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -315,9 +315,6 @@ void SAL_CALL SidebarController::requestLayout (void) RestrictWidth(nMinimalWidth); } - - - void SidebarController::BroadcastPropertyChange (void) { DataChangedEvent aEvent (DATACHANGED_USER); @@ -325,9 +322,6 @@ void SidebarController::BroadcastPropertyChange (void) mpParentWindow->Invalidate(INVALIDATE_CHILDREN); } - - - void SidebarController::NotifyResize (void) { if (mpTabBar == 0) @@ -361,11 +355,48 @@ void SidebarController::NotifyResize (void) else bIsDeckVisible = false; - SfxSplitWindow* pSplitWindow = GetSplitWindow(); - if ( mpCurrentDeck && pSplitWindow ) + if (mpCurrentDeck) { - // 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 + SfxSplitWindow* pSplitWindow = GetSplitWindow(); + if (pSplitWindow) //in sidebar mode + { + // 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(); + } + } + else //floating window mode { // Place the deck first. { @@ -383,22 +414,6 @@ void SidebarController::NotifyResize (void) 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(); - } } // Determine if the closer of the deck can be shown. @@ -414,9 +429,6 @@ void SidebarController::NotifyResize (void) RestrictWidth(nMinimalWidth); } - - - void SidebarController::ProcessNewWidth (const sal_Int32 nNewWidth) { if ( ! mbIsDeckRequestedOpen) |