BTabView: remove obsolete code

Seems to come mostly from before the move to ControlLook, and it's not
been working for some time as the drawing rect passed now to
DrawInactiveTab is invalid in one direction. tabsBounds should be
initialized to tabFrame (as set before DrawTabFrame changes it), but
then BeControlLook would draw something we don't want.

If HaikuControlLook (or any other) wants something special for the last
tab, it should handle that itself using the tab indexes.

Change-Id: Iabecb27d1d30d91423c51e7bc03cf7906e530afe
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6397
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Máximo Castañeda
2023-04-29 16:15:13 +00:00
committed by waddlesplash
parent 0ba60bc743
commit b00da680fb
-24
View File
@@ -937,12 +937,9 @@ BTabView::DrawTabs()
borders, fBorderStyle, fTabSide);
// draw the tabs on top of the tab frame
BRect activeTabFrame;
int32 tabCount = CountTabs();
for (int32 i = 0; i < tabCount; i++) {
BRect tabFrame = TabFrame(i);
if (i == fSelection)
activeTabFrame = tabFrame;
TabAt(i)->DrawTab(this, tabFrame,
i == fSelection ? B_TAB_FRONT
@@ -950,27 +947,6 @@ BTabView::DrawTabs()
i != fSelection - 1);
}
BRect tabsBounds;
float last = 0.0f;
float lastTab = 0.0f;
if (fTabSide == kTopSide || fTabSide == kBottomSide) {
lastTab = TabFrame(tabCount - 1).right;
last = tabFrame.right;
tabsBounds.left = tabsBounds.right = lastTab;
borders = BControlLook::B_TOP_BORDER | BControlLook::B_BOTTOM_BORDER;
} else if (fTabSide == kLeftSide || fTabSide == kRightSide) {
lastTab = TabFrame(tabCount - 1).bottom;
last = tabFrame.bottom;
tabsBounds.top = tabsBounds.bottom = lastTab;
borders = BControlLook::B_LEFT_BORDER | BControlLook::B_RIGHT_BORDER;
}
if (lastTab < last) {
// draw a 1px right border on the last tab
be_control_look->DrawInactiveTab(this, tabsBounds, tabsBounds, base, 0,
borders, fTabSide);
}
return fSelection < CountTabs() ? TabFrame(fSelection) : BRect();
}