* Right clicking the resize area now always moves the window behind. This
obviously differentiates from BeOS behaviour, but I think it makes much more sense this way. * Simplified DefaultDecorator::Clicked() by eliminating the "clicked" variable. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35258 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2008, Haiku.
|
* Copyright 2001-2010, Haiku.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
* Philippe Saint-Pierre, [email protected]
|
* Philippe Saint-Pierre, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*! Default and fallback decorator for the app_server - the yellow tabs */
|
/*! Default and fallback decorator for the app_server - the yellow tabs */
|
||||||
|
|
||||||
|
|
||||||
@@ -541,19 +542,19 @@ DefaultDecorator::Clicked(BPoint point, int32 buttons, int32 modifiers)
|
|||||||
if (!(fFlags & B_NOT_ZOOMABLE) && fZoomRect.Contains(point))
|
if (!(fFlags & B_NOT_ZOOMABLE) && fZoomRect.Contains(point))
|
||||||
return DEC_ZOOM;
|
return DEC_ZOOM;
|
||||||
|
|
||||||
|
if ((buttons & B_SECONDARY_MOUSE_BUTTON) != 0)
|
||||||
|
return DEC_MOVETOBACK;
|
||||||
|
|
||||||
if (fLook == B_DOCUMENT_WINDOW_LOOK && fResizeRect.Contains(point))
|
if (fLook == B_DOCUMENT_WINDOW_LOOK && fResizeRect.Contains(point))
|
||||||
return DEC_RESIZE;
|
return DEC_RESIZE;
|
||||||
|
|
||||||
bool clicked = false;
|
|
||||||
|
|
||||||
// Clicking in the tab?
|
|
||||||
if (fTabRect.Contains(point)) {
|
if (fTabRect.Contains(point)) {
|
||||||
|
// Clicked in the tab
|
||||||
|
|
||||||
// tab sliding in any case if either shift key is held down
|
// tab sliding in any case if either shift key is held down
|
||||||
// except sliding up-down by moving mouse left-right would look strange
|
// except sliding up-down by moving mouse left-right would look strange
|
||||||
if ((modifiers & B_SHIFT_KEY) && (fLook != kLeftTitledWindowLook))
|
if ((modifiers & B_SHIFT_KEY) && (fLook != kLeftTitledWindowLook))
|
||||||
return DEC_SLIDETAB;
|
return DEC_SLIDETAB;
|
||||||
|
|
||||||
clicked = true;
|
|
||||||
} else if (fLeftBorder.Contains(point) || fRightBorder.Contains(point)
|
} else if (fLeftBorder.Contains(point) || fRightBorder.Contains(point)
|
||||||
|| fTopBorder.Contains(point) || fBottomBorder.Contains(point)) {
|
|| fTopBorder.Contains(point) || fBottomBorder.Contains(point)) {
|
||||||
// Clicked on border
|
// Clicked on border
|
||||||
@@ -569,25 +570,15 @@ DefaultDecorator::Clicked(BPoint point, int32 buttons, int32 modifiers)
|
|||||||
if (temp.Contains(point))
|
if (temp.Contains(point))
|
||||||
return DEC_RESIZE;
|
return DEC_RESIZE;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
clicked = true;
|
// Guess user didn't click anything
|
||||||
|
return DEC_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clicked) {
|
if (fWasDoubleClick && !(fFlags & B_NOT_MINIMIZABLE))
|
||||||
// NOTE: On R5, windows are not moved to back if clicked inside the
|
return DEC_MINIMIZE;
|
||||||
// resize area with the second mouse button. So we check this after
|
|
||||||
// the check above
|
|
||||||
if ((buttons & B_SECONDARY_MOUSE_BUTTON) != 0)
|
|
||||||
return DEC_MOVETOBACK;
|
|
||||||
|
|
||||||
if (fWasDoubleClick && !(fFlags & B_NOT_MINIMIZABLE))
|
return DEC_DRAG;
|
||||||
return DEC_MINIMIZE;
|
|
||||||
|
|
||||||
return DEC_DRAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Guess user didn't click anything
|
|
||||||
return DEC_NONE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2009, Haiku, Inc.
|
* Copyright 2001-2010, Haiku, Inc.
|
||||||
* Distributed under the terms of the MIT license.
|
* Distributed under the terms of the MIT license.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -899,7 +899,7 @@ Window::MouseDown(BMessage* message, BPoint where, int32* _viewToken)
|
|||||||
else {
|
else {
|
||||||
fDesktop->SetFocusWindow(this);
|
fDesktop->SetFocusWindow(this);
|
||||||
if (desktopSettings.MouseMode() == B_FOCUS_FOLLOWS_MOUSE
|
if (desktopSettings.MouseMode() == B_FOCUS_FOLLOWS_MOUSE
|
||||||
&& action == DEC_DRAG) {
|
&& (action == DEC_DRAG || action == DEC_RESIZE)) {
|
||||||
fActivateOnMouseUp = true;
|
fActivateOnMouseUp = true;
|
||||||
fMouseMoveDistance = 0.0f;
|
fMouseMoveDistance = 0.0f;
|
||||||
fLastMoveTime = system_time();
|
fLastMoveTime = system_time();
|
||||||
|
|||||||
Reference in New Issue
Block a user