diff options
author | Noel Power <noel.power@novell.com> | 2011-11-24 19:45:09 +0000 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2011-11-24 19:49:15 +0000 |
commit | 50171e51373800bfe598e461d551f873aff87f09 (patch) | |
tree | 1093f52392c323b4cdd0a8637d3a3f2277abf610 /vcl/source | |
parent | ef3a19eed2dc3aaddf3d48a204eff934b7002055 (diff) |
tweak toolbar layout for gsoc formula/input bar & other misc changes
summary:
* tweak toolbar layout to layout the toolbar items aligned to top of highest
item
* make Capture/ReleaseMouse logic much simpler
* make resize detection simpler
* control toolbar height ( e.g. don't let visible grid area be overrun by
toolbar )
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/toolbox.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 13a56487340f..1016301ca157 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -1596,6 +1596,7 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle ) meAlign = WINDOWALIGN_TOP; meLastStyle = POINTER_ARROW; mnWinStyle = nStyle; + meLayoutMode = TBX_LAYOUT_NORMAL; mnLastFocusItemId = 0; mnKeyModifier = 0; mnActivateCount = 0; @@ -2720,7 +2721,10 @@ void ToolBox::ImplFormat( sal_Bool bResize ) if ( mbHorz ) { it->maCalcRect.Left() = nX; - it->maCalcRect.Top() = nY+(nLineSize-aCurrentItemSize.Height())/2; + if ( meLayoutMode == TBX_LAYOUT_TOP && mnLines ) + it->maCalcRect.Top() = nY/2; + else + it->maCalcRect.Top() = nY+(nLineSize-aCurrentItemSize.Height())/2; it->maCalcRect.Right() = nX+aCurrentItemSize.Width()-1; it->maCalcRect.Bottom() = it->maCalcRect.Top()+aCurrentItemSize.Height()-1; nX += aCurrentItemSize.Width(); @@ -6014,4 +6018,15 @@ void ToolBox::ImplDisableFlatButtons() #endif } +ToolBoxLayoutMode ToolBox::GetToolbarLayoutMode() +{ + return meLayoutMode; +} + +void ToolBox::SetToolbarLayoutMode( ToolBoxLayoutMode eLayout ) +{ + if ( meLayoutMode != eLayout ) + meLayoutMode = eLayout; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |