From e4f9bfce33a0baeb0b45297eb8c021934928d49a Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sat, 27 Oct 2012 17:34:10 -0400 Subject: [PATCH] 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. --- src/apps/deskbar/BarView.cpp | 8 +++----- src/apps/deskbar/ExpandoMenuBar.cpp | 10 +++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/apps/deskbar/BarView.cpp b/src/apps/deskbar/BarView.cpp index a52a21cdd1..2e88320efa 100644 --- a/src/apps/deskbar/BarView.cpp +++ b/src/apps/deskbar/BarView.cpp @@ -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); } diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp b/src/apps/deskbar/ExpandoMenuBar.cpp index f2cbca65b9..d44fc069da 100644 --- a/src/apps/deskbar/ExpandoMenuBar.cpp +++ b/src/apps/deskbar/ExpandoMenuBar.cpp @@ -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); }