]> git.saurik.com Git - wxWidgets.git/commitdiff
undock/float toolbar if it's dragged right or south of client area
authorBenjamin Williams <bwilliams@kirix.com>
Tue, 31 Mar 2009 08:32:16 +0000 (08:32 +0000)
committerBenjamin Williams <bwilliams@kirix.com>
Tue, 31 Mar 2009 08:32:16 +0000 (08:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59959 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/aui/framemanager.cpp

index cbf61e65190225f24fa1c76b4b1e9c446a16bd56..76a3081d68ef17379e8aa29a88469f0c7b38b2ca 100644 (file)
@@ -3026,7 +3026,8 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
         // toolbars may only be moved in and to fixed-pane docks,
         // otherwise we will try to float the pane.  Also, the pane
         // should float if being dragged over center pane windows
-        if (!part->dock->fixed || part->dock->dock_direction == wxAUI_DOCK_CENTER)
+        if (!part->dock->fixed || part->dock->dock_direction == wxAUI_DOCK_CENTER ||
+            pt.x >= cli_size.x || pt.x <= 0 || pt.y >= cli_size.y || pt.y <= 0)
         {
             if (m_last_rect.IsEmpty() || m_last_rect.Contains(pt.x, pt.y ))
             {
@@ -3034,13 +3035,9 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
             }
             else
             {
-                if ((m_flags & wxAUI_MGR_ALLOW_FLOATING) &&
-                   (drop.IsFloatable() ||
-                    (part->dock->dock_direction != wxAUI_DOCK_CENTER &&
-                     part->dock->dock_direction != wxAUI_DOCK_NONE)))
+                if ((m_flags & wxAUI_MGR_ALLOW_FLOATING) && drop.IsFloatable())
                 {
-                    if (drop.IsFloatable())
-                        drop.Float();
+                    drop.Float();
                 }
 
                 m_skipping = false;