* The window title now uses B_TRUNCATE_MIDDLE instead of *_END.

* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26954 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-08-12 21:07:28 +00:00
parent 1fb04337f5
commit b31df46fd2
2 changed files with 35 additions and 29 deletions

View File

@ -2312,7 +2312,7 @@ TWindowView::Draw(BRect update)
if (stringWidth > maxWidth) {
// window title is too long, need to truncate
TruncateString(&title, B_TRUNCATE_END, maxWidth);
TruncateString(&title, B_TRUNCATE_MIDDLE, maxWidth);
stringWidth = maxWidth;
}

View File

@ -158,8 +158,8 @@ DefaultDecorator::SetTitle(const char* string, BRegion* updateRegion)
void
DefaultDecorator::SetLook(DesktopSettings& settings,
window_look look, BRegion* updateRegion)
DefaultDecorator::SetLook(DesktopSettings& settings, window_look look,
BRegion* updateRegion)
{
// TODO: we could be much smarter about the update region
@ -350,7 +350,8 @@ DefaultDecorator::ResizeBy(BPoint pt, BRegion* dirty)
if (fLook != kLeftTitledWindowLook && tabSize != fTabRect.Width()) {
fTabRect.right = fTabRect.left + tabSize;
} else if (fLook == kLeftTitledWindowLook && tabSize != fTabRect.Height()) {
} else if (fLook == kLeftTitledWindowLook
&& tabSize != fTabRect.Height()) {
fTabRect.bottom = fTabRect.top + tabSize;
}
@ -387,7 +388,8 @@ DefaultDecorator::SetTabLocation(float location, BRegion* updateRegion)
if (location < 0)
location = 0;
float maxLocation = fRightBorder.right - fLeftBorder.left - fTabRect.Width();
float maxLocation
= fRightBorder.right - fLeftBorder.left - fTabRect.Width();
if (location > maxLocation)
location = maxLocation;
@ -469,10 +471,14 @@ void
DefaultDecorator::GetSizeLimits(int32* minWidth, int32* minHeight,
int32* maxWidth, int32* maxHeight) const
{
if (fTabRect.IsValid())
*minWidth = (int32)roundf(max_c(*minWidth, fMinTabSize - 2 * fBorderWidth));
if (fResizeRect.IsValid())
*minHeight = (int32)roundf(max_c(*minHeight, fResizeRect.Height() - fBorderWidth));
if (fTabRect.IsValid()) {
*minWidth = (int32)roundf(max_c(*minWidth,
fMinTabSize - 2 * fBorderWidth));
}
if (fResizeRect.IsValid()) {
*minHeight = (int32)roundf(max_c(*minHeight,
fResizeRect.Height() - fBorderWidth));
}
}
@ -556,8 +562,8 @@ DefaultDecorator::Clicked(BPoint pt, int32 buttons, int32 modifiers)
|| fLook == B_FLOATING_WINDOW_LOOK
|| fLook == B_MODAL_WINDOW_LOOK
|| fLook == kLeftTitledWindowLook)) {
BRect temp(BPoint(fBottomBorder.right - 18, fBottomBorder.bottom - 18),
fBottomBorder.RightBottom());
BRect temp(BPoint(fBottomBorder.right - 18,
fBottomBorder.bottom - 18), fBottomBorder.RightBottom());
if (temp.Contains(pt))
return DEC_RESIZE;
}
@ -1032,7 +1038,7 @@ DefaultDecorator::_DrawTitle(BRect r)
titlePos);
}
// _DrawZoom
void
DefaultDecorator::_DrawZoom(BRect rect)
{
@ -1050,7 +1056,7 @@ DefaultDecorator::_DrawZoom(BRect rect)
_DrawButtonBitmap(bitmap, rect);
}
// _SetFocus
void
DefaultDecorator::_SetFocus()
{
@ -1153,7 +1159,7 @@ DefaultDecorator::_DrawBlendedRect(DrawingEngine *engine, BRect rect,
focus ? fFocusFrameColors[1] : fNonFocusFrameColors[1]);
}
// _GetButtonSizeAndOffset
void
DefaultDecorator::_GetButtonSizeAndOffset(const BRect& tabRect, float* _offset,
float* _size, float* _inset) const
@ -1174,7 +1180,7 @@ DefaultDecorator::_GetButtonSizeAndOffset(const BRect& tabRect, float* _offset,
*_size = tabSize - 2 * *_offset + *_inset;
}
// _LayoutTabItems
void
DefaultDecorator::_LayoutTabItems(const BRect& tabRect)
{
@ -1220,7 +1226,7 @@ DefaultDecorator::_LayoutTabItems(const BRect& tabRect)
size = (fZoomRect.top - fCloseRect.bottom) - fTextOffset * 2 + inset;
fTruncatedTitle = Title();
fDrawState.Font().TruncateString(&fTruncatedTitle, B_TRUNCATE_END, size);
fDrawState.Font().TruncateString(&fTruncatedTitle, B_TRUNCATE_MIDDLE, size);
fTruncatedTitleLength = fTruncatedTitle.Length();
}