View | Details | Raw Unified | Return to bug 587441 | Differences between
and this patch

Collapse All | Expand All

(-)a/gtk/gtkpaned.c (-5 / +25 lines)
 Lines 685-690   gtk_paned_init (GtkPaned *paned) Link Here 
685
  priv->handle_pos.y = -1;
685
  priv->handle_pos.y = -1;
686
686
687
  priv->drag_pos = -1;
687
  priv->drag_pos = -1;
688
  priv->child1_size = -1;
688
}
689
}
689
690
690
static void
691
static void
 Lines 855-861   gtk_paned_get_preferred_size (GtkWidget *widget, Link Here 
855
{
856
{
856
  GtkPaned *paned = GTK_PANED (widget);
857
  GtkPaned *paned = GTK_PANED (widget);
857
  GtkPanedPrivate *priv = paned->priv;
858
  GtkPanedPrivate *priv = paned->priv;
858
  gint child_min, child_nat;
859
  gint child_min, child_nat, child2_size;
859
860
860
  *minimum = *natural = 0;
861
  *minimum = *natural = 0;
861
862
 Lines 866-873   gtk_paned_get_preferred_size (GtkWidget *widget, Link Here 
866
      else
867
      else
867
        gtk_widget_get_preferred_height (priv->child1, &child_min, &child_nat);
868
        gtk_widget_get_preferred_height (priv->child1, &child_min, &child_nat);
868
869
869
      *minimum = child_min;
870
      if (priv->orientation == orientation)
870
      *natural = child_nat;
871
        {
872
          /* We use the lower of the desired size and the set size, but only if the set size is valid. */
873
          *minimum = (child_min > priv->child1_size && priv->child1_size >= 0) ? priv->child1_size : child_min;
874
          *natural = (child_nat > priv->child1_size && priv->child1_size >= 0) ? priv->child1_size : child_nat;
875
        }
876
      else
877
        {
878
          *minimum = child_min;
879
          *natural = child_nat;
880
        }
871
    }
881
    }
872
882
873
  if (priv->child2 && gtk_widget_get_visible (priv->child2))
883
  if (priv->child2 && gtk_widget_get_visible (priv->child2))
 Lines 879-886   gtk_paned_get_preferred_size (GtkWidget *widget, Link Here 
879
889
880
      if (priv->orientation == orientation)
890
      if (priv->orientation == orientation)
881
        {
891
        {
882
          *minimum += child_min;
892
          /* As above, but calculate the size first */
883
          *natural += child_nat;
893
          if (priv->last_allocation >= 0 && priv->child1_size >= 0)
894
            {
895
              child2_size = priv->last_allocation - priv->child1_size;
896
              *minimum += MIN (child_min, child2_size);
897
              *natural += MIN (child_nat, child2_size);
898
            }
899
          else
900
            {
901
              *minimum += child_min;
902
              *natural += child_nat;
903
            }
884
        }
904
        }
885
      else
905
      else
886
        {
906
        {

Return to bug 587441