[gtk+] notebook: Remove weird hack where the current page was special-cased



commit 7e0c7f7deb8e93322e2b171203acc5007a7c7ab9
Author: Benjamin Otte <otte redhat com>
Date:   Fri Dec 25 01:27:22 2015 +0100

    notebook: Remove weird hack where the current page was special-cased
    
    I don't even know what it does, but it assumed that the current page was
    always as large or larger than any other page. And that isn't true.

 gtk/gtknotebook.c |   46 ----------------------------------------------
 1 files changed, 0 insertions(+), 46 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 307f06e..d22a491 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -5600,7 +5600,6 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook  *notebook,
   GtkAllocation allocation;
   GtkWidget *widget;
   GtkNotebookPage *page;
-  GtkStyleContext *context;
   gboolean allocate_at_bottom;
   gint tab_extra_space;
   GtkPositionType tab_pos;
@@ -5621,8 +5620,6 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook  *notebook,
   child_allocation.x = allocation.x;
   child_allocation.y = allocation.y;
 
-  context = gtk_widget_get_style_context (widget);
-
   switch (tab_pos)
     {
     case GTK_POS_BOTTOM:
@@ -5794,49 +5791,6 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook  *notebook,
           page->allocation.y = 0;
         }
 
-      if (page != priv->cur_page)
-        {
-          GtkBorder active_padding, normal_padding, padding;
-
-          /* The active tab is by definition at least the same height as the inactive one.
-           * The padding we're building is the offset between the two tab states, 
-           * so in case the style specifies normal_padding > active_padding we
-           * remove the offset and draw them with the same height.
-           * Note that the padding will still be applied to the tab content though,
-           * see gtk_notebook_page_allocate().
-           */
-          gtk_style_context_save_to_node (context, page->cssnode);
-          gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &normal_padding);
-          gtk_style_context_restore (context);
-
-          gtk_style_context_save_to_node (context, priv->cur_page->cssnode);
-          gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &active_padding);
-          gtk_style_context_restore (context);
-
-          padding.top = MAX (0, active_padding.top - normal_padding.top);
-          padding.right = MAX (0, active_padding.right - normal_padding.right);
-          padding.bottom = MAX (0, active_padding.bottom - normal_padding.bottom);
-          padding.left = MAX (0, active_padding.left - normal_padding.left);
-
-          switch (tab_pos)
-            {
-            case GTK_POS_TOP:
-              page->allocation.y += padding.top + padding.bottom;
-              page->allocation.height = MAX (1, page->allocation.height - padding.top - padding.bottom);
-              break;
-            case GTK_POS_BOTTOM:
-              page->allocation.height = MAX (1, page->allocation.height - padding.top - padding.bottom);
-              break;
-            case GTK_POS_LEFT:
-              page->allocation.x += padding.left + padding.right;
-              page->allocation.width = MAX (1, page->allocation.width - padding.left - padding.right);
-              break;
-            case GTK_POS_RIGHT:
-              page->allocation.width = MAX (1, page->allocation.width - padding.left - padding.right);
-              break;
-            }
-        }
-
       /* calculate whether to leave a gap based on reorder operation or not */
       switch (tab_pos)
         {


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