Merge TreeView fixes from HEAD up to Apr 26:
Fri Apr 26 00:00:00 2002 Kristian Rietveld <kris@gtk.org> Merge TreeView fixes from HEAD up to Apr 26: (Apr 25): * gtk/gtktreemodelsort.c (gtk_tree_model_sort_reset_default_sort_func): resort if we're already in 'unsorted' state, and update the docs * gtk/gtktreeview.c (gtk_tree_view_search_iter): make the search dialog not scroll horizontally (prolly fixes #74806). (Also from Apr 25, fixes #74206): * gtk/gtktreeprivate.h: add _gtk_tree_view_column_count_special_cells * gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell), (_gtk_tree_view_column_get_editable_cell): remove a space which made the code look ugly (_gtk_tree_view_column_count_special_cells): new function, (gtk_tree_view_column_cell_process_action): if there's only one activatable cell, the whole column will activate that renderer. (Apr 24): * gtk/gtktreeview.c (gtk_tree_view_stop_editing): temporarily set ->priv->edited_column to NULL. Pleas read the comment in this function for an explanation (fixes #79632).
This commit is contained in:
committed by
Kristian Rietveld
parent
f2b3c6e6a3
commit
9255c12c87
26
ChangeLog
26
ChangeLog
@@ -1,3 +1,29 @@
|
||||
Fri Apr 26 00:00:00 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
Merge TreeView fixes from HEAD up to Apr 26:
|
||||
|
||||
(Apr 25):
|
||||
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_reset_default_sort_func):
|
||||
resort if we're already in 'unsorted' state, and update the docs
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_search_iter): make the search
|
||||
dialog not scroll horizontally (prolly fixes #74806).
|
||||
|
||||
(Also from Apr 25, fixes #74206):
|
||||
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_count_special_cells
|
||||
|
||||
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell),
|
||||
(_gtk_tree_view_column_get_editable_cell): remove a space which made
|
||||
the code look ugly
|
||||
(_gtk_tree_view_column_count_special_cells): new function,
|
||||
(gtk_tree_view_column_cell_process_action): if there's only one
|
||||
activatable cell, the whole column will activate that renderer.
|
||||
|
||||
(Apr 24):
|
||||
* gtk/gtktreeview.c (gtk_tree_view_stop_editing): temporarily set
|
||||
->priv->edited_column to NULL. Pleas read the comment in this
|
||||
function for an explanation (fixes #79632).
|
||||
|
||||
Thu Apr 25 20:24:37 2002 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): use the child's
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
Fri Apr 26 00:00:00 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
Merge TreeView fixes from HEAD up to Apr 26:
|
||||
|
||||
(Apr 25):
|
||||
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_reset_default_sort_func):
|
||||
resort if we're already in 'unsorted' state, and update the docs
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_search_iter): make the search
|
||||
dialog not scroll horizontally (prolly fixes #74806).
|
||||
|
||||
(Also from Apr 25, fixes #74206):
|
||||
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_count_special_cells
|
||||
|
||||
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell),
|
||||
(_gtk_tree_view_column_get_editable_cell): remove a space which made
|
||||
the code look ugly
|
||||
(_gtk_tree_view_column_count_special_cells): new function,
|
||||
(gtk_tree_view_column_cell_process_action): if there's only one
|
||||
activatable cell, the whole column will activate that renderer.
|
||||
|
||||
(Apr 24):
|
||||
* gtk/gtktreeview.c (gtk_tree_view_stop_editing): temporarily set
|
||||
->priv->edited_column to NULL. Pleas read the comment in this
|
||||
function for an explanation (fixes #79632).
|
||||
|
||||
Thu Apr 25 20:24:37 2002 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): use the child's
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
Fri Apr 26 00:00:00 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
Merge TreeView fixes from HEAD up to Apr 26:
|
||||
|
||||
(Apr 25):
|
||||
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_reset_default_sort_func):
|
||||
resort if we're already in 'unsorted' state, and update the docs
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_search_iter): make the search
|
||||
dialog not scroll horizontally (prolly fixes #74806).
|
||||
|
||||
(Also from Apr 25, fixes #74206):
|
||||
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_count_special_cells
|
||||
|
||||
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell),
|
||||
(_gtk_tree_view_column_get_editable_cell): remove a space which made
|
||||
the code look ugly
|
||||
(_gtk_tree_view_column_count_special_cells): new function,
|
||||
(gtk_tree_view_column_cell_process_action): if there's only one
|
||||
activatable cell, the whole column will activate that renderer.
|
||||
|
||||
(Apr 24):
|
||||
* gtk/gtktreeview.c (gtk_tree_view_stop_editing): temporarily set
|
||||
->priv->edited_column to NULL. Pleas read the comment in this
|
||||
function for an explanation (fixes #79632).
|
||||
|
||||
Thu Apr 25 20:24:37 2002 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): use the child's
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
Fri Apr 26 00:00:00 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
Merge TreeView fixes from HEAD up to Apr 26:
|
||||
|
||||
(Apr 25):
|
||||
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_reset_default_sort_func):
|
||||
resort if we're already in 'unsorted' state, and update the docs
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_search_iter): make the search
|
||||
dialog not scroll horizontally (prolly fixes #74806).
|
||||
|
||||
(Also from Apr 25, fixes #74206):
|
||||
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_count_special_cells
|
||||
|
||||
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell),
|
||||
(_gtk_tree_view_column_get_editable_cell): remove a space which made
|
||||
the code look ugly
|
||||
(_gtk_tree_view_column_count_special_cells): new function,
|
||||
(gtk_tree_view_column_cell_process_action): if there's only one
|
||||
activatable cell, the whole column will activate that renderer.
|
||||
|
||||
(Apr 24):
|
||||
* gtk/gtktreeview.c (gtk_tree_view_stop_editing): temporarily set
|
||||
->priv->edited_column to NULL. Pleas read the comment in this
|
||||
function for an explanation (fixes #79632).
|
||||
|
||||
Thu Apr 25 20:24:37 2002 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): use the child's
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
Fri Apr 26 00:00:00 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
Merge TreeView fixes from HEAD up to Apr 26:
|
||||
|
||||
(Apr 25):
|
||||
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_reset_default_sort_func):
|
||||
resort if we're already in 'unsorted' state, and update the docs
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_search_iter): make the search
|
||||
dialog not scroll horizontally (prolly fixes #74806).
|
||||
|
||||
(Also from Apr 25, fixes #74206):
|
||||
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_count_special_cells
|
||||
|
||||
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell),
|
||||
(_gtk_tree_view_column_get_editable_cell): remove a space which made
|
||||
the code look ugly
|
||||
(_gtk_tree_view_column_count_special_cells): new function,
|
||||
(gtk_tree_view_column_cell_process_action): if there's only one
|
||||
activatable cell, the whole column will activate that renderer.
|
||||
|
||||
(Apr 24):
|
||||
* gtk/gtktreeview.c (gtk_tree_view_stop_editing): temporarily set
|
||||
->priv->edited_column to NULL. Pleas read the comment in this
|
||||
function for an explanation (fixes #79632).
|
||||
|
||||
Thu Apr 25 20:24:37 2002 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): use the child's
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
Fri Apr 26 00:00:00 2002 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
Merge TreeView fixes from HEAD up to Apr 26:
|
||||
|
||||
(Apr 25):
|
||||
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_reset_default_sort_func):
|
||||
resort if we're already in 'unsorted' state, and update the docs
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_search_iter): make the search
|
||||
dialog not scroll horizontally (prolly fixes #74806).
|
||||
|
||||
(Also from Apr 25, fixes #74206):
|
||||
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_count_special_cells
|
||||
|
||||
* gtk/gtktreeviewcolumn.c (_gtk_tree_view_column_has_editable_cell),
|
||||
(_gtk_tree_view_column_get_editable_cell): remove a space which made
|
||||
the code look ugly
|
||||
(_gtk_tree_view_column_count_special_cells): new function,
|
||||
(gtk_tree_view_column_cell_process_action): if there's only one
|
||||
activatable cell, the whole column will activate that renderer.
|
||||
|
||||
(Apr 24):
|
||||
* gtk/gtktreeview.c (gtk_tree_view_stop_editing): temporarily set
|
||||
->priv->edited_column to NULL. Pleas read the comment in this
|
||||
function for an explanation (fixes #79632).
|
||||
|
||||
Thu Apr 25 20:24:37 2002 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkmenuitem.c (gtk_menu_item_size_allocate): use the child's
|
||||
|
||||
@@ -2200,7 +2200,9 @@ gtk_tree_model_sort_clear_cache_helper (GtkTreeModelSort *tree_model_sort,
|
||||
* @tree_model_sort: A #GtkTreeModelSort
|
||||
*
|
||||
* This resets the default sort function to be in the 'unsorted' state. That
|
||||
* is, it is in the same order as the child model.
|
||||
* is, it is in the same order as the child model. It will re-sort the model
|
||||
* to be in the same order as the child model only if the #GtkTreeModelSort
|
||||
* is in 'unsorted' state.
|
||||
**/
|
||||
void
|
||||
gtk_tree_model_sort_reset_default_sort_func (GtkTreeModelSort *tree_model_sort)
|
||||
@@ -2218,6 +2220,9 @@ gtk_tree_model_sort_reset_default_sort_func (GtkTreeModelSort *tree_model_sort)
|
||||
tree_model_sort->default_sort_func = NO_SORT_FUNC;
|
||||
tree_model_sort->default_sort_data = NULL;
|
||||
tree_model_sort->default_sort_destroy = NULL;
|
||||
|
||||
if (tree_model_sort->sort_column_id == GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID)
|
||||
gtk_tree_model_sort_sort (tree_model_sort);
|
||||
tree_model_sort->sort_column_id = GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID;
|
||||
}
|
||||
|
||||
|
||||
@@ -317,6 +317,7 @@ void _gtk_tree_view_column_autosize (GtkTreeView *tre
|
||||
|
||||
gboolean _gtk_tree_view_column_has_editable_cell (GtkTreeViewColumn *column);
|
||||
GtkCellRenderer *_gtk_tree_view_column_get_editable_cell (GtkTreeViewColumn *column);
|
||||
gint _gtk_tree_view_column_count_special_cells (GtkTreeViewColumn *column);
|
||||
|
||||
GtkTreeSelection* _gtk_tree_selection_new (void);
|
||||
GtkTreeSelection* _gtk_tree_selection_new_with_tree_view (GtkTreeView *tree_view);
|
||||
|
||||
@@ -9984,7 +9984,6 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view,
|
||||
&cell_area,
|
||||
&expose_area,
|
||||
0);
|
||||
|
||||
cell_offset += column->width;
|
||||
}
|
||||
|
||||
@@ -10427,8 +10426,8 @@ gtk_tree_view_search_iter (GtkTreeModel *model,
|
||||
(*count)++;
|
||||
if (*count == n)
|
||||
{
|
||||
gtk_tree_view_scroll_to_cell (tree_view, path, column,
|
||||
TRUE, 0.5, 0.5);
|
||||
gtk_tree_view_scroll_to_cell (tree_view, path, NULL,
|
||||
TRUE, 0.5, 0.0);
|
||||
gtk_tree_selection_select_iter (selection, iter);
|
||||
gtk_tree_view_real_set_cursor (tree_view, path, FALSE, TRUE);
|
||||
|
||||
@@ -10676,11 +10675,28 @@ static void
|
||||
gtk_tree_view_stop_editing (GtkTreeView *tree_view,
|
||||
gboolean cancel_editing)
|
||||
{
|
||||
GtkTreeViewColumn *column;
|
||||
|
||||
if (tree_view->priv->edited_column == NULL)
|
||||
return;
|
||||
|
||||
if (! cancel_editing)
|
||||
gtk_cell_editable_editing_done (tree_view->priv->edited_column->editable_widget);
|
||||
/**
|
||||
* This is very evil. We need to do this, because
|
||||
* gtk_cell_editable_editing_done may trigger gtk_tree_view_row_changed
|
||||
* later on. If gtk_tree_view_row_changed notices
|
||||
* tree_view->priv->edited_column != NULL, it'll call
|
||||
* gtk_tree_view_stop_editing again. Bad things will happen then.
|
||||
*
|
||||
* Please read that again if you intend to modify anything here.
|
||||
*/
|
||||
|
||||
gtk_cell_editable_remove_widget (tree_view->priv->edited_column->editable_widget);
|
||||
column = tree_view->priv->edited_column;
|
||||
tree_view->priv->edited_column = NULL;
|
||||
|
||||
if (! cancel_editing)
|
||||
gtk_cell_editable_editing_done (column->editable_widget);
|
||||
|
||||
tree_view->priv->edited_column = column;
|
||||
|
||||
gtk_cell_editable_remove_widget (column->editable_widget);
|
||||
}
|
||||
|
||||
@@ -1046,7 +1046,7 @@ _gtk_tree_view_column_has_editable_cell (GtkTreeViewColumn *column)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
for (list = column->cell_list; list; list = list ->next)
|
||||
for (list = column->cell_list; list; list = list->next)
|
||||
if (((GtkTreeViewColumnCellInfo *)list->data)->cell->mode ==
|
||||
GTK_CELL_RENDERER_MODE_EDITABLE)
|
||||
return TRUE;
|
||||
@@ -1059,7 +1059,7 @@ _gtk_tree_view_column_get_editable_cell (GtkTreeViewColumn *column)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
for (list = column->cell_list; list; list = list ->next)
|
||||
for (list = column->cell_list; list; list = list->next)
|
||||
if (((GtkTreeViewColumnCellInfo *)list->data)->cell->mode ==
|
||||
GTK_CELL_RENDERER_MODE_EDITABLE)
|
||||
return ((GtkTreeViewColumnCellInfo *)list->data)->cell;
|
||||
@@ -1067,6 +1067,24 @@ _gtk_tree_view_column_get_editable_cell (GtkTreeViewColumn *column)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gint
|
||||
_gtk_tree_view_column_count_special_cells (GtkTreeViewColumn *column)
|
||||
{
|
||||
gint i = 0;
|
||||
GList *list;
|
||||
|
||||
for (list = column->cell_list; list; list = list->next)
|
||||
{
|
||||
GtkTreeViewColumnCellInfo *cellinfo = list->data;
|
||||
|
||||
if (cellinfo->cell->mode == GTK_CELL_RENDERER_MODE_EDITABLE ||
|
||||
cellinfo->cell->mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE)
|
||||
i++;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Public Functions */
|
||||
|
||||
|
||||
@@ -2408,8 +2426,18 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn *tree_column,
|
||||
|
||||
if (event)
|
||||
{
|
||||
if (real_cell_area.x <= ((GdkEventButton *)event)->x &&
|
||||
if (_gtk_tree_view_column_count_special_cells (tree_column) == 1)
|
||||
{
|
||||
/* only 1 activatably cell -> whole column can activate */
|
||||
if (cell_area->x <= ((GdkEventButton *)event)->x &&
|
||||
cell_area->x + cell_area->width > ((GdkEventButton *)event)->x)
|
||||
try_event = TRUE;
|
||||
}
|
||||
else if (real_cell_area.x <= ((GdkEventButton *)event)->x &&
|
||||
real_cell_area.x + real_cell_area.width > ((GdkEventButton *)event)->x)
|
||||
/* only activate cell if the user clicked on an individual
|
||||
* cell
|
||||
*/
|
||||
try_event = TRUE;
|
||||
}
|
||||
else /* if (info->has_focus)*/
|
||||
|
||||
Reference in New Issue
Block a user