[glade3] * plugins/gtk+/glade-gtk.c: Set added treeviewcolumns to fixed sizing mode if the treeview is se
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3] * plugins/gtk+/glade-gtk.c: Set added treeviewcolumns to fixed sizing mode if the treeview is se
- Date: Thu, 16 Dec 2010 09:13:12 +0000 (UTC)
commit b65dae9daa0f8e0eb96ad8f0f9d8f1e975a1bbf8
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Thu Dec 16 18:18:26 2010 +0900
* plugins/gtk+/glade-gtk.c: Set added treeviewcolumns to fixed sizing mode if the
treeview is set to use fixed height mode (closing bug 596480).
ChangeLog | 3 +++
plugins/gtk+/glade-gtk.c | 16 ++++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5c28c56..4115ac6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,9 @@
* gladeui/glade-base-editor.c: Fixed glade_base_editor_dispose to not access the signal
editor, it's automatically destroyed as being a child of the editor.
+ * plugins/gtk+/glade-gtk.c: Set added treeviewcolumns to fixed sizing mode if the
+ treeview is set to use fixed height mode (closing bug 596480).
+
2010-12-15 Tristan Van Berkom <tristanvb openismus com>
* gladeui/glade-project.c: Cleanup glade_project_remove_object(), make sure row_deleted is
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index eaafd79..d19c4ae 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -11481,6 +11481,13 @@ glade_gtk_treeview_get_children (GladeWidgetAdaptor *adaptor,
return gtk_tree_view_get_columns (view);
}
+/* XXX FIXME: We should hide the actual "fixed-height-mode" setting from
+ * treeview editors and provide a custom control that sets all its columns
+ * to fixed size and then control the column's sensitivity accordingly.
+ */
+#define INSENSITIVE_COLUMN_SIZING_MSG \
+ _("Columns must have a fixed size inside a treeview with fixed height mode set")
+
void
glade_gtk_treeview_add_child (GladeWidgetAdaptor *adaptor,
GObject *container,
@@ -11488,10 +11495,19 @@ glade_gtk_treeview_add_child (GladeWidgetAdaptor *adaptor,
{
GtkTreeView *view = GTK_TREE_VIEW (container);
GtkTreeViewColumn *column;
+ GladeWidget *gcolumn;
if (!GTK_IS_TREE_VIEW_COLUMN (child))
return;
+ if (gtk_tree_view_get_fixed_height_mode (view))
+ {
+ gcolumn = glade_widget_get_from_gobject (child);
+ glade_widget_property_set (gcolumn, "sizing", GTK_TREE_VIEW_COLUMN_FIXED);
+ glade_widget_property_set_sensitive (gcolumn, "sizing", FALSE,
+ INSENSITIVE_COLUMN_SIZING_MSG);
+ }
+
column = GTK_TREE_VIEW_COLUMN (child);
gtk_tree_view_append_column (view, column);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]