Add BLayoutItem::LayoutInvalidated() hook. Leave BLayoutItem::InvalidateLayout() (and therefore BLayout::InvalidateLayout()) virtual. This is needed to let BLayout override it for invalidation propagations.
This commit is contained in:
@@ -48,7 +48,7 @@ public:
|
|||||||
|
|
||||||
// Layouting related methods
|
// Layouting related methods
|
||||||
|
|
||||||
void InvalidateLayout(bool children = false);
|
virtual void InvalidateLayout(bool children = false);
|
||||||
void Relayout(bool immediate = false);
|
void Relayout(bool immediate = false);
|
||||||
void RequireLayout();
|
void RequireLayout();
|
||||||
bool IsValid();
|
bool IsValid();
|
||||||
|
|||||||
@@ -59,10 +59,11 @@ public:
|
|||||||
virtual status_t AllUnarchived(const BMessage* from);
|
virtual status_t AllUnarchived(const BMessage* from);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void SetLayout(BLayout* layout);
|
void SetLayout(BLayout* layout);
|
||||||
|
|
||||||
// hook methods
|
// hook methods
|
||||||
|
virtual void LayoutInvalidated(bool children);
|
||||||
|
|
||||||
virtual void AttachedToLayout();
|
virtual void AttachedToLayout();
|
||||||
virtual void DetachedFromLayout(BLayout* layout);
|
virtual void DetachedFromLayout(BLayout* layout);
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ BLayoutItem::View()
|
|||||||
void
|
void
|
||||||
BLayoutItem::InvalidateLayout(bool children)
|
BLayoutItem::InvalidateLayout(bool children)
|
||||||
{
|
{
|
||||||
|
LayoutInvalidated(children);
|
||||||
if (fLayout)
|
if (fLayout)
|
||||||
fLayout->InvalidateLayout(children);
|
fLayout->InvalidateLayout(children);
|
||||||
}
|
}
|
||||||
@@ -183,6 +184,13 @@ BLayoutItem::SetLayout(BLayout* layout)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BLayoutItem::LayoutInvalidated(bool children)
|
||||||
|
{
|
||||||
|
// hook method
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BLayoutItem::AttachedToLayout()
|
BLayoutItem::AttachedToLayout()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -157,13 +157,6 @@ BViewLayoutItem::View()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BViewLayoutItem::InvalidateLayout(bool children)
|
|
||||||
{
|
|
||||||
fView->InvalidateLayout(children);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BViewLayoutItem::Relayout(bool immediate)
|
BViewLayoutItem::Relayout(bool immediate)
|
||||||
{
|
{
|
||||||
@@ -220,6 +213,13 @@ BViewLayoutItem::Instantiate(BMessage* from)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
BViewLayoutItem::LayoutInvalidated(bool children)
|
||||||
|
{
|
||||||
|
fView->InvalidateLayout(children);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BViewLayoutItem::AncestorVisibilityChanged(bool shown)
|
BViewLayoutItem::AncestorVisibilityChanged(bool shown)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ public:
|
|||||||
|
|
||||||
virtual BView* View();
|
virtual BView* View();
|
||||||
|
|
||||||
virtual void InvalidateLayout(bool children = false);
|
|
||||||
virtual void Relayout(bool immediate = false);
|
virtual void Relayout(bool immediate = false);
|
||||||
|
|
||||||
virtual status_t Archive(BMessage* into, bool deep = true) const;
|
virtual status_t Archive(BMessage* into, bool deep = true) const;
|
||||||
@@ -45,6 +44,7 @@ public:
|
|||||||
static BArchivable* Instantiate(BMessage* from);
|
static BArchivable* Instantiate(BMessage* from);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void LayoutInvalidated(bool children);
|
||||||
virtual void AncestorVisibilityChanged(bool shown);
|
virtual void AncestorVisibilityChanged(bool shown);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user