From 7e36984164af1ab38b3ca3028dd30f2a07826ba7 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 2 Jan 2011 00:29:17 +0000 Subject: [PATCH] Removed Humdinger's resize mode. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40060 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/DefaultWindowBehaviour.cpp | 73 ---------------------- src/servers/app/DefaultWindowBehaviour.h | 5 +- 2 files changed, 1 insertion(+), 77 deletions(-) diff --git a/src/servers/app/DefaultWindowBehaviour.cpp b/src/servers/app/DefaultWindowBehaviour.cpp index fc6e08801a..039db104e1 100644 --- a/src/servers/app/DefaultWindowBehaviour.cpp +++ b/src/servers/app/DefaultWindowBehaviour.cpp @@ -701,68 +701,6 @@ private: }; -// #pragma mark - State - - -struct DefaultWindowBehaviour::HumdingerResizeState : State { - HumdingerResizeState(DefaultWindowBehaviour& behavior, BPoint where) - : - State(behavior), - fInitialMousePosition(where), - fJitterPhase(true) - { - } - - virtual void EnterState(State* previousState) - { - fDesktop->SetManagementCursor( - fDesktop->GetCursorManager().GetCursor(B_CURSOR_ID_MOVE)); - } - - virtual void ExitState(State* nextState) - { - fBehavior._ResetResizeCursor(); - } - - virtual void MouseUp(BMessage* message, BPoint where) - { - // Leave the state, when the middle mouse button has been released. - int32 buttons = message->FindInt32("buttons"); - if ((buttons & B_TERTIARY_MOUSE_BUTTON) == 0) - fBehavior._NextState(NULL); - } - - virtual void MouseMoved(BMessage* message, BPoint where, bool isFake) - { - // ignore the initial movement - float dx = where.x - fInitialMousePosition.x; - float dy = where.y - fInitialMousePosition.y; - if (dx * dx + dy * dy < (fJitterPhase ? 16 : 64)) - return; - - // Enter the next phase, if we're still in the first one. - if (fJitterPhase) { - fInitialMousePosition = where; - fJitterPhase = false; - return; - } - - // The mouse has moved far enough for us to take a guess in which - // direction. - int8 horizontal; - int8 vertical; - _ComputeResizeDirection(dx, dy, horizontal, vertical); - - fBehavior._NextState(new (std::nothrow) ResizeBorderState(fBehavior, - where, horizontal, vertical)); - } - -private: - BPoint fInitialMousePosition; - bool fJitterPhase; -}; - - // #pragma mark - DefaultWindowBehaviour @@ -901,12 +839,6 @@ DefaultWindowBehaviour::MouseDown(BMessage* message, BPoint where, default: break; } - } else if ((buttons & B_TERTIARY_MOUSE_BUTTON) != 0) { - // Middle-click anywhere on the window shall initiate - // humdinger-resize mode. - if (windowModifier && hitRegion != Decorator::REGION_NONE - && (flags & B_NOT_RESIZABLE) == 0) - action = ACTION_HUMDINGER_RESIZE; } } @@ -976,11 +908,6 @@ DefaultWindowBehaviour::MouseDown(BMessage* message, BPoint where, STRACE_CLICK(("===> ACTION_RESIZE_BORDER\n")); break; - case ACTION_HUMDINGER_RESIZE: - _NextState(new (std::nothrow) HumdingerResizeState(*this, where)); - STRACE_CLICK(("===> ACTION_HUMDINGER_RESIZE\n")); - break; - default: break; } diff --git a/src/servers/app/DefaultWindowBehaviour.h b/src/servers/app/DefaultWindowBehaviour.h index b75d95125e..14a0977092 100644 --- a/src/servers/app/DefaultWindowBehaviour.h +++ b/src/servers/app/DefaultWindowBehaviour.h @@ -49,8 +49,7 @@ private: ACTION_DRAG, ACTION_SLIDE_TAB, ACTION_RESIZE, - ACTION_RESIZE_BORDER, - ACTION_HUMDINGER_RESIZE + ACTION_RESIZE_BORDER }; enum { @@ -72,7 +71,6 @@ private: struct ResizeBorderState; struct DecoratorButtonState; struct ManageWindowState; - struct HumdingerResizeState; // to keep gcc 2 happy friend struct State; @@ -83,7 +81,6 @@ private: friend struct ResizeBorderState; friend struct DecoratorButtonState; friend struct ManageWindowState; - friend struct HumdingerResizeState; private: bool _IsWindowModifier(int32 modifiers) const;