]> Pileus Git - ~andy/gtk/commitdiff
This commit includes a fix for #169463, Stefan Kost.
authorKristian Rietveld <kris@gtk.org>
Sun, 19 Jun 2005 12:44:12 +0000 (12:44 +0000)
committerKristian Rietveld <kristian@src.gnome.org>
Sun, 19 Jun 2005 12:44:12 +0000 (12:44 +0000)
2005-06-19  Kristian Rietveld  <kris@gtk.org>

This commit includes a fix for #169463, Stefan Kost.

* gtk/gtkcellrendererprogress.c (gtk_cell_renderer_progress_get_size):
when cell_area is set, return cell_area width/height as width/height,
so the focus rectangle will be drawn correctly.

* gtk/gtktreeview.c (gtk_tree_view_bin_expose): drop unneeded get
of focus-line-width property,
(validate_row): take focus_line_width into account.

* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
also take focus_line_width into account when calculating the cell_area
y and height (before, we only took it into account when calculating
x and width).

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkcellrendererprogress.c
gtk/gtktreeview.c
gtk/gtktreeviewcolumn.c

index 5fc9b31ada70ac4ea3db444496dba002fa6daf35..7f788d08fc7412726ae30b557d236a4a93d7af5c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2005-06-19  Kristian Rietveld  <kris@gtk.org>
+
+       This commit includes a fix for #169463, Stefan Kost.
+
+       * gtk/gtkcellrendererprogress.c (gtk_cell_renderer_progress_get_size):
+       when cell_area is set, return cell_area width/height as width/height,
+       so the focus rectangle will be drawn correctly.
+
+       * gtk/gtktreeview.c (gtk_tree_view_bin_expose): drop unneeded get
+       of focus-line-width property,
+       (validate_row): take focus_line_width into account.
+
+       * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
+       also take focus_line_width into account when calculating the cell_area
+       y and height (before, we only took it into account when calculating
+       x and width).
+
 2005-06-19  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtk.symbols:
index 5fc9b31ada70ac4ea3db444496dba002fa6daf35..7f788d08fc7412726ae30b557d236a4a93d7af5c 100644 (file)
@@ -1,3 +1,20 @@
+2005-06-19  Kristian Rietveld  <kris@gtk.org>
+
+       This commit includes a fix for #169463, Stefan Kost.
+
+       * gtk/gtkcellrendererprogress.c (gtk_cell_renderer_progress_get_size):
+       when cell_area is set, return cell_area width/height as width/height,
+       so the focus rectangle will be drawn correctly.
+
+       * gtk/gtktreeview.c (gtk_tree_view_bin_expose): drop unneeded get
+       of focus-line-width property,
+       (validate_row): take focus_line_width into account.
+
+       * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
+       also take focus_line_width into account when calculating the cell_area
+       y and height (before, we only took it into account when calculating
+       x and width).
+
 2005-06-19  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtk.symbols:
index 5fc9b31ada70ac4ea3db444496dba002fa6daf35..7f788d08fc7412726ae30b557d236a4a93d7af5c 100644 (file)
@@ -1,3 +1,20 @@
+2005-06-19  Kristian Rietveld  <kris@gtk.org>
+
+       This commit includes a fix for #169463, Stefan Kost.
+
+       * gtk/gtkcellrendererprogress.c (gtk_cell_renderer_progress_get_size):
+       when cell_area is set, return cell_area width/height as width/height,
+       so the focus rectangle will be drawn correctly.
+
+       * gtk/gtktreeview.c (gtk_tree_view_bin_expose): drop unneeded get
+       of focus-line-width property,
+       (validate_row): take focus_line_width into account.
+
+       * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action):
+       also take focus_line_width into account when calculating the cell_area
+       y and height (before, we only took it into account when calculating
+       x and width).
+
 2005-06-19  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtk.symbols:
index c01bbd2f17b7ba7792e5cf0df5dbeed672b63244..e565b2646dfc04272a734c92468e6a2564850053 100644 (file)
@@ -302,10 +302,23 @@ gtk_cell_renderer_progress_get_size (GtkCellRenderer *cell,
   compute_dimensions (cell, widget, cellprogress->priv->label, &w, &h);
   
   if (width)
-      *width = MAX (cellprogress->priv->min_w, w);
+    *width = MAX (cellprogress->priv->min_w, w);
   
   if (height)
     *height = MIN (cellprogress->priv->min_h, h);
+
+  /* FIXME: at the moment cell_area is only set when we are requesting
+   * the size for drawing the focus rectangle. We now just return
+   * the last size we used for drawing the progress bar, which will
+   * work for now. Not a really nice solution though.
+   */
+  if (cell_area)
+    {
+      if (width)
+        *width = cell_area->width;
+      if (height)
+        *height = cell_area->height;
+    }
 }
 
 static void
index 8f179bae9738fde13d976dd5f2ccb2cd2db6da6b..3549c54d98effdfffe9cc228d7bec52c4d7a110d 100644 (file)
@@ -3771,7 +3771,6 @@ gtk_tree_view_bin_expose (GtkWidget      *widget,
          GtkRBTree *tree = NULL;
          GtkRBNode *node = NULL;
          gint width;
-         gint focus_line_width;
 
           switch (tree_view->priv->drag_dest_pos)
             {
@@ -3793,7 +3792,6 @@ gtk_tree_view_bin_expose (GtkWidget      *widget,
                break;
              gdk_drawable_get_size (tree_view->priv->bin_window,
                                     &width, NULL);
-             gtk_widget_style_get (widget, "focus-line-width", &focus_line_width, NULL);
              gtk_paint_focus (widget->style,
                               tree_view->priv->bin_window,
                               GTK_WIDGET_STATE (widget),
@@ -4553,6 +4551,7 @@ validate_row (GtkTreeView *tree_view,
   GList *list;
   gint height = 0;
   gint horizontal_separator;
+  gint focus_line_width;
   gint depth = gtk_tree_path_get_depth (path);
   gboolean retval = FALSE;
   gboolean is_separator = FALSE;
@@ -4572,6 +4571,7 @@ validate_row (GtkTreeView *tree_view,
 
   gtk_widget_style_get (GTK_WIDGET (tree_view),
                        "focus-padding", &focus_pad,
+                       "focus-line-width", &focus_line_width,
                        "horizontal-separator", &horizontal_separator,
                        NULL);
   
@@ -4597,6 +4597,9 @@ validate_row (GtkTreeView *tree_view,
 
       if (!is_separator)
        {
+          tmp_width += 2 * focus_line_width;
+          tmp_height += 2 * focus_line_width;
+
          height = MAX (height, tmp_height);
          height = MAX (height, tree_view->priv->expander_size);
        }
index d7ccf5f67ab4f75d8a53c7c43043d4b951e0703f..945d0311f80f0177814c80ce035c4fdfa68d883f 100644 (file)
@@ -2710,6 +2710,8 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn  *tree_column,
   real_background_area = *background_area;
 
   real_cell_area.x += focus_line_width;
+  real_cell_area.y += focus_line_width;
+  real_cell_area.height -= 2 * focus_line_width;
 
   /* Find out how much extra space we have to allocate */
   for (list = tree_column->cell_list; list; list = list->next)