//! draws the tab, title, and buttons void Decorator::DrawTab() { _DrawTab(fTabRect); _DrawZoom(fZoomRect); _DrawMinimize(fMinimizeRect); _DrawTitle(fTabRect); _DrawClose(fCloseRect); }
void WinDecorator::_DrawTab(BRect r) { // If a window has a tab, this will draw it and any buttons which are // in it. if(fLook==B_NO_BORDER_WINDOW_LOOK) return; fDrawingEngine->FillRect(fTabRect,tab_highcol); _DrawTitle(r); // Draw the buttons if we're supposed to if(!(fFlags & B_NOT_CLOSABLE)) _DrawClose(fCloseRect); if(!(fFlags & B_NOT_ZOOMABLE)) _DrawZoom(fZoomRect); }
/*! \brief Actually draws the tab This function is called when the tab itself needs drawn. Other items, like the window title or buttons, should not be drawn here. \param tab The \a tab to update. \param rect The area of the \a tab to update. */ void WinDecorator::_DrawTab(Decorator::Tab* tab, BRect rect) { const BRect& tabRect = tab->tabRect; // If a window has a tab, this will draw it and any buttons in it. if (!tabRect.IsValid() || !rect.Intersects(tabRect) || fTopTab->look == B_NO_BORDER_WINDOW_LOOK) { return; } fDrawingEngine->FillRect(tabRect & rect, fTabColor); _DrawTitle(tab, tabRect); // Draw the buttons if we're supposed to // TODO : we should still draw the buttons if they are disabled, but grey them out _DrawButtons(tab, rect); }
void WinDecorator::_DrawTab(BRect invalid) { // If a window has a tab, this will draw it and any buttons which are // in it. if (!fTabRect.IsValid() || !invalid.Intersects(fTabRect) || fLook==B_NO_BORDER_WINDOW_LOOK) return; fDrawingEngine->FillRect(fTabRect,tab_highcol); _DrawTitle(fTabRect); // Draw the buttons if we're supposed to // TODO : we should still draw the buttons if they are disabled, but grey them out if (!(fFlags & B_NOT_CLOSABLE) && invalid.Intersects(fCloseRect)) _DrawClose(fCloseRect); if (!(fFlags & B_NOT_ZOOMABLE) && invalid.Intersects(fZoomRect)) _DrawZoom(fZoomRect); }
void MacDecorator::_DrawTab(BRect invalid) { // If a window has a tab, this will draw it and any buttons which are // in it. if (!fTabRect.IsValid() || !invalid.Intersects(fTabRect)) return; BRect rect(fTabRect); fDrawingEngine->SetHighColor(RGBColor(frame_midcol)); fDrawingEngine->FillRect(rect,frame_midcol); if (IsFocus()) { fDrawingEngine->StrokeLine(rect.LeftTop(),rect.RightTop(),frame_lowercol); fDrawingEngine->StrokeLine(rect.LeftTop(),rect.LeftBottom(),frame_lowercol); fDrawingEngine->StrokeLine(rect.RightBottom(),rect.RightTop(),frame_lowercol); rect.InsetBy(1,1); rect.bottom++; fDrawingEngine->StrokeLine(rect.LeftTop(),rect.RightTop(),frame_highcol); fDrawingEngine->StrokeLine(rect.LeftTop(),rect.LeftBottom(),frame_highcol); fDrawingEngine->StrokeLine(rect.RightBottom(),rect.RightTop(),frame_lowcol); // Draw the neat little lines on either side of the title if there's room if (fTabRect.left + textoffset > fCloseRect.right + 5) { // Left side BPoint offset(fCloseRect.right+5,fCloseRect.top), pt2(fTabRect.left+textoffset-5,fCloseRect.top); fDrawState.SetHighColor(RGBColor(frame_highcol)); for (int32 i = 0; i < 6; i++) { fDrawingEngine->StrokeLine(offset,pt2,fDrawState.HighColor()); offset.y+=2; pt2.y+=2; } offset.Set(fCloseRect.right+6,fCloseRect.top+1), pt2.Set(fTabRect.left+textoffset-4,fCloseRect.top+1); fDrawState.SetHighColor(RGBColor(frame_lowcol)); for (int32 i = 0; i < 6; i++) { fDrawingEngine->StrokeLine(offset, pt2, fDrawState.HighColor()); offset.y += 2; pt2.y += 2; } // Right side offset.Set(fTabRect.left + textoffset + titlepixelwidth + 6, fZoomRect.top), pt2.Set(fZoomRect.left - 6, fZoomRect.top); if (offset.x < pt2.x) { fDrawState.SetHighColor(RGBColor(frame_highcol)); for (int32 i = 0; i < 6; i++) { fDrawingEngine->StrokeLine(offset, pt2, fDrawState.HighColor()); offset.y += 2; pt2.y += 2; } offset.Set(fTabRect.left+textoffset + titlepixelwidth + 7, fZoomRect.top + 1), pt2.Set(fZoomRect.left - 5, fZoomRect.top + 1); fDrawState.SetHighColor(frame_lowcol); for(int32 i = 0; i < 6; i++) { fDrawingEngine->StrokeLine(offset, pt2, fDrawState.HighColor()); offset.y += 2; pt2.y += 2; } } } // Draw the buttons if we're supposed to if (!(fFlags & B_NOT_CLOSABLE)) _DrawClose(fCloseRect); if (!(fFlags & B_NOT_ZOOMABLE)) _DrawZoom(fZoomRect); } else { // Not focused - Just draw a plain light grey area with the title in the middle fDrawingEngine->StrokeLine(rect.LeftTop(),rect.RightTop(),frame_lowcol); fDrawingEngine->StrokeLine(rect.LeftTop(),rect.LeftBottom(),frame_lowcol); fDrawingEngine->StrokeLine(rect.RightBottom(),rect.RightTop(),frame_lowcol); } _DrawTitle(fTabRect); }
//! draws the title void Decorator::DrawTitle() { _DrawTitle(fTabRect); }