* Followed Ingo's suggestion, and added a BWindow::Layout() method.

* Changed ShowImage to use that function.
+alpha in case Ingo gives his okay :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41782 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2011-05-27 22:21:59 +00:00
parent c67a3f98ab
commit 48ae3e3808
3 changed files with 19 additions and 10 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2009, Haiku, Inc. All rights reserved.
* Copyright 2001-2011, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _WINDOW_H
@ -10,6 +10,7 @@
#include <StorageDefs.h>
#include <View.h>
class BButton;
class BMenuBar;
class BMenuItem;
@ -260,6 +261,7 @@ public:
BLayout* GetLayout() const;
void InvalidateLayout(bool descendants = false);
void Layout(bool force);
private:
// FBC padding and forbidden methods
@ -394,4 +396,5 @@ private:
uint32 _reserved[9];
};
#endif // _WINDOW_H

View File

@ -1295,9 +1295,9 @@ ShowImageWindow::_ToggleFullScreen()
fImageView->SetHideIdlingCursor(fFullScreen);
fImageView->SetShowCaption(fFullScreen && fShowCaption);
GetLayout()->Relayout(true);
// We need to manually relayout here, as the views would be relayouted
// later, and FitToBounds() would still have the wrong size
Layout(false);
// We need to manually relayout here, as the views are layouted
// asynchronously, and FitToBounds() would still have the wrong size
fImageView->FitToBounds();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2001-2010, Haiku.
* Copyright 2001-2011, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -1445,11 +1445,7 @@ FrameMoved(origin);
case B_LAYOUT_WINDOW:
{
UpdateSizeLimits();
// do the actual layout
fTopView->Layout(false);
Layout(false);
break;
}
@ -2632,6 +2628,16 @@ BWindow::InvalidateLayout(bool descendants)
}
void
BWindow::Layout(bool force)
{
UpdateSizeLimits();
// Do the actual layout
fTopView->Layout(force);
}
status_t
BWindow::GetSupportedSuites(BMessage* data)
{