Replace remaining InvalidateLayout()'s with LayoutInvalidated(). Also do a bit of cleanup/move methods around.
This commit is contained in:
@@ -77,8 +77,6 @@ public:
|
|||||||
virtual void DoLayout();
|
virtual void DoLayout();
|
||||||
virtual void FrameMoved(BPoint newPosition);
|
virtual void FrameMoved(BPoint newPosition);
|
||||||
virtual void FrameResized(float newWidth, float newHeight);
|
virtual void FrameResized(float newWidth, float newHeight);
|
||||||
void InvalidateLayout();
|
|
||||||
virtual void InvalidateLayout(bool descendants);
|
|
||||||
|
|
||||||
virtual void MakeFocus(bool focus = true);
|
virtual void MakeFocus(bool focus = true);
|
||||||
|
|
||||||
@@ -139,6 +137,8 @@ protected:
|
|||||||
uint32 resizeMask, uint32 flags,
|
uint32 resizeMask, uint32 flags,
|
||||||
menu_layout layout, bool resizeToFit);
|
menu_layout layout, bool resizeToFit);
|
||||||
|
|
||||||
|
virtual void LayoutInvalidated(bool descendants);
|
||||||
|
|
||||||
virtual BPoint ScreenLocation();
|
virtual BPoint ScreenLocation();
|
||||||
|
|
||||||
void SetItemMargins(float left, float top,
|
void SetItemMargins(float left, float top,
|
||||||
|
|||||||
@@ -83,14 +83,13 @@ public:
|
|||||||
virtual BSize MaxSize();
|
virtual BSize MaxSize();
|
||||||
virtual BSize PreferredSize();
|
virtual BSize PreferredSize();
|
||||||
|
|
||||||
virtual void InvalidateLayout(bool descendants = false);
|
|
||||||
|
|
||||||
BLayoutItem* CreateLabelLayoutItem();
|
BLayoutItem* CreateLabelLayoutItem();
|
||||||
BLayoutItem* CreateMenuBarLayoutItem();
|
BLayoutItem* CreateMenuBarLayoutItem();
|
||||||
|
|
||||||
virtual status_t Perform(perform_code d, void* arg);
|
virtual status_t Perform(perform_code d, void* arg);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void LayoutInvalidated(bool descendants);
|
||||||
virtual void DoLayout();
|
virtual void DoLayout();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -48,8 +48,6 @@ public:
|
|||||||
virtual BSize PreferredSize();
|
virtual BSize PreferredSize();
|
||||||
virtual void ResizeToPreferred();
|
virtual void ResizeToPreferred();
|
||||||
|
|
||||||
virtual void InvalidateLayout(bool descendants = false);
|
|
||||||
virtual void DoLayout();
|
|
||||||
virtual void FrameMoved(BPoint position);
|
virtual void FrameMoved(BPoint position);
|
||||||
virtual void FrameResized(float width, float height);
|
virtual void FrameResized(float width, float height);
|
||||||
|
|
||||||
@@ -80,6 +78,10 @@ public:
|
|||||||
|
|
||||||
virtual status_t Perform(perform_code d, void* arg);
|
virtual status_t Perform(perform_code d, void* arg);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void LayoutInvalidated(bool descendants = false);
|
||||||
|
virtual void DoLayout();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// FBC padding and forbidden methods
|
// FBC padding and forbidden methods
|
||||||
virtual void _ReservedScrollView1();
|
virtual void _ReservedScrollView1();
|
||||||
|
|||||||
@@ -156,12 +156,13 @@ public:
|
|||||||
|
|
||||||
virtual float MaxUpdateTextWidth();
|
virtual float MaxUpdateTextWidth();
|
||||||
|
|
||||||
virtual void InvalidateLayout(bool descendants = false);
|
|
||||||
|
|
||||||
virtual BSize MinSize();
|
virtual BSize MinSize();
|
||||||
virtual BSize MaxSize();
|
virtual BSize MaxSize();
|
||||||
virtual BSize PreferredSize();
|
virtual BSize PreferredSize();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void LayoutInvalidated(bool descendants);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _DrawBlockThumb();
|
void _DrawBlockThumb();
|
||||||
void _DrawTriangleThumb();
|
void _DrawTriangleThumb();
|
||||||
|
|||||||
@@ -88,12 +88,11 @@ public:
|
|||||||
virtual BSize MaxSize();
|
virtual BSize MaxSize();
|
||||||
virtual BSize PreferredSize();
|
virtual BSize PreferredSize();
|
||||||
|
|
||||||
virtual void InvalidateLayout(bool descendants = false);
|
|
||||||
|
|
||||||
BLayoutItem* CreateLabelLayoutItem();
|
BLayoutItem* CreateLabelLayoutItem();
|
||||||
BLayoutItem* CreateTextViewLayoutItem();
|
BLayoutItem* CreateTextViewLayoutItem();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void LayoutInvalidated(bool descendants);
|
||||||
virtual void DoLayout();
|
virtual void DoLayout();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -220,9 +220,8 @@ public:
|
|||||||
virtual void GetHeightForWidth(float width, float* min,
|
virtual void GetHeightForWidth(float width, float* min,
|
||||||
float* max, float* preferred);
|
float* max, float* preferred);
|
||||||
|
|
||||||
virtual void InvalidateLayout(bool descendants = false);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void LayoutInvalidated(bool descendants);
|
||||||
virtual void DoLayout();
|
virtual void DoLayout();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -373,7 +373,6 @@ public:
|
|||||||
virtual BSize PreferredSize();
|
virtual BSize PreferredSize();
|
||||||
virtual BSize MaxSize();
|
virtual BSize MaxSize();
|
||||||
|
|
||||||
virtual void InvalidateLayout(bool descendants = false);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
@@ -382,6 +381,7 @@ protected:
|
|||||||
virtual void WindowActivated(bool active);
|
virtual void WindowActivated(bool active);
|
||||||
virtual void Draw(BRect updateRect);
|
virtual void Draw(BRect updateRect);
|
||||||
|
|
||||||
|
virtual void LayoutInvalidated(bool descendants = false);
|
||||||
virtual void DoLayout();
|
virtual void DoLayout();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -1886,9 +1886,8 @@ BColumnListView::MaxSize()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BColumnListView::InvalidateLayout(bool descendants)
|
BColumnListView::LayoutInvalidated(bool descendants)
|
||||||
{
|
{
|
||||||
BView::InvalidateLayout(descendants);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -667,23 +667,6 @@ BMenu::FrameResized(float new_width, float new_height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BMenu::InvalidateLayout()
|
|
||||||
{
|
|
||||||
InvalidateLayout(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BMenu::InvalidateLayout(bool descendants)
|
|
||||||
{
|
|
||||||
fUseCachedMenuLayout = false;
|
|
||||||
fLayoutData->preferred.Set(B_SIZE_UNSET, B_SIZE_UNSET);
|
|
||||||
|
|
||||||
BView::InvalidateLayout(descendants);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
@@ -2271,6 +2254,14 @@ BMenu::_ComputeMatrixLayout(BRect &frame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BMenu::LayoutInvalidated(bool descendants)
|
||||||
|
{
|
||||||
|
fUseCachedMenuLayout = false;
|
||||||
|
fLayoutData->preferred.Set(B_SIZE_UNSET, B_SIZE_UNSET);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Assumes the SuperMenu to be locked (due to calling ConvertToScreen())
|
// Assumes the SuperMenu to be locked (due to calling ConvertToScreen())
|
||||||
BPoint
|
BPoint
|
||||||
BMenu::ScreenLocation()
|
BMenu::ScreenLocation()
|
||||||
|
|||||||
@@ -801,17 +801,6 @@ BMenuField::PreferredSize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BMenuField::InvalidateLayout(bool descendants)
|
|
||||||
{
|
|
||||||
CALLED();
|
|
||||||
|
|
||||||
fLayoutData->valid = false;
|
|
||||||
|
|
||||||
BView::InvalidateLayout(descendants);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BLayoutItem*
|
BLayoutItem*
|
||||||
BMenuField::CreateLabelLayoutItem()
|
BMenuField::CreateLabelLayoutItem()
|
||||||
{
|
{
|
||||||
@@ -906,6 +895,15 @@ BMenuField::Perform(perform_code code, void* _data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BMenuField::LayoutInvalidated(bool descendants)
|
||||||
|
{
|
||||||
|
CALLED();
|
||||||
|
|
||||||
|
fLayoutData->valid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BMenuField::DoLayout()
|
BMenuField::DoLayout()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -300,39 +300,6 @@ BScrollView::ResizeToPreferred()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BScrollView::InvalidateLayout(bool descendants)
|
|
||||||
{
|
|
||||||
BView::InvalidateLayout(descendants);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BScrollView::DoLayout()
|
|
||||||
{
|
|
||||||
if (!(Flags() & B_SUPPORTS_LAYOUT))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// If the user set a layout, we let the base class version call its hook.
|
|
||||||
if (GetLayout()) {
|
|
||||||
BView::DoLayout();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BRect innerFrame = _InnerFrame();
|
|
||||||
|
|
||||||
if (fTarget != NULL) {
|
|
||||||
fTarget->MoveTo(innerFrame.left, innerFrame.top);
|
|
||||||
fTarget->ResizeTo(innerFrame.Width(), innerFrame.Height());
|
|
||||||
|
|
||||||
//BLayoutUtils::AlignInFrame(fTarget, fTarget->Bounds());
|
|
||||||
}
|
|
||||||
|
|
||||||
_AlignScrollBars(fHorizontalScrollBar != NULL, fVerticalScrollBar != NULL,
|
|
||||||
innerFrame);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BScrollView::FrameMoved(BPoint position)
|
BScrollView::FrameMoved(BPoint position)
|
||||||
{
|
{
|
||||||
@@ -668,6 +635,40 @@ BScrollView::Perform(perform_code code, void* _data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BScrollView::LayoutInvalidated(bool descendants)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BScrollView::DoLayout()
|
||||||
|
{
|
||||||
|
if (!(Flags() & B_SUPPORTS_LAYOUT))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// If the user set a layout, we let the base class version call its hook.
|
||||||
|
if (GetLayout()) {
|
||||||
|
BView::DoLayout();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BRect innerFrame = _InnerFrame();
|
||||||
|
|
||||||
|
if (fTarget != NULL) {
|
||||||
|
fTarget->MoveTo(innerFrame.left, innerFrame.top);
|
||||||
|
fTarget->ResizeTo(innerFrame.Width(), innerFrame.Height());
|
||||||
|
|
||||||
|
//BLayoutUtils::AlignInFrame(fTarget, fTarget->Bounds());
|
||||||
|
}
|
||||||
|
|
||||||
|
_AlignScrollBars(fHorizontalScrollBar != NULL, fVerticalScrollBar != NULL,
|
||||||
|
innerFrame);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1736,16 +1736,6 @@ BSlider::MaxUpdateTextWidth()
|
|||||||
// #pragma mark - layout related
|
// #pragma mark - layout related
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BSlider::InvalidateLayout(bool descendants)
|
|
||||||
{
|
|
||||||
// invalidate cached preferred size
|
|
||||||
fMinSize.Set(-1, -1);
|
|
||||||
|
|
||||||
BControl::InvalidateLayout(descendants);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BSize
|
BSize
|
||||||
BSlider::MinSize()
|
BSlider::MinSize()
|
||||||
{
|
{
|
||||||
@@ -1778,6 +1768,14 @@ BSlider::PreferredSize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BSlider::LayoutInvalidated(bool descendants)
|
||||||
|
{
|
||||||
|
// invalidate cached preferred size
|
||||||
|
fMinSize.Set(-1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - private
|
// #pragma mark - private
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -841,17 +841,6 @@ BTextControl::PreferredSize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BTextControl::InvalidateLayout(bool descendants)
|
|
||||||
{
|
|
||||||
CALLED();
|
|
||||||
|
|
||||||
fLayoutData->valid = false;
|
|
||||||
|
|
||||||
BView::InvalidateLayout(descendants);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BLayoutItem*
|
BLayoutItem*
|
||||||
BTextControl::CreateLabelLayoutItem()
|
BTextControl::CreateLabelLayoutItem()
|
||||||
{
|
{
|
||||||
@@ -870,6 +859,15 @@ BTextControl::CreateTextViewLayoutItem()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BTextControl::LayoutInvalidated(bool descendants)
|
||||||
|
{
|
||||||
|
CALLED();
|
||||||
|
|
||||||
|
fLayoutData->valid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BTextControl::DoLayout()
|
BTextControl::DoLayout()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2782,13 +2782,11 @@ BTextView::GetHeightForWidth(float width, float* min, float* max,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BTextView::InvalidateLayout(bool descendants)
|
BTextView::LayoutInvalidated(bool descendants)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
fLayoutData->valid = false;
|
fLayoutData->valid = false;
|
||||||
|
|
||||||
BView::InvalidateLayout(descendants);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user