From a94bfed0cce494c88812595eae1dc4e9b762240c Mon Sep 17 00:00:00 2001 From: "james.k.crook@gmail.com" Date: Wed, 29 Oct 2014 19:15:19 +0000 Subject: [PATCH] Incremental improvement to toolbars. Fixes the undock-redock moving the toolbar to a new position. No change expected to 'dock marker vanishes' in linux issue. --- src/toolbars/ToolManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/toolbars/ToolManager.cpp b/src/toolbars/ToolManager.cpp index c627f0f12..097551220 100644 --- a/src/toolbars/ToolManager.cpp +++ b/src/toolbars/ToolManager.cpp @@ -1026,6 +1026,11 @@ void ToolManager::OnMouse( wxMouseEvent & event ) br.SetBottom( br.GetBottom() + 20 ); br.SetPosition( mBotDock->GetParent()->ClientToScreen( br.GetPosition() ) ); + + // Add half the bar height. We could use the actual bar height, but that would be confusing as a + // bar removed at a place might not dock back there if just let go. + pos += wxPoint( 0, 20 ); + // Is mouse pointer within either dock? ToolDock *dock = NULL; if( tr.Contains( pos ) ) @@ -1043,6 +1048,7 @@ void ToolManager::OnMouse( wxMouseEvent & event ) wxPoint p; wxRect r; + // Calculate where the bar would be placed mDragBefore = dock->PositionBar( mDragBar, pos, r );