From 5afe0aef82146ed5b40b35755cbdacb7ee912eaf Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 18 Nov 2010 13:58:49 +0000 Subject: [PATCH] * 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 --- src/apps/terminal/TermWindow.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp index cb80b0bd4f..4cb49e4413 100644 --- a/src/apps/terminal/TermWindow.cpp +++ b/src/apps/terminal/TermWindow.cpp @@ -119,9 +119,10 @@ struct TermWindow::Session { class TermWindow::TabView : public SmartTabView { 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) { } @@ -233,7 +234,7 @@ TermWindow::_InitWindow() BRect textFrame = Bounds(); 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); // 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 if (sessionTitle != session->title.title) { session->title.title = sessionTitle; - BTab* tab = fTabView->TabAt(index); - tab->SetLabel(session->title.title); - fTabView->Invalidate(fTabView->TabFrame(index)); + fTabView->TabAt(index)->SetLabel(session->title.title); + fTabView->Invalidate(); + // Invalidate the complete tab view, since other tabs might change + // their positions. } // If this is the active tab, also recompute the window title.