[gtk+] notebook: Remove the homogenous private member variable



commit 1cdb47d9605cbf2d08339739cfceea6c4ce8e92f
Author: Benjamin Otte <otte redhat com>
Date:   Tue Jul 19 12:53:06 2011 +0200

    notebook: Remove the homogenous private member variable
    
    It's unused and therefor always FALSE, so we can remove the parts of the
    code that branch based on it.

 gtk/gtknotebook.c |   32 ++++++--------------------------
 1 files changed, 6 insertions(+), 26 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index fca4a45..16ccc7d 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -165,7 +165,6 @@ struct _GtkNotebookPrivate
   guint          focus_out          : 1; /* Flag used by ::move-focus-out implementation */
   guint          has_scrolled       : 1;
   guint          have_visible_child : 1;
-  guint          homogeneous        : 1;
   guint          in_child           : 3;
   guint          need_timer         : 1;
   guint          show_border        : 1;
@@ -2089,10 +2088,7 @@ gtk_notebook_get_preferred_tabs_size (GtkNotebook    *notebook,
               if (!gtk_widget_get_visible (page->child))
                 continue;
 
-              if (priv->homogeneous)
-                page->requisition.width = tab_max;
-              else
-                page->requisition.width += padding;
+              page->requisition.width += padding;
 
               tab_width += page->requisition.width;
               page->requisition.height = tab_height;
@@ -2104,10 +2100,7 @@ gtk_notebook_get_preferred_tabs_size (GtkNotebook    *notebook,
 
           action_width += action_widget_requisition[ACTION_WIDGET_START].width;
           action_width += action_widget_requisition[ACTION_WIDGET_END].width;
-          if (priv->homogeneous && !priv->scrollable)
-            requisition->width = vis_pages * tab_max + tab_overlap + action_width;
-          else
-            requisition->width = tab_width + tab_overlap + action_width;
+          requisition->width = tab_width + tab_overlap + action_width;
 
           requisition->height = tab_height;
           break;
@@ -2135,10 +2128,7 @@ gtk_notebook_get_preferred_tabs_size (GtkNotebook    *notebook,
 
               page->requisition.width = tab_width;
 
-              if (priv->homogeneous)
-                page->requisition.height = tab_max;
-              else
-                page->requisition.height += padding;
+              page->requisition.height += padding;
 
               tab_height += page->requisition.height;
             }
@@ -2149,15 +2139,9 @@ gtk_notebook_get_preferred_tabs_size (GtkNotebook    *notebook,
           action_height += action_widget_requisition[ACTION_WIDGET_START].height;
           action_height += action_widget_requisition[ACTION_WIDGET_END].height;
 
-          if (priv->homogeneous && !priv->scrollable)
-            requisition->height = vis_pages * tab_max + tab_overlap + action_height;
-          else
-            requisition->height = tab_height + tab_overlap + action_height;
+          requisition->height = tab_height + tab_overlap + action_height;
 
-          if (!priv->homogeneous || priv->scrollable)
-            vis_pages = 1;
-          requisition->height = MAX (requisition->height,
-                                     vis_pages * tab_max + tab_overlap);
+          requisition->height = MAX (requisition->height, tab_max + tab_overlap);
 
           requisition->width = tab_width;
           break;
@@ -5749,10 +5733,6 @@ gtk_notebook_calculate_shown_tabs (GtkNotebook  *notebook,
               (gtk_widget_compute_expand (page->tab_label, tab_expand_orientation)))
             (*n)++;
         }
-
-      /* if notebook is homogeneous, all tabs are expanded */
-      if (priv->homogeneous && *n)
-        *n = c;
     }
 }
 
@@ -5881,7 +5861,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook  *notebook,
         continue;
 
       tab_extra_space = 0;
-      if (*expanded_tabs && (showarrow || page->expand || gtk_widget_compute_expand (page->tab_label, tab_expand_orientation) || priv->homogeneous))
+      if (*expanded_tabs && (showarrow || page->expand || gtk_widget_compute_expand (page->tab_label, tab_expand_orientation)))
         {
           tab_extra_space = *remaining_space / *expanded_tabs;
           *remaining_space -= tab_extra_space;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]