Ticket #337 (closed bug: fixed)

Opened 3 years ago

Last modified 4 months ago

TabView labels not centered. (easy)

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

Description (last modified by stippi) (diff)

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

Changed 3 years ago by tomas.wilhelmsson@…

  • owner changed from axeld to bpmagic@…

Changed 3 years ago by axeld

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.

Changed 3 years ago by axeld

  • owner changed from bpmagic@… to stippi

Changed 3 years ago by diver

  • cc diver added

Changed 2 years ago by stippi

  • status changed from new to assigned
  • platform set to All
  • description modified (diff)

Changed 17 months ago by wkornewald

  • summary changed from TabView labels not centered. to TabView labels not centered. (easy)

Changed 4 months ago by aldeck

  • status changed from assigned to closed
  • resolution set to fixed

Fixed a long time ago it seems!

Note: See TracTickets for help on using tickets.