Opened 19 years ago
Last modified 16 years ago
#337 closed bug
TabView labels not centered. — at Version 5
Reported by: | Owned by: | stippi | |
---|---|---|---|
Priority: | low | Milestone: | R1 |
Component: | - General | Version: | |
Keywords: | Cc: | diver | |
Blocked By: | Blocking: | ||
Platform: | All |
Description (last modified by )
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 , 19 years ago
Owner: | changed from | to
---|
comment:2 by , 19 years ago
comment:3 by , 19 years ago
Owner: | changed from | to
---|
comment:4 by , 19 years ago
Cc: | added |
---|
comment:5 by , 18 years ago
Description: | modified (diff) |
---|---|
Platform: | → All |
Status: | new → assigned |
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.