diff --git a/headers/os/interface/Layout.h b/headers/os/interface/Layout.h index b63aba73cf..c5ec46a613 100644 --- a/headers/os/interface/Layout.h +++ b/headers/os/interface/Layout.h @@ -48,7 +48,7 @@ public: // Layouting related methods - void InvalidateLayout(bool children = false); + virtual void InvalidateLayout(bool children = false); void Relayout(bool immediate = false); void RequireLayout(); bool IsValid(); diff --git a/headers/os/interface/LayoutItem.h b/headers/os/interface/LayoutItem.h index fd8771620f..3e5e70f84f 100644 --- a/headers/os/interface/LayoutItem.h +++ b/headers/os/interface/LayoutItem.h @@ -59,10 +59,11 @@ public: virtual status_t AllUnarchived(const BMessage* from); protected: - void SetLayout(BLayout* layout); // hook methods + virtual void LayoutInvalidated(bool children); + virtual void AttachedToLayout(); virtual void DetachedFromLayout(BLayout* layout); diff --git a/src/kits/interface/LayoutItem.cpp b/src/kits/interface/LayoutItem.cpp index 9c871a652e..980378fb05 100644 --- a/src/kits/interface/LayoutItem.cpp +++ b/src/kits/interface/LayoutItem.cpp @@ -72,6 +72,7 @@ BLayoutItem::View() void BLayoutItem::InvalidateLayout(bool children) { + LayoutInvalidated(children); if (fLayout) fLayout->InvalidateLayout(children); } @@ -183,6 +184,13 @@ BLayoutItem::SetLayout(BLayout* layout) } +void +BLayoutItem::LayoutInvalidated(bool children) +{ + // hook method +} + + void BLayoutItem::AttachedToLayout() { diff --git a/src/kits/interface/ViewLayoutItem.cpp b/src/kits/interface/ViewLayoutItem.cpp index 75b3b269a2..7c14bd0d5a 100644 --- a/src/kits/interface/ViewLayoutItem.cpp +++ b/src/kits/interface/ViewLayoutItem.cpp @@ -157,13 +157,6 @@ BViewLayoutItem::View() } -void -BViewLayoutItem::InvalidateLayout(bool children) -{ - fView->InvalidateLayout(children); -} - - void BViewLayoutItem::Relayout(bool immediate) { @@ -220,6 +213,13 @@ BViewLayoutItem::Instantiate(BMessage* from) } +void +BViewLayoutItem::LayoutInvalidated(bool children) +{ + fView->InvalidateLayout(children); +} + + void BViewLayoutItem::AncestorVisibilityChanged(bool shown) { diff --git a/src/kits/interface/ViewLayoutItem.h b/src/kits/interface/ViewLayoutItem.h index d557d43e2e..b16eaab61c 100644 --- a/src/kits/interface/ViewLayoutItem.h +++ b/src/kits/interface/ViewLayoutItem.h @@ -36,7 +36,6 @@ public: virtual BView* View(); - virtual void InvalidateLayout(bool children = false); virtual void Relayout(bool immediate = false); virtual status_t Archive(BMessage* into, bool deep = true) const; @@ -45,6 +44,7 @@ public: static BArchivable* Instantiate(BMessage* from); protected: + virtual void LayoutInvalidated(bool children); virtual void AncestorVisibilityChanged(bool shown); private: