[glom] Really use the goocanvasmm RGBA properties.



commit 152c5812669f6781dc9dc8024ced06eb886e325b
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Oct 10 19:00:36 2011 +0200

    Really use the goocanvasmm RGBA properties.
    
    * glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:
    * glom/mode_design/layout/layout_item_dialogs/dialog_line.cc: Use
    Gtk::ColorButton::get_rgba() instead of get_color.
    * glom/mode_design/layout/dialog_layout_list_related.[h|cc]: Do not save
    color details if they are not shown in the UI.

 ChangeLog                                          |   10 +++++++++
 .../layout/dialog_layout_list_related.cc           |   21 ++++++++++++-------
 .../layout/dialog_layout_list_related.h            |    2 +
 .../layout/layout_item_dialogs/box_formatting.cc   |    4 +-
 .../layout/layout_item_dialogs/dialog_line.cc      |    4 +--
 5 files changed, 28 insertions(+), 13 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b3312fe..4ff7c96 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2011-10-10  Murray Cumming  <murrayc murrayc com>
 
+	Really use the goocanvasmm RGBA properties.
+
+	* glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:
+	* glom/mode_design/layout/layout_item_dialogs/dialog_line.cc: Use 
+	Gtk::ColorButton::get_rgba() instead of get_color.
+	* glom/mode_design/layout/dialog_layout_list_related.[h|cc]: Do not save 
+	color details if they are not shown in the UI.
+	 
+2011-10-10  Murray Cumming  <murrayc murrayc com>
+
 	Require the latest goocanvasmm.
 
 	* configure.ac: Require goocanvasmm 1.90.6 because of the new RGBA properties.
diff --git a/glom/mode_design/layout/dialog_layout_list_related.cc b/glom/mode_design/layout/dialog_layout_list_related.cc
index f123f91..9ad97a9 100644
--- a/glom/mode_design/layout/dialog_layout_list_related.cc
+++ b/glom/mode_design/layout/dialog_layout_list_related.cc
@@ -47,7 +47,8 @@ Dialog_Layout_List_Related::Dialog_Layout_List_Related(BaseObjectType* cobject,
   m_combo_navigation_specify(0),
   m_spinbutton_row_line_width(0),
   m_spinbutton_column_line_width(0),
-  m_colorbutton_line(0)
+  m_colorbutton_line(0),
+  m_for_print_layout(false)
 {  
   // Show the appropriate alternate widgets:
   m_box_table_widgets->hide();
@@ -110,6 +111,8 @@ Dialog_Layout_List_Related::~Dialog_Layout_List_Related()
 
 void Dialog_Layout_List_Related::set_document(const Glib::ustring& layout_name, const Glib::ustring& layout_platform, Document* document, const sharedptr<const LayoutItem_Portal>& portal, const Glib::ustring& from_table, bool for_print_layout)
 {
+  m_for_print_layout = for_print_layout;
+
   //Ignore the provided from_table if the portal has one:
   Glib::ustring actual_from_table;
   if(portal)
@@ -353,13 +356,15 @@ void Dialog_Layout_List_Related::save_to_document()
     
     m_portal->set_rows_count( m_spinbutton_rows_count->get_value() );
     
-   
-    m_portal->set_print_layout_row_line_width(
-      m_spinbutton_row_line_width->get_value());
-    m_portal->set_print_layout_column_line_width(
-      m_spinbutton_column_line_width->get_value());      
-    //TODO: Use GdkRGBA's color string (CSS) format instead, everywhere:
-    m_portal->set_print_layout_line_color( m_colorbutton_line->get_color().to_string() );
+    if(m_for_print_layout)
+    {
+      m_portal->set_print_layout_row_line_width(
+        m_spinbutton_row_line_width->get_value());
+      m_portal->set_print_layout_column_line_width(
+        m_spinbutton_column_line_width->get_value());      
+      m_portal->set_print_layout_line_color(
+        m_colorbutton_line->get_rgba().to_string() );
+    }
   }
 }
 
diff --git a/glom/mode_design/layout/dialog_layout_list_related.h b/glom/mode_design/layout/dialog_layout_list_related.h
index 0880cab..03cf4a1 100644
--- a/glom/mode_design/layout/dialog_layout_list_related.h
+++ b/glom/mode_design/layout/dialog_layout_list_related.h
@@ -81,6 +81,8 @@ protected:
   Gtk::SpinButton* m_spinbutton_row_line_width;
   Gtk::SpinButton* m_spinbutton_column_line_width;
   Gtk::ColorButton* m_colorbutton_line;
+  
+  bool m_for_print_layout;
 };
 
 } //namespace Glom
diff --git a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
index 9364102..55c5dc6 100644
--- a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
@@ -342,12 +342,12 @@ bool Box_Formatting::get_formatting(FieldFormatting& format) const
 
   Glib::ustring color_foreground;
   if(m_checkbox_format_text_color_foreground->get_active())
-    color_foreground = m_colorbutton_foreground->get_color().to_string();
+    color_foreground = m_colorbutton_foreground->get_rgba().to_string();
   m_format.set_text_format_color_foreground(color_foreground);
 
   Glib::ustring color_background;
   if(m_checkbox_format_text_color_background->get_active())
-    color_background = m_colorbutton_background->get_color().to_string();
+    color_background = m_colorbutton_background->get_rgba().to_string();
 
   m_format.set_text_format_color_background(color_background);
 
diff --git a/glom/mode_design/layout/layout_item_dialogs/dialog_line.cc b/glom/mode_design/layout/layout_item_dialogs/dialog_line.cc
index fd0705f..cce4147 100644
--- a/glom/mode_design/layout/layout_item_dialogs/dialog_line.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_line.cc
@@ -88,9 +88,7 @@ sharedptr<LayoutItem_Line> Dialog_Line::get_line() const
   }
 
   result->set_line_width( m_spinbutton_line_width->get_value() );
-  
-  //TODO: Use GdkRGBA's color string (CSS) format instead, everywhere:
-  result->set_line_color( m_colorbutton->get_color().to_string() );
+  result->set_line_color( m_colorbutton->get_rgba().to_string() );
 
   return result;
 }



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