Opened 19 years ago

Last modified 16 years ago

#337 closed bug

TabView labels not centered. — at Initial Version

Reported by: tomas.wilhelmsson@… Owned by: axeld
Priority: low Milestone: R1
Component: - General Version:
Keywords: Cc: diver
Blocked By: Blocking:
Platform: All

Description

The tabview labels is not centered, the current impementation looks great with deafult tab size but if you resize the tabs it becomes a totaly new story.

Im using haikus tabview for one of my current projects and did this insted:

void BTab::DrawLabel(BView *owner, BRect frame) {

const char *label = Label(); if (label == NULL)

return;

owner->SetHighColor(0, 0, 0); float width = owner->StringWidth(label); TODO: remove offset

font_height height; owner->GetFontHeight(&height);

float offset = frame.Height() / 2.0;

owner->DrawString(label, BPoint((frame.left + frame.right - width +

offset) / 2.0, frame.bottom - offset - (height.descent - height.ascent) / 2)); }

Atleast it fixes the centering of the text, tried it with everything from 14 to 44 in size and its always centered :>

Change History (0)

Note: See TracTickets for help on using tickets.