//! draws the tab, title, and buttons void Decorator::DrawTab() { _DrawTab(fTabRect); _DrawZoom(fZoomRect); _DrawMinimize(fMinimizeRect); _DrawTitle(fTabRect); _DrawClose(fCloseRect); }
void TabDecorator::_DrawButtons(Decorator::Tab* tab, const BRect& invalid) { STRACE(("TabDecorator: _DrawButtons\n")); // Draw the buttons if we're supposed to if (!(tab->flags & B_NOT_CLOSABLE) && invalid.Intersects(tab->closeRect)) _DrawClose(tab, false, tab->closeRect); if (!(tab->flags & B_NOT_ZOOMABLE) && invalid.Intersects(tab->zoomRect)) _DrawZoom(tab, false, tab->zoomRect); }
void WinDecorator::_DrawButtons(Decorator::Tab* tab, const BRect& invalid) { if ((tab->flags & B_NOT_MINIMIZABLE) == 0 && invalid.Intersects(tab->minimizeRect)) { _DrawMinimize(tab, false, tab->minimizeRect); } if ((tab->flags & B_NOT_ZOOMABLE) == 0 && invalid.Intersects(tab->zoomRect)) { _DrawZoom(tab, false, tab->zoomRect); } if ((tab->flags & B_NOT_CLOSABLE) == 0 && invalid.Intersects(tab->closeRect)) { _DrawClose(tab, false, tab->closeRect); } }
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); }
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 zoom button void Decorator::DrawZoom() { _DrawZoom(fZoomRect); }