glom r1518 - in branches/glom-1-6: . glom/mode_data



Author: murrayc
Date: Fri Apr  4 08:39:48 2008
New Revision: 1518
URL: http://svn.gnome.org/viewvc/glom?rev=1518&view=rev

Log:
2008-04-04  Murray Cumming  <murrayc murrayc com>

* glom/mode_data/box_data_list.cc
* glom/mode_data/box_data_list.h
on_dialog_layout_hide(): Override this so we can set a bool and 
check for this bool in create_layout_add_group(), to reset the column 
widths after the layout dialog has been closed. Otherwise the new 
columns are off the right-hand side of the scroll area, making users 
think that nothing has happened unless they look at the scroll bar.
This is not ideal, but drag-and-drop will make this easier anyway.
Bug #526046 (Jani Monoses).

Modified:
   branches/glom-1-6/ChangeLog
   branches/glom-1-6/glom/mode_data/box_data_list.cc
   branches/glom-1-6/glom/mode_data/box_data_list.h

Modified: branches/glom-1-6/glom/mode_data/box_data_list.cc
==============================================================================
--- branches/glom-1-6/glom/mode_data/box_data_list.cc	(original)
+++ branches/glom-1-6/glom/mode_data/box_data_list.cc	Fri Apr  4 08:39:48 2008
@@ -33,7 +33,8 @@
 
 Box_Data_List::Box_Data_List()
 : m_has_one_or_more_records(false),
-  m_read_only(false)
+  m_read_only(false),
+  m_reset_column_widths(false)
 {
   m_layout_name = "list";
 
@@ -726,6 +727,10 @@
         }
       }
 
+      //Sometimes we reset the column width so that new fields are easily visible:
+      if(m_reset_column_widths)
+        child_item->set_display_width(0);
+
       m_AddDel.add_column(child_item);
     }
   }
@@ -891,7 +896,16 @@
     refModelDerived->get_record_counts(total, found);
 }
 
-} //namespace Glom
-
+#ifndef GLOM_ENABLE_CLIENT_ONLY
+//overridden, so we can change the column widths, so they are all visible:
+void Box_Data_List::on_dialog_layout_hide()
+{
+  //Tell create_layout() to reset the display_width for each layout item:
+  m_reset_column_widths = true;
+  Box_Data::on_dialog_layout_hide();
+  m_reset_column_widths = false;
+}
+#endif //GLOM_ENABLE_CLIENT_ONLY
 
+} //namespace Glom
 

Modified: branches/glom-1-6/glom/mode_data/box_data_list.h
==============================================================================
--- branches/glom-1-6/glom/mode_data/box_data_list.h	(original)
+++ branches/glom-1-6/glom/mode_data/box_data_list.h	Fri Apr  4 08:39:48 2008
@@ -71,6 +71,10 @@
 
   void get_record_counts(gulong& total, gulong& found) const;
 
+  #ifndef GLOM_ENABLE_CLIENT_ONLY
+  virtual void on_dialog_layout_hide(); //override
+  #endif //GLOM_ENABLE_CLIENT_ONLY
+
 protected:
   virtual void create_layout(); //override
   virtual Document_Glom::type_mapLayoutGroupSequence create_layout_get_layout(); //overriden in Box_Data_List_Related.
@@ -108,6 +112,8 @@
   bool m_has_one_or_more_records;
   bool m_read_only;
 
+  bool m_reset_column_widths; //create_layout() sets these to 0 when this is set.
+
   type_signal_user_requested_details m_signal_user_requested_details;
 };
 



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