[glom] Print Layout: Make the window bigger by default.



commit 6e93ebf6619ac6047ce42b7c110525bbb597b74f
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Aug 9 18:00:33 2011 +0200

    Print Layout: Make the window bigger by default.

 ChangeLog                                          |    4 ++++
 .../print_layouts/window_print_layout_edit.cc      |    8 +++++++-
 glom/print_layout/canvas_print_layout.cc           |   11 ++++++++++-
 3 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c9226d8..5ba65bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2011-08-09  Murray Cumming  <murrayc murrayc com>
 
+	Print Layout: Make the window bigger by default.
+
+2011-08-09  Murray Cumming  <murrayc murrayc com>
+
 	Print Layout: Make ruler markers follow moved items.
 
 	* glom/mode_design/print_layouts/window_print_layout_edit.cc:
diff --git a/glom/mode_design/print_layouts/window_print_layout_edit.cc b/glom/mode_design/print_layouts/window_print_layout_edit.cc
index bd6932e..e89b2e8 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -55,7 +55,13 @@ Window_PrintLayout_Edit::Window_PrintLayout_Edit(BaseObjectType* cobject, const
   m_hruler(0),
   m_context_menu(0)
 {
-  set_default_size(640, 480);
+  //See CanvasPrintLayout's commented-out use of set_size_request()
+  //for an attempt to do this properly.
+
+  //Try to give the user a large-enough window for working with a whole page:
+  //TODO: Make this even larger if we can be sure that no WM will make 
+  //the window bigger than the screen.
+  set_default_size(900, 640);
 
   add_view(&m_canvas);
 
diff --git a/glom/print_layout/canvas_print_layout.cc b/glom/print_layout/canvas_print_layout.cc
index 12564c8..b9c4422 100644
--- a/glom/print_layout/canvas_print_layout.cc
+++ b/glom/print_layout/canvas_print_layout.cc
@@ -465,7 +465,7 @@ void Canvas_PrintLayout::set_page_setup(const Glib::RefPtr<Gtk::PageSetup>& page
     return;
 
   //Change the scroll extents to match the page size:
-  Gtk::PaperSize paper_size = m_page_setup->get_paper_size();
+  const Gtk::PaperSize paper_size = m_page_setup->get_paper_size();
   Goocanvas::Bounds bounds;
   bounds.set_x1(0);
   bounds.set_y1(0);
@@ -520,6 +520,15 @@ void Canvas_PrintLayout::set_page_setup(const Glib::RefPtr<Gtk::PageSetup>& page
   m_margin_bottom = create_margin_line(bounds.get_x1(), bounds.get_y2() - page_setup->get_bottom_margin(units), bounds.get_x2(), bounds.get_y2() - page_setup->get_bottom_margin(units));
 
   m_bounds_group->lower();
+
+  //Try to show the whole thing, by (indirectly) making the parent window big enough:
+  /* TODO: This doesn't seem to work
+  double width_pixels = bounds.get_x2() - bounds.get_x1();
+  double height_pixels = bounds.get_y2() - bounds.get_y1();
+  convert_to_pixels(width_pixels, height_pixels);
+  std::cout << "DEBUG: width_pixels=" << width_pixels << ", height_pixels=" << height_pixels << std::endl;
+  set_size_request(width_pixels, height_pixels);
+  */
 }
 
 Glib::RefPtr<Gtk::PageSetup> Canvas_PrintLayout::get_page_setup()



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