Opened 19 years ago

Last modified 16 years ago

#337 closed bug

TabView labels not centered. — at Version 5

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

Description (last modified by stippi)

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 (5)

comment:1 by tomas.wilhelmsson@…, 19 years ago

Owner: changed from axeld to bpmagic@…

comment:2 by axeld, 19 years ago

Since Stephan is at least reponsible for that look (still don't like it ;-)), I'm assigning this to him. There are some other pending issues with BTabViews, anyway.

comment:3 by axeld, 19 years ago

Owner: changed from bpmagic@… to stippi

comment:4 by diver, 19 years ago

Cc: diver added

comment:5 by stippi, 18 years ago

Description: modified (diff)
Platform: All
Status: newassigned
Note: See TracTickets for help on using tickets.