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
|
void
|
||||||
Decorator::SetTitle(const char* string, BRegion* updateRegion)
|
Decorator::SetTitle(const char* string, BRegion* updateRegion)
|
||||||
{
|
{
|
||||||
fTitle.SetTo(string);
|
|
||||||
_DoLayout();
|
|
||||||
|
|
||||||
fFootprintValid = false;
|
fFootprintValid = false;
|
||||||
// the border very likely changed
|
// the border very likely changed
|
||||||
|
|
||||||
|
fTitle.SetTo(string);
|
||||||
_SetTitle(string, updateRegion);
|
_SetTitle(string, updateRegion);
|
||||||
|
|
||||||
// TODO: redraw?
|
// TODO: redraw?
|
||||||
@@ -639,12 +637,6 @@ Decorator::_SetFlags(uint32 flags, BRegion* updateRegion)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
Decorator::_SetTitle(const char* string, BRegion* updateRegion)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Decorator::_MoveBy(BPoint offset)
|
Decorator::_MoveBy(BPoint offset)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ protected:
|
|||||||
BRegion* updateRegion = NULL);
|
BRegion* updateRegion = NULL);
|
||||||
|
|
||||||
virtual void _SetTitle(const char* string,
|
virtual void _SetTitle(const char* string,
|
||||||
BRegion* updateRegion = NULL);
|
BRegion* updateRegion = NULL) = 0;
|
||||||
|
|
||||||
virtual void _SetFocus();
|
virtual void _SetFocus();
|
||||||
virtual void _MoveBy(BPoint offset);
|
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
|
bool
|
||||||
DefaultDecorator::GetSettings(BMessage* settings) const
|
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
|
void
|
||||||
DefaultDecorator::_FontsChanged(DesktopSettings& settings,
|
DefaultDecorator::_FontsChanged(DesktopSettings& settings,
|
||||||
BRegion* updateRegion)
|
BRegion* updateRegion)
|
||||||
|
|||||||
@@ -27,9 +27,6 @@ public:
|
|||||||
uint32 flags);
|
uint32 flags);
|
||||||
virtual ~DefaultDecorator();
|
virtual ~DefaultDecorator();
|
||||||
|
|
||||||
virtual void SetTitle(const char* string,
|
|
||||||
BRegion* updateRegion = NULL);
|
|
||||||
|
|
||||||
virtual float TabLocation() const
|
virtual float TabLocation() const
|
||||||
{ return (float)fTabOffset; }
|
{ return (float)fTabOffset; }
|
||||||
|
|
||||||
@@ -54,6 +51,9 @@ protected:
|
|||||||
virtual void _DrawTitle(BRect r);
|
virtual void _DrawTitle(BRect r);
|
||||||
virtual void _DrawZoom(BRect r);
|
virtual void _DrawZoom(BRect r);
|
||||||
|
|
||||||
|
virtual void _SetTitle(const char* string,
|
||||||
|
BRegion* updateRegion = NULL);
|
||||||
|
|
||||||
virtual void _FontsChanged(DesktopSettings& settings,
|
virtual void _FontsChanged(DesktopSettings& settings,
|
||||||
BRegion* updateRegion);
|
BRegion* updateRegion);
|
||||||
virtual void _SetLook(DesktopSettings& settings,
|
virtual void _SetLook(DesktopSettings& settings,
|
||||||
|
|||||||
Reference in New Issue
Block a user