[glom] List view: Stop unnecessary saving of column widths.



commit 55f486cb04bba9ac8aa7a75538689438281e8fd8
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Nov 16 12:45:34 2011 +0100

    List view: Stop unnecessary saving of column widths.
    
    * glom/mode_data/db_adddel/db_adddel.[h|cc]: Do not handle changes
    of the GtkTreeView column width, because it happens during normal
    size allocation as well as when the user resizes columns.
    It is not essential anyway.

 ChangeLog                             |    9 +++++++++
 glom/mode_data/db_adddel/db_adddel.cc |   11 ++++++++++-
 glom/mode_data/db_adddel/db_adddel.h  |    2 +-
 3 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 252ec42..8c0d5ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-11-16  Murray Cumming  <murrayc murrayc com>
 
+	List view: Stop unnecessary saving of column widths.
+
+	* glom/mode_data/db_adddel/db_adddel.[h|cc]: Do not handle changes 
+	of the GtkTreeView column width, because it happens during normal
+	size allocation as well as when the user resizes columns.
+	It is not essential anyway.
+
+2011-11-16  Murray Cumming  <murrayc murrayc com>
+
 	Make the Calendar portal work again.
 
 	* glom/mode_data/box_data_calendar_related.[h|cc]: Override
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index 6eff69f..4453c33 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -1557,6 +1557,13 @@ bool DbAddDel::on_treeview_column_drop(Gtk::TreeView* /* treeview */, Gtk::TreeV
   return true;
 }
 
+/* We do not let the developer resize the columns directly in the treeview
+ * because we cannot easily avoid this signal handler from being called just during the 
+ * intial size allocation.
+ * Anyway, this would be rather implicit anyway - people might not know that they are changing it in the document.
+ * The size can still be specified in the layout dialog.
+ */
+/*
 void DbAddDel::on_treeview_column_resized(int model_column_index, DbTreeViewColumnGlom* view_column)
 {
   if(!view_column)
@@ -1585,6 +1592,7 @@ void DbAddDel::on_treeview_column_resized(int model_column_index, DbTreeViewColu
   if(layout_item)
     layout_item->set_display_width(width);
 }
+*/
 
 void DbAddDel::on_treeview_column_clicked(int model_column_index)
 {
@@ -1749,7 +1757,8 @@ guint DbAddDel::treeview_append_column(const Glib::ustring& title, Gtk::CellRend
   pViewColumn->signal_clicked().connect(
     sigc::bind( sigc::mem_fun(*this, &DbAddDel::on_treeview_column_clicked), model_column_index) );
 
-  pViewColumn->connect_property_changed("width", sigc::bind(sigc::mem_fun(*this, &DbAddDel::on_treeview_column_resized), model_column_index, pViewColumn) );
+  // See the comment on on_treeview_column_resized():
+  //pViewColumn->connect_property_changed("width", sigc::bind(sigc::mem_fun(*this, &DbAddDel::on_treeview_column_resized), model_column_index, pViewColumn) );
 
   return cols_count;
 }
diff --git a/glom/mode_data/db_adddel/db_adddel.h b/glom/mode_data/db_adddel/db_adddel.h
index f8b2cfc..2484255 100644
--- a/glom/mode_data/db_adddel/db_adddel.h
+++ b/glom/mode_data/db_adddel/db_adddel.h
@@ -343,7 +343,7 @@ private:
 
   bool on_treeview_columnheader_button_press_event(GdkEventButton* event);
   void on_treeview_column_clicked(int model_column_index);
-  void on_treeview_column_resized(int model_column_index, DbTreeViewColumnGlom* view_column);
+  //void on_treeview_column_resized(int model_column_index, DbTreeViewColumnGlom* view_column);
   void on_idle_row_edit();
   void on_cell_button_clicked(const Gtk::TreeModel::Path& path);
   void on_cell_layout_button_clicked(const Gtk::TreeModel::Path& path, int model_column_index);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]