aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2003-02-26 08:07:41 +0800
committerHans Petter <hansp@src.gnome.org>2003-02-26 08:07:41 +0800
commit1bc1b31cc0bb9cd102da768b3d6a32f7fbe02fc2 (patch)
treeb580d9c04007c61466daaffaacd1a040e548c340 /calendar
parent14f14718af6672af0014d65a1b01ae61f1fd24ee (diff)
downloadgsoc2013-evolution-1bc1b31cc0bb9cd102da768b3d6a32f7fbe02fc2.tar
gsoc2013-evolution-1bc1b31cc0bb9cd102da768b3d6a32f7fbe02fc2.tar.gz
gsoc2013-evolution-1bc1b31cc0bb9cd102da768b3d6a32f7fbe02fc2.tar.bz2
gsoc2013-evolution-1bc1b31cc0bb9cd102da768b3d6a32f7fbe02fc2.tar.lz
gsoc2013-evolution-1bc1b31cc0bb9cd102da768b3d6a32f7fbe02fc2.tar.xz
gsoc2013-evolution-1bc1b31cc0bb9cd102da768b3d6a32f7fbe02fc2.tar.zst
gsoc2013-evolution-1bc1b31cc0bb9cd102da768b3d6a32f7fbe02fc2.zip
Use fixed margins of 5% of page width/height. This is the same cheat as
2003-02-25 Hans Petter Jansson <hpj@ximian.com> * gui/print.c (print_calendar): Use fixed margins of 5% of page width/height. This is the same cheat as gtkhtml employs to get around the fact that GNOME_PRINT_KEY_PAGE_MARGIN_* don't return useful values (I think). It sort of sucks, but is better than no margins at all. (print_comp): Ditto. svn path=/trunk/; revision=20066
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog9
-rw-r--r--calendar/gui/print.c46
2 files changed, 43 insertions, 12 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index a0f464fe50..1037b89039 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,14 @@
2003-02-25 Hans Petter Jansson <hpj@ximian.com>
+ * gui/print.c (print_calendar): Use fixed margins of 5% of page
+ width/height. This is the same cheat as gtkhtml employs to get
+ around the fact that GNOME_PRINT_KEY_PAGE_MARGIN_* don't return
+ useful values (I think). It sort of sucks, but is better than
+ no margins at all.
+ (print_comp): Ditto.
+
+2003-02-25 Hans Petter Jansson <hpj@ximian.com>
+
* gui/calendar-config.c (calendar_config_get_default_view): Get
default view from correct key.
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index 1b83073766..dff86a02a2 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -61,6 +61,12 @@
* what gnome-print uses.
*/
+/* GtkHTML prints using a fixed margin. It has code to get the margins from
+ * gnome-print keys, but it's commented out. The corresponding code here
+ * doesn't seem to work either (getting zero margins), so we adopt
+ * gtkhtml's cheat. */
+#define TEMP_MARGIN .05
+
/* The fonts to use */
#define REGULAR_FONT "Sans Regular"
#define BOLD_FONT "Sans Bold"
@@ -2486,12 +2492,20 @@ print_calendar (GnomeCalendar *gcal, gboolean preview, time_t date,
pc = gnome_print_job_get_context (gpm);
gnome_print_config_get_page_size (print_config, &r, &t);
- gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_TOP, &temp_d);
- t -= temp_d;
- gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT, &temp_d);
- r -= temp_d;
- gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM, &b);
- gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_LEFT, &l);
+ /* See top of source for an explanation of this */
+
+ /* gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_TOP, &temp_d);
+ * t -= temp_d;
+ * gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT, &temp_d);
+ * r -= temp_d;
+ * gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM, &b);
+ * gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_LEFT, &l);
+ * b = l = TEMP_MARGIN; */
+
+ b = t * TEMP_MARGIN;
+ l = r * TEMP_MARGIN;
+ t *= (1.0 - TEMP_MARGIN);
+ r *= (1.0 - TEMP_MARGIN);
/* depending on the view, do a different output */
switch (default_view) {
@@ -2581,12 +2595,20 @@ print_comp (CalComponent *comp, CalClient *client, gboolean preview)
pc = gnome_print_job_get_context (gpm);
gnome_print_config_get_page_size (print_config, &r, &t);
- gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_TOP, &temp_d);
- t -= temp_d;
- gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT, &temp_d);
- r -= temp_d;
- gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM, &b);
- gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_LEFT, &l);
+ /* See top of source for an explanation of this */
+
+ /* gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_TOP, &temp_d);
+ * t -= temp_d;
+ * gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT, &temp_d);
+ * r -= temp_d;
+ * gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM, &b);
+ * gnome_print_config_get_double (print_config, GNOME_PRINT_KEY_PAGE_MARGIN_LEFT, &l);
+ * b = l = TEMP_MARGIN; */
+
+ b = t * TEMP_MARGIN;
+ l = r * TEMP_MARGIN;
+ t *= (1.0 - TEMP_MARGIN);
+ r *= (1.0 - TEMP_MARGIN);
print_comp_item (pc, comp, client, l, r, t, b);
gnome_print_job_close (gpm);