Fix SetTitle (bug #6321).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37559 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -187,12 +187,10 @@ Decorator::SetZoom(bool pressed)
|
||||
void
|
||||
Decorator::SetTitle(const char* string, BRegion* updateRegion)
|
||||
{
|
||||
fTitle.SetTo(string);
|
||||
_DoLayout();
|
||||
|
||||
fFootprintValid = false;
|
||||
// the border very likely changed
|
||||
|
||||
fTitle.SetTo(string);
|
||||
_SetTitle(string, updateRegion);
|
||||
|
||||
// TODO: redraw?
|
||||
@@ -639,12 +637,6 @@ Decorator::_SetFlags(uint32 flags, BRegion* updateRegion)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Decorator::_SetTitle(const char* string, BRegion* updateRegion)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Decorator::_MoveBy(BPoint offset)
|
||||
{
|
||||
|
||||
@@ -144,7 +144,7 @@ protected:
|
||||
BRegion* updateRegion = NULL);
|
||||
|
||||
virtual void _SetTitle(const char* string,
|
||||
BRegion* updateRegion = NULL);
|
||||
BRegion* updateRegion = NULL) = 0;
|
||||
|
||||
virtual void _SetFocus();
|
||||
virtual void _MoveBy(BPoint offset);
|
||||
|
||||
@@ -120,31 +120,6 @@ DefaultDecorator::~DefaultDecorator()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DefaultDecorator::SetTitle(const char* string, BRegion* updateRegion)
|
||||
{
|
||||
// TODO: we could be much smarter about the update region
|
||||
|
||||
BRect rect = TabRect();
|
||||
|
||||
Decorator::SetTitle(string);
|
||||
|
||||
if (updateRegion == NULL)
|
||||
return;
|
||||
|
||||
BRect updatedRect = TabRect();
|
||||
if (rect.left > updatedRect.left)
|
||||
rect.left = updatedRect.left;
|
||||
if (rect.right < updatedRect.right)
|
||||
rect.right = updatedRect.right;
|
||||
|
||||
rect.bottom++;
|
||||
// the border will look differently when the title is adjacent
|
||||
|
||||
updateRegion->Include(rect);
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
DefaultDecorator::GetSettings(BMessage* settings) const
|
||||
{
|
||||
@@ -767,6 +742,31 @@ DefaultDecorator::_DrawZoom(BRect rect)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DefaultDecorator::_SetTitle(const char* string, BRegion* updateRegion)
|
||||
{
|
||||
// TODO: we could be much smarter about the update region
|
||||
|
||||
BRect rect = TabRect();
|
||||
|
||||
_DoLayout();
|
||||
|
||||
if (updateRegion == NULL)
|
||||
return;
|
||||
|
||||
BRect updatedRect = TabRect();
|
||||
if (rect.left > updatedRect.left)
|
||||
rect.left = updatedRect.left;
|
||||
if (rect.right < updatedRect.right)
|
||||
rect.right = updatedRect.right;
|
||||
|
||||
rect.bottom++;
|
||||
// the border will look differently when the title is adjacent
|
||||
|
||||
updateRegion->Include(rect);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DefaultDecorator::_FontsChanged(DesktopSettings& settings,
|
||||
BRegion* updateRegion)
|
||||
|
||||
@@ -27,9 +27,6 @@ public:
|
||||
uint32 flags);
|
||||
virtual ~DefaultDecorator();
|
||||
|
||||
virtual void SetTitle(const char* string,
|
||||
BRegion* updateRegion = NULL);
|
||||
|
||||
virtual float TabLocation() const
|
||||
{ return (float)fTabOffset; }
|
||||
|
||||
@@ -54,6 +51,9 @@ protected:
|
||||
virtual void _DrawTitle(BRect r);
|
||||
virtual void _DrawZoom(BRect r);
|
||||
|
||||
virtual void _SetTitle(const char* string,
|
||||
BRegion* updateRegion = NULL);
|
||||
|
||||
virtual void _FontsChanged(DesktopSettings& settings,
|
||||
BRegion* updateRegion);
|
||||
virtual void _SetLook(DesktopSettings& settings,
|
||||
|
||||
Reference in New Issue
Block a user