Added drawing the window titles to the Workspace window - but I disabled
it, as it slows down window moving noticeably. To provide a good Workspaces window functionality, we should probably let WindowLayer take care of the updates itself - that would simplify the whole thing a lot. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15260 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a1d0e588b9
commit
649e929c7a
@ -23,6 +23,8 @@ WorkspacesLayer::WorkspacesLayer(BRect frame, const char* name,
|
||||
int32 token, uint32 resizeMode, uint32 flags, DrawingEngine* driver)
|
||||
: Layer(frame, name, token, resizeMode, flags, driver)
|
||||
{
|
||||
fDrawState->SetLowColor(RGBColor(255, 255, 255));
|
||||
fDrawState->SetHighColor(RGBColor(0, 0, 0));
|
||||
}
|
||||
|
||||
|
||||
@ -138,6 +140,32 @@ WorkspacesLayer::_DrawWindow(const BRect& workspaceFrame,
|
||||
|
||||
frame.InsetBy(1, 1);
|
||||
GetDrawingEngine()->FillRect(frame, white);
|
||||
|
||||
// draw title
|
||||
|
||||
// TODO: disabled because it's much too slow this way - the mini-window
|
||||
// functionality should probably be moved into the WindowLayer class,
|
||||
// so that it has only to be recalculated on demand. With double buffered
|
||||
// windows, this would also open up the door to have a more detailed
|
||||
// preview.
|
||||
#if 0
|
||||
BString title = window->Name();
|
||||
|
||||
ServerFont font = fDrawState->Font();
|
||||
font.SetSize(7);
|
||||
fDrawState->SetFont(font);
|
||||
|
||||
fDrawState->Font().TruncateString(&title, B_TRUNCATE_END, frame.Width() - 4);
|
||||
float width = GetDrawingEngine()->StringWidth(title.String(), title.Length(),
|
||||
fDrawState, NULL);
|
||||
float height = GetDrawingEngine()->StringHeight(title.String(), title.Length(),
|
||||
fDrawState);
|
||||
|
||||
GetDrawingEngine()->DrawString(title.String(), title.Length(),
|
||||
BPoint(frame.left + (frame.Width() - width) / 2,
|
||||
frame.top + (frame.Height() + height) / 2),
|
||||
fDrawState, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user