Sidebar: Correcting anomalous mouse behaviour while resizing
Currently, when the sidebar is showing, and we hold the handle to make it wider/narrower, if we move the mouse much to the left (so that it can't become any wider), and now move mouse pointer to the right (while still holding the handle), it immediately begins to shrink. Ideally how it should behave when we move the mouse much to the left is that- the sidebar should begin shrinking once we have the mouse pointer over the handle again and not immediately. Change-Id: Id17dc19e6e1ad02fb7879ace9a2e092ac0128693
This commit is contained in:
committed by
Jan Holesovsky
parent
14e7a290da
commit
16ea2dc1f5
@@ -2542,21 +2542,30 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt )
|
||||
{
|
||||
sal_Bool bPropSmaller = (mnMouseModifier & KEY_SHIFT) ? sal_True : sal_False;
|
||||
sal_Bool bPropGreater = (mnMouseModifier & KEY_MOD1) ? sal_True : sal_False;
|
||||
long nDelta = mnMSplitPos-mnMStartPos;
|
||||
|
||||
if ( (mnSplitTest & SPLIT_WINDOW) && !mpMainSet->mpItems )
|
||||
{
|
||||
// nDelta corresponds to the direction to which user drags the mouse.
|
||||
// If nDelta > 0, means user has dragged the handle towards the right and vice-versa
|
||||
long nDelta = mnMSplitPos-mnMStartPos;
|
||||
|
||||
if ( (mpSplitSet == mpMainSet) && mbBottomRight )
|
||||
nDelta *= -1;
|
||||
ImplSetWindowSize( nDelta );
|
||||
}
|
||||
else
|
||||
{
|
||||
long nNewSize = mpSplitSet->mpItems[mnSplitPos].mnPixSize;
|
||||
long nNewSize( 0 );
|
||||
|
||||
// where is the sidebar is attached?
|
||||
if ( (mpSplitSet == mpMainSet) && mbBottomRight )
|
||||
nNewSize -= nDelta;
|
||||
nNewSize = mnMaxSize - mnMStartPos; // right hand side of the screen
|
||||
else
|
||||
nNewSize += nDelta;
|
||||
nNewSize = mnMStartPos; // left hand side of the screen
|
||||
|
||||
// do not make the sidebar wider than mnMaxSize
|
||||
nNewSize = std::min(nNewSize, mpSplitSet->mpItems[mnSplitPos].mnMaxSize);
|
||||
|
||||
SplitItem( mpSplitSet->mpItems[mnSplitPos].mnId, nNewSize,
|
||||
bPropSmaller, bPropGreater );
|
||||
}
|
||||
|
Reference in New Issue
Block a user