diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-02-25 11:38:02 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-02-25 21:13:49 +0100 |
commit | a5dbc997bff8f7fe61ddc848f48c880a6e67e448 (patch) | |
tree | 7518b1d7c918effdbc41749d031cde110a357ae3 /vcl/source/window/brdwin.cxx | |
parent | f1512bb979245a22f07b7e34bd923d7ca6b52ac7 (diff) |
drop archaic rollable support
Change-Id: I69f94cd8013a31f8f6bcf62d703b99f659a1ebb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111555
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/window/brdwin.cxx')
-rw-r--r-- | vcl/source/window/brdwin.cxx | 194 |
1 files changed, 55 insertions, 139 deletions
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 976ee9b4fedc..d01e1e0eecb0 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -179,8 +179,6 @@ BorderWindowHitTest ImplBorderWindowView::ImplHitTest( ImplBorderFrameData const { if ( pData->maCloseRect.IsInside( rPos ) ) return BorderWindowHitTest::Close; - else if ( pData->maRollRect.IsInside( rPos ) ) - return BorderWindowHitTest::Roll; else if ( pData->maMenuRect.IsInside( rPos ) ) return BorderWindowHitTest::Menu; else if ( pData->maDockRect.IsInside( rPos ) ) @@ -193,8 +191,7 @@ BorderWindowHitTest ImplBorderWindowView::ImplHitTest( ImplBorderFrameData const return BorderWindowHitTest::Title; } - if ( (pBorderWindow->GetStyle() & WB_SIZEABLE) && - !pBorderWindow->mbRollUp ) + if (pBorderWindow->GetStyle() & WB_SIZEABLE) { tools::Long nSizeWidth = pData->mnNoTitleTop+pData->mnTitleHeight; if ( nSizeWidth < 16 ) @@ -301,14 +298,6 @@ OUString ImplBorderWindowView::ImplRequestHelp( ImplBorderFrameData const * pDat pHelpId = SV_HELPTEXT_CLOSE; rHelpRect = pData->maCloseRect; } - else if ( nHitTest & BorderWindowHitTest::Roll ) - { - if ( pData->mpBorderWindow->mbRollUp ) - pHelpId = SV_HELPTEXT_ROLLDOWN; - else - pHelpId = SV_HELPTEXT_ROLLUP; - rHelpRect = pData->maRollRect; - } else if ( nHitTest & BorderWindowHitTest::Dock ) { pHelpId = SV_HELPTEXT_MAXIMIZE; @@ -354,7 +343,6 @@ tools::Long ImplBorderWindowView::ImplCalcTitleWidth( const ImplBorderFrameData* ImplBorderWindow* pBorderWindow = pData->mpBorderWindow; tools::Long nTitleWidth = pBorderWindow->GetTextWidth( pBorderWindow->GetText() )+6; nTitleWidth += pData->maCloseRect.GetWidth(); - nTitleWidth += pData->maRollRect.GetWidth(); nTitleWidth += pData->maDockRect.GetWidth(); nTitleWidth += pData->maMenuRect.GetWidth(); nTitleWidth += pData->maHideRect.GetWidth(); @@ -747,7 +735,6 @@ ImplStdBorderWindowView::ImplStdBorderWindowView( ImplBorderWindow* pBorderWindo maFrameData.mbDragFull = false; maFrameData.mnHitTest = BorderWindowHitTest::NONE; maFrameData.mnCloseState = DrawButtonFlags::NONE; - maFrameData.mnRollState = DrawButtonFlags::NONE; maFrameData.mnDockState = DrawButtonFlags::NONE; maFrameData.mnMenuState = DrawButtonFlags::NONE; maFrameData.mnHideState = DrawButtonFlags::NONE; @@ -784,11 +771,6 @@ bool ImplStdBorderWindowView::MouseButtonDown( const MouseEvent& rMEvt ) maFrameData.mnCloseState |= DrawButtonFlags::Pressed; pBorderWindow->InvalidateBorder(); } - else if ( maFrameData.mnHitTest & BorderWindowHitTest::Roll ) - { - maFrameData.mnRollState |= DrawButtonFlags::Pressed; - pBorderWindow->InvalidateBorder(); - } else if ( maFrameData.mnHitTest & BorderWindowHitTest::Dock ) { maFrameData.mnDockState |= DrawButtonFlags::Pressed; @@ -903,27 +885,6 @@ bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt ) } } } - else if ( nHitTest & BorderWindowHitTest::Roll ) - { - if ( maFrameData.mnRollState & DrawButtonFlags::Pressed ) - { - maFrameData.mnRollState &= ~DrawButtonFlags::Pressed; - pBorderWindow->InvalidateBorder(); - - // do not call a Click-Handler when aborting - if ( !rTEvt.IsTrackingCanceled() ) - { - if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() ) - { - SystemWindow* pClientWindow = static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow()); - if ( pClientWindow->IsRollUp() ) - pClientWindow->RollDown(); - else - pClientWindow->RollUp(); - } - } - } - } else if ( nHitTest & BorderWindowHitTest::Dock ) { if ( maFrameData.mnDockState & DrawButtonFlags::Pressed ) @@ -1026,25 +987,6 @@ bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt ) } } } - else if ( maFrameData.mnHitTest & BorderWindowHitTest::Roll ) - { - if ( maFrameData.maRollRect.IsInside( aMousePos ) ) - { - if ( !(maFrameData.mnRollState & DrawButtonFlags::Pressed) ) - { - maFrameData.mnRollState |= DrawButtonFlags::Pressed; - pBorderWindow->InvalidateBorder(); - } - } - else - { - if ( maFrameData.mnRollState & DrawButtonFlags::Pressed ) - { - maFrameData.mnRollState &= ~DrawButtonFlags::Pressed; - pBorderWindow->InvalidateBorder(); - } - } - } else if ( maFrameData.mnHitTest & BorderWindowHitTest::Dock ) { if ( maFrameData.maDockRect.IsInside( aMousePos ) ) @@ -1363,7 +1305,6 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, tools::Long nWidth, tool pData->maDockRect.SetEmpty(); pData->maMenuRect.SetEmpty(); pData->maHideRect.SetEmpty(); - pData->maRollRect.SetEmpty(); pData->maHelpRect.SetEmpty(); } @@ -1376,7 +1317,6 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, tools::Long nWidth, tool pData->maDockRect.SetEmpty(); pData->maMenuRect.SetEmpty(); pData->maHideRect.SetEmpty(); - pData->maRollRect.SetEmpty(); pData->maHelpRect.SetEmpty(); } } @@ -1482,8 +1422,6 @@ void ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, con if (!pData->maHelpRect.IsEmpty()) aInRect.SetRight( pData->maHelpRect.Left() - 2 ); - else if (!pData->maRollRect.IsEmpty()) - aInRect.SetRight( pData->maRollRect.Left() - 2 ); else if (!pData->maHideRect.IsEmpty()) aInRect.SetRight( pData->maHideRect.Left() - 2 ); else if (!pData->maDockRect.IsEmpty()) @@ -1540,18 +1478,6 @@ void ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, con aSymbolRect.Move(pOffset->X(), pOffset->Y()); ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, SymbolType::HIDE, pData->mnHideState); } - if (!pData->maRollRect.IsEmpty()) - { - SymbolType eType; - if (pBorderWindow->mbRollUp) - eType = SymbolType::ROLLDOWN; - else - eType = SymbolType::ROLLUP; - tools::Rectangle aSymbolRect(pData->maRollRect); - if (pOffset) - aSymbolRect.Move(pOffset->X(), pOffset->Y()); - ImplDrawBrdWinSymbolButton(&rRenderContext, aSymbolRect, eType, pData->mnRollState); - } if (!pData->maHelpRect.IsEmpty()) { @@ -1623,7 +1549,6 @@ void ImplBorderWindow::ImplInit( vcl::Window* pParent, mnMaxWidth = SHRT_MAX; mnMaxHeight = SHRT_MAX; mnOrgMenuHeight = 0; - mbRollUp = false; mbMenuHide = false; mbDockBtn = false; mbMenuBtn = false; @@ -1739,73 +1664,70 @@ void ImplBorderWindow::Resize() { Size aSize = GetOutputSizePixel(); - if ( !mbRollUp ) - { - vcl::Window* pClientWindow = ImplGetClientWindow(); + vcl::Window* pClientWindow = ImplGetClientWindow(); - sal_Int32 nLeftBorder; - sal_Int32 nTopBorder; - sal_Int32 nRightBorder; - sal_Int32 nBottomBorder; - mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder ); + sal_Int32 nLeftBorder; + sal_Int32 nTopBorder; + sal_Int32 nRightBorder; + sal_Int32 nBottomBorder; + mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder ); - if (mpMenuBarWindow) + if (mpMenuBarWindow) + { + tools::Long nMenuHeight = mpMenuBarWindow->GetSizePixel().Height(); + if ( mbMenuHide ) { - tools::Long nMenuHeight = mpMenuBarWindow->GetSizePixel().Height(); - if ( mbMenuHide ) - { - if ( nMenuHeight ) - mnOrgMenuHeight = nMenuHeight; - nMenuHeight = 0; - } - else - { - if ( !nMenuHeight ) - nMenuHeight = mnOrgMenuHeight; - } - mpMenuBarWindow->setPosSizePixel( - nLeftBorder, nTopBorder, - aSize.Width()-nLeftBorder-nRightBorder, - nMenuHeight); - - // shift the notebookbar down accordingly - nTopBorder += nMenuHeight; + if ( nMenuHeight ) + mnOrgMenuHeight = nMenuHeight; + nMenuHeight = 0; } - - if (mpNotebookBar) + else { - tools::Long nNotebookBarHeight = mpNotebookBar->GetSizePixel().Height(); + if ( !nMenuHeight ) + nMenuHeight = mnOrgMenuHeight; + } + mpMenuBarWindow->setPosSizePixel( + nLeftBorder, nTopBorder, + aSize.Width()-nLeftBorder-nRightBorder, + nMenuHeight); - const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - const BitmapEx& aPersona = rStyleSettings.GetPersonaHeader(); - // since size of notebookbar changes, to make common persona for menubar - // and notebookbar persona should be set again with changed coordinates - if (!aPersona.IsEmpty()) - { - Wallpaper aWallpaper(aPersona); - aWallpaper.SetStyle(WallpaperStyle::TopRight); - aWallpaper.SetRect(tools::Rectangle(Point(0, -nTopBorder), - Size(aSize.Width() - nLeftBorder - nRightBorder, - nNotebookBarHeight + nTopBorder))); - mpNotebookBar->SetBackground(aWallpaper); - } + // shift the notebookbar down accordingly + nTopBorder += nMenuHeight; + } - mpNotebookBar->setPosSizePixel( - nLeftBorder, nTopBorder, - aSize.Width() - nLeftBorder - nRightBorder, - nNotebookBarHeight); - } + if (mpNotebookBar) + { + tools::Long nNotebookBarHeight = mpNotebookBar->GetSizePixel().Height(); - GetBorder( pClientWindow->mpWindowImpl->mnLeftBorder, pClientWindow->mpWindowImpl->mnTopBorder, - pClientWindow->mpWindowImpl->mnRightBorder, pClientWindow->mpWindowImpl->mnBottomBorder ); - pClientWindow->ImplPosSizeWindow( pClientWindow->mpWindowImpl->mnLeftBorder, - pClientWindow->mpWindowImpl->mnTopBorder, - aSize.Width()-pClientWindow->mpWindowImpl->mnLeftBorder-pClientWindow->mpWindowImpl->mnRightBorder, - aSize.Height()-pClientWindow->mpWindowImpl->mnTopBorder-pClientWindow->mpWindowImpl->mnBottomBorder, - PosSizeFlags::X | PosSizeFlags::Y | - PosSizeFlags::Width | PosSizeFlags::Height ); + const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); + const BitmapEx& aPersona = rStyleSettings.GetPersonaHeader(); + // since size of notebookbar changes, to make common persona for menubar + // and notebookbar persona should be set again with changed coordinates + if (!aPersona.IsEmpty()) + { + Wallpaper aWallpaper(aPersona); + aWallpaper.SetStyle(WallpaperStyle::TopRight); + aWallpaper.SetRect(tools::Rectangle(Point(0, -nTopBorder), + Size(aSize.Width() - nLeftBorder - nRightBorder, + nNotebookBarHeight + nTopBorder))); + mpNotebookBar->SetBackground(aWallpaper); + } + + mpNotebookBar->setPosSizePixel( + nLeftBorder, nTopBorder, + aSize.Width() - nLeftBorder - nRightBorder, + nNotebookBarHeight); } + GetBorder( pClientWindow->mpWindowImpl->mnLeftBorder, pClientWindow->mpWindowImpl->mnTopBorder, + pClientWindow->mpWindowImpl->mnRightBorder, pClientWindow->mpWindowImpl->mnBottomBorder ); + pClientWindow->ImplPosSizeWindow( pClientWindow->mpWindowImpl->mnLeftBorder, + pClientWindow->mpWindowImpl->mnTopBorder, + aSize.Width()-pClientWindow->mpWindowImpl->mnLeftBorder-pClientWindow->mpWindowImpl->mnRightBorder, + aSize.Height()-pClientWindow->mpWindowImpl->mnTopBorder-pClientWindow->mpWindowImpl->mnBottomBorder, + PosSizeFlags::X | PosSizeFlags::Y | + PosSizeFlags::Width | PosSizeFlags::Height ); + // UpdateView mpBorderView->Init( this, aSize.Width(), aSize.Height() ); InvalidateBorder(); @@ -1955,12 +1877,6 @@ void ImplBorderWindow::SetBorderStyle( WindowBorderStyle nStyle ) } } -void ImplBorderWindow::SetRollUp( bool bRollUp, const Size& rSize ) -{ - mbRollUp = bRollUp; - UpdateView( false, rSize ); -} - void ImplBorderWindow::SetCloseButton() { SetStyle( GetStyle() | WB_CLOSEABLE ); |