* When dragging/resizing columns, remember and take the click offset into
account. * When releasing the mouse buttom from a resize operation, don't reset the view cursor, as we would still start resizing the column again if we clicked. This doesn't only improve these mouse operations, but solves weird jumping columns, for example when just clicking in the resize hot-area. +alphabranch git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32849 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8028111912
commit
8c21216131
|
@ -2684,6 +2684,8 @@ TitleView::MouseDown(BPoint position)
|
|||
fSelectedColumn = column;
|
||||
fSelectedColumnRect.Set(leftEdge, 0, rightEdge,
|
||||
fVisibleRect.Height());
|
||||
fClickPoint = BPoint(position.x - rightEdge - 1,
|
||||
position.y - fSelectedColumnRect.top);
|
||||
SetMouseEventMask(B_POINTER_EVENTS,
|
||||
B_LOCK_WINDOW_FOCUS | B_NO_POINTER_HISTORY);
|
||||
break;
|
||||
|
@ -2720,7 +2722,7 @@ TitleView::MouseMoved(BPoint position, uint32 transit,
|
|||
// Handle column manipulation
|
||||
switch (fCurrentState) {
|
||||
case RESIZING_COLUMN:
|
||||
ResizeSelectedColumn(position);
|
||||
ResizeSelectedColumn(position - BPoint(fClickPoint.x, 0));
|
||||
break;
|
||||
|
||||
case PRESSING_COLUMN: {
|
||||
|
@ -2788,7 +2790,7 @@ TitleView::MouseMoved(BPoint position, uint32 transit,
|
|||
BeginRectTracking(dragRect, B_TRACK_WHOLE_RECT);
|
||||
} else if (position.x < fLeftDragBoundry
|
||||
|| position.x > fRightDragBoundry) {
|
||||
DragSelectedColumn(position);
|
||||
DragSelectedColumn(position - BPoint(fClickPoint.x, 0));
|
||||
}
|
||||
|
||||
#if DRAG_TITLE_OUTLINE
|
||||
|
@ -2813,7 +2815,7 @@ TitleView::MouseMoved(BPoint position, uint32 transit,
|
|||
EndRectTracking();
|
||||
fCurrentState = DRAG_COLUMN_INSIDE_TITLE;
|
||||
fSelectedColumn->SetVisible(true);
|
||||
DragSelectedColumn(position);
|
||||
DragSelectedColumn(position - BPoint(fClickPoint.x, 0));
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -2865,10 +2867,9 @@ TitleView::MouseUp(BPoint position)
|
|||
|
||||
switch (fCurrentState) {
|
||||
case RESIZING_COLUMN:
|
||||
ResizeSelectedColumn(position);
|
||||
ResizeSelectedColumn(position - BPoint(fClickPoint.x, 0));
|
||||
fCurrentState = INACTIVE;
|
||||
FixScrollBar(false);
|
||||
SetViewCursor(B_CURSOR_SYSTEM_DEFAULT, true);
|
||||
break;
|
||||
|
||||
case PRESSING_COLUMN: {
|
||||
|
|
Loading…
Reference in New Issue