diff --git a/headers/os/interface/ScrollBar.h b/headers/os/interface/ScrollBar.h index c70acbe88f..d9e709ebd5 100644 --- a/headers/os/interface/ScrollBar.h +++ b/headers/os/interface/ScrollBar.h @@ -19,6 +19,12 @@ #define DISABLES_ON_WINDOW_DEACTIVATION 1 +enum { + KNOB_STYLE_NONE = 0, + KNOB_STYLE_DOTS, + KNOB_STYLE_LINES +}; + class BScrollBar : public BView { public: BScrollBar(BRect frame, const char* name, diff --git a/src/kits/interface/ScrollBar.cpp b/src/kits/interface/ScrollBar.cpp index 1050dcbb6c..56fab7ba38 100644 --- a/src/kits/interface/ScrollBar.cpp +++ b/src/kits/interface/ScrollBar.cpp @@ -846,6 +846,7 @@ BScrollBar::Draw(BRect updateRect) EndLineArray(); } else StrokeRect(bounds); + bounds.InsetBy(1.0, 1.0); bool enabled = fPrivateData->fEnabled && fMin < fMax @@ -1153,7 +1154,11 @@ BScrollBar::Draw(BRect updateRect) } } - bool square = false; + if (fPrivateData->fScrollBarInfo.knob == KNOB_STYLE_NONE) + return; + + // draw the scrollbar thumb knobs + bool square = fPrivateData->fScrollBarInfo.knob == KNOB_STYLE_DOTS; int32 hextent = 0; int32 vextent = 0; @@ -1165,7 +1170,6 @@ BScrollBar::Draw(BRect updateRect) vextent = 3; } - // draw the marks on the scrollbar thumb int32 flags = 0; if (!enabled) flags |= BControlLook::B_DISABLED; @@ -1209,7 +1213,7 @@ BScrollBar::Draw(BRect updateRect) } } - // draw middle mark last because it modifies middleKnob + // draw middle knob last because it modifies middleKnob be_control_look->DrawButtonBackground(this, middleKnob, updateRect, normal, flags, BControlLook::B_ALL_BORDERS, fOrientation); }