Sat Apr 13 22:49:45 2002  Kristian Rietveld  <kris@gtk.org>

        Fixes #75510

        * gtk/gtktreeselection.c (gtk_tree_selection_get_selected): make this
        function work correctly and more sane

        * gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): remove
        node->children from rbtree before emitting GtkTreeSelection::changed

Sat Apr 13 17:15:12 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_init): dont set
        the mode to GTK_CELL_RENDERER_MODE_EDITABLE by default,
        (gtk_cell_renderer_text_class_init): for some reason our default for
        editable was TRUE, of course this is FALSE.
        (gtk_cell_renderer_text_set_property): update mode when editable
        has been changed.
This commit is contained in:
Kristian Rietveld 2002-04-13 20:48:31 +00:00 committed by Kristian Rietveld
parent 0a4977915b
commit 2666ab462e
9 changed files with 144 additions and 21 deletions

View File

@ -1,3 +1,22 @@
Sat Apr 13 22:49:45 2002 Kristian Rietveld <kris@gtk.org>
Fixes #75510
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): make this
function work correctly and more sane
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): remove
node->children from rbtree before emitting GtkTreeSelection::changed
Sat Apr 13 17:15:12 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_init): dont set
the mode to GTK_CELL_RENDERER_MODE_EDITABLE by default,
(gtk_cell_renderer_text_class_init): for some reason our default for
editable was TRUE, of course this is FALSE.
(gtk_cell_renderer_text_set_property): update mode when editable
has been changed.
2002-04-12 jacob berkman <jacob@ximian.com>
* gdk/x11/xsettings-client.c (fetch_card8): fix cut-n-paste bug

View File

@ -1,3 +1,22 @@
Sat Apr 13 22:49:45 2002 Kristian Rietveld <kris@gtk.org>
Fixes #75510
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): make this
function work correctly and more sane
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): remove
node->children from rbtree before emitting GtkTreeSelection::changed
Sat Apr 13 17:15:12 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_init): dont set
the mode to GTK_CELL_RENDERER_MODE_EDITABLE by default,
(gtk_cell_renderer_text_class_init): for some reason our default for
editable was TRUE, of course this is FALSE.
(gtk_cell_renderer_text_set_property): update mode when editable
has been changed.
2002-04-12 jacob berkman <jacob@ximian.com>
* gdk/x11/xsettings-client.c (fetch_card8): fix cut-n-paste bug

View File

@ -1,3 +1,22 @@
Sat Apr 13 22:49:45 2002 Kristian Rietveld <kris@gtk.org>
Fixes #75510
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): make this
function work correctly and more sane
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): remove
node->children from rbtree before emitting GtkTreeSelection::changed
Sat Apr 13 17:15:12 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_init): dont set
the mode to GTK_CELL_RENDERER_MODE_EDITABLE by default,
(gtk_cell_renderer_text_class_init): for some reason our default for
editable was TRUE, of course this is FALSE.
(gtk_cell_renderer_text_set_property): update mode when editable
has been changed.
2002-04-12 jacob berkman <jacob@ximian.com>
* gdk/x11/xsettings-client.c (fetch_card8): fix cut-n-paste bug

View File

@ -1,3 +1,22 @@
Sat Apr 13 22:49:45 2002 Kristian Rietveld <kris@gtk.org>
Fixes #75510
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): make this
function work correctly and more sane
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): remove
node->children from rbtree before emitting GtkTreeSelection::changed
Sat Apr 13 17:15:12 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_init): dont set
the mode to GTK_CELL_RENDERER_MODE_EDITABLE by default,
(gtk_cell_renderer_text_class_init): for some reason our default for
editable was TRUE, of course this is FALSE.
(gtk_cell_renderer_text_set_property): update mode when editable
has been changed.
2002-04-12 jacob berkman <jacob@ximian.com>
* gdk/x11/xsettings-client.c (fetch_card8): fix cut-n-paste bug

View File

@ -1,3 +1,22 @@
Sat Apr 13 22:49:45 2002 Kristian Rietveld <kris@gtk.org>
Fixes #75510
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): make this
function work correctly and more sane
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): remove
node->children from rbtree before emitting GtkTreeSelection::changed
Sat Apr 13 17:15:12 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_init): dont set
the mode to GTK_CELL_RENDERER_MODE_EDITABLE by default,
(gtk_cell_renderer_text_class_init): for some reason our default for
editable was TRUE, of course this is FALSE.
(gtk_cell_renderer_text_set_property): update mode when editable
has been changed.
2002-04-12 jacob berkman <jacob@ximian.com>
* gdk/x11/xsettings-client.c (fetch_card8): fix cut-n-paste bug

