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



commit 2b1d4573b82e6851d2833836ae4553e5ceefe0b8
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        |    7 +++++++
 glom/utils_ui.cc |    4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5b1560c..77bd3f8 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.
+
 1.13.7:
 
 2010-02-28  Murray Cumming  <murrayc murrayc com>
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]