[glom/glom-1-12] Details: Do not make field widgets too wide, so this fits on a laptop screen.



commit 0e5618d0499813e20e50f87e0d5a396e9a39a77a
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Mar 6 01:29:45 2010 +0100

    Details: Do not make field widgets too wide, so this fits on a laptop screen.
    
    * glom/utils_ui.cc: get_suitable_field_width_for_widget(): Do not add 150
    to all calculated widths. I don't know why this code ever did that.

 ChangeLog        |    9 ++++++++-
 glom/utils_ui.cc |    4 ++--
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 504c84b..9bc2edd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-03-06  Murray Cumming  <murrayc murrayc com>
+
+    Details: Do not make field widgets too wide, so this fits on a laptop screen.
+  
+	* glom/utils_ui.cc: get_suitable_field_width_for_widget(): Do not add 150 
+	to all calculated widths. I don't know why this code ever did that.
+
 2010-03-19  Daniel Borgmann <danielb openismus com>
 
 	* configure.ac: Make Glom build with autoconf 2.65.
@@ -21,7 +28,7 @@
 
 2010-02-08  Peter Penz <ppenz openismus com>
 
-  libglom: Fix build issue for Maemo.
+    libglom: Fix build issue for Maemo.
   
 	* glom/libglom/data_structure/glomconversions.cc: get_text_for_gda_value():
 	Add an ifdef for the disabled-exceptions build.
diff --git a/glom/utils_ui.cc b/glom/utils_ui.cc
index 24c436c..b4ece6d 100644
--- a/glom/utils_ui.cc
+++ b/glom/utils_ui.cc
@@ -340,7 +340,7 @@ static int get_width_for_text(Gtk::Widget& widget, const Glib::ustring& text)
 
 int Utils::get_suitable_field_width_for_widget(Gtk::Widget& widget, const sharedptr<const LayoutItem_Field>& field_layout, bool or_title)
 {
-  int result = 150;
+  int result = 150; //Suitable default.
 
   const Field::glom_field_type field_type = field_layout->get_glom_type();
 
@@ -394,7 +394,7 @@ int Utils::get_suitable_field_width_for_widget(Gtk::Widget& widget, const shared
   if(!example_text.empty())
   {
     //Get the width required for this string in the current font:
-    result += get_width_for_text(widget, example_text);
+    result = get_width_for_text(widget, example_text);
   }
 
   if(or_title)



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