[glom] Print Layout: Actually allow the user to change the text formatting.



commit 1eef5f3f8f23413e4c859ca14d3b545bc635c7b1
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Aug 11 11:29:43 2011 +0200

    Print Layout: Actually allow the user to change the text formatting.
    
    * glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:
    When used for a print layout, enable the hidden checkboxes, because
    other code checks for them.
    * glom/print_layout/canvas_print_layout.cc: on_context_menu_formatting():
    Make the dialog transient for the parent window.
    Also, do not show numeric formatting for text items.

 ChangeLog                                          |   11 +++++++++++
 .../layout/layout_item_dialogs/box_formatting.cc   |   11 ++++++++---
 glom/print_layout/canvas_print_layout.cc           |    8 +++++++-
 3 files changed, 26 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 43409df..b54de73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2011-08-11  Murray Cumming  <murrayc murrayc com>
 
+	Print Layout: Actually allow the user to change the text formatting.
+
+	* glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:
+	When used for a print layout, enable the hidden checkboxes, because 
+	other code checks for them.
+	* glom/print_layout/canvas_print_layout.cc: on_context_menu_formatting():
+	Make the dialog transient for the parent window.
+	Also, do not show numeric formatting for text items.
+
+2011-08-11  Murray Cumming  <murrayc murrayc com>
+
 	Print Layout: Correct drag positions when scrolled.
 
 	* glom/mode_design/print_layouts/window_print_layout_edit.[h|cc]:
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 11ce36f..29aa684 100644
--- a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
@@ -473,12 +473,17 @@ void Box_Formatting::enforce_constraints()
     m_checkbox_format_text_font->hide();
     m_checkbox_format_text_color_background->hide();
     m_checkbox_format_text_color_foreground->hide();
+
+    //But enable them so that other code, that checks for it, works:
+    m_checkbox_format_text_font->set_active();
+    m_checkbox_format_text_color_background->set_active();
+    m_checkbox_format_text_color_foreground->set_active();
   }
 
   //Enable UI depending on the checkbutton state:
-  m_fontbutton->set_sensitive( m_for_print_layout || m_checkbox_format_text_font->get_active() );
-  m_colorbutton_foreground->set_sensitive( m_for_print_layout || m_checkbox_format_text_color_foreground->get_active() );
-  m_colorbutton_background->set_sensitive( m_for_print_layout || m_checkbox_format_text_color_background->get_active() );
+  m_fontbutton->set_sensitive( m_checkbox_format_text_font->get_active() );
+  m_colorbutton_foreground->set_sensitive( m_checkbox_format_text_color_foreground->get_active() );
+  m_colorbutton_background->set_sensitive(  m_checkbox_format_text_color_background->get_active() );
 
   //Choices:
   //Radio buttons only make sense when the items are restricted, instead of free-form:
diff --git a/glom/print_layout/canvas_print_layout.cc b/glom/print_layout/canvas_print_layout.cc
index 3ee3681..a94b090 100644
--- a/glom/print_layout/canvas_print_layout.cc
+++ b/glom/print_layout/canvas_print_layout.cc
@@ -29,6 +29,7 @@
 #include <glom/utility_widgets/canvas/canvas_table_movable.h>
 #include <glom/utility_widgets/canvas/canvas_image_movable.h>
 #include <glom/utility_widgets/canvas/canvas_text_movable.h>
+#include <glom/application.h>
 #include <libglom/data_structure/glomconversions.h>
 #include <libglom/db_utils.h>
 
@@ -415,6 +416,10 @@ void Canvas_PrintLayout::on_context_menu_formatting()
   Utils::get_glade_widget_derived_with_warning(m_dialog_format);
   add_view(m_dialog_format);
 
+  Gtk::Window* window = dynamic_cast<Gtk::Window*>(get_toplevel());
+  if(window)
+    m_dialog_format->set_transient_for(*window);
+
   m_dialog_format->signal_hide().connect( sigc::mem_fun(*this, &Canvas_PrintLayout::on_dialog_format_hide) );
 
   //We need an if here, because they have no common base class.
@@ -427,7 +432,8 @@ void Canvas_PrintLayout::on_context_menu_formatting()
   else
   {
     const FieldFormatting& formatting = layout_item_text->m_formatting;
-    m_dialog_format->m_box_formatting->set_formatting_for_non_field(formatting);
+    m_dialog_format->m_box_formatting->set_formatting_for_non_field(
+      formatting, false /* don't show numeric options */);
   }
 
   m_dialog_format->m_box_formatting->set_is_for_non_editable();



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