]> Pileus Git - ~andy/gtk/commitdiff
Typo fix.
authorMatthias Clasen <mclasen@dhcp64-228.boston.redhat.com>
Mon, 12 Apr 2004 19:40:22 +0000 (19:40 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 12 Apr 2004 19:40:22 +0000 (19:40 +0000)
2004-04-12  Matthias Clasen  <mclasen@dhcp64-228.boston.redhat.com>

* gtk/gtktreeview.c (gtk_tree_view_get_cell_area): Typo fix.

* gtk/gtkentrycompletion.c (gtk_entry_completion_init): Don't add
a shadow inside the scrolled window, add it around the vbox.

* gtk/gtkentryprivate.h:
* gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup):
Return a boolean indicating whether the popup is positioned above
or below. Scroll the completions to the beginning or the end,
depending on the positioning.

* gtk/gtkentry.c (gtk_entry_completion_key_press): Make keynav
wrap around in the entry completion popup, and allow GDK_UP to
enter the popup.  (#137440)

2004-04-12  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkentry.c (gtk_entry_size_request): Make sure the style is
there before using it.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkentry.c
gtk/gtkentrycompletion.c
gtk/gtkentryprivate.h
gtk/gtktreeview.c

index 297c999fc2f0293ef324433afb3ea87becc0eaa7..cdfa77e7e99a4c9be30b6fc4d2066a32cf3bbed2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2004-04-12  Matthias Clasen  <mclasen@dhcp64-228.boston.redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_cell_area): Typo fix.
+
+       * gtk/gtkentrycompletion.c (gtk_entry_completion_init): Don't add
+       a shadow inside the scrolled window, add it around the vbox.
+
+       * gtk/gtkentryprivate.h: 
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
+       Return a boolean indicating whether the popup is positioned above 
+       or below. Scroll the completions to the beginning or the end, 
+       depending on the positioning.
+
+       * gtk/gtkentry.c (gtk_entry_completion_key_press): Make keynav
+       wrap around in the entry completion popup, and allow GDK_UP to 
+       enter the popup.  (#137440)
+
+2004-04-12  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkentry.c (gtk_entry_size_request): Make sure the style is 
+       there before using it.
+
 Sun Apr 11 15:08:45 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtktreeprivate.h: Moved search entries into priv data.
index 297c999fc2f0293ef324433afb3ea87becc0eaa7..cdfa77e7e99a4c9be30b6fc4d2066a32cf3bbed2 100644 (file)
@@ -1,3 +1,25 @@
+2004-04-12  Matthias Clasen  <mclasen@dhcp64-228.boston.redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_cell_area): Typo fix.
+
+       * gtk/gtkentrycompletion.c (gtk_entry_completion_init): Don't add
+       a shadow inside the scrolled window, add it around the vbox.
+
+       * gtk/gtkentryprivate.h: 
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
+       Return a boolean indicating whether the popup is positioned above 
+       or below. Scroll the completions to the beginning or the end, 
+       depending on the positioning.
+
+       * gtk/gtkentry.c (gtk_entry_completion_key_press): Make keynav
+       wrap around in the entry completion popup, and allow GDK_UP to 
+       enter the popup.  (#137440)
+
+2004-04-12  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkentry.c (gtk_entry_size_request): Make sure the style is 
+       there before using it.
+
 Sun Apr 11 15:08:45 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtktreeprivate.h: Moved search entries into priv data.
index 297c999fc2f0293ef324433afb3ea87becc0eaa7..cdfa77e7e99a4c9be30b6fc4d2066a32cf3bbed2 100644 (file)
@@ -1,3 +1,25 @@
+2004-04-12  Matthias Clasen  <mclasen@dhcp64-228.boston.redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_cell_area): Typo fix.
+
+       * gtk/gtkentrycompletion.c (gtk_entry_completion_init): Don't add
+       a shadow inside the scrolled window, add it around the vbox.
+
+       * gtk/gtkentryprivate.h: 
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
+       Return a boolean indicating whether the popup is positioned above 
+       or below. Scroll the completions to the beginning or the end, 
+       depending on the positioning.
+
+       * gtk/gtkentry.c (gtk_entry_completion_key_press): Make keynav
+       wrap around in the entry completion popup, and allow GDK_UP to 
+       enter the popup.  (#137440)
+
+2004-04-12  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkentry.c (gtk_entry_size_request): Make sure the style is 
+       there before using it.
+
 Sun Apr 11 15:08:45 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtktreeprivate.h: Moved search entries into priv data.
index 297c999fc2f0293ef324433afb3ea87becc0eaa7..cdfa77e7e99a4c9be30b6fc4d2066a32cf3bbed2 100644 (file)
@@ -1,3 +1,25 @@
+2004-04-12  Matthias Clasen  <mclasen@dhcp64-228.boston.redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_cell_area): Typo fix.
+
+       * gtk/gtkentrycompletion.c (gtk_entry_completion_init): Don't add
+       a shadow inside the scrolled window, add it around the vbox.
+
+       * gtk/gtkentryprivate.h: 
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
+       Return a boolean indicating whether the popup is positioned above 
+       or below. Scroll the completions to the beginning or the end, 
+       depending on the positioning.
+
+       * gtk/gtkentry.c (gtk_entry_completion_key_press): Make keynav
+       wrap around in the entry completion popup, and allow GDK_UP to 
+       enter the popup.  (#137440)
+
+2004-04-12  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkentry.c (gtk_entry_size_request): Make sure the style is 
+       there before using it.
+
 Sun Apr 11 15:08:45 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtktreeprivate.h: Moved search entries into priv data.
index 297c999fc2f0293ef324433afb3ea87becc0eaa7..cdfa77e7e99a4c9be30b6fc4d2066a32cf3bbed2 100644 (file)
@@ -1,3 +1,25 @@
+2004-04-12  Matthias Clasen  <mclasen@dhcp64-228.boston.redhat.com>
+
+       * gtk/gtktreeview.c (gtk_tree_view_get_cell_area): Typo fix.
+
+       * gtk/gtkentrycompletion.c (gtk_entry_completion_init): Don't add
+       a shadow inside the scrolled window, add it around the vbox.
+
+       * gtk/gtkentryprivate.h: 
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_resize_popup): 
+       Return a boolean indicating whether the popup is positioned above 
+       or below. Scroll the completions to the beginning or the end, 
+       depending on the positioning.
+
+       * gtk/gtkentry.c (gtk_entry_completion_key_press): Make keynav
+       wrap around in the entry completion popup, and allow GDK_UP to 
+       enter the popup.  (#137440)
+
+2004-04-12  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkentry.c (gtk_entry_size_request): Make sure the style is 
+       there before using it.
+
 Sun Apr 11 15:08:45 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtktreeprivate.h: Moved search entries into priv data.
index 3f0c4f441ef1db2ea05bcd415b21a93ac2b95338..05d37711a856f3a5f1f57bf33dff69c41918d117 100644 (file)
@@ -1127,6 +1127,7 @@ gtk_entry_size_request (GtkWidget      *widget,
   gint xborder, yborder;
   PangoContext *context;
   
+  gtk_widget_ensure_style (widget);
   context = gtk_widget_get_pango_context (widget);
   metrics = pango_context_get_metrics (context,
                                       widget->style->font_desc,
@@ -1134,7 +1135,7 @@ gtk_entry_size_request (GtkWidget      *widget,
 
   entry->ascent = pango_font_metrics_get_ascent (metrics);
   entry->descent = pango_font_metrics_get_descent (metrics);
-
+  
   get_borders (entry, &xborder, &yborder);
   
   xborder += INNER_BORDER;
@@ -4703,19 +4704,23 @@ gtk_entry_completion_key_press (GtkWidget   *widget,
       
       if (event->keyval == GDK_Up || event->keyval == GDK_KP_Up)
         {
-          completion->priv->current_selected--;
-          if (completion->priv->current_selected < -1)
-            completion->priv->current_selected = -1;
+         if (completion->priv->current_selected < 0)
+           completion->priv->current_selected = matches + actions - 1;
+         else
+           completion->priv->current_selected--;
         }
       else if (event->keyval == GDK_Down || event->keyval == GDK_KP_Down)
         {
-          completion->priv->current_selected++;
-          if (completion->priv->current_selected > matches + actions - 1)
-            completion->priv->current_selected = matches + actions - 1;
+          if (completion->priv->current_selected < matches + actions - 1)
+           completion->priv->current_selected++;
+         else
+            completion->priv->current_selected = -1;
         }
       else if (event->keyval == GDK_Page_Up)
        {
-         if (completion->priv->current_selected <= 0)
+         if (completion->priv->current_selected < 0)
+           completion->priv->current_selected = matches + actions - 1;
+         else if (completion->priv->current_selected == 0)
            completion->priv->current_selected = -1;
          else if (completion->priv->current_selected < matches) 
            {
@@ -4740,7 +4745,11 @@ gtk_entry_completion_key_press (GtkWidget   *widget,
              if (completion->priv->current_selected > matches - 1)
                completion->priv->current_selected = matches - 1;
            }
-         else 
+         else if (completion->priv->current_selected == matches + actions - 1)
+           {
+             completion->priv->current_selected = -1;
+           }
+         else
            {
              completion->priv->current_selected += 14;
              if (completion->priv->current_selected > matches + actions - 1)
index 3ce0ac07adba4942ce56f713ca65b069446f93bb..34fcb7a696d8fbf1d71d810dcaf162da06cc01b4 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "gtkintl.h"
 #include "gtkcellrenderertext.h"
+#include "gtkframe.h"
 #include "gtktreeselection.h"
 #include "gtktreeview.h"
 #include "gtkscrolledwindow.h"
@@ -254,6 +255,7 @@ gtk_entry_completion_init (GtkEntryCompletion *completion)
   GtkCellRenderer *cell;
   GtkTreeSelection *sel;
   GtkEntryCompletionPrivate *priv;
+  GtkWidget *popup_frame;
 
   /* yes, also priv, need to keep the code readable */
   priv = completion->priv = GTK_ENTRY_COMPLETION_GET_PRIVATE (completion);
@@ -286,7 +288,7 @@ gtk_entry_completion_init (GtkEntryCompletion *completion)
                                   GTK_POLICY_NEVER,
                                   GTK_POLICY_AUTOMATIC);
   gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (priv->scrolled_window),
-                                       GTK_SHADOW_ETCHED_IN);
+                                       GTK_SHADOW_NONE);
 
   /* a nasty hack to get the completions treeview to size nicely */
   gtk_widget_set_size_request (GTK_SCROLLED_WINDOW (priv->scrolled_window)->vscrollbar, -1, 0);
@@ -323,8 +325,14 @@ gtk_entry_completion_init (GtkEntryCompletion *completion)
                     G_CALLBACK (gtk_entry_completion_popup_button_press),
                     completion);
 
+  popup_frame = gtk_frame_new (NULL);
+  gtk_frame_set_shadow_type (GTK_FRAME (popup_frame),
+                            GTK_SHADOW_ETCHED_IN);
+  gtk_widget_show (popup_frame);
+  gtk_container_add (GTK_CONTAINER (priv->popup_window), popup_frame);
+  
   priv->vbox = gtk_vbox_new (FALSE, 0);
-  gtk_container_add (GTK_CONTAINER (priv->popup_window), priv->vbox);
+  gtk_container_add (GTK_CONTAINER (popup_frame), priv->vbox);
 
   gtk_container_add (GTK_CONTAINER (priv->scrolled_window), priv->tree_view);
   gtk_box_pack_start (GTK_BOX (priv->vbox), priv->scrolled_window,
@@ -1086,7 +1094,7 @@ get_borders (GtkEntry *entry,
 }
 
 /* some nasty size requisition */
-gint
+gboolean
 _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
 {
   gint x, y;
@@ -1095,6 +1103,8 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
   gint monitor_num;
   GdkRectangle monitor;
   GtkRequisition popup_req;
+  GtkTreePath *path;
+  gboolean above;
 
   gdk_window_get_origin (completion->priv->entry->window, &x, &y);
   get_borders (GTK_ENTRY (completion->priv->entry), &x_border, &y_border);
@@ -1151,13 +1161,24 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion)
     x = monitor.x + monitor.width - popup_req.width;
   
   if (y + height + popup_req.height <= monitor.y + monitor.height)
-    y += height;
+    {
+      y += height;
+      above = FALSE;
+      path = gtk_tree_path_new_from_indices (0, -1);
+    }
   else
-    y -= popup_req.height;
+    {
+      y -= popup_req.height;
+      above = TRUE;
+      path = gtk_tree_path_new_from_indices (gtk_tree_model_iter_n_children (GTK_TREE_MODEL (completion->priv->filter_model), NULL) - 1, -1);
+    }
+  
+  gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (completion->priv->tree_view), path, NULL, FALSE, 0.0, 0.0);
+  gtk_tree_path_free (path);
 
   gtk_window_move (GTK_WINDOW (completion->priv->popup_window), x, y);
 
-  return height;
+  return above;
 }
 
 void
@@ -1169,6 +1190,8 @@ _gtk_entry_completion_popup (GtkEntryCompletion *completion)
   if (GTK_WIDGET_MAPPED (completion->priv->popup_window))
     return;
 
+  completion->priv->may_wrap = TRUE;
+
   column = gtk_tree_view_get_column (GTK_TREE_VIEW (completion->priv->action_view), 0);
   renderers = gtk_tree_view_column_get_cell_renderers (column);
   gtk_widget_ensure_style (completion->priv->tree_view);
index a4dd011551911c341b797d2f85cd7468821c4c2e..7816c8784e2311a2dce0bfd9b7250fdfba61f2a9 100644 (file)
@@ -56,9 +56,12 @@ struct _GtkEntryCompletionPrivate
   gulong completion_timeout;
   gulong changed_id;
   gulong key_press_id;
+  gulong key_release_id;
+
+  gboolean may_wrap;
 };
 
-gint                _gtk_entry_completion_resize_popup           (GtkEntryCompletion          *completion);
+gboolean            _gtk_entry_completion_resize_popup           (GtkEntryCompletion          *completion);
 void                _gtk_entry_completion_popup                  (GtkEntryCompletion          *completion);
 void                _gtk_entry_completion_popdown                (GtkEntryCompletion          *completion);
 
index a435faea74a4785dadf2ca3f5592d151ec978feb..65bc59e7e6980b454895aa68640a1ca78d1e8d71 100644 (file)
@@ -10725,7 +10725,7 @@ gtk_tree_view_get_path_at_pos (GtkTreeView        *tree_view,
  * gtk_tree_view_get_cell_area:
  * @tree_view: a #GtkTreeView
  * @path: a #GtkTreePath for the row, or %NULL to get only horizontal coordinates
- * @column: a #GtkTreeViewColumn for the column, or %NULL to get only vertical coordiantes
+ * @column: a #GtkTreeViewColumn for the column, or %NULL to get only vertical coordinates
  * @rect: rectangle to fill with cell rect
  *
  * Fills the bounding rectangle in tree window coordinates for the cell at the