Lines Matching defs:tab

133 DefaultDecorator::TabLocation(int32 tab) const
135 DefaultDecorator::Tab* decoratorTab = _TabAt(tab);
148 if (settings->AddRect("tab frame", fTitleBarRect) != B_OK)
154 // TODO only add the location of the tab of the window who requested the
157 DefaultDecorator::Tab* tab = _TabAt(i);
158 if (settings->AddFloat("tab location", (float)tab->tabOffset) != B_OK)
174 // We need to draw a few things: the tab, the resize knob, the borders,
214 DefaultDecorator::RegionAt(BPoint where, int32& tab) const
216 // Let the base class version identify hits of the buttons and the tab.
217 Region region = Decorator::RegionAt(where, tab);
261 DefaultDecorator::Tab* tab = _TabAt(tabIndex);
262 if (tab != NULL) {
263 tab->isHighlighted = highlight != 0;
269 memset(&tab->closeBitmaps, 0, sizeof(tab->closeBitmaps));
273 memset(&tab->zoomBitmaps, 0, sizeof(tab->zoomBitmaps));
431 // no tab
433 Decorator::Tab* tab = fTabList.ItemAt(i);
434 tab->tabRect.Set(0.0, 0.0, -1.0, -1.0);
452 // calculate our tab rect
454 DefaultDecorator::Tab* tab = _TabAt(i);
456 BRect& tabRect = tab->tabRect;
457 // distance from one item of the tab bar to another.
459 tab->textOffset = _DefaultTextOffset();
464 if (tab->look != kLeftTitledWindowLook) {
478 // format tab rect for a floating window - make the rect smaller
479 if (tab->look == B_FLOATING_WINDOW_LOOK) {
489 // tab->minTabSize contains just the room for the buttons
490 tab->minTabSize = inset * 2 + tab->textOffset;
491 if ((tab->flags & B_NOT_CLOSABLE) == 0)
492 tab->minTabSize += offset + size;
493 if ((tab->flags & B_NOT_ZOOMABLE) == 0)
494 tab->minTabSize += offset + size;
496 // tab->maxTabSize contains tab->minTabSize + the width required for the
498 tab->maxTabSize = fDrawingEngine
499 ? ceilf(fDrawingEngine->StringWidth(Title(tab), strlen(Title(tab)),
501 if (tab->maxTabSize > 0.0)
502 tab->maxTabSize += tab->textOffset;
503 tab->maxTabSize += tab->minTabSize;
505 float tabSize = (tab->look != kLeftTitledWindowLook
507 if (tabSize < tab->minTabSize)
508 tabSize = tab->minTabSize;
509 if (tabSize > tab->maxTabSize)
510 tabSize = tab->maxTabSize;
513 if (tab->look != kLeftTitledWindowLook)
520 tab->tabOffset = (uint32)tabOffset;
521 if (tab->tabLocation != 0.0 && fTabList.CountItems() == 1
522 && tab->tabOffset > (fRightBorder.right - fLeftBorder.left
524 tab->tabOffset = uint32(fRightBorder.right - fLeftBorder.left
527 tabRect.OffsetBy(tab->tabOffset, 0);
537 // finally, layout the buttons and text within the tab rect
539 Decorator::Tab* tab = fTabList.ItemAt(i);
542 fTitleBarRect = tab->tabRect;
544 fTitleBarRect = fTitleBarRect | tab->tabRect;
546 _LayoutTabItems(tab, tab->tabRect);
568 Decorator::Tab* tab = fTabList.ItemAt(i);
569 float tabWidth = tab->tabRect.Width();
588 Decorator::Tab* tab = fTabList.ItemAt(i);
589 if (int_equal(maxTabSize, tab->tabRect.Width()))
590 tab->tabRect.right -= minus;
593 tab->tabRect.OffsetBy(prevTab->tabRect.right - tab->tabRect.left,
597 prevTab = tab;
609 DefaultDecorator::Tab* tab = _TabAt(i);
610 tab->tabOffset = uint32(tab->tabRect.left - fLeftBorder.left);
618 Decorator::Tab* tab = new(std::nothrow) DefaultDecorator::Tab;
619 if (tab == NULL)
623 _SetFocus(tab);
624 return tab;
667 // grey along the bottom of the tab
726 // grey along the bottom of the tab
746 // grey along the right side of the tab
876 DefaultDecorator::_DrawTab(Decorator::Tab* tab, BRect invalid)
880 const BRect& tabRect = tab->tabRect;
881 // If a window has a tab, this will draw it and any buttons which are
887 _GetComponentColors(COMPONENT_TAB, colors, tab);
894 if (tab->look != kLeftTitledWindowLook) {
903 if (fTopTab != tab)
909 tabBotton - (tab->look == kLeftTitledWindowLook ? 1 : 0)),
912 BPoint(tabRect.right - (tab->look == kLeftTitledWindowLook ? 0 : 1),
916 if (tab->look != kLeftTitledWindowLook) {
933 if (tab->look != kLeftTitledWindowLook) {
943 _DrawTitle(tab, tabRect);
945 DrawButtons(tab, invalid);
955 DefaultDecorator::Tab* tab = static_cast<DefaultDecorator::Tab*>(_tab);
957 int32 index = (tab->buttonFocus ? 0 : 1) + (tab->closePressed ? 0 : 2);
958 ServerBitmap* bitmap = tab->closeBitmaps[index];
960 bitmap = _GetBitmapForButton(tab, COMPONENT_CLOSE_BUTTON,
961 tab->closePressed, rect.IntegerWidth(), rect.IntegerHeight());
962 tab->closeBitmaps[index] = bitmap;
972 DefaultDecorator::Tab* tab = static_cast<DefaultDecorator::Tab*>(_tab);
974 const BRect& tabRect = tab->tabRect;
975 const BRect& closeRect = tab->closeRect;
976 const BRect& zoomRect = tab->zoomRect;
981 _GetComponentColors(COMPONENT_TAB, colors, tab);
992 if (tab->look != kLeftTitledWindowLook) {
993 titlePos.x = closeRect.IsValid() ? closeRect.right + tab->textOffset
994 : tabRect.left + tab->textOffset;
1002 titlePos.y = zoomRect.IsValid() ? zoomRect.top - tab->textOffset
1003 : tabRect.bottom - tab->textOffset;
1006 fDrawingEngine->DrawString(tab->truncatedTitle, tab->truncatedTitleLength,
1020 DefaultDecorator::Tab* tab = static_cast<DefaultDecorator::Tab*>(_tab);
1022 int32 index = (tab->buttonFocus ? 0 : 1) + (tab->zoomPressed ? 0 : 2);
1023 ServerBitmap* bitmap = tab->zoomBitmaps[index];
1025 bitmap = _GetBitmapForButton(tab, COMPONENT_ZOOM_BUTTON,
1026 tab->zoomPressed, rect.IntegerWidth(), rect.IntegerHeight());
1027 tab->zoomBitmaps[index] = bitmap;
1035 DefaultDecorator::_SetTitle(Decorator::Tab* tab, const char* string,
1040 BRect rect = TabRect(tab);
1047 rect = rect | TabRect(tab);
1075 DefaultDecorator::_SetLook(Decorator::Tab* tab, DesktopSettings& settings,
1084 tab->look = look;
1097 DefaultDecorator::_SetFlags(Decorator::Tab* tab, uint32 flags,
1106 tab->flags = flags;
1118 DefaultDecorator::Tab* tab = static_cast<DefaultDecorator::Tab*>(_tab);
1119 tab->buttonFocus = IsFocus(tab)
1120 || ((tab->look == B_FLOATING_WINDOW_LOOK
1121 || tab->look == kLeftTitledWindowLook)
1122 && (tab->flags & B_AVOID_FOCUS) != 0);
1124 _LayoutTabItems(tab, tab->tabRect);
1134 Decorator::Tab* tab = fTabList.ItemAt(i);
1136 tab->zoomRect.OffsetBy(offset);
1137 tab->closeRect.OffsetBy(offset);
1138 tab->tabRect.OffsetBy(offset);
1240 // resize tab and layout tab items
1249 DefaultDecorator::Tab* tab = _TabAt(0);
1250 BRect& tabRect = tab->tabRect;
1256 float delta = tabOffset - tab->tabOffset;
1257 tab->tabOffset = (uint32)tabOffset;
1263 if (tabSize < tab->minTabSize)
1264 tabSize = tab->minTabSize;
1265 if (tabSize > tab->maxTabSize)
1266 tabSize = tab->maxTabSize;
1277 _LayoutTabItems(tab, tabRect);
1280 // NOTE: the tab rect becoming smaller only would
1319 DefaultDecorator::Tab* tab = static_cast<DefaultDecorator::Tab*>(_tab);
1320 BRect& tabRect = tab->tabRect;
1335 float delta = floor(location - tab->tabOffset);
1346 tab->tabOffset = (int32)location;
1348 tab->tabLocation = maxLocation > 0.0 ? tab->tabOffset / maxLocation : 0.0;
1371 if (settings.FindFloat("tab location", i, &tabLocation) != B_OK)
1467 DefaultDecorator::DrawButtons(Decorator::Tab* tab, const BRect& invalid)
1470 if (!(tab->flags & B_NOT_CLOSABLE) && invalid.Intersects(tab->closeRect))
1471 _DrawClose(tab, false, tab->closeRect);
1472 if (!(tab->flags & B_NOT_ZOOMABLE) && invalid.Intersects(tab->zoomRect))
1473 _DrawZoom(tab, false, tab->zoomRect);
1490 DefaultDecorator::Tab* tab = static_cast<DefaultDecorator::Tab*>(_tab);
1493 if (tab && tab->buttonFocus) {
1518 if (tab && tab->buttonFocus) {
1533 if (tab && tab->buttonFocus) {
1657 DefaultDecorator::Tab* tab = static_cast<DefaultDecorator::Tab*>(_tab);
1665 tab->textOffset = _DefaultTextOffset();
1667 BRect& closeRect = tab->closeRect;
1668 BRect& zoomRect = tab->zoomRect;
1670 // calulate close rect based on the tab rectangle
1671 if (tab->look != kLeftTitledWindowLook) {
1679 if ((tab->flags & B_NOT_CLOSABLE) != 0)
1681 if ((tab->flags & B_NOT_ZOOMABLE) != 0)
1691 if ((tab->flags & B_NOT_CLOSABLE) != 0)
1693 if ((tab->flags & B_NOT_ZOOMABLE) != 0)
1701 if (tab->look != kLeftTitledWindowLook)
1702 size = (zoomRect.left - closeRect.right) - tab->textOffset * 2 + inset;
1704 size = (zoomRect.top - closeRect.bottom) - tab->textOffset * 2 + inset;
1707 if (stackMode && IsFocus(tab) == false) {
1709 size = (tab->tabRect.right - closeRect.right) - tab->textOffset * 2
1714 if (tab->tabRect.Width() < 100)
1716 float titleWidth = fDrawState.Font().StringWidth(Title(tab),
1717 BString(Title(tab)).Length());
1719 float oldTextOffset = tab->textOffset;
1720 tab->textOffset -= (titleWidth - size) / 2;
1722 if (tab->textOffset < kMinTextOffset)
1723 tab->textOffset = kMinTextOffset;
1725 size -= tab->textOffset * 2;
1728 tab->truncatedTitle = Title(tab);
1729 fDrawState.Font().TruncateString(&tab->truncatedTitle, truncateMode, size);
1730 tab->truncatedTitleLength = tab->truncatedTitle.Length();
1738 DefaultDecorator::Tab* tab = _TabAt(i);
1740 tab->closeBitmaps[index] = NULL;
1741 tab->zoomBitmaps[index] = NULL;
1748 DefaultDecorator::_GetBitmapForButton(Decorator::Tab* tab, Component item,
1767 _GetComponentColors(item, colors, tab);
1854 ComponentColors _colors, Decorator::Tab* tab)
1885 return GetComponentColors(component, RegionHighlight(region), _colors, tab);
1906 DefaultDecorator::Tab* tab = _TabAt(0);
1907 maxLocation = tabSize - tab->maxTabSize;
1911 return floorf(tab->tabLocation * maxLocation);