View File

@ -1,3 +1,22 @@
Sat Apr 13 22:49:45 2002 Kristian Rietveld <kris@gtk.org>
Fixes #75510
* gtk/gtktreeselection.c (gtk_tree_selection_get_selected): make this
function work correctly and more sane
* gtk/gtktreeview.c (gtk_tree_view_real_collapse_row): remove
node->children from rbtree before emitting GtkTreeSelection::changed
Sat Apr 13 17:15:12 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_init): dont set
the mode to GTK_CELL_RENDERER_MODE_EDITABLE by default,
(gtk_cell_renderer_text_class_init): for some reason our default for
editable was TRUE, of course this is FALSE.
(gtk_cell_renderer_text_set_property): update mode when editable
has been changed.
2002-04-12 jacob berkman <jacob@ximian.com>
* gdk/x11/xsettings-client.c (fetch_card8): fix cut-n-paste bug

View File

@ -146,7 +146,6 @@ gtk_cell_renderer_text_init (GtkCellRendererText *celltext)
GTK_CELL_RENDERER (celltext)->yalign = 0.5;
GTK_CELL_RENDERER (celltext)->xpad = 2;
GTK_CELL_RENDERER (celltext)->ypad = 2;
GTK_CELL_RENDERER (celltext)->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
celltext->fixed_height_rows = -1;
celltext->font = pango_font_description_new ();
}
@ -230,7 +229,7 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
g_param_spec_boolean ("editable",
_("Editable"),
_("Whether the text can be modified by the user"),
TRUE,
FALSE,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (object_class,
@ -979,6 +978,10 @@ gtk_cell_renderer_text_set_property (GObject *object,
case PROP_EDITABLE:
celltext->editable = g_value_get_boolean (value);
celltext->editable_set = TRUE;
if (celltext->editable)
GTK_CELL_RENDERER (celltext)->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
else
GTK_CELL_RENDERER (celltext)->mode = GTK_CELL_RENDERER_MODE_INERT;
g_object_notify (object, "editable_set");
break;

View File

@ -354,6 +354,7 @@ gtk_tree_selection_get_selected (GtkTreeSelection *selection,
GtkRBNode *node;
GtkTreePath *anchor_path;
gboolean retval;
gboolean found_node;
g_return_val_if_fail (GTK_IS_TREE_SELECTION (selection), FALSE);
g_return_val_if_fail (selection->type != GTK_SELECTION_MULTIPLE, FALSE);
@ -371,30 +372,31 @@ gtk_tree_selection_get_selected (GtkTreeSelection *selection,
if (anchor_path == NULL)
return FALSE;
if (iter == NULL)
{
gtk_tree_path_free (anchor_path);
return TRUE;
}
retval = FALSE;
if (!_gtk_tree_view_find_node (selection->tree_view,
anchor_path,
&tree,
&node) &&
! GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
found_node = !_gtk_tree_view_find_node (selection->tree_view,
anchor_path,
&tree,
&node);
if (found_node && GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
{
/* we only want to return the anchor if it exists in the rbtree and
* is selected.
*/
if (iter == NULL)
retval = TRUE;
else
retval = gtk_tree_model_get_iter (selection->tree_view->priv->model,
iter,
anchor_path);
}
else
{
/* We don't want to return the anchor if it isn't actually selected.
*/
retval = FALSE;
}
else
{
retval = gtk_tree_model_get_iter (selection->tree_view->priv->model,
iter,
anchor_path);
}
gtk_tree_path_free (anchor_path);

View File

@ -8837,8 +8837,12 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view,
}
if (gtk_tree_view_unref_and_check_selection_tree (tree_view, node->children))
g_signal_emit_by_name (G_OBJECT (tree_view->priv->selection), "changed", 0);
_gtk_rbtree_remove (node->children);
{
_gtk_rbtree_remove (node->children);
g_signal_emit_by_name (G_OBJECT (tree_view->priv->selection), "changed", 0);
}
else
_gtk_rbtree_remove (node->children);
if (tree_view->priv->expand_collapse_timeout)
{