tdf#96683 Move tabs in Basic IDE to an own row
So that the tab height does not depend on the scrollbar height (which is subject to the desktop theme) Change-Id: Ie2d787528152aed92c9943fe76955bf499d7d2a9 Reviewed-on: https://gerrit.libreoffice.org/21707 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
parent
04d4af8496
commit
867af25bd8
@ -1186,30 +1186,21 @@ void Shell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
|
||||
if ( GetViewFrame()->GetWindow().GetOutputSizePixel().Height() == 0 )
|
||||
return;
|
||||
|
||||
Size aTabBarSize;
|
||||
aTabBarSize.Height() = GetViewFrame()->GetWindow().GetFont().GetHeight() + 4;
|
||||
aTabBarSize.Width() = rSize.Width();
|
||||
|
||||
Size aSz( rSize );
|
||||
Size aScrollBarBoxSz( aScrollBarBox->GetSizePixel() );
|
||||
aSz.Height() -= aScrollBarBoxSz.Height();
|
||||
aSz.Height() -= aTabBarSize.Height();
|
||||
|
||||
Size aOutSz( aSz );
|
||||
aSz.Width() -= aScrollBarBoxSz.Width();
|
||||
aScrollBarBox->SetPosPixel( Point( rSize.Width() - aScrollBarBoxSz.Width(), rSize.Height() - aScrollBarBoxSz.Height() ) );
|
||||
aVScrollBar->SetPosSizePixel( Point( rPos.X()+aSz.Width(), rPos.Y() ), Size( aScrollBarBoxSz.Width(), aSz.Height() ) );
|
||||
if ( bTabBarSplitted )
|
||||
{
|
||||
// SplitSize is 0 at a resize!
|
||||
long nSplitPos = pTabBar->GetSizePixel().Width();
|
||||
if ( nSplitPos > aSz.Width() )
|
||||
nSplitPos = aSz.Width();
|
||||
pTabBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aSz.Height() ), Size( nSplitPos, aScrollBarBoxSz.Height() ) );
|
||||
long nScrlStart = rPos.X() + nSplitPos;
|
||||
aHScrollBar->SetPosSizePixel( Point( nScrlStart, rPos.Y()+aSz.Height() ), Size( aSz.Width() - nScrlStart + 1, aScrollBarBoxSz.Height() ) );
|
||||
aHScrollBar->Update();
|
||||
}
|
||||
else
|
||||
{
|
||||
aHScrollBar->SetPosSizePixel( Point( rPos.X()+ aSz.Width()/2 - 1, rPos.Y()+aSz.Height() ), Size( aSz.Width()/2 + 2, aScrollBarBoxSz.Height() ) );
|
||||
pTabBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aSz.Height() ), Size( aSz.Width()/2, aScrollBarBoxSz.Height() ) );
|
||||
}
|
||||
aHScrollBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aSz.Height() ), Size( aSz.Width(), aScrollBarBoxSz.Height() ) );
|
||||
pTabBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aScrollBarBoxSz.Height()+aSz.Height()), aTabBarSize );
|
||||
|
||||
if (pLayout)
|
||||
pLayout->SetPosSizePixel(rPos, dynamic_cast<DialogWindow*>(pCurWin.get()) ? aSz : aOutSz);
|
||||
|
@ -187,8 +187,6 @@ void Shell::Init()
|
||||
bCreatingWindow = false;
|
||||
|
||||
pTabBar.reset(VclPtr<TabBar>::Create(&GetViewFrame()->GetWindow()));
|
||||
pTabBar->SetSplitHdl( LINK( this, Shell, TabBarSplitHdl ) );
|
||||
bTabBarSplitted = false;
|
||||
|
||||
nCurKey = 100;
|
||||
InitScrollBars();
|
||||
@ -441,12 +439,6 @@ void Shell::OuterResizePixel( const Point &rPos, const Size &rSize )
|
||||
}
|
||||
|
||||
|
||||
IMPL_LINK_NOARG_TYPED( Shell, TabBarSplitHdl, ::TabBar *, void )
|
||||
{
|
||||
bTabBarSplitted = true;
|
||||
ArrangeTabBar();
|
||||
}
|
||||
|
||||
IMPL_LINK_TYPED( Shell, TabBarHdl, ::TabBar *, pCurTabBar, void )
|
||||
{
|
||||
sal_uInt16 nCurId = pCurTabBar->GetCurPageId();
|
||||
@ -477,25 +469,6 @@ bool Shell::NextPage( bool bPrev )
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Shell::ArrangeTabBar()
|
||||
{
|
||||
long nBoxPos = aScrollBarBox->GetPosPixel().X() - 1;
|
||||
long nPos = pTabBar->GetSplitSize();
|
||||
if ( nPos <= nBoxPos )
|
||||
{
|
||||
Point aPnt( pTabBar->GetPosPixel() );
|
||||
long nH = aHScrollBar->GetSizePixel().Height();
|
||||
pTabBar->SetPosSizePixel( aPnt, Size( nPos, nH ) );
|
||||
long nScrlStart = aPnt.X() + nPos;
|
||||
aHScrollBar->SetPosSizePixel( Point( nScrlStart, aPnt.Y() ), Size( nBoxPos - nScrlStart + 2, nH ) );
|
||||
aHScrollBar->Update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
::svl::IUndoManager* Shell::GetUndoManager()
|
||||
{
|
||||
::svl::IUndoManager* pMgr = nullptr;
|
||||
|
@ -75,7 +75,6 @@ private:
|
||||
VclPtr<ScrollBar> aVScrollBar;
|
||||
VclPtr<ScrollBarBox> aScrollBarBox;
|
||||
VclPtr<TabBar> pTabBar; // basctl::TabBar
|
||||
bool bTabBarSplitted;
|
||||
bool bCreatingWindow;
|
||||
// layout windows
|
||||
VclPtr<ModulWindowLayout> pModulLayout;
|
||||
@ -106,7 +105,6 @@ private:
|
||||
void ImplStartListening( StarBASIC* pBasic );
|
||||
|
||||
DECL_LINK_TYPED( TabBarHdl, ::TabBar*, void );
|
||||
DECL_LINK_TYPED( TabBarSplitHdl, ::TabBar *, void );
|
||||
|
||||
static unsigned nShellCount;
|
||||
|
||||
@ -118,7 +116,6 @@ private:
|
||||
|
||||
void SetCurWindow (BaseWindow* pNewWin, bool bUpdateTabBar = false, bool bRememberAsCurrent = true);
|
||||
void ManageToolbars();
|
||||
void ArrangeTabBar();
|
||||
|
||||
VclPtr<ModulWindow> CreateBasWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rModName );
|
||||
VclPtr<DialogWindow> CreateDlgWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rDlgName );
|
||||
|
Loading…
x
Reference in New Issue
Block a user