Add a "resizable" property, to get rid of the
Mon Nov 19 15:30:51 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add a "resizable" property, to get rid of the GTK_TREE_VIEW_COLUMN_RESIZABLE sizing flag. (gtk_tree_view_column_set_resizable): New function to set resizable. (gtk_tree_view_column_set_resizable): getter. * tests/testtreecolumns.c (add_clicked): modify for above change. * Makefile.am (install-data-hook): remove old .pc files before installing the new one. We used to symlink this, and it will break old installs.
This commit is contained in:
parent
650e82680a
commit
94a097ef5d
13 changed files with 158 additions and 12 deletions
14
ChangeLog
14
ChangeLog
|
|
@ -1,3 +1,17 @@
|
|||
Mon Nov 19 15:30:51 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add a
|
||||
"resizable" property, to get rid of the
|
||||
GTK_TREE_VIEW_COLUMN_RESIZABLE sizing flag.
|
||||
(gtk_tree_view_column_set_resizable): New function to set resizable.
|
||||
(gtk_tree_view_column_set_resizable): getter.
|
||||
|
||||
* tests/testtreecolumns.c (add_clicked): modify for above change.
|
||||
|
||||
* Makefile.am (install-data-hook): remove old .pc files before
|
||||
installing the new one. We used to symlink this, and it will
|
||||
break old installs.
|
||||
|
||||
2001-11-19 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* tests/testtext.c (fill_example_buffer): put in a test for
|
||||
|
|
|
|||
|
|
@ -1,3 +1,17 @@
|
|||
Mon Nov 19 15:30:51 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add a
|
||||
"resizable" property, to get rid of the
|
||||
GTK_TREE_VIEW_COLUMN_RESIZABLE sizing flag.
|
||||
(gtk_tree_view_column_set_resizable): New function to set resizable.
|
||||
(gtk_tree_view_column_set_resizable): getter.
|
||||
|
||||
* tests/testtreecolumns.c (add_clicked): modify for above change.
|
||||
|
||||
* Makefile.am (install-data-hook): remove old .pc files before
|
||||
installing the new one. We used to symlink this, and it will
|
||||
break old installs.
|
||||
|
||||
2001-11-19 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* tests/testtext.c (fill_example_buffer): put in a test for
|
||||
|
|
|
|||
|
|
@ -1,3 +1,17 @@
|
|||
Mon Nov 19 15:30:51 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add a
|
||||
"resizable" property, to get rid of the
|
||||
GTK_TREE_VIEW_COLUMN_RESIZABLE sizing flag.
|
||||
(gtk_tree_view_column_set_resizable): New function to set resizable.
|
||||
(gtk_tree_view_column_set_resizable): getter.
|
||||
|
||||
* tests/testtreecolumns.c (add_clicked): modify for above change.
|
||||
|
||||
* Makefile.am (install-data-hook): remove old .pc files before
|
||||
installing the new one. We used to symlink this, and it will
|
||||
break old installs.
|
||||
|
||||
2001-11-19 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* tests/testtext.c (fill_example_buffer): put in a test for
|
||||
|
|
|
|||
|
|
@ -1,3 +1,17 @@
|
|||
Mon Nov 19 15:30:51 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add a
|
||||
"resizable" property, to get rid of the
|
||||
GTK_TREE_VIEW_COLUMN_RESIZABLE sizing flag.
|
||||
(gtk_tree_view_column_set_resizable): New function to set resizable.
|
||||
(gtk_tree_view_column_set_resizable): getter.
|
||||
|
||||
* tests/testtreecolumns.c (add_clicked): modify for above change.
|
||||
|
||||
* Makefile.am (install-data-hook): remove old .pc files before
|
||||
installing the new one. We used to symlink this, and it will
|
||||
break old installs.
|
||||
|
||||
2001-11-19 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* tests/testtext.c (fill_example_buffer): put in a test for
|
||||
|
|
|
|||
|
|
@ -1,3 +1,17 @@
|
|||
Mon Nov 19 15:30:51 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add a
|
||||
"resizable" property, to get rid of the
|
||||
GTK_TREE_VIEW_COLUMN_RESIZABLE sizing flag.
|
||||
(gtk_tree_view_column_set_resizable): New function to set resizable.
|
||||
(gtk_tree_view_column_set_resizable): getter.
|
||||
|
||||
* tests/testtreecolumns.c (add_clicked): modify for above change.
|
||||
|
||||
* Makefile.am (install-data-hook): remove old .pc files before
|
||||
installing the new one. We used to symlink this, and it will
|
||||
break old installs.
|
||||
|
||||
2001-11-19 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* tests/testtext.c (fill_example_buffer): put in a test for
|
||||
|
|
|
|||
|
|
@ -1,3 +1,17 @@
|
|||
Mon Nov 19 15:30:51 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add a
|
||||
"resizable" property, to get rid of the
|
||||
GTK_TREE_VIEW_COLUMN_RESIZABLE sizing flag.
|
||||
(gtk_tree_view_column_set_resizable): New function to set resizable.
|
||||
(gtk_tree_view_column_set_resizable): getter.
|
||||
|
||||
* tests/testtreecolumns.c (add_clicked): modify for above change.
|
||||
|
||||
* Makefile.am (install-data-hook): remove old .pc files before
|
||||
installing the new one. We used to symlink this, and it will
|
||||
break old installs.
|
||||
|
||||
2001-11-19 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* tests/testtext.c (fill_example_buffer): put in a test for
|
||||
|
|
|
|||
|
|
@ -1,3 +1,17 @@
|
|||
Mon Nov 19 15:30:51 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add a
|
||||
"resizable" property, to get rid of the
|
||||
GTK_TREE_VIEW_COLUMN_RESIZABLE sizing flag.
|
||||
(gtk_tree_view_column_set_resizable): New function to set resizable.
|
||||
(gtk_tree_view_column_set_resizable): getter.
|
||||
|
||||
* tests/testtreecolumns.c (add_clicked): modify for above change.
|
||||
|
||||
* Makefile.am (install-data-hook): remove old .pc files before
|
||||
installing the new one. We used to symlink this, and it will
|
||||
break old installs.
|
||||
|
||||
2001-11-19 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* tests/testtext.c (fill_example_buffer): put in a test for
|
||||
|
|
|
|||
10
Makefile.am
10
Makefile.am
|
|
@ -143,17 +143,17 @@ DISTCLEANFILES = \
|
|||
gtk+-$(GDKTARGET)-2.0-uninstalled.pc \
|
||||
gdk-$(GDKTARGET)-2.0-uninstalled.pc
|
||||
|
||||
## symlink gdk-2.0.pc and gtk+-2.0.pc to default target for the platform
|
||||
## copy the default target for this platform to gdk-2.0.pc and gtk+-2.0.pc
|
||||
DEFAULT_GDKTARGET=x11
|
||||
install-data-hook:
|
||||
(cd $(DESTDIR)$(pkgconfigdir) && \
|
||||
test -e gdk-$(DEFAULT_GDKTARGET)-2.0.pc && \
|
||||
test -e gtk+-$(DEFAULT_GDKTARGET)-2.0.pc && \
|
||||
cp -f gdk-$(DEFAULT_GDKTARGET)-2.0.pc gdk-2.0.pc && \
|
||||
cp -f gtk+-$(DEFAULT_GDKTARGET)-2.0.pc gtk+-2.0.pc) || \
|
||||
rm -f gdk-2.0.pc && cp -f gdk-$(DEFAULT_GDKTARGET)-2.0.pc gdk-2.0.pc && \
|
||||
rm -f gtk+-2.0.pc && cp -f gtk+-$(DEFAULT_GDKTARGET)-2.0.pc gtk+-2.0.pc) || \
|
||||
(cd $(DESTDIR)$(pkgconfigdir) && \
|
||||
cp -f gdk-$(GDKTARGET)-2.0.pc gdk-2.0.pc && \
|
||||
cp -f gtk+-$(GDKTARGET)-2.0.pc gtk+-2.0.pc)
|
||||
rm -f gdk-2.0.pc && cp -f gdk-$(GDKTARGET)-2.0.pc gdk-2.0.pc && \
|
||||
rm -f gtk+-2.0.pc && cp -f gtk+-$(GDKTARGET)-2.0.pc gtk+-2.0.pc)
|
||||
|
||||
dist-hook: gtk+.spec
|
||||
if test -e $(srcdir)/INSTALL.in && test -e $(srcdir)/README.in ; then \
|
||||
|
|
|
|||
|
|
@ -1151,7 +1151,7 @@ gtk_tree_view_map_buttons (GtkTreeView *tree_view)
|
|||
column = list->data;
|
||||
if (column->visible == FALSE)
|
||||
continue;
|
||||
if (column->column_type == GTK_TREE_VIEW_COLUMN_RESIZABLE)
|
||||
if (column->resizable)
|
||||
{
|
||||
gdk_window_raise (column->window);
|
||||
gdk_window_show (column->window);
|
||||
|
|
@ -1746,7 +1746,7 @@ gtk_tree_view_button_press (GtkWidget *widget,
|
|||
{
|
||||
column = list->data;
|
||||
if (event->window == column->window &&
|
||||
column->column_type == GTK_TREE_VIEW_COLUMN_RESIZABLE &&
|
||||
column->resizable &&
|
||||
column->window)
|
||||
{
|
||||
gpointer drag_data;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ enum
|
|||
{
|
||||
PROP_0,
|
||||
PROP_VISIBLE,
|
||||
PROP_RESIZABLE,
|
||||
PROP_WIDTH,
|
||||
PROP_SIZING,
|
||||
PROP_FIXED_WIDTH,
|
||||
|
|
@ -174,6 +175,14 @@ gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class)
|
|||
TRUE,
|
||||
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_RESIZABLE,
|
||||
g_param_spec_boolean ("resizable",
|
||||
_("Resizable"),
|
||||
_("Column is user-resizable"),
|
||||
FALSE,
|
||||
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_WIDTH,
|
||||
g_param_spec_int ("width",
|
||||
|
|
@ -295,6 +304,7 @@ gtk_tree_view_column_init (GtkTreeViewColumn *tree_column)
|
|||
tree_column->max_width = -1;
|
||||
tree_column->column_type = GTK_TREE_VIEW_COLUMN_GROW_ONLY;
|
||||
tree_column->visible = TRUE;
|
||||
tree_column->resizable = FALSE;
|
||||
tree_column->clickable = FALSE;
|
||||
tree_column->dirty = TRUE;
|
||||
tree_column->sort_order = GTK_SORT_ASCENDING;
|
||||
|
|
@ -666,7 +676,7 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
|
|||
gtk_widget_show_now (tree_column->button);
|
||||
if (tree_column->window)
|
||||
{
|
||||
if (tree_column->column_type == GTK_TREE_VIEW_COLUMN_RESIZABLE)
|
||||
if (tree_column->resizable)
|
||||
{
|
||||
gdk_window_show (tree_column->window);
|
||||
gdk_window_raise (tree_column->window);
|
||||
|
|
@ -1409,6 +1419,34 @@ gtk_tree_view_column_get_visible (GtkTreeViewColumn *tree_column)
|
|||
return tree_column->visible;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_tree_view_column_set_resizable (GtkTreeViewColumn *tree_column,
|
||||
gboolean resizable)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
||||
|
||||
resizable = !! resizable;
|
||||
|
||||
if (tree_column->resizable == resizable)
|
||||
return;
|
||||
|
||||
if (resizable && tree_column->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
||||
gtk_tree_view_column_set_sizing (tree_column, GTK_TREE_VIEW_COLUMN_GROW_ONLY);
|
||||
|
||||
gtk_tree_view_column_update_button (tree_column);
|
||||
|
||||
g_object_notify (G_OBJECT (tree_column), "resizable");
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_tree_view_column_get_resizable (GtkTreeViewColumn *tree_column)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
||||
|
||||
return tree_column->resizable;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gtk_tree_view_column_set_sizing:
|
||||
* @tree_column: A #GtkTreeViewColumn.
|
||||
|
|
@ -1425,16 +1463,23 @@ gtk_tree_view_column_set_sizing (GtkTreeViewColumn *tree_column,
|
|||
if (type == tree_column->column_type)
|
||||
return;
|
||||
|
||||
if (type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
||||
gtk_tree_view_column_set_resizable (tree_column, FALSE);
|
||||
|
||||
#if 0
|
||||
/* I was clearly on crack when I wrote this. I'm not sure what's supposed to
|
||||
* be below so I'll leave it until I figure it out.
|
||||
*/
|
||||
if (tree_column->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE &&
|
||||
tree_column->requested_width != -1)
|
||||
{
|
||||
gtk_tree_view_column_set_sizing (tree_column, tree_column->requested_width);
|
||||
}
|
||||
#endif
|
||||
tree_column->column_type = type;
|
||||
|
||||
gtk_tree_view_column_update_button (tree_column);
|
||||
|
||||
if (type != GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
||||
g_object_notify (G_OBJECT (tree_column), "sizing");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ extern "C" {
|
|||
typedef enum
|
||||
{
|
||||
GTK_TREE_VIEW_COLUMN_GROW_ONLY,
|
||||
GTK_TREE_VIEW_COLUMN_RESIZABLE,
|
||||
GTK_TREE_VIEW_COLUMN_AUTOSIZE,
|
||||
GTK_TREE_VIEW_COLUMN_FIXED
|
||||
} GtkTreeViewColumnSizing;
|
||||
|
|
@ -91,6 +90,7 @@ struct _GtkTreeViewColumn
|
|||
|
||||
/* Flags */
|
||||
guint visible : 1;
|
||||
guint resizable : 1;
|
||||
guint clickable : 1;
|
||||
guint dirty : 1;
|
||||
guint show_sort_indicator : 1;
|
||||
|
|
@ -138,6 +138,9 @@ gint gtk_tree_view_column_get_spacing (GtkTreeViewCol
|
|||
void gtk_tree_view_column_set_visible (GtkTreeViewColumn *tree_column,
|
||||
gboolean visible);
|
||||
gboolean gtk_tree_view_column_get_visible (GtkTreeViewColumn *tree_column);
|
||||
void gtk_tree_view_column_set_resizable (GtkTreeViewColumn *tree_column,
|
||||
gboolean resizable);
|
||||
gboolean gtk_tree_view_column_get_resizable (GtkTreeViewColumn *tree_column);
|
||||
void gtk_tree_view_column_set_sizing (GtkTreeViewColumn *tree_column,
|
||||
GtkTreeViewColumnSizing type);
|
||||
GtkTreeViewColumnSizing gtk_tree_view_column_get_sizing (GtkTreeViewColumn *tree_column);
|
||||
|
|
|
|||
|
|
@ -538,7 +538,8 @@ add_clicked (GtkWidget *button, gpointer data)
|
|||
column = gtk_tree_view_column_new_with_attributes (label, cell, "text", 0, NULL);
|
||||
g_object_set_data_full (G_OBJECT (column), column_data, label, g_free);
|
||||
gtk_tree_view_column_set_reorderable (column, TRUE);
|
||||
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_RESIZABLE);
|
||||
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_GROW_ONLY);
|
||||
gtk_tree_view_column_set_resizable (column, TRUE);
|
||||
gtk_list_store_append (GTK_LIST_STORE (left_tree_model), &iter);
|
||||
gtk_list_store_set (GTK_LIST_STORE (left_tree_model), &iter, 0, label, 1, column, -1);
|
||||
i++;
|
||||
|
|
|
|||
|
|
@ -121,7 +121,6 @@ main (gint argc, gchar **argv)
|
|||
|
||||
g_object_set (G_OBJECT (renderer),
|
||||
"xalign", 0.0,
|
||||
"mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE,
|
||||
NULL);
|
||||
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
|
||||
-1, "Editable",
|
||||
|
|
|
|||
Loading…
Reference in a new issue