Gravity: Fixup scroll bar range
This commit is contained in:
@@ -53,8 +53,6 @@ ConfigView::ConfigView(BRect frame, Gravity* parent)
|
|||||||
fShadeList->AddItem(new ColorItem("White", (rgb_color){ 255, 255, 255 }));
|
fShadeList->AddItem(new ColorItem("White", (rgb_color){ 255, 255, 255 }));
|
||||||
fShadeList->AddItem(new RainbowItem("Rainbow"));
|
fShadeList->AddItem(new RainbowItem("Rainbow"));
|
||||||
|
|
||||||
fShadeList->Select(parent->Config.ShadeID);
|
|
||||||
|
|
||||||
fShadeScroll = new BScrollView(B_EMPTY_STRING, fShadeList,
|
fShadeScroll = new BScrollView(B_EMPTY_STRING, fShadeList,
|
||||||
B_WILL_DRAW | B_FRAME_EVENTS, false, true);
|
B_WILL_DRAW | B_FRAME_EVENTS, false, true);
|
||||||
|
|
||||||
@@ -76,6 +74,19 @@ ConfigView::ConfigView(BRect frame, Gravity* parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
ConfigView::AllAttached()
|
||||||
|
{
|
||||||
|
// fixup scroll bar range
|
||||||
|
fShadeScroll->ScrollBar(B_VERTICAL)->SetRange(0.0f,
|
||||||
|
fShadeList->ItemFrame(fShadeList->CountItems()).bottom
|
||||||
|
- fShadeList->ItemFrame((int32)0).top);
|
||||||
|
|
||||||
|
// select the shade
|
||||||
|
fShadeList->Select(fParent->Config.ShadeID);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ConfigView::AttachedToWindow()
|
ConfigView::AttachedToWindow()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class ConfigView : public BView {
|
|||||||
public:
|
public:
|
||||||
ConfigView(BRect frame, Gravity* parent);
|
ConfigView(BRect frame, Gravity* parent);
|
||||||
|
|
||||||
|
void AllAttached();
|
||||||
void AttachedToWindow();
|
void AttachedToWindow();
|
||||||
void MessageReceived(BMessage* message);
|
void MessageReceived(BMessage* message);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user