[gtk+/treeview-refactor] Remove the need for _gtk_tree_view_column_get_focus_area
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/treeview-refactor] Remove the need for _gtk_tree_view_column_get_focus_area
- Date: Sun, 5 Dec 2010 17:20:53 +0000 (UTC)
commit 6c73647727cdd2b3d2d062fe9fb7d54c37daabb4
Author: Kristian Rietveld <kris gtk org>
Date: Sun Dec 5 17:10:21 2010 +0100
Remove the need for _gtk_tree_view_column_get_focus_area
gtk/gtktreeprivate.h | 4 ----
gtk/gtktreeview.c | 47 ++++++++++++++++++-----------------------------
gtk/gtktreeviewcolumn.c | 20 --------------------
3 files changed, 18 insertions(+), 53 deletions(-)
---
diff --git a/gtk/gtktreeprivate.h b/gtk/gtktreeprivate.h
index 837801e..6cb1ffc 100644
--- a/gtk/gtktreeprivate.h
+++ b/gtk/gtktreeprivate.h
@@ -134,10 +134,6 @@ void _gtk_tree_view_column_cell_render (GtkTreeViewColumn *tree_column,
const GdkRectangle *cell_area,
guint flags,
gboolean draw_focus);
-void _gtk_tree_view_column_get_focus_area (GtkTreeViewColumn *tree_column,
- const GdkRectangle *background_area,
- const GdkRectangle *cell_area,
- GdkRectangle *focus_area);
void _gtk_tree_view_column_cell_set_dirty (GtkTreeViewColumn *tree_column,
gboolean install_handler);
gboolean _gtk_tree_view_column_cell_get_dirty (GtkTreeViewColumn *tree_column);
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index c63ec24..2d16f46 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -9367,42 +9367,31 @@ gtk_tree_view_clamp_column_visible (GtkTreeView *tree_view,
* focus cell is bigger than the page size, we make sure the
* left-hand side of the cell is visible).
*
- * If the column does not have those so-called special cells, we
+ * If the column does not have an activatable cell, we
* make sure the left-hand side of the column is visible.
*/
if (focus_to_cell && gtk_tree_view_has_can_focus_cell (tree_view))
{
- GtkTreePath *cursor_path;
- GdkRectangle background_area, cell_area, focus_area;
+ GtkCellArea *cell_area;
+ GtkCellRenderer *focus_cell;
- cursor_path = gtk_tree_row_reference_get_path (tree_view->priv->cursor);
+ cell_area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (column));
+ focus_cell = gtk_cell_area_get_focus_cell (cell_area);
- gtk_tree_view_get_cell_area (tree_view,
- cursor_path, column, &cell_area);
- gtk_tree_view_get_background_area (tree_view,
- cursor_path, column,
- &background_area);
-
- gtk_tree_path_free (cursor_path);
-
- _gtk_tree_view_column_get_focus_area (column,
- &background_area,
- &cell_area,
- &focus_area);
-
- x = focus_area.x;
- width = focus_area.width;
-
- if (width < tree_view->priv->hadjustment->page_size)
- {
- if ((tree_view->priv->hadjustment->value + tree_view->priv->hadjustment->page_size) < (x + width))
- gtk_adjustment_set_value (tree_view->priv->hadjustment,
- x + width - tree_view->priv->hadjustment->page_size);
- else if (tree_view->priv->hadjustment->value > x)
- gtk_adjustment_set_value (tree_view->priv->hadjustment, x);
- }
- }
+ if (gtk_tree_view_column_cell_get_position (column, focus_cell,
+ &x, &width))
+ {
+ if (width < tree_view->priv->hadjustment->page_size)
+ {
+ if (tree_view->priv->hadjustment->value + tree_view->priv->hadjustment->page_size < x + width)
+ gtk_adjustment_set_value (tree_view->priv->hadjustment,
+ x + width - tree_view->priv->hadjustment->page_size);
+ else if (tree_view->priv->hadjustment->value > x)
+ gtk_adjustment_set_value (tree_view->priv->hadjustment, x);
+ }
+ }
+ }
gtk_adjustment_set_value (tree_view->priv->hadjustment, x);
}
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index 6b86fd3..1fa4cf0 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -2811,26 +2811,6 @@ _gtk_tree_view_column_cell_event (GtkTreeViewColumn *tree_column,
flags);
}
-void
-_gtk_tree_view_column_get_focus_area (GtkTreeViewColumn *tree_column,
- const GdkRectangle *background_area,
- const GdkRectangle *cell_area,
- GdkRectangle *focus_area)
-{
- /* FIXME */
-#if 0
- gtk_tree_view_column_cell_process_action (tree_column,
- NULL,
- background_area,
- cell_area,
- 0,
- CELL_ACTION_FOCUS,
- focus_area,
- NULL, NULL, NULL);
-#endif
-}
-
-
/**
* gtk_tree_view_column_cell_is_visible:
* @tree_column: A #GtkTreeViewColumn
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]