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-11-12 22:03:24 -05:00
parent dec421b1db
commit e4f9bfce33
2 changed files with 10 additions and 8 deletions
+3 -5
View File
@@ -516,6 +516,8 @@ TBarView::PlaceApplicationBar()
SizeWindow(screenFrame); SizeWindow(screenFrame);
PositionWindow(screenFrame); PositionWindow(screenFrame);
CheckForScrolling();
Window()->UpdateIfNeeded(); Window()->UpdateIfNeeded();
Invalidate(); Invalidate();
} }
@@ -578,8 +580,6 @@ TBarView::SizeWindow(BRect screenFrame)
float windowWidth, windowHeight; float windowWidth, windowHeight;
GetPreferredWindowSize(screenFrame, &windowWidth, &windowHeight); GetPreferredWindowSize(screenFrame, &windowWidth, &windowHeight);
Window()->ResizeTo(windowWidth, windowHeight); Window()->ResizeTo(windowWidth, windowHeight);
CheckForScrolling();
} }
@@ -609,7 +609,7 @@ TBarView::PositionWindow(BRect screenFrame)
void void
TBarView::CheckForScrolling() TBarView::CheckForScrolling()
{ {
if (fExpando != NULL) { if (fInlineScrollView != NULL && fExpando != NULL) {
if (fExpando->CheckForSizeOverrun()) if (fExpando->CheckForSizeOverrun())
fInlineScrollView->AttachScrollers(); fInlineScrollView->AttachScrollers();
else else
@@ -719,8 +719,6 @@ TBarView::ExpandItems()
// Clean up the expanded items list // Clean up the expanded items list
RemoveExpandedItems(); RemoveExpandedItems();
fExpando->SizeWindow(1);
} }
+7 -3
View File
@@ -808,6 +808,7 @@ TExpandoMenuBar::CheckForSizeOverrun()
+ kSepItemWidth; + kSepItemWidth;
float maxWidth = fBarView->DragRegion()->Frame().left float maxWidth = fBarView->DragRegion()->Frame().left
- fDeskbarMenuWidth - kSepItemWidth; - fDeskbarMenuWidth - kSepItemWidth;
return menuWidth > maxWidth; return menuWidth > maxWidth;
} }
@@ -819,9 +820,12 @@ TExpandoMenuBar::SizeWindow(int32 delta)
// code the resize method will be centered in one place // code the resize method will be centered in one place
// thus, the same behavior (good or bad) will be used // thus, the same behavior (good or bad) will be used
// wherever window sizing is done // wherever window sizing is done
if (fVertical) if (fVertical) {
fBarView->SizeWindow(BScreen(Window()).Frame()); BRect screenFrame = (BScreen(Window())).Frame();
else fBarView->SizeWindow(screenFrame);
fBarView->PositionWindow(screenFrame);
fBarView->CheckForScrolling();
} else
CheckItemSizes(delta); CheckItemSizes(delta);
} }