Kaydet (Commit) 5e0acb90 authored tarafından Ivan Timofeev's avatar Ivan Timofeev

so many code to just add a minimal border in the gallery

Change-Id: Id7349d1ff6547afe0f46404340b20132b97ce854
üst c66efa24
......@@ -331,7 +331,6 @@ GalleryBrowser2::GalleryBrowser2( GalleryBrowser* pParent, const ResId& rResId,
maViewBox.SetHelpId( TBX_ID_LIST, HID_GALLERY_LISTVIEW );
maViewBox.SetQuickHelpText( TBX_ID_LIST, GAL_RESSTR(RID_SVXSTR_GALLERY_LISTVIEW) );
maViewBox.SetBorder( 0, 1 );
MiscHdl( NULL );
maViewBox.SetSelectHdl( LINK( this, GalleryBrowser2, SelectTbxHdl ) );
maViewBox.Show();
......
......@@ -193,8 +193,6 @@ private:
long mnMaxItemWidth; // max item width
long mnMaxItemHeight; // max item height (for standard items)
long mnWinHeight; // max window height (for window items)
long mnBorderX; // custom border
long mnBorderY;
long mnLeftBorder; // inner border
long mnTopBorder;
long mnRightBorder;
......@@ -516,10 +514,6 @@ public:
void SetFloatingLines( sal_uInt16 nFloatLines );
sal_uInt16 GetFloatingLines() const;
void SetBorder( long nX, long nY );
long GetBorderX() const { return mnBorderX; }
long GetBorderY() const { return mnBorderY; }
void SetStyle( WinBits nNewStyle ) { mnWinStyle = nNewStyle; }
WinBits GetStyle() const { return mnWinStyle; }
......
......@@ -466,24 +466,6 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp
}
}
if( pThis->mbHorz )
{
aTopLineSz.Height() += pThis->mnBorderY;
if( pThis->mnCurLines == 1 )
aTopLineSz.Height() += pThis->mnBorderY;
aBottomLineSz.Height() += pThis->mnBorderY;
}
else
{
aTopLineSz.Width() += pThis->mnBorderX;
if( pThis->mnCurLines == 1 )
aTopLineSz.Width() += pThis->mnBorderX;
aBottomLineSz.Width() += pThis->mnBorderX;
}
if ( pThis->mnWinStyle & WB_LINESPACING )
{
if( pThis->mbHorz )
......@@ -867,11 +849,6 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uIn
}
}
if ( aSize.Width() )
aSize.Width() += pThis->mnBorderX*2;
if ( aSize.Height() )
aSize.Height() += pThis->mnBorderY*2;
return aSize;
}
......@@ -1548,8 +1525,6 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle )
mnMaxItemWidth = 0;
mnMaxItemHeight = 0;
mnWinHeight = 0;
mnBorderX = 0;
mnBorderY = 0;
mnLeftBorder = 0;
mnTopBorder = 0;
mnRightBorder = 0;
......@@ -2292,8 +2267,8 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode )
{
// try to preserve current width
long nLineHeight = ( mnWinHeight > mnMaxItemHeight ) ? mnWinHeight : mnMaxItemHeight;
int nBorderX = 2*TB_BORDER_OFFSET1 + mnLeftBorder + mnRightBorder + 2*mnBorderX;
int nBorderY = 2*TB_BORDER_OFFSET2 + mnTopBorder + mnBottomBorder + 2*mnBorderY;
int nBorderX = 2*TB_BORDER_OFFSET1 + mnLeftBorder + mnRightBorder;
int nBorderY = 2*TB_BORDER_OFFSET2 + mnTopBorder + mnBottomBorder;
Size aSz( aCurrentSize );
long maxX;
sal_uInt16 nLines = ImplCalcBreaks( aSz.Width()-nBorderX, &maxX, mbHorz );
......@@ -2446,7 +2421,6 @@ void ToolBox::ImplFormat( sal_Bool bResize )
}
// add in all border offsets
// inner border as well as custom border (mnBorderX, mnBorderY)
if ( mnWinStyle & WB_BORDER )
{
nLeft = TB_BORDER_OFFSET1 + mnLeftBorder;
......@@ -2461,11 +2435,6 @@ void ToolBox::ImplFormat( sal_Bool bResize )
nBottom = 0;
}
nLeft += mnBorderX;
nTop += mnBorderY;
nBottom += mnBorderY;
nMax -= mnBorderX*2;
// adjust linesize if docked in single-line mode (i.e. when using a clipped item menu)
// we have to center all items in the window height
if( IsMenuEnabled() && !ImplIsFloatingMode() )
......@@ -2505,11 +2474,6 @@ void ToolBox::ImplFormat( sal_Bool bResize )
nRight = 0;
}
nLeft += mnBorderX;
nRight+= mnBorderX;
nTop += mnBorderY;
nMax -= mnBorderY*2;
// adjust linesize if docked in single-line mode (i.e. when using a clipped item menu)
// we have to center all items in the window height
if( !ImplIsFloatingMode() && IsMenuEnabled() )
......@@ -2565,14 +2529,14 @@ void ToolBox::ImplFormat( sal_Bool bResize )
maNextToolRect.Left() = nLeft+nMax;
maNextToolRect.Right() = maNextToolRect.Left()+TB_NEXT_SIZE-1;
maNextToolRect.Top() = nTop;
maNextToolRect.Bottom() = mnDY-mnBottomBorder-mnBorderY-TB_BORDER_OFFSET2-1;
maNextToolRect.Bottom() = mnDY-mnBottomBorder-TB_BORDER_OFFSET2-1;
}
else
{
maNextToolRect.Top() = nTop+nMax;
maNextToolRect.Bottom() = maNextToolRect.Top()+TB_NEXT_SIZE-1;
maNextToolRect.Left() = nLeft;
maNextToolRect.Right() = mnDX-mnRightBorder-mnBorderX-TB_BORDER_OFFSET2-1;
maNextToolRect.Right() = mnDX-mnRightBorder-TB_BORDER_OFFSET2-1;
}
}
......@@ -2607,13 +2571,13 @@ void ToolBox::ImplFormat( sal_Bool bResize )
{
mpData->maMenubuttonItem.maRect.Right() = mnDX - 2;
mpData->maMenubuttonItem.maRect.Top() = nTop;
mpData->maMenubuttonItem.maRect.Bottom() = mnDY-mnBottomBorder-mnBorderY-TB_BORDER_OFFSET2-1;
mpData->maMenubuttonItem.maRect.Bottom() = mnDY-mnBottomBorder-TB_BORDER_OFFSET2-1;
}
else
{
mpData->maMenubuttonItem.maRect.Right() = mnDX - mnRightBorder-mnBorderX-TB_BORDER_OFFSET1-1;
mpData->maMenubuttonItem.maRect.Right() = mnDX - mnRightBorder-TB_BORDER_OFFSET1-1;
mpData->maMenubuttonItem.maRect.Top() = nTop;
mpData->maMenubuttonItem.maRect.Bottom() = mnDY-mnBottomBorder-mnBorderY-TB_BORDER_OFFSET2-1;
mpData->maMenubuttonItem.maRect.Bottom() = mnDY-mnBottomBorder-TB_BORDER_OFFSET2-1;
}
mpData->maMenubuttonItem.maRect.Left() = mpData->maMenubuttonItem.maRect.Right() - mpData->mnMenuButtonWidth;
}
......@@ -2622,7 +2586,7 @@ void ToolBox::ImplFormat( sal_Bool bResize )
maUpperRect.Left() = nLeft+nMax+TB_SPIN_OFFSET;
maUpperRect.Right() = maUpperRect.Left()+TB_SPIN_SIZE-1;
maUpperRect.Top() = nTop;
maLowerRect.Bottom() = mnDY-mnBottomBorder-mnBorderY-TB_BORDER_OFFSET2-1;
maLowerRect.Bottom() = mnDY-mnBottomBorder-TB_BORDER_OFFSET2-1;
maLowerRect.Left() = maUpperRect.Left();
maLowerRect.Right() = maUpperRect.Right();
maUpperRect.Bottom() = maUpperRect.Top() +
......@@ -2638,13 +2602,13 @@ void ToolBox::ImplFormat( sal_Bool bResize )
{
mpData->maMenubuttonItem.maRect.Bottom() = mnDY - 2;
mpData->maMenubuttonItem.maRect.Left() = nLeft;
mpData->maMenubuttonItem.maRect.Right() = mnDX-mnRightBorder-mnBorderX-TB_BORDER_OFFSET2-1;
mpData->maMenubuttonItem.maRect.Right() = mnDX-mnRightBorder-TB_BORDER_OFFSET2-1;
}
else
{
mpData->maMenubuttonItem.maRect.Bottom() = mnDY - mnBottomBorder-mnBorderY-TB_BORDER_OFFSET1-1;
mpData->maMenubuttonItem.maRect.Bottom() = mnDY - mnBottomBorder-TB_BORDER_OFFSET1-1;
mpData->maMenubuttonItem.maRect.Left() = nLeft;
mpData->maMenubuttonItem.maRect.Right() = mnDX-mnRightBorder-mnBorderX-TB_BORDER_OFFSET2-1;
mpData->maMenubuttonItem.maRect.Right() = mnDX-mnRightBorder-TB_BORDER_OFFSET2-1;
}
mpData->maMenubuttonItem.maRect.Top() = mpData->maMenubuttonItem.maRect.Bottom() - mpData->mnMenuButtonWidth;
}
......@@ -2653,7 +2617,7 @@ void ToolBox::ImplFormat( sal_Bool bResize )
maUpperRect.Top() = nTop+nMax+TB_SPIN_OFFSET;
maUpperRect.Bottom() = maUpperRect.Top()+TB_SPIN_SIZE-1;
maUpperRect.Left() = nLeft;
maLowerRect.Right() = mnDX-mnRightBorder-mnBorderX-TB_BORDER_OFFSET2-1;
maLowerRect.Right() = mnDX-mnRightBorder-TB_BORDER_OFFSET2-1;
maLowerRect.Top() = maUpperRect.Top();
maLowerRect.Bottom() = maUpperRect.Bottom();
maUpperRect.Right() = maUpperRect.Left() +
......
......@@ -1773,16 +1773,6 @@ rtl::OString ToolBox::GetHelpId( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
void ToolBox::SetBorder( long nX, long nY )
{
mnBorderX = nX;
mnBorderY = nY;
ImplInvalidate( sal_True, sal_True );
}
// -----------------------------------------------------------------------
void ToolBox::SetOutStyle( sal_uInt16 nNewStyle )
{
// always force flat looking toolbars since NWF
......
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