BScrollView: Increase small scroll step size from 1 to 3
... and then don't multiply by 3 in BView
This commit is contained in:
@@ -202,7 +202,7 @@ BScrollBar::BScrollBar(BRect frame, const char* name, BView* target,
|
|||||||
B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS),
|
B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS),
|
||||||
fMin(min),
|
fMin(min),
|
||||||
fMax(max),
|
fMax(max),
|
||||||
fSmallStep(1.0f),
|
fSmallStep(3.0f),
|
||||||
fLargeStep(10.0f),
|
fLargeStep(10.0f),
|
||||||
fValue(0),
|
fValue(0),
|
||||||
fProportion(0.0f),
|
fProportion(0.0f),
|
||||||
@@ -232,7 +232,7 @@ BScrollBar::BScrollBar(const char* name, BView* target,
|
|||||||
BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS),
|
BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_FRAME_EVENTS),
|
||||||
fMin(min),
|
fMin(min),
|
||||||
fMax(max),
|
fMax(max),
|
||||||
fSmallStep(1.0f),
|
fSmallStep(3.0f),
|
||||||
fLargeStep(10.0f),
|
fLargeStep(10.0f),
|
||||||
fValue(0),
|
fValue(0),
|
||||||
fProportion(0.0f),
|
fProportion(0.0f),
|
||||||
@@ -269,7 +269,7 @@ BScrollBar::BScrollBar(BMessage* data)
|
|||||||
fMax = 0.0f;
|
fMax = 0.0f;
|
||||||
|
|
||||||
if (data->FindFloat("_steps", 0, &fSmallStep) < B_OK)
|
if (data->FindFloat("_steps", 0, &fSmallStep) < B_OK)
|
||||||
fSmallStep = 1.0f;
|
fSmallStep = 3.0f;
|
||||||
|
|
||||||
if (data->FindFloat("_steps", 1, &fLargeStep) < B_OK)
|
if (data->FindFloat("_steps", 1, &fLargeStep) < B_OK)
|
||||||
fLargeStep = 10.0f;
|
fLargeStep = 10.0f;
|
||||||
|
|||||||
@@ -5729,11 +5729,7 @@ BView::ScrollWithMouseWheelDelta(BScrollBar* scrollBar, float delta)
|
|||||||
|
|
||||||
// pressing the shift key scrolls faster (following the pseudo-standard set
|
// pressing the shift key scrolls faster (following the pseudo-standard set
|
||||||
// by other desktop environments).
|
// by other desktop environments).
|
||||||
if ((modifiers() & B_SHIFT_KEY) != 0)
|
delta *= (modifiers() & B_SHIFT_KEY) != 0 ? largeStep : smallStep;
|
||||||
delta *= largeStep;
|
|
||||||
else
|
|
||||||
delta *= smallStep * 3;
|
|
||||||
|
|
||||||
scrollBar->SetValue(scrollBar->Value() + delta);
|
scrollBar->SetValue(scrollBar->Value() + delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user