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