]> Pileus Git - ~andy/gtk/commitdiff
Allow passing NULL to unset the model. (#137211, patch by Mariano
authorMatthias Clasen <maclas@gmx.de>
Sat, 26 Jun 2004 03:39:35 +0000 (03:39 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 26 Jun 2004 03:39:35 +0000 (03:39 +0000)
Fri Jun 25 23:35:42 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
* gtk/gtkcombobox.c (gtk_combo_box_set_model): Allow passing
NULL to unset the model.  (#137211, patch by  Mariano Suárez-Alvarez)

Fri Jun 25 23:33:05 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkcombobox.c (gtk_combo_box_menu_position_below): Fix the
placement policy for GtkComboBoxEntry to be: if it fits below,
place below, if it fits above place above, else place in the
larger space and scroll so that the scroll arrow appear at the
far end.  (#144362, David A. Knight)

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

index 434a5de42fe074c5ca3832678ddc5f67f1ba4ba3..fd57a6c1cd88e554bad4aca8067dd2d46de77c2d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+Fri Jun 25 23:35:42 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
+       * gtk/gtkcombobox.c (gtk_combo_box_set_model): Allow passing
+       NULL to unset the model.  (#137211, patch by  Mariano Suárez-Alvarez)
+
+Fri Jun 25 23:33:05 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_menu_position_below): Fix the
+       placement policy for GtkComboBoxEntry to be: if it fits below, 
+       place below, if it fits above place above, else place in the 
+       larger space and scroll so that the scroll arrow appear at the
+       far end.  (#144362, David A. Knight)
+
 Fri Jun 25 22:49:58 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtktreestore.c (gtk_tree_store_move): Avoid uninitialized
index 434a5de42fe074c5ca3832678ddc5f67f1ba4ba3..fd57a6c1cd88e554bad4aca8067dd2d46de77c2d 100644 (file)
@@ -1,3 +1,17 @@
+Fri Jun 25 23:35:42 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
+       * gtk/gtkcombobox.c (gtk_combo_box_set_model): Allow passing
+       NULL to unset the model.  (#137211, patch by  Mariano Suárez-Alvarez)
+
+Fri Jun 25 23:33:05 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_menu_position_below): Fix the
+       placement policy for GtkComboBoxEntry to be: if it fits below, 
+       place below, if it fits above place above, else place in the 
+       larger space and scroll so that the scroll arrow appear at the
+       far end.  (#144362, David A. Knight)
+
 Fri Jun 25 22:49:58 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtktreestore.c (gtk_tree_store_move): Avoid uninitialized
index 434a5de42fe074c5ca3832678ddc5f67f1ba4ba3..fd57a6c1cd88e554bad4aca8067dd2d46de77c2d 100644 (file)
@@ -1,3 +1,17 @@
+Fri Jun 25 23:35:42 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
+       * gtk/gtkcombobox.c (gtk_combo_box_set_model): Allow passing
+       NULL to unset the model.  (#137211, patch by  Mariano Suárez-Alvarez)
+
+Fri Jun 25 23:33:05 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_menu_position_below): Fix the
+       placement policy for GtkComboBoxEntry to be: if it fits below, 
+       place below, if it fits above place above, else place in the 
+       larger space and scroll so that the scroll arrow appear at the
+       far end.  (#144362, David A. Knight)
+
 Fri Jun 25 22:49:58 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtktreestore.c (gtk_tree_store_move): Avoid uninitialized
index 434a5de42fe074c5ca3832678ddc5f67f1ba4ba3..fd57a6c1cd88e554bad4aca8067dd2d46de77c2d 100644 (file)
@@ -1,3 +1,17 @@
+Fri Jun 25 23:35:42 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkentrycompletion.c (gtk_entry_completion_set_model):
+       * gtk/gtkcombobox.c (gtk_combo_box_set_model): Allow passing
+       NULL to unset the model.  (#137211, patch by  Mariano Suárez-Alvarez)
+
+Fri Jun 25 23:33:05 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_menu_position_below): Fix the
+       placement policy for GtkComboBoxEntry to be: if it fits below, 
+       place below, if it fits above place above, else place in the 
+       larger space and scroll so that the scroll arrow appear at the
+       far end.  (#144362, David A. Knight)
+
 Fri Jun 25 22:49:58 2004  Matthias Clasen  <maclas@gmx.de>
 
        * gtk/gtktreestore.c (gtk_tree_store_move): Avoid uninitialized
index 4f0d1d257f2b1ef8fd7b8178f7b2586047a56119..7dc08dcf863620016da84f0060b3b57d9306352d 100644 (file)
@@ -985,12 +985,16 @@ gtk_combo_box_menu_position_below (GtkMenu  *menu,
   else if (*x + req.width > monitor.x + monitor.width)
     *x = monitor.x + monitor.width - req.width;
   
-  if (*y + child->allocation.height + req.height <= monitor.y + monitor.height)
+  if (monitor.y + monitor.height - *y - child->allocation.height >= req.height)
+    *y += child->allocation.height;
+  else if (*y - monitor.y >= req.height)
+    *y -= req.height;
+  else if (monitor.y + monitor.height - *y - child->allocation.height > *y - monitor.y) 
     *y += child->allocation.height;
   else
     *y -= req.height;
 
-   *push_in = TRUE;
+   *push_in = FALSE;
 }
 
 static void
@@ -3523,6 +3527,13 @@ gtk_combo_box_set_model (GtkComboBox  *combo_box,
                          GtkTreeModel *model)
 {
   g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
+
+  if (!model)
+    {
+      gtk_combo_box_unset_model (combo_box);
+      return;
+    }
+
   g_return_if_fail (GTK_IS_TREE_MODEL (model));
 
   if (model == combo_box->priv->model)
index 3d6f15a88957d8f9c81444a91a2197e72ad5cf4d..35a1470489123a5df03268cf67e139071a81a13a 100644 (file)
@@ -827,7 +827,7 @@ gtk_entry_completion_set_model (GtkEntryCompletion *completion,
                                 GtkTreeModel       *model)
 {
   g_return_if_fail (GTK_IS_ENTRY_COMPLETION (completion));
-  g_return_if_fail (GTK_IS_TREE_MODEL (model));
+  g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model));
 
   /* code will unref the old filter model (if any) */
   completion->priv->filter_model =