Make the zoom "sticky" at 1.0 for about half a second when zooming with the mousewheel.
It might be a bit annoying, not sure yet. Implements #7253. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42311 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
0f06b3de2a
commit
281ad93ce7
@ -71,6 +71,7 @@ class PopUpMenu : public BPopUpMenu {
|
|||||||
|
|
||||||
// the delay time for hiding the cursor in 1/10 seconds (the pulse rate)
|
// the delay time for hiding the cursor in 1/10 seconds (the pulse rate)
|
||||||
#define HIDE_CURSOR_DELAY_TIME 20
|
#define HIDE_CURSOR_DELAY_TIME 20
|
||||||
|
#define STICKY_ZOOM_DELAY_TIME 5
|
||||||
#define SHOW_IMAGE_ORIENTATION_ATTRIBUTE "ShowImage:orientation"
|
#define SHOW_IMAGE_ORIENTATION_ATTRIBUTE "ShowImage:orientation"
|
||||||
|
|
||||||
|
|
||||||
@ -196,6 +197,7 @@ ShowImageView::ShowImageView(BRect rect, const char *name, uint32 resizingMode,
|
|||||||
fShowCaption(false),
|
fShowCaption(false),
|
||||||
fShowingPopUpMenu(false),
|
fShowingPopUpMenu(false),
|
||||||
fHideCursorCountDown(HIDE_CURSOR_DELAY_TIME),
|
fHideCursorCountDown(HIDE_CURSOR_DELAY_TIME),
|
||||||
|
fStickyZoomCountDown(0),
|
||||||
fIsActiveWin(true),
|
fIsActiveWin(true),
|
||||||
fDefaultCursor(NULL),
|
fDefaultCursor(NULL),
|
||||||
fGrabCursor(NULL)
|
fGrabCursor(NULL)
|
||||||
@ -253,6 +255,10 @@ ShowImageView::Pulse()
|
|||||||
} else
|
} else
|
||||||
fHideCursorCountDown--;
|
fHideCursorCountDown--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fStickyZoomCountDown > 0)
|
||||||
|
fStickyZoomCountDown--;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1355,10 +1361,16 @@ ShowImageView::_MouseWheelChanged(BMessage *msg)
|
|||||||
uint32 buttons;
|
uint32 buttons;
|
||||||
GetMouse(&where, &buttons);
|
GetMouse(&where, &buttons);
|
||||||
|
|
||||||
if (dy < 0)
|
if (fStickyZoomCountDown <= 0) {
|
||||||
ZoomIn(where);
|
if (dy < 0)
|
||||||
else if (dy > 0)
|
ZoomIn(where);
|
||||||
ZoomOut(where);
|
else if (dy > 0)
|
||||||
|
ZoomOut(where);
|
||||||
|
|
||||||
|
if (fZoom == 1.0)
|
||||||
|
fStickyZoomCountDown = STICKY_ZOOM_DELAY_TIME;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,6 +219,9 @@ private:
|
|||||||
|
|
||||||
int fHideCursorCountDown;
|
int fHideCursorCountDown;
|
||||||
// Hides the cursor when it reaches zero
|
// Hides the cursor when it reaches zero
|
||||||
|
int fStickyZoomCountDown;
|
||||||
|
// Make the zoom sticky at 1.0 when zoomed with the mousewheel
|
||||||
|
|
||||||
bool fIsActiveWin;
|
bool fIsActiveWin;
|
||||||
// Is the parent window the active window?
|
// Is the parent window the active window?
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user