* Use B_WIDTH_FROM_WIDEST for tabs, so the titles aren't truncated

unnecessarily.
* Invalidate the complete tab view after setting a label. Otherwise we'd get
  artifacts when the label gets shorter.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39478 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-11-18 13:58:49 +00:00
parent a949fa2a67
commit 5afe0aef82

View File

@ -119,9 +119,10 @@ struct TermWindow::Session {
class TermWindow::TabView : public SmartTabView { class TermWindow::TabView : public SmartTabView {
public: public:
TabView(TermWindow* window, BRect frame, const char *name) TabView(TermWindow* window, BRect frame, const char *name,
button_width width)
: :
SmartTabView(frame, name), SmartTabView(frame, name, width),
fWindow(window) fWindow(window)
{ {
} }
@ -233,7 +234,7 @@ TermWindow::_InitWindow()
BRect textFrame = Bounds(); BRect textFrame = Bounds();
textFrame.top = fMenubar->Bounds().bottom + 1.0; textFrame.top = fMenubar->Bounds().bottom + 1.0;
fTabView = new TabView(this, textFrame, "tab view"); fTabView = new TabView(this, textFrame, "tab view", B_WIDTH_FROM_WIDEST);
AddChild(fTabView); AddChild(fTabView);
// Make the scroll view one pixel wider than the tab view container view, so // Make the scroll view one pixel wider than the tab view container view, so
@ -1151,9 +1152,10 @@ TermWindow::_UpdateSessionTitle(int32 index)
// set the tab title // set the tab title
if (sessionTitle != session->title.title) { if (sessionTitle != session->title.title) {
session->title.title = sessionTitle; session->title.title = sessionTitle;
BTab* tab = fTabView->TabAt(index); fTabView->TabAt(index)->SetLabel(session->title.title);
tab->SetLabel(session->title.title); fTabView->Invalidate();
fTabView->Invalidate(fTabView->TabFrame(index)); // Invalidate the complete tab view, since other tabs might change
// their positions.
} }
// If this is the active tab, also recompute the window title. // If this is the active tab, also recompute the window title.