diff --git a/src/kits/interface/Button.cpp b/src/kits/interface/Button.cpp index 0495348dd4..8519cd79f8 100644 --- a/src/kits/interface/Button.cpp +++ b/src/kits/interface/Button.cpp @@ -62,7 +62,7 @@ BButton::BButton(BMessage *archive) //------------------------------------------------------------------------------ BArchivable *BButton::Instantiate ( BMessage *archive ) { - if ( validate_instantiation(archive, "BButton")) + if (validate_instantiation(archive, "BButton")) return new BButton(archive); else return NULL; @@ -274,7 +274,7 @@ void BButton::AttachedToWindow() BControl::AttachedToWindow(); if (IsDefault()) - Window()->SetDefaultButton((BButton*)this); + Window()->SetDefaultButton(this); } //------------------------------------------------------------------------------ void BButton::KeyDown ( const char *bytes, int32 numBytes ) @@ -306,23 +306,22 @@ void BButton::MakeDefault(bool flag) fDrawAsDefault = flag; BWindow *window = Window(); - - if (window) - { - BButton *button = (BButton*)(window->DefaultButton()); - if (flag) - { - ResizeBy(6.0f, 6.0f); - MoveBy(-3.0f, -3.0f); + if (flag) + { + ResizeBy(6.0f, 6.0f); + MoveBy(-3.0f, -3.0f); + + if (window) window->SetDefaultButton((BButton*)this); - } - else - { - ResizeBy(-6.0f, -6.0f); - MoveBy(3.0f, 3.0f); + } + else + { + ResizeBy(-6.0f, -6.0f); + MoveBy(3.0f, 3.0f); + + if (window) window->SetDefaultButton(NULL); - } } } //------------------------------------------------------------------------------ @@ -397,6 +396,12 @@ void BButton::GetPreferredSize (float *width, float *height) if (*width < 75.0f) *width = 75.0f; + + if (fDrawAsDefault) + { + *width += 6.0f; + *height += 6.0f; + } } //------------------------------------------------------------------------------ void BButton::ResizeToPreferred() diff --git a/src/kits/interface/Control.cpp b/src/kits/interface/Control.cpp index a427ed173c..edbb58a942 100644 --- a/src/kits/interface/Control.cpp +++ b/src/kits/interface/Control.cpp @@ -301,25 +301,6 @@ void BControl::KeyDown(const char *bytes, int32 numBytes) { switch (bytes[0]) { - case B_UP_ARROW: - message->ReplaceInt64("when", (int64)system_time()); - message->ReplaceInt32("key", 38); - message->ReplaceInt32("raw_char", B_TAB); - message->ReplaceInt32("modifiers", B_SCROLL_LOCK | B_SHIFT_KEY); - message->ReplaceInt8("byte", B_TAB); - message->ReplaceString("bytes", ""); - Looper()->PostMessage(message); - break; - - case B_DOWN_ARROW: - message->ReplaceInt64("when", (int64)system_time()); - message->ReplaceInt32("key", 38); - message->ReplaceInt32("raw_char", B_TAB); - message->ReplaceInt8("byte", B_TAB); - message->ReplaceString("bytes", ""); - Looper()->PostMessage(message); - break; - case B_ENTER: case B_SPACE: if (Value()) diff --git a/src/kits/interface/StatusBar.cpp b/src/kits/interface/StatusBar.cpp index ae58f0ef8d..0b8e6a10d7 100644 --- a/src/kits/interface/StatusBar.cpp +++ b/src/kits/interface/StatusBar.cpp @@ -373,6 +373,9 @@ void BStatusBar::Update(float delta, const char *text, const char *trailingText) { fCurrent += delta; + if (fCurrent > fMax) + fCurrent = fMax; + if (fText) free(fText); diff --git a/src/kits/interface/TabView.cpp b/src/kits/interface/TabView.cpp index fc407e6017..99080b834c 100644 --- a/src/kits/interface/TabView.cpp +++ b/src/kits/interface/TabView.cpp @@ -569,7 +569,10 @@ BRect BTabView::DrawTabs() (i == fSelection) ? B_TAB_FRONT : (i == 0) ? B_TAB_FIRST : B_TAB_ANY, (i + 1 != fSelection)); - return TabFrame(fSelection); + if (fSelection > -1) + return TabFrame(fSelection); + else + return BRect(); } //------------------------------------------------------------------------------ void BTabView::DrawBox(BRect selTabRect)