diff options
author | Kristian Rietveld <kris@gtk.org> | 2005-06-19 12:44:12 +0000 |
---|---|---|
committer | Kristian Rietveld <kristian@src.gnome.org> | 2005-06-19 12:44:12 +0000 |
commit | d4fdc6b7a90482c4eebccbf1a7d1bb19289818fa (patch) | |
tree | 4c0fb3b603362d887f1df7a6c39b4063bc833090 | |
parent | a2ea759334b897b194714433a646c288a5c05617 (diff) | |
download | gtk+-d4fdc6b7a90482c4eebccbf1a7d1bb19289818fa.tar.gz |
This commit includes a fix for #169463, Stefan Kost.
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).
-rw-r--r-- | ChangeLog | 17 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 17 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 17 | ||||
-rw-r--r-- | gtk/gtkcellrendererprogress.c | 15 | ||||
-rw-r--r-- | gtk/gtktreeview.c | 7 | ||||
-rw-r--r-- | gtk/gtktreeviewcolumn.c | 2 |
6 files changed, 72 insertions, 3 deletions
@@ -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: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 5fc9b31ada..7f788d08fc 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -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: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 5fc9b31ada..7f788d08fc 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -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: diff --git a/gtk/gtkcellrendererprogress.c b/gtk/gtkcellrendererprogress.c index c01bbd2f17..e565b2646d 100644 --- a/gtk/gtkcellrendererprogress.c +++ b/gtk/gtkcellrendererprogress.c @@ -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 diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 8f179bae97..3549c54d98 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -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); } diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index d7ccf5f67a..945d0311f8 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -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) |