Renamed _CheckSizeLimits() to UpdateSizeLimits() and made it public.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39495 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -204,6 +204,7 @@ public:
|
|||||||
float minHeight, float maxHeight);
|
float minHeight, float maxHeight);
|
||||||
void GetSizeLimits(float* minWidth, float* maxWidth,
|
void GetSizeLimits(float* minWidth, float* maxWidth,
|
||||||
float* minHeight, float* maxHeight);
|
float* minHeight, float* maxHeight);
|
||||||
|
void UpdateSizeLimits();
|
||||||
|
|
||||||
status_t SetDecoratorSettings(const BMessage& settings);
|
status_t SetDecoratorSettings(const BMessage& settings);
|
||||||
status_t GetDecoratorSettings(BMessage* settings) const;
|
status_t GetDecoratorSettings(BMessage* settings) const;
|
||||||
@@ -350,8 +351,6 @@ private:
|
|||||||
void _GetDecoratorSize(float* _borderWidth,
|
void _GetDecoratorSize(float* _borderWidth,
|
||||||
float* _tabHeight) const;
|
float* _tabHeight) const;
|
||||||
|
|
||||||
void _CheckSizeLimits();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char* fTitle;
|
char* fTitle;
|
||||||
int32 _unused0;
|
int32 _unused0;
|
||||||
|
|||||||
@@ -1445,7 +1445,7 @@ FrameMoved(origin);
|
|||||||
|
|
||||||
case B_LAYOUT_WINDOW:
|
case B_LAYOUT_WINDOW:
|
||||||
{
|
{
|
||||||
_CheckSizeLimits();
|
UpdateSizeLimits();
|
||||||
|
|
||||||
// do the actual layout
|
// do the actual layout
|
||||||
fTopView->Layout(false);
|
fTopView->Layout(false);
|
||||||
@@ -1560,6 +1560,30 @@ BWindow::GetSizeLimits(float* _minWidth, float* _maxWidth, float* _minHeight,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*! Updates the window's size limits from the minimum and maximum sizes of its
|
||||||
|
top view.
|
||||||
|
|
||||||
|
Is a no-op, unless the \c B_AUTO_UPDATE_SIZE_LIMITS window flag is set.
|
||||||
|
|
||||||
|
The method is called automatically after a layout invalidation. Since it is
|
||||||
|
invoked asynchronously, calling this method manually is necessary, if it is
|
||||||
|
desired to adjust the limits (and as a possible side effect the window size)
|
||||||
|
earlier (e.g. before the first Show()).
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
BWindow::UpdateSizeLimits()
|
||||||
|
{
|
||||||
|
if ((fFlags & B_AUTO_UPDATE_SIZE_LIMITS) != 0) {
|
||||||
|
// Get min/max constraints of the top view and enforce window
|
||||||
|
// size limits respectively.
|
||||||
|
BSize minSize = fTopView->MinSize();
|
||||||
|
BSize maxSize = fTopView->MaxSize();
|
||||||
|
SetSizeLimits(minSize.width, maxSize.width,
|
||||||
|
minSize.height, maxSize.height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BWindow::SetDecoratorSettings(const BMessage& settings)
|
BWindow::SetDecoratorSettings(const BMessage& settings)
|
||||||
{
|
{
|
||||||
@@ -2501,7 +2525,7 @@ void
|
|||||||
BWindow::CenterIn(const BRect& rect)
|
BWindow::CenterIn(const BRect& rect)
|
||||||
{
|
{
|
||||||
// Set size limits now if needed
|
// Set size limits now if needed
|
||||||
_CheckSizeLimits();
|
UpdateSizeLimits();
|
||||||
|
|
||||||
MoveTo(BLayoutUtils::AlignInFrame(rect, Size(),
|
MoveTo(BLayoutUtils::AlignInFrame(rect, Size(),
|
||||||
BAlignment(B_ALIGN_HORIZONTAL_CENTER,
|
BAlignment(B_ALIGN_HORIZONTAL_CENTER,
|
||||||
@@ -3963,20 +3987,6 @@ BWindow::_GetDecoratorSize(float* _borderWidth, float* _tabHeight) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BWindow::_CheckSizeLimits()
|
|
||||||
{
|
|
||||||
if (fFlags & B_AUTO_UPDATE_SIZE_LIMITS) {
|
|
||||||
// Get min/max constraints of the top view and enforce window
|
|
||||||
// size limits respectively.
|
|
||||||
BSize minSize = fTopView->MinSize();
|
|
||||||
BSize maxSize = fTopView->MaxSize();
|
|
||||||
SetSizeLimits(minSize.width, maxSize.width,
|
|
||||||
minSize.height, maxSize.height);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - C++ binary compatibility kludge
|
// #pragma mark - C++ binary compatibility kludge
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user