pane sizes within a dock are not allowed to exceed the dock's entire current pixel size
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4140,6 +4140,11 @@ bool wxAuiManager::DoEndResizeAction(wxMouseEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// new size can never be more than the number of dock pixels
|
||||||
|
if (new_pixsize > dock_pixels)
|
||||||
|
new_pixsize = dock_pixels;
|
||||||
|
|
||||||
|
|
||||||
// find a pane in our dock to 'steal' space from or to 'give'
|
// find a pane in our dock to 'steal' space from or to 'give'
|
||||||
// space to -- this is essentially what is done when a pane is
|
// space to -- this is essentially what is done when a pane is
|
||||||
// resized; the pane should usually be the first non-fixed pane
|
// resized; the pane should usually be the first non-fixed pane
|
||||||
@@ -4166,7 +4171,7 @@ bool wxAuiManager::DoEndResizeAction(wxMouseEvent& event)
|
|||||||
m_action = actionNone;
|
m_action = actionNone;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate the new proportion of the pane
|
// calculate the new proportion of the pane
|
||||||
int new_proportion = (new_pixsize*total_proportion)/dock_pixels;
|
int new_proportion = (new_pixsize*total_proportion)/dock_pixels;
|
||||||
|
|
||||||
@@ -4214,10 +4219,26 @@ bool wxAuiManager::DoEndResizeAction(wxMouseEvent& event)
|
|||||||
int prop_diff = new_proportion - pane.dock_proportion;
|
int prop_diff = new_proportion - pane.dock_proportion;
|
||||||
|
|
||||||
// borrow the space from our neighbor pane to the
|
// borrow the space from our neighbor pane to the
|
||||||
// right or bottom (depending on orientation)
|
// right or bottom (depending on orientation);
|
||||||
dock.panes.Item(borrow_pane)->dock_proportion -= prop_diff;
|
// also make sure we don't make the neighbor too small
|
||||||
|
int prop_borrow = dock.panes.Item(borrow_pane)->dock_proportion;
|
||||||
|
|
||||||
|
if (prop_borrow - prop_diff < 0)
|
||||||
|
{
|
||||||
|
// borrowing from other pane would make it too small,
|
||||||
|
// so cancel the resize operation
|
||||||
|
prop_borrow = min_proportion;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
prop_borrow -= prop_diff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
dock.panes.Item(borrow_pane)->dock_proportion = prop_borrow;
|
||||||
pane.dock_proportion = new_proportion;
|
pane.dock_proportion = new_proportion;
|
||||||
|
|
||||||
|
|
||||||
// repaint
|
// repaint
|
||||||
Update();
|
Update();
|
||||||
Repaint(NULL);
|
Repaint(NULL);
|
||||||
|
Reference in New Issue
Block a user