Browse Source

Take padding into account for TabContainer

Josh Engebretson 10 years ago
parent
commit
ed76fe2cbd
1 changed files with 7 additions and 3 deletions
  1. 7 3
      Source/ThirdParty/TurboBadger/tb_tab_container.cpp

+ 7 - 3
Source/ThirdParty/TurboBadger/tb_tab_container.cpp

@@ -100,12 +100,16 @@ void TBTabContainer::SetValue(int index)
             if (page->GetVisibility() == WIDGET_VISIBILITY_GONE)
             if (page->GetVisibility() == WIDGET_VISIBILITY_GONE)
                 continue;
                 continue;
 
 
-            TBRect contentRect = m_content_root.GetRect();
+            TBRect contentRect = m_content_root.GetRect();            
+            TBSkinElement* skin = m_content_root.GetSkinBgElement();
+            contentRect = contentRect.Shrink(skin->padding_left, skin->padding_top, skin->padding_right, skin->padding_bottom);
+
             TBRect pageRect = page->GetRect();
             TBRect pageRect = page->GetRect();
 
 
-            if (contentRect.w != pageRect.w || contentRect.h != pageRect.w)
+            if (contentRect.w != pageRect.w || contentRect.h != pageRect.h)
             {
             {
-                contentRect.x = contentRect.y = 0;
+                contentRect.x = skin->padding_left;
+                contentRect.y = skin->padding_right;
                 page->SetRect(contentRect);
                 page->SetRect(contentRect);
             }
             }
         }
         }