Need to position window before checking for scrolling.

Otherwise when you switch from bottom mini mode to vertical expando mode
you'll get scroll arrows when you shouldn't because the bottom of the
window frame will be below the screen.
This commit is contained in:
John Scipione 2012-10-27 17:34:10 -04:00
parent dec421b1db
commit e4f9bfce33
2 changed files with 10 additions and 8 deletions

View File

@ -516,6 +516,8 @@ TBarView::PlaceApplicationBar()
SizeWindow(screenFrame);
PositionWindow(screenFrame);
CheckForScrolling();
Window()->UpdateIfNeeded();
Invalidate();
}
@ -578,8 +580,6 @@ TBarView::SizeWindow(BRect screenFrame)
float windowWidth, windowHeight;
GetPreferredWindowSize(screenFrame, &windowWidth, &windowHeight);
Window()->ResizeTo(windowWidth, windowHeight);
CheckForScrolling();
}
@ -609,7 +609,7 @@ TBarView::PositionWindow(BRect screenFrame)
void
TBarView::CheckForScrolling()
{
if (fExpando != NULL) {
if (fInlineScrollView != NULL && fExpando != NULL) {
if (fExpando->CheckForSizeOverrun())
fInlineScrollView->AttachScrollers();
else
@ -719,8 +719,6 @@ TBarView::ExpandItems()
// Clean up the expanded items list
RemoveExpandedItems();
fExpando->SizeWindow(1);
}

View File

@ -808,6 +808,7 @@ TExpandoMenuBar::CheckForSizeOverrun()
+ kSepItemWidth;
float maxWidth = fBarView->DragRegion()->Frame().left
- fDeskbarMenuWidth - kSepItemWidth;
return menuWidth > maxWidth;
}
@ -819,9 +820,12 @@ TExpandoMenuBar::SizeWindow(int32 delta)
// code the resize method will be centered in one place
// thus, the same behavior (good or bad) will be used
// wherever window sizing is done
if (fVertical)
fBarView->SizeWindow(BScreen(Window()).Frame());
else
if (fVertical) {
BRect screenFrame = (BScreen(Window())).Frame();
fBarView->SizeWindow(screenFrame);
fBarView->PositionWindow(screenFrame);
fBarView->CheckForScrolling();
} else
CheckItemSizes(delta);
}