]> Pileus Git - ~andy/gtk/commitdiff
Pass a last item to gtk_combo_box_relayout_item. (#161050, John Finlay)
authorMatthias Clasen <mclasen@redhat.com>
Mon, 13 Dec 2004 04:22:07 +0000 (04:22 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 13 Dec 2004 04:22:07 +0000 (04:22 +0000)
2004-12-12  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkcombobox.c (gtk_combo_box_menu_row_changed): Pass a
last item to gtk_combo_box_relayout_item.  (#161050, John Finlay)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcombobox.c

index 3c132289a42f0856264ba04b280fe78998f21c65..0a1c754e976ea0936a47b84dfd5107e05e171b0e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-12-12  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkcombobox.c (gtk_combo_box_menu_row_changed): Pass a 
+       last item to gtk_combo_box_relayout_item.  (#161050, John Finlay)
+
        * tests/testfilechooserbutton.c (tests_button_clicked_cb): Rename
        a local variable to avoid a conflict.  (#161109, Robert Ögren)
 
index 3c132289a42f0856264ba04b280fe78998f21c65..0a1c754e976ea0936a47b84dfd5107e05e171b0e 100644 (file)
@@ -1,5 +1,8 @@
 2004-12-12  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkcombobox.c (gtk_combo_box_menu_row_changed): Pass a 
+       last item to gtk_combo_box_relayout_item.  (#161050, John Finlay)
+
        * tests/testfilechooserbutton.c (tests_button_clicked_cb): Rename
        a local variable to avoid a conflict.  (#161109, Robert Ögren)
 
index 3c132289a42f0856264ba04b280fe78998f21c65..0a1c754e976ea0936a47b84dfd5107e05e171b0e 100644 (file)
@@ -1,5 +1,8 @@
 2004-12-12  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkcombobox.c (gtk_combo_box_menu_row_changed): Pass a 
+       last item to gtk_combo_box_relayout_item.  (#161050, John Finlay)
+
        * tests/testfilechooserbutton.c (tests_button_clicked_cb): Rename
        a local variable to avoid a conflict.  (#161109, Robert Ögren)
 
index 3c132289a42f0856264ba04b280fe78998f21c65..0a1c754e976ea0936a47b84dfd5107e05e171b0e 100644 (file)
@@ -1,5 +1,8 @@
 2004-12-12  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkcombobox.c (gtk_combo_box_menu_row_changed): Pass a 
+       last item to gtk_combo_box_relayout_item.  (#161050, John Finlay)
+
        * tests/testfilechooserbutton.c (tests_button_clicked_cb): Rename
        a local variable to avoid a conflict.  (#161109, Robert Ögren)
 
index 0d349037cf0a802a7e0af6dad83ae6c70efbe4ea..f0acdd1b5c69172df53c2c3cb9c0c01b17497d0b 100644 (file)
@@ -3056,7 +3056,29 @@ gtk_combo_box_menu_row_changed (GtkTreeModel *model,
 
   if (combo_box->priv->wrap_width
       && item->parent == combo_box->priv->popup_widget)
-    gtk_combo_box_relayout_item (combo_box, item, iter, NULL);
+    {
+      GtkWidget *pitem = NULL;
+      GtkTreePath *prev;
+
+      prev = gtk_tree_path_copy (path);
+
+      if (gtk_tree_path_prev (prev))
+        pitem = find_menu_by_path (combo_box->priv->popup_widget, prev, FALSE);
+
+      gtk_tree_path_free (prev);
+
+      /* unattach item so gtk_combo_box_relayout_item() won't spuriously
+         move it */
+      gtk_container_child_set (GTK_CONTAINER (combo_box->priv->popup_widget),
+                               item, 
+                              "left_attach", -1, 
+                              "right_attach", -1,
+                               "top_attach", -1, 
+                              "bottom_attach", -1, 
+                              NULL);
+
+      gtk_combo_box_relayout_item (combo_box, item, iter, pitem);
+    }
 
   width = gtk_combo_box_calc_requested_width (combo_box, path);