[haiku-commits] Re: haiku: hrev49398 - src/kits/interface headers/os/interface

  • From: Adrien Destugues <pulkomandy@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 14 Jul 2015 08:41:31 +0200

On Tue, Jul 14, 2015 at 03:35:23AM +0200, waddlesplash@xxxxxxxxx wrote:

diff --git a/src/kits/interface/TabView.cpp b/src/kits/interface/TabView.cpp
index cb2db7c..50a6b97 100644
--- a/src/kits/interface/TabView.cpp
+++ b/src/kits/interface/TabView.cpp
@@ -52,7 +52,8 @@ BTab::BTab(BView* tabView)
fEnabled(true),
fSelected(false),
fFocus(false),
- fView(tabView)
+ fView(tabView),
+ fTabView(NULL)
{
}

This makes the name "tabView" for the parameter misleading. Maybe it
should be called "contentsView" ?

@@ -133,6 +135,9 @@ BTab::SetLabel(const char* label)
return;

fView->SetName(label);
+
+ if (fTabView != NULL)
+ fTabView->Invalidate();
}

It would be better to invalidate only the tabs. You can compute the
rectangle from fTabView->TabHeight() and use the tabview width.

This would avoid redraws of the children view completely, a good idea if
it is a complex/slow view (a web page in a web browser, for example)

+ if (fTabView != NULL && fSelected) {
+ Select(NULL);
+ fTabView->Invalidate();
+ }

Same here.

--
Adrien.

Other related posts: