Rename hextent and vextent to knobWidth and knobHeight
This commit is contained in:
@@ -1159,15 +1159,15 @@ BScrollBar::Draw(BRect updateRect)
|
|||||||
|
|
||||||
// draw the scrollbar thumb knobs
|
// draw the scrollbar thumb knobs
|
||||||
bool square = fPrivateData->fScrollBarInfo.knob == B_KNOB_STYLE_DOTS;
|
bool square = fPrivateData->fScrollBarInfo.knob == B_KNOB_STYLE_DOTS;
|
||||||
int32 hextent = 0;
|
int32 knobWidth = 0;
|
||||||
int32 vextent = 0;
|
int32 knobHeight = 0;
|
||||||
|
|
||||||
if (square) {
|
if (square) {
|
||||||
hextent = 2;
|
knobWidth = 2;
|
||||||
vextent = 2;
|
knobHeight = 2;
|
||||||
} else {
|
} else {
|
||||||
hextent = 1;
|
knobWidth = 1;
|
||||||
vextent = 3;
|
knobHeight = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 flags = 0;
|
int32 flags = 0;
|
||||||
@@ -1179,35 +1179,35 @@ BScrollBar::Draw(BRect updateRect)
|
|||||||
|
|
||||||
BRect middleKnob = BRect(
|
BRect middleKnob = BRect(
|
||||||
rect.left + hmiddle
|
rect.left + hmiddle
|
||||||
- (fOrientation == B_HORIZONTAL ? hextent : vextent),
|
- (fOrientation == B_HORIZONTAL ? knobWidth : knobHeight),
|
||||||
rect.top + vmiddle
|
rect.top + vmiddle
|
||||||
- (fOrientation == B_HORIZONTAL ? vextent : hextent),
|
- (fOrientation == B_HORIZONTAL ? knobHeight : knobWidth),
|
||||||
rect.left + hmiddle
|
rect.left + hmiddle
|
||||||
+ (fOrientation == B_HORIZONTAL ? hextent : vextent),
|
+ (fOrientation == B_HORIZONTAL ? knobWidth : knobHeight),
|
||||||
rect.top + vmiddle
|
rect.top + vmiddle
|
||||||
+ (fOrientation == B_HORIZONTAL ? vextent : hextent));
|
+ (fOrientation == B_HORIZONTAL ? knobHeight : knobWidth));
|
||||||
|
|
||||||
if (fOrientation == B_HORIZONTAL) {
|
if (fOrientation == B_HORIZONTAL) {
|
||||||
BRect leftKnob = middleKnob.OffsetByCopy(hextent * -4, 0);
|
BRect leftKnob = middleKnob.OffsetByCopy(knobWidth * -4, 0);
|
||||||
if (leftKnob.left > rect.left + hextent) {
|
if (leftKnob.left > rect.left + knobWidth) {
|
||||||
be_control_look->DrawButtonBackground(this, leftKnob, updateRect,
|
be_control_look->DrawButtonBackground(this, leftKnob, updateRect,
|
||||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||||
}
|
}
|
||||||
|
|
||||||
BRect rightKnob = middleKnob.OffsetByCopy(hextent * 4, 0);
|
BRect rightKnob = middleKnob.OffsetByCopy(knobWidth * 4, 0);
|
||||||
if (rightKnob.right < rect.right - hextent) {
|
if (rightKnob.right < rect.right - knobWidth) {
|
||||||
be_control_look->DrawButtonBackground(this, rightKnob, updateRect,
|
be_control_look->DrawButtonBackground(this, rightKnob, updateRect,
|
||||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BRect topKnob = middleKnob.OffsetByCopy(0, hextent * -4);
|
BRect topKnob = middleKnob.OffsetByCopy(0, knobWidth * -4);
|
||||||
if (topKnob.top > rect.top + vextent) {
|
if (topKnob.top > rect.top + knobHeight) {
|
||||||
be_control_look->DrawButtonBackground(this, topKnob, updateRect,
|
be_control_look->DrawButtonBackground(this, topKnob, updateRect,
|
||||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||||
}
|
}
|
||||||
|
|
||||||
BRect bottomKnob = middleKnob.OffsetByCopy(0, hextent * 4);
|
BRect bottomKnob = middleKnob.OffsetByCopy(0, knobWidth * 4);
|
||||||
if (bottomKnob.bottom < rect.bottom - vextent) {
|
if (bottomKnob.bottom < rect.bottom - knobHeight) {
|
||||||
be_control_look->DrawButtonBackground(this, bottomKnob, updateRect,
|
be_control_look->DrawButtonBackground(this, bottomKnob, updateRect,
|
||||||
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
normal, flags, BControlLook::B_ALL_BORDERS, fOrientation);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,30 +148,30 @@ FakeScrollBar::Draw(BRect updateRect)
|
|||||||
|
|
||||||
// draw the scrollbar thumb knobs
|
// draw the scrollbar thumb knobs
|
||||||
bool square = fKnobStyle == B_KNOB_STYLE_DOTS;
|
bool square = fKnobStyle == B_KNOB_STYLE_DOTS;
|
||||||
int32 hextent = 0;
|
int32 knobWidth = 0;
|
||||||
int32 vextent = 0;
|
int32 knobHeight = 0;
|
||||||
|
|
||||||
if (square) {
|
if (square) {
|
||||||
hextent = 2;
|
knobWidth = 2;
|
||||||
vextent = 2;
|
knobHeight = 2;
|
||||||
} else {
|
} else {
|
||||||
hextent = 1;
|
knobWidth = 1;
|
||||||
vextent = 3;
|
knobHeight = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
float hmiddle = bgRect.Width() / 2;
|
float hmiddle = bgRect.Width() / 2;
|
||||||
float vmiddle = bgRect.Height() / 2;
|
float vmiddle = bgRect.Height() / 2;
|
||||||
|
|
||||||
BRect middleKnob = BRect(bgRect.left + hmiddle - hextent,
|
BRect middleKnob = BRect(bgRect.left + hmiddle - knobWidth,
|
||||||
bgRect.top + vmiddle - vextent,
|
bgRect.top + vmiddle - knobHeight,
|
||||||
bgRect.left + hmiddle + hextent,
|
bgRect.left + hmiddle + knobWidth,
|
||||||
bgRect.top + vmiddle + vextent);
|
bgRect.top + vmiddle + knobHeight);
|
||||||
|
|
||||||
BRect leftKnob = middleKnob.OffsetByCopy(hextent * -4, 0);
|
BRect leftKnob = middleKnob.OffsetByCopy(knobWidth * -4, 0);
|
||||||
be_control_look->DrawButtonBackground(this, leftKnob, updateRect,
|
be_control_look->DrawButtonBackground(this, leftKnob, updateRect,
|
||||||
normal, 0, BControlLook::B_ALL_BORDERS, B_HORIZONTAL);
|
normal, 0, BControlLook::B_ALL_BORDERS, B_HORIZONTAL);
|
||||||
|
|
||||||
BRect rightKnob = middleKnob.OffsetByCopy(hextent * 4, 0);
|
BRect rightKnob = middleKnob.OffsetByCopy(knobWidth * 4, 0);
|
||||||
be_control_look->DrawButtonBackground(this, rightKnob, updateRect,
|
be_control_look->DrawButtonBackground(this, rightKnob, updateRect,
|
||||||
normal, 0, BControlLook::B_ALL_BORDERS, B_HORIZONTAL);
|
normal, 0, BControlLook::B_ALL_BORDERS, B_HORIZONTAL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user