[haiku-commits] r39478 - haiku/trunk/src/apps/terminal

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 18 Nov 2010 14:58:49 +0100 (CET)

Author: bonefish
Date: 2010-11-18 14:58:49 +0100 (Thu, 18 Nov 2010)
New Revision: 39478
Changeset: http://dev.haiku-os.org/changeset/39478

Modified:
   haiku/trunk/src/apps/terminal/TermWindow.cpp
Log:
* 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.


Modified: haiku/trunk/src/apps/terminal/TermWindow.cpp
===================================================================
--- haiku/trunk/src/apps/terminal/TermWindow.cpp        2010-11-18 12:54:23 UTC 
(rev 39477)
+++ haiku/trunk/src/apps/terminal/TermWindow.cpp        2010-11-18 13:58:49 UTC 
(rev 39478)
@@ -119,9 +119,10 @@
 
 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 @@
        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 @@
        // 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.


Other related posts: