BAlert: Support changing icons while the alert is running.
After all, you can change buttons, text, and the other settings, so why not support this, too?
This commit is contained in:
parent
a649df28ac
commit
f583d90436
@ -57,8 +57,7 @@ public:
|
||||
virtual BSize MaxSize();
|
||||
virtual void Draw(BRect updateRect);
|
||||
|
||||
void SetBitmap(BBitmap* Icon)
|
||||
{ fIconBitmap = Icon; }
|
||||
void SetBitmap(BBitmap* icon);
|
||||
BBitmap* Bitmap()
|
||||
{ return fIconBitmap; }
|
||||
|
||||
@ -745,6 +744,22 @@ TAlertView::Archive(BMessage* archive, bool deep) const
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TAlertView::SetBitmap(BBitmap* icon)
|
||||
{
|
||||
BBitmap* oldBitmap = fIconBitmap;
|
||||
fIconBitmap = icon;
|
||||
|
||||
if (oldBitmap == NULL
|
||||
|| (icon != NULL && oldBitmap->Bounds() != icon->Bounds())) {
|
||||
InvalidateLayout();
|
||||
} else
|
||||
Invalidate();
|
||||
|
||||
delete oldBitmap;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TAlertView::GetPreferredSize(float* _width, float* _height)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user