[glom/glom-1-18] Revert "Remove some unnecessary padding/borders around the main window."



commit cbabe177e2276606f0b5def5d1113fe17259d0a6
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Mar 9 09:30:43 2011 +0100

    Revert "Remove some unnecessary padding/borders around the main window."
    
    This reverts commit c82ff7116a376f41abd603ac1b33f040dc94a5b3.

 ChangeLog                             |   11 -----------
 glom/box_withbuttons.cc               |    4 ++--
 glom/mode_data/box_data_details.cc    |    2 +-
 glom/mode_data/flowtablewithfields.cc |   10 +++++-----
 glom/mode_data/flowtablewithfields.h  |    8 ++------
 5 files changed, 10 insertions(+), 25 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ffe699e..7d268e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,17 +5,6 @@
 	* glom/libglom/init.cc: The linker seems to behave differently when this 
 	code is run from inside a JVM in OnlineGlom. This gives us a clue.
 
-2011-03-08  Murray Cumming  <murrayc murrayc com>
-
-	Remove some unnecessary padding/borders around the main window.
-
-	* glom/box_withbuttons.cc: Remove the border, because it is not useful.
-	It would be for the parent widget to decide that.
-	* glom/mode_data/flowtablewithfields.[h|cc]: add_group(): Add a with_indent
-	optional parameter.
-	* glom/mode_data/box_data_details.cc: create_layout(): Have no indent on
-	top-level groups.
-
 2011-02-26  Murray Cumming  <murrayc murrayc com>
 
 	Fix the CSV import test.
diff --git a/glom/box_withbuttons.cc b/glom/box_withbuttons.cc
index 1dd8a24..49d7afa 100644
--- a/glom/box_withbuttons.cc
+++ b/glom/box_withbuttons.cc
@@ -35,7 +35,7 @@ Box_WithButtons::Box_WithButtons()
 {
   //m_pDocument = 0;
 
-  //set_border_width(Utils::DEFAULT_SPACING_SMALL);
+  set_border_width(Utils::DEFAULT_SPACING_SMALL);
   set_spacing(Utils::DEFAULT_SPACING_SMALL);
 
   //Connect signals:
@@ -49,7 +49,7 @@ Box_WithButtons::Box_WithButtons(BaseObjectType* cobject, const Glib::RefPtr<Gtk
 {
   //m_pDocument = 0;
 
-  //set_border_width(Utils::DEFAULT_SPACING_SMALL);
+  set_border_width(Utils::DEFAULT_SPACING_SMALL);
   set_spacing(Utils::DEFAULT_SPACING_SMALL);
 
   //Connect signals:
diff --git a/glom/mode_data/box_data_details.cc b/glom/mode_data/box_data_details.cc
index bd3dad8..a7987e5 100644
--- a/glom/mode_data/box_data_details.cc
+++ b/glom/mode_data/box_data_details.cc
@@ -232,7 +232,7 @@ void Box_Data_Details::create_layout()
 
     for(Document::type_list_layout_groups::const_iterator iter = layout_groups.begin(); iter != layout_groups.end(); ++iter)
     {
-      m_FlowTable.add_layout_group(*iter, false /* no indent at this top level */);
+      m_FlowTable.add_layout_group(*iter);
     }
 
     m_FlowTable.align_child_group_labels();
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index 030809d..f9a3130 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -168,12 +168,12 @@ void FlowTableWithFields::add_layout_item_at_position(const sharedptr<LayoutItem
   }
 }
 
-void FlowTableWithFields::add_layout_group(const sharedptr<LayoutGroup>& group, bool with_indent)
+void FlowTableWithFields::add_layout_group(const sharedptr<LayoutGroup>& group)
 {
-  add_layout_group_at_position(group, m_list_layoutwidgets.end(), with_indent);
+  add_layout_group_at_position(group, m_list_layoutwidgets.end());
 }
 
-void FlowTableWithFields::add_layout_group_at_position(const sharedptr<LayoutGroup>& group, const type_list_layoutwidgets::iterator& add_before, bool with_indent)
+void FlowTableWithFields::add_layout_group_at_position(const sharedptr<LayoutGroup>& group, const type_list_layoutwidgets::iterator& add_before)
 {
   if(!group)
     return;
@@ -195,9 +195,9 @@ void FlowTableWithFields::add_layout_group_at_position(const sharedptr<LayoutGro
 
     Gtk::Alignment* alignment = Gtk::manage( new Gtk::Alignment ); //TODO_leak: This is possibly leaked, according to valgrind.
 
-    if(!group->get_title().empty() && with_indent) //Don't indent if it has no title, to allow use of groups just for positioning.
+    if(!group->get_title().empty()) //Don't indent if it has no title, to allow use of groups just for positioning.
     {
-      alignment->set_padding(Glom::Utils::DEFAULT_SPACING_SMALL, 0, Glom::Utils::DEFAULT_SPACING_SMALL, 0);
+      alignment->set_padding(Glom::Utils::DEFAULT_SPACING_SMALL, 0, 6, 0); //Use left-padding of 6 even on Maemo because indentation is important.
       #ifdef GLOM_ENABLE_MAEMO
       std::cerr << "DEBUG: Unexpected group with title causing extra spacing on Maemo." << std::endl;
       #endif
diff --git a/glom/mode_data/flowtablewithfields.h b/glom/mode_data/flowtablewithfields.h
index c184d11..36d781b 100644
--- a/glom/mode_data/flowtablewithfields.h
+++ b/glom/mode_data/flowtablewithfields.h
@@ -81,11 +81,7 @@ public:
   //virtual void add_group(const Glib::ustring& group_name, const Glib::ustring& group_title, const type_map_field_sequence& fields);
 
   void add_layout_item(const sharedptr<LayoutItem>& item);
-
-  /**
-   * @param with_indent Pass true for top-level groups, to avoid wasting extra space with an unnecessary indent.
-   */
-  void add_layout_group(const sharedptr<LayoutGroup>& group, bool with_indent = true);
+  void add_layout_group(const sharedptr<LayoutGroup>& group);
 
   void set_field_editable(const sharedptr<const LayoutItem_Field>& field, bool editable = true);
 
@@ -243,7 +239,7 @@ private:
   void add_layoutwidgetbase(LayoutWidgetBase* layout_widget);
   void add_layoutwidgetbase(LayoutWidgetBase* layout_widget, const type_list_layoutwidgets::iterator& add_before);
   void add_layout_item_at_position(const sharedptr<LayoutItem>& item, const type_list_layoutwidgets::iterator& add_before);
-  void add_layout_group_at_position(const sharedptr<LayoutGroup>& group, const type_list_layoutwidgets::iterator& add_before, bool with_indent = true);
+  void add_layout_group_at_position(const sharedptr<LayoutGroup>& group, const type_list_layoutwidgets::iterator& add_before);
   void add_layout_notebook_at_position(const sharedptr<LayoutItem_Notebook>& notebook, const type_list_layoutwidgets::iterator& add_before);
   void add_layout_portal_at_position(const sharedptr<LayoutItem_Portal>& portal, const type_list_layoutwidgets::iterator& add_before);
 



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