[gtk+] notebook: Draw the same things, no matter the show-border value
- From: Benjamin Otte <otte src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gtk+] notebook: Draw the same things, no matter the show-border value
 
- Date: Mon, 11 Jan 2016 16:29:28 +0000 (UTC)
 
commit 0045e57e96eeffd3ff914a47fa2ac1e5dc1a3966
Author: Benjamin Otte <otte redhat com>
Date:   Sat Dec 19 03:57:43 2015 +0100
    notebook: Draw the same things, no matter the show-border value
    
    show-border modifies the "frame" style class on the notebook node, but
    not what we actually draw.
 gtk/gtknotebook.c |   66 +++++++++++++++++++++++++----------------------------
 1 files changed, 31 insertions(+), 35 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 1123a81..ce05f75 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2307,52 +2307,49 @@ gtk_notebook_measure_contents (GtkCssGadget   *gadget,
         }
     }
 
-  if (priv->show_border || priv->show_tabs)
+  if (priv->show_tabs)
     {
-      if (priv->show_tabs)
-        {
-          GtkRequisition tabs_requisition = { 0, 0 };
+      GtkRequisition tabs_requisition = { 0, 0 };
 
-          gtk_notebook_get_preferred_tabs_size (notebook, &tabs_requisition);
-          if (orientation == GTK_ORIENTATION_HORIZONTAL)
+      gtk_notebook_get_preferred_tabs_size (notebook, &tabs_requisition);
+      if (orientation == GTK_ORIENTATION_HORIZONTAL)
+        {
+          if (priv->tab_pos == GTK_POS_TOP || priv->tab_pos == GTK_POS_BOTTOM)
             {
-              if (priv->tab_pos == GTK_POS_TOP || priv->tab_pos == GTK_POS_BOTTOM)
-                {
-                  *minimum = MAX (*minimum, tabs_requisition.width);
-                  *natural = MAX (*minimum, *natural);
-                }
-              else
-                {
-                  *minimum += tabs_requisition.width;
-                  *natural += tabs_requisition.width;
-                }
+              *minimum = MAX (*minimum, tabs_requisition.width);
+              *natural = MAX (*minimum, *natural);
             }
           else
             {
-              if (priv->tab_pos == GTK_POS_LEFT || priv->tab_pos == GTK_POS_RIGHT)
-                {
-                  *minimum = MAX (*minimum, tabs_requisition.height);
-                  *natural = MAX (*minimum, *natural);
-                }
-              else
-                {
-                  *minimum += tabs_requisition.height;
-                  *natural += tabs_requisition.height;
-                }
+              *minimum += tabs_requisition.width;
+              *natural += tabs_requisition.width;
             }
         }
       else
         {
-          for (children = priv->children; children;
-               children = children->next)
+          if (priv->tab_pos == GTK_POS_LEFT || priv->tab_pos == GTK_POS_RIGHT)
             {
-              page = children->data;
-
-              if (page->tab_label && gtk_widget_get_visible (page->tab_label))
-                gtk_widget_hide (page->tab_label);
+              *minimum = MAX (*minimum, tabs_requisition.height);
+              *natural = MAX (*minimum, *natural);
+            }
+          else
+            {
+              *minimum += tabs_requisition.height;
+              *natural += tabs_requisition.height;
             }
         }
     }
+  else
+    {
+      for (children = priv->children; children;
+           children = children->next)
+        {
+          page = children->data;
+
+          if (page->tab_label && gtk_widget_get_visible (page->tab_label))
+            gtk_widget_hide (page->tab_label);
+        }
+    }
 
   border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
 
@@ -2478,7 +2475,7 @@ gtk_notebook_allocate_contents (GtkCssGadget        *gadget,
       child_allocation.width = MAX (1, allocation->width - border_width * 2);
       child_allocation.height = MAX (1, allocation->height - border_width * 2);
 
-      if (priv->show_tabs || priv->show_border)
+      if (priv->show_tabs)
         {
           if (priv->show_tabs && priv->children && priv->cur_page)
             {
@@ -5386,8 +5383,7 @@ gtk_notebook_paint (GtkWidget    *widget,
   context = gtk_widget_get_style_context (widget);
   showarrow = FALSE;
 
-  if ((!priv->show_tabs && !priv->show_border) ||
-      !priv->cur_page || !gtk_widget_get_visible (priv->cur_page->child))
+  if (!priv->cur_page || !gtk_widget_get_visible (priv->cur_page->child))
     return;
 
   x += border_width;
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